17 #include <Geant4/G4ParticleTable.hh>
18 #include <Geant4/G4ParticleDefinition.hh>
19 #include <Geant4/G4SystemOfUnits.hh>
30 steppingAction_(
NULL ),
31 trackingAction_(
NULL ),
32 saveOnlyEmbeded_(false)
43 PHG4TruthInfoContainer* truthInfoList = findNode::getClass<PHG4TruthInfoContainer>( topNode ,
"G4TruthInfo" );
74 cout <<
PHWHERE <<
" No EventAction registered" << endl;
78 if ( trackingAction_ )
84 cout <<
PHWHERE <<
" No TrackingAction registered" << endl;
97 cout <<__PRETTY_FUNCTION__<<
" - INFO - only save the G4 truth information that is associated with the embedded particle"<<endl;
100 PHG4TruthInfoContainer* truthInfoList = findNode::getClass<PHG4TruthInfoContainer>( topNode ,
"G4TruthInfo" );
101 assert(truthInfoList);
103 set<int> savevtxlist;
108 while (truthiter != truth_range.second)
110 const int primary_id = (truthiter->second)->get_primary_id();
111 if (truthInfoList->
isEmbeded(primary_id) <= 0)
121 savevtxlist.insert((truthiter->second)->get_vtx_id());
129 while (vtxiter != vtxrange.second)
131 if (savevtxlist.find(vtxiter->first) == savevtxlist.end())
155 {
return eventAction_; }
160 {
return steppingAction_; }
165 return trackingAction_;
int InitRun(PHCompositeNode *)
init
int ResetEvent(PHCompositeNode *)
Clean up after each event.
int isEmbeded(const int trackid) const
int ResetEvent(PHCompositeNode *)
PHNode * findFirst(const std::string &, const std::string &)
std::pair< Iterator, Iterator > Range
virtual PHG4SteppingAction * GetSteppingAction(void) const
return pointer to this subsystem stepping action
PHBoolean addNode(PHNode *)
PHG4TruthSubsystem(const std::string &name="TRUTH")
constructor
int process_event(PHCompositeNode *)
event processing
VtxRange GetVtxRange()
Get a range of iterators covering the entire vertex container.
Range GetParticleRange()
Get a range of iterators covering the entire container.
void delete_vtx(VtxIterator viter)
VtxMap::iterator VtxIterator
virtual int Verbosity() const
Gets the verbosity of this module.
void SetInterfacePointers(PHCompositeNode *)
get relevant nodes from top node passed as argument
int ResetEvent(PHCompositeNode *)
virtual void SetInterfacePointers(PHCompositeNode *)
Set pointers to the i/o nodes.
virtual int process_after_geant(PHCompositeNode *)
event processing
virtual PHG4TrackingAction * GetTrackingAction(void) const
return pointer to this subsystem stepping action
void delete_particle(Iterator piter)
std::pair< VtxIterator, VtxIterator > VtxRange
virtual PHG4EventAction * GetEventAction(void) const
accessors (reimplemented)