CbmRoot
CbmStackFilter Class Reference

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...
 

Detailed Description

Class for filtering the stack before writing.

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
12.02.2019
Version
1.0

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:

  • Primary particles are store in any case
  • Particles with at least one point in any detector are stored (except for PSD, where the minimum required is 5).
  • All mother particles of particles to be stored are also stored.

This default behaviour can be modified by the appropriate methods:

  • SetMinNofPoints: set the minimum number of points for a particular detector. Note that when the value 0 is chosen, all tracks will be stored irrespectively of the points in any detector. To exclude tracks which have points only in one particular detector, select a large cut value for this detector, i.e. SetMinNofPoints(kPsd, 999999).
  • SetMinEkin: set the minimum kinetic energy. This cut is additive to the number of points cut, i.e. both have to be fulfilled.
  • SetStoreAllPrimaries, SetStoreAllMothers, SetStoreAllPrimaryDecays.

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.

Member Typedef Documentation

◆ PointMap

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.

Constructor & Destructor Documentation

◆ CbmStackFilter()

CbmStackFilter::CbmStackFilter ( )

Constructor.

Definition at line 23 of file CbmStackFilter.cxx.

References fMinNofPoints, kNofSystems, kPsd, and kRef.

◆ ~CbmStackFilter()

CbmStackFilter::~CbmStackFilter ( )
virtual

Destructor.

Definition at line 42 of file CbmStackFilter.cxx.

Member Function Documentation

◆ ClassDef()

CbmStackFilter::ClassDef ( CbmStackFilter  ,
 
)
private

◆ Select()

const vector< Bool_t > & CbmStackFilter::Select ( const TClonesArray &  particles,
const PointMap points 
)
virtual

Check the stack particles for fulfilling the storage criteria.

Parameters
particlesTClonesArray of TParticles
pointsMap holding the number of points in each detector
Returns
Storage decision for each index in the TClonesArray

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.

◆ SetMinEkin()

void CbmStackFilter::SetMinEkin ( Double_t  minimum)
inline

Set the minimum kinetic energy.

Parameters
minimumMinimum 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.

◆ SetMinNofPoints()

void CbmStackFilter::SetMinNofPoints ( ECbmModuleId  detector,
UInt_t  minimum 
)
inline

Set the minimum number of MCPoints for a given detector.

Parameters
detectorDetector ID
minimumMinimum 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.

◆ SetStoreAllMothers()

void CbmStackFilter::SetStoreAllMothers ( Bool_t  choice)
inline

Set the storage of all mothers of selected tracks.

Parameters
choiceIf 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.

◆ SetStoreAllPrimaries()

void CbmStackFilter::SetStoreAllPrimaries ( Bool_t  choice)
inline

Set the storage of primary tracks.

Parameters
choiceIf 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.

◆ SetStoreAllPrimaryDecays()

void CbmStackFilter::SetStoreAllPrimaryDecays ( Bool_t  choice = kTRUE)
inline

Set the storage of all decay daughters of primaries.

Parameters
choiceIf 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.

Member Data Documentation

◆ fMinEkin

Double_t CbmStackFilter::fMinEkin
private

Cut value for kinetic energy.

Definition at line 175 of file CbmStackFilter.h.

Referenced by Select(), and SetMinEkin().

◆ fMinNofPoints

std::map<ECbmModuleId, UInt_t> CbmStackFilter::fMinNofPoints
private

Cut values for the number of points.

Definition at line 174 of file CbmStackFilter.h.

Referenced by CbmStackFilter(), Select(), and SetMinNofPoints().

◆ fStore

std::vector<Bool_t> CbmStackFilter::fStore
private

Vector with storage decision.

Definition at line 176 of file CbmStackFilter.h.

Referenced by Select().

◆ fStoreAllDecays

Bool_t CbmStackFilter::fStoreAllDecays
private

Flag for storage of all primary decay daughters.

Definition at line 172 of file CbmStackFilter.h.

Referenced by Select(), and SetStoreAllPrimaryDecays().

◆ fStoreAllMothers

Bool_t CbmStackFilter::fStoreAllMothers
private

Flag for storage of mothers.

Definition at line 171 of file CbmStackFilter.h.

Referenced by Select(), and SetStoreAllMothers().

◆ fStoreAllPrimaries

Bool_t CbmStackFilter::fStoreAllPrimaries
private

Flag for storage of primaries.

Definition at line 170 of file CbmStackFilter.h.

Referenced by Select(), and SetStoreAllPrimaries().


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