17#include "TClonesArray.h"
18#include "TMCProcess.h"
30 : fStoreAllPrimaries(kTRUE)
31 , fStoreAllMothers(kTRUE)
32 , fStoreAllDecays(kFALSE)
56 assert(particles.GetEntriesFast() >= 0);
57 UInt_t nParticles = particles.GetEntriesFast();
62 for (UInt_t index = 0; index < nParticles; index++) {
65 TParticle* particle =
dynamic_cast<TParticle*
>(particles.At(index));
70 if (particle->GetUniqueID() == kPPrimary) {
80 auto it =
points.find(make_pair(index, system));
81 UInt_t nPoints = (it ==
points.end() ? 0 : it->second);
100 TParticle* particle =
nullptr;
102 for (UInt_t index = 0; index < nParticles; index++) {
103 if (
fStore[index])
continue;
104 particle =
dynamic_cast<TParticle*
>(particles.At(index));
108 Bool_t store = kTRUE;
109 UInt_t process = particle->GetUniqueID();
110 while (process != kPPrimary) {
111 if (process != kPDecay) {
115 Int_t iMother = particle->GetMother(0);
116 particle =
dynamic_cast<TParticle*
>(particles.At(iMother));
118 process = particle->GetUniqueID();
129 for (UInt_t index = 0; index < nParticles; index++) {
130 if (!
fStore[index])
continue;
131 Int_t iMother =
dynamic_cast<TParticle*
>(particles.At(index))->GetMother(0);
132 while (iMother >= 0) {
134 iMother =
dynamic_cast<TParticle*
>(particles.At(iMother))->GetMother(0);
ClassImp(CbmConverterManager)
@ kPsd
Projectile spectator detector.
@ kNofSystems
For loops over active systems.
Class for filtering the stack before writing.
Bool_t fStoreAllDecays
Flag for storage of all primary decay daughters.
CbmStackFilter()
Constructor.
Bool_t fStoreAllMothers
Flag for storage of mothers.
Double_t fMinEkin
Cut value for kinetic energy.
std::map< ECbmModuleId, UInt_t > fMinNofPoints
Cut values for the number of points.
Bool_t fStoreAllPrimaries
Flag for storage of primaries.
virtual ~CbmStackFilter()
Destructor.
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,...
std::vector< Bool_t > fStore
Vector with storage decision.
virtual const std::vector< Bool_t > & Select(const TClonesArray &particles, const PointMap &points)
Check the stack particles for fulfilling the storage criteria.