16 #include <HepMC/GenEvent.h>
18 #include <gsl/gsl_const.h>
31 bool operator()(
const HepMC::GenParticle*
p )
33 if ( !p->end_vertex() && p->status() == 1 )
return 1;
47 VariableArrayContainer *vararraycontainer = findNode::getClass<VariableArrayContainer>(topNode,
"HEPMC_VarArray");
48 if (!vararraycontainer)
69 HepMC::GenEvent *evt = findNode::getClass<HepMC::GenEvent>(topNode,
"HEPMC");
72 cout <<
PHWHERE <<
" no evt pointer under HEPMC Node found" << endl;
75 VariableArrayContainer *vararraycontainer = findNode::getClass<VariableArrayContainer>(topNode,
"HEPMC_VarArray");
76 if (!vararraycontainer)
78 cout <<
PHWHERE <<
"no PHG4INEVENT node" << endl;
82 vector<short> shepmcvtxvec;
84 std::list<HepMC::GenParticle*> finalstateparticles;
87 const double length_factor = HepMC::Units::conversion_factor( evt->length_unit(), HepMC::Units::CM );
88 for ( HepMC::GenEvent::vertex_iterator
v = evt->vertices_begin();
89 v != evt->vertices_end(); ++
v )
91 finalstateparticles.clear();
92 for (HepMC::GenVertex::particle_iterator
p = (*v)->particles_begin(HepMC::children);
p != (*v)->particles_end(HepMC::children); ++
p)
100 finalstateparticles.push_back(*
p);
111 finalstateparticles.push_back(*
p);
114 if (!finalstateparticles.empty())
124 shepmcvtxvec.push_back((*v)->barcode());
125 shepmcvtxvec.push_back(
FloatToInt((*v)->position().x()*length_factor));
126 shepmcvtxvec.push_back(
FloatToInt((*v)->position().y()*length_factor));
127 shepmcvtxvec.push_back(
FloatToInt((*v)->position().z()*length_factor));