1 #include "AliHBTReader.h"
3 #include "AliHBTParticleCut.h"
9 /*************************************************************************************/
11 AliHBTReader::AliHBTReader()
14 fCuts = new TObjArray();
17 /*************************************************************************************/
19 AliHBTReader::~AliHBTReader()
26 /*************************************************************************************/
28 void AliHBTReader::AddParticleCut(AliHBTParticleCut* cut)
32 if (!cut) //if cut is NULL return with error
34 Error("AddParticleType","NULL pointers are not accepted any more.\nIf You want to accept all particles of this type, set an empty cut ");
37 AliHBTParticleCut *c = (AliHBTParticleCut*)cut->Clone();
41 /*************************************************************************************/
43 Bool_t AliHBTReader::Pass(AliHBTParticle* p)
45 //Method examines whether particle meets all cut and particle type criteria
47 if(p==0x0)//of corse we not pass NULL pointers
49 Warning("Pass()","No Pasaran! We never accept NULL pointers");
52 //if no particle is specified, we pass all particles
53 //excluding NULL pointers, of course
55 for(Int_t i=0; i<fCuts->GetEntriesFast(); i++)
57 AliHBTParticleCut &cut = *((AliHBTParticleCut*)fCuts->At(i));
58 if(!cut.Pass(p)) return kFALSE; //accepted
61 return kTRUE;//not accepted
64 /*************************************************************************************/
66 Bool_t AliHBTReader::Pass(Int_t pid)
68 //this method checks if any of existing cuts accepts this pid particles
69 //or any cuts accepts all particles
74 for(Int_t i=0; i<fCuts->GetEntriesFast(); i++)
76 AliHBTParticleCut &cut = *((AliHBTParticleCut*)fCuts->At(i));
77 //if some of cuts accepts all particles or some accepts particles of this type, accept
78 if ( (cut.GetPID() == 0) || (cut.GetPID() == pid) ) return kFALSE;
82 /*************************************************************************************/