SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrackManager Class Reference

Manages access to stored track information used for MCParticle output. More...

#include <TrackManager.hh>

Inheritance diagram for TrackManager:
Singleton< TrackManager > Module

Public Member Functions

 TrackManager ()
 
virtual ~TrackManager ()
 
TrackSummary * findTrackSummary (G4int trackID)
 
TrackSummaryVector * getTrackSummaries ()
 
TrackSummaryMap * getTrackSummaryMap ()
 
void registerTrackSummary (TrackSummary *trackSummary)
 
void reset ()
 
void saveTrackSummaries (const G4Event *event, LCEvent *lcevent)
 
- Public Member Functions inherited from Singleton< TrackManager >
 Singleton ()
 
 ~Singleton ()
 
void release ()
 
- Public Member Functions inherited from Module
virtual ~Module ()
 
virtual void beginEvent (const G4Event *)
 
virtual void beginRun (const G4Run *)
 
virtual void cleanup ()
 
bool deleteOnExit ()
 
virtual void endEvent (const G4Event *)
 
virtual void endRun (const G4Run *)
 
const std::string & getName () const
 
ModuleStatus getStatus () const
 
virtual void initialize ()
 
LogStream & log ()
 
virtual void postTracking (const G4Track *)
 
virtual void preTracking (const G4Track *)
 
virtual void stepping (const G4Step *)
 

Private Member Functions

TrackSummary * findFirstSavedAncestor (TrackSummary *trackSummary)
 

Private Attributes

TrackSummaryVector * _trackSummaries
 
TrackSummaryMap * _trackSummaryMap
 

Additional Inherited Members

- Public Types inherited from Module
enum  ModuleStatus { eOkay = 0 , eNotInitialized = 1 , eBadState = 2 , eFatalError = 3 }
 
- Static Public Member Functions inherited from Singleton< TrackManager >
static TrackManager * instance ()
 
- Public Attributes inherited from Module
bool m_deleteOnExit
 
LogStream * m_log
 
std::string m_name
 
ModuleStatus m_status
 
- Protected Member Functions inherited from Module
 Module (const std::string &name, bool deleteOnExit=true, bool autoRegister=true)
 

Detailed Description

Manages access to stored track information used for MCParticle output.

Definition at line 23 of file TrackManager.hh.

Constructor & Destructor Documentation

◆ TrackManager()

TrackManager ( )
inline

Class constructor.

Definition at line 30 of file TrackManager.hh.

References TrackManager::_trackSummaries, and TrackManager::_trackSummaryMap.

◆ ~TrackManager()

virtual ~TrackManager ( )
inlinevirtual

Class destructor.

Definition at line 39 of file TrackManager.hh.

References TrackManager::_trackSummaries, and TrackManager::_trackSummaryMap.

Member Function Documentation

◆ findFirstSavedAncestor()

TrackSummary * findFirstSavedAncestor ( TrackSummary *  trackSummary)
private

Find the first saved ancestor of a TrackSummary and associate it to the first saved MCParticle ancestor.

Parameters
[in]trackSummaryThe child TrackSummary.
Returns
The first saved ancestor TrackSummary.

Definition at line 124 of file TrackManager.cc.

References TrackSummary::findParent(), TrackSummary::getMCParticle(), TrackSummary::getToBeSaved(), TrackSummary::getTrackID(), and Singleton< MCParticleManager >::instance().

Referenced by TrackManager::saveTrackSummaries().

◆ findTrackSummary()

TrackSummary* findTrackSummary ( G4int  trackID)
inline

Find a TrackSummary by track ID.

Parameters
[in]trackIDThe track ID.
Returns
The matching TrackSummary or NULL if not found.

Definition at line 96 of file TrackManager.hh.

References TrackManager::_trackSummaryMap.

Referenced by TrackSummary::findParent().

◆ getTrackSummaries()

TrackSummaryVector* getTrackSummaries ( )
inline

Get the current collection of TrackSummary objects.

Returns
The current collection of TrackSummaries.

Definition at line 50 of file TrackManager.hh.

References TrackManager::_trackSummaries.

◆ getTrackSummaryMap()

TrackSummaryMap* getTrackSummaryMap ( )
inline

Get the map of TrackSummary objects to track IDs.

Returns
The TrackSummaryMap.

Definition at line 79 of file TrackManager.hh.

References TrackManager::_trackSummaryMap.

◆ registerTrackSummary()

void registerTrackSummary ( TrackSummary *  trackSummary)
inline

Map a TrackSummary to its track ID.

Parameters
[in]trackSummaryThe TrackSummary.

Definition at line 87 of file TrackManager.hh.

References TrackSummary::getTrackID().

◆ reset()

void reset ( )
inlinevirtual

Reset the state of this object by clearing data structures.

Reimplemented from Module.

Definition at line 64 of file TrackManager.hh.

References TrackManager::_trackSummaries, and TrackManager::_trackSummaryMap.

◆ saveTrackSummaries()

void saveTrackSummaries ( const G4Event *  event,
LCEvent *  lcevent 
)

Save the TrackSummary vector into a collection of MCParticles in an output LCEvent.

Parameters
[in]eventThe current G4Event.
[in,out]lceventThe output LCEvent.

Definition at line 23 of file TrackManager.cc.

References TrackManager::_trackSummaries, TrackSummary::buildMCParticle(), LOG::debug, LOG::done, TrackManager::findFirstSavedAncestor(), TrackSummary::getMCParticle(), TrackSummary::getToBeSaved(), TrackSummary::getTrackID(), Singleton< LcioManager >::instance(), Singleton< MCParticleManager >::instance(), and Module::log().

Member Data Documentation

◆ _trackSummaries

TrackSummaryVector* _trackSummaries
private

◆ _trackSummaryMap

TrackSummaryMap* _trackSummaryMap
private

The documentation for this class was generated from the following files: