CbmRoot
|
Class for filtering the stack before writing. More...
#include <CbmStackFilter.h>
Public Types | |
typedef std::map< std::pair< Int_t, ECbmModuleId >, Int_t > | PointMap |
Map holding the number of points for each detector. The key is a pair of (track index, detector ID), the value is the number of points of the track in the detector. More... | |
Public Member Functions | |
CbmStackFilter () | |
Constructor. More... | |
virtual | ~CbmStackFilter () |
Destructor. More... | |
virtual const std::vector< Bool_t > & | Select (const TClonesArray &particles, const PointMap &points) |
Check the stack particles for fulfilling the storage criteria. More... | |
void | SetMinEkin (Double_t minimum) |
Set the minimum kinetic energy. More... | |
void | SetMinNofPoints (ECbmModuleId detector, UInt_t minimum) |
Set the minimum number of MCPoints for a given detector. More... | |
void | SetStoreAllMothers (Bool_t choice) |
Set the storage of all mothers of selected tracks. More... | |
void | SetStoreAllPrimaries (Bool_t choice) |
Set the storage of primary tracks. More... | |
void | SetStoreAllPrimaryDecays (Bool_t choice=kTRUE) |
Set the storage of all decay daughters of primaries. More... | |
Private Member Functions | |
ClassDef (CbmStackFilter, 2) | |
Private Attributes | |
Bool_t | fStoreAllPrimaries |
Flag for storage of primaries. More... | |
Bool_t | fStoreAllMothers |
Flag for storage of mothers. More... | |
Bool_t | fStoreAllDecays |
Flag for storage of all primary decay daughters. More... | |
std::map< ECbmModuleId, UInt_t > | fMinNofPoints |
Cut values for the number of points. More... | |
Double_t | fMinEkin |
Cut value for kinetic energy. More... | |
std::vector< Bool_t > | fStore |
Vector with storage decision. More... | |
Class for filtering the stack before writing.
During transport simulation, the stack is filled with primary particles (defined by the generator) and secondary particles generated by the transport engine. For each particle, a TParticle object is created. After the event is finished, the particle objects are converted into CbmMCTrack objects and written to the respective branch in the output tree.
Not all of the tracks created during the transport are of interest for analysis or further processing - e.g., secondary tracks not registered in any detector. The CbmStackFilter allows to define selection criteria for the persistent storage of MCTracks in the output - such as number of MCPoints in some detector or kinetic energy.
The default behaviour is:
This default behaviour can be modified by the appropriate methods:
If a cut logic is desired which cannot be achieved with the above scheme, it can be implemented in a derived class re-implementing the method Select. The user stack filter class has to be registered by CbmRunTransport::SetStackFilter.
Definition at line 61 of file CbmStackFilter.h.
typedef std::map<std::pair<Int_t, ECbmModuleId>, Int_t> CbmStackFilter::PointMap |
Map holding the number of points for each detector. The key is a pair of (track index, detector ID), the value is the number of points of the track in the detector.
Definition at line 69 of file CbmStackFilter.h.
CbmStackFilter::CbmStackFilter | ( | ) |
Constructor.
Definition at line 23 of file CbmStackFilter.cxx.
References fMinNofPoints, kNofSystems, kPsd, and kRef.
|
virtual |
Destructor.
Definition at line 42 of file CbmStackFilter.cxx.
|
private |
|
virtual |
Check the stack particles for fulfilling the storage criteria.
particles | TClonesArray of TParticles |
points | Map holding the number of points in each detector |
The implemented behaviour is described in the class documentation. When re-implementing in a derived class: The nPoints map gives access to the number of points of a particle in each detector. The key is pair<index, detector>, with the index of the particle in its array and the detector identifier (EcbmModuleId). The return vector must have the same size as the TClonesArray.
Definition at line 47 of file CbmStackFilter.cxx.
References fMinEkin, fMinNofPoints, fStore, fStoreAllDecays, fStoreAllMothers, fStoreAllPrimaries, kNofSystems, kRef, and points.
|
inline |
Set the minimum kinetic energy.
minimum | Minimum kinetic energy [GeV] |
Tracks with kinetic energy less than the minimum will not be stored, irrespectively of their number of points in the detectors.
The default value is 0., meaning no energy cut.
Definition at line 104 of file CbmStackFilter.h.
References fMinEkin.
|
inline |
Set the minimum number of MCPoints for a given detector.
detector | Detector ID |
minimum | Minimum number of points in detector |
Tracks with a number of points in the detector not less than the minimum will be stored. In case this cut is defined for several detector systems, the cuts are connected by logical OR, i.e., at least one cut has to be satisfied.
Note that selecting MinNofPoints = 0 for any detectors means storing all tracks, which is not advisable.
Excluding tracks which have points only in one detector can be achieved by setting MinOfPoints to a large number for this detector.
By default, the cut values are 1 for all detectors except for the PSD, where the cut value is 5.
Definition at line 126 of file CbmStackFilter.h.
References fMinNofPoints, and kNofSystems.
|
inline |
Set the storage of all mothers of selected tracks.
choice | If kTRUE, all mothers will be stored. |
If activated, all mother tracks of selected tracks will be stored, irrespective of any other selection criteria. This holds recursively, i.e. also for grandmothers and grand-grand-mothers etc.
By default, storage of mother tracks is activated.
Definition at line 141 of file CbmStackFilter.h.
References fStoreAllMothers.
|
inline |
Set the storage of primary tracks.
choice | If kTRUE, all primaries will be stored. |
If activated, all primary tracks will be stored, irrespective of any other selection criteria.
By default, storage of all primary tracks is activated.
Definition at line 152 of file CbmStackFilter.h.
References fStoreAllPrimaries.
|
inline |
Set the storage of all decay daughters of primaries.
choice | If kTRUE, all daughters will be stored. |
If activated, all particles in the decay chain of a primary particle will be stored, irrespective of any other selection criteria.
By default, storage of decay daughters is deactivated.
Definition at line 164 of file CbmStackFilter.h.
References fStoreAllDecays.
|
private |
Cut value for kinetic energy.
Definition at line 175 of file CbmStackFilter.h.
Referenced by Select(), and SetMinEkin().
|
private |
Cut values for the number of points.
Definition at line 174 of file CbmStackFilter.h.
Referenced by CbmStackFilter(), Select(), and SetMinNofPoints().
|
private |
Vector with storage decision.
Definition at line 176 of file CbmStackFilter.h.
Referenced by Select().
|
private |
Flag for storage of all primary decay daughters.
Definition at line 172 of file CbmStackFilter.h.
Referenced by Select(), and SetStoreAllPrimaryDecays().
|
private |
Flag for storage of mothers.
Definition at line 171 of file CbmStackFilter.h.
Referenced by Select(), and SetStoreAllMothers().
|
private |
Flag for storage of primaries.
Definition at line 170 of file CbmStackFilter.h.
Referenced by Select(), and SetStoreAllPrimaries().