24 #include <Geant4/G4ParticleDefinition.hh>
25 #include <Geant4/G4ParticleTable.hh>
26 #include <Geant4/G4SystemOfUnits.hh>
28 #include <HepMC/SimpleVector.h>
30 #include <gsl/gsl_rng.h>
63 G4ParticleTable *particleTable = G4ParticleTable::GetParticleTable();
64 G4ParticleDefinition *particledef = particleTable->FindParticle(name);
67 return particledef->GetPDGEncoding();
75 G4ParticleTable *particleTable = G4ParticleTable::GetParticleTable();
76 G4ParticleDefinition *particledef = particleTable->FindParticle(pdgcode);
79 return particledef->GetParticleName();
88 G4ParticleTable *particleTable = G4ParticleTable::GetParticleTable();
89 G4ParticleDefinition *particledef = particleTable->FindParticle(
get_pdgname(pdgcode));
92 return particledef->GetPDGMass() /
GeV;
130 PHG4InEvent *ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
146 std::cout <<
PHWHERE <<
" " <<
Name() <<
" using empty process_event" << std::endl;
152 std::vector<PHG4Particle *>::const_iterator iter;
156 std::cout <<
"particle " << i << std::endl;
208 std::cout <<
Name() <<
" random seed: " <<
m_Seed << std::endl;
219 PHHepMCGenEventMap *genevtmap = findNode::getClass<PHHepMCGenEventMap>(topNode,
"PHHepMCGenEventMap");
228 if (iter != genevtmap->
rend())
236 set_vtx(vtx.x(), vtx.y(), vtx.z());
240 std::cout <<
"PHG4ParticleGeneratorBase::ReuseExistingVertex - reuse PHHepMCGenEventMap vertex "
241 << vtx.x() <<
", " << vtx.y() <<
", " << vtx.z() <<
" cm. Source event:"
251 PHG4InEvent *ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
255 std::pair<std::map<int, PHG4VtxPoint *>::const_iterator,
256 std::map<int, PHG4VtxPoint *>::const_iterator>
258 std::map<int, PHG4VtxPoint *>::const_iterator iter = range.first;
263 std::cout <<
PHWHERE <<
"::Error - PHG4SimpleEventGenerator expects an existing vertex in PHG4InEvent, but none exists" << std::endl;
268 std::cout <<
PHWHERE <<
"::Info - use this primary vertex from PHG4InEvent:" << std::endl;
279 findNode::getClass<PHG4TruthInfoContainer>(topNode,
290 std::cout <<
PHWHERE <<
"::Error - PHG4SimpleEventGenerator expects an existing truth vertex in PHG4TruthInfoContainer, but none exists"
297 std::cout <<
PHWHERE <<
"::Info - use this primary vertex from PHG4TruthInfoContainer:" << std::endl;
307 std::cout <<
PHWHERE <<
"::Error we expect an existing truth vertex, but none exists"