11 #include <HepMC/GenEvent.h>
12 #include <gsl/gsl_const.h>
25 bool operator()(
const HepMC::GenParticle*
p )
27 if ( !p->end_vertex() && p->status() == 1 )
return 1;
41 VariableArrayContainer *vararraycontainer = findNode::getClass<VariableArrayContainer>(topNode,
"HEPMC_VarArray");
42 if (!vararraycontainer)
63 HepMC::GenEvent *evt = findNode::getClass<HepMC::GenEvent>(topNode,
"HEPMC");
66 cout <<
PHWHERE <<
" no evt pointer under HEPMC Node found" << endl;
69 VariableArrayContainer *vararraycontainer = findNode::getClass<VariableArrayContainer>(topNode,
"HEPMC_VarArray");
70 if (!vararraycontainer)
72 cout <<
PHWHERE <<
"no PHG4INEVENT node" << endl;
76 vector<short> shepmcvtxvec;
78 std::list<HepMC::GenParticle*> finalstateparticles;
81 const double length_factor = HepMC::Units::conversion_factor( evt->length_unit(), HepMC::Units::CM );
82 for ( HepMC::GenEvent::vertex_iterator
v = evt->vertices_begin();
83 v != evt->vertices_end(); ++
v )
85 finalstateparticles.clear();
86 for (HepMC::GenVertex::particle_iterator
p = (*v)->particles_begin(HepMC::children);
p != (*v)->particles_end(HepMC::children); ++
p)
94 finalstateparticles.push_back(*
p);
105 finalstateparticles.push_back(*
p);
108 if (!finalstateparticles.empty())
118 shepmcvtxvec.push_back((*v)->barcode());
119 shepmcvtxvec.push_back(
FloatToInt((*v)->position().x()*length_factor));
120 shepmcvtxvec.push_back(
FloatToInt((*v)->position().y()*length_factor));
121 shepmcvtxvec.push_back(
FloatToInt((*v)->position().z()*length_factor));