]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSFastRecParticle.h
Give names to reconstructed particles with AliPHOSPIDv1
[u/mrichter/AliRoot.git] / PHOS / AliPHOSFastRecParticle.h
1 #ifndef ALIPHOSFASTRECPARTICLE_H
2 #define ALIPHOSFASTRECPARTICLE_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //_________________________________________________________________________
9 //  A  Particle modified by PHOS response and produced by AliPHOSvFast
10 //  To become a general class of AliRoot ?    
11 //               
12 //*-- Author: Yves Schutz (SUBATECH)
13
14 // --- ROOT system ---
15
16 #include "TParticle.h"
17 #include "TVector3.h"
18
19 // --- Standard library ---
20
21 // --- AliRoot header files ---
22
23 class AliPHOSFastRecParticle : public TParticle {
24
25  public:
26   
27   AliPHOSFastRecParticle() ;
28
29   AliPHOSFastRecParticle(const AliPHOSFastRecParticle & rp) ;  // ctor
30   AliPHOSFastRecParticle(const TParticle & p) ;  // ctor
31   virtual ~AliPHOSFastRecParticle(){
32     // dtor
33   }
34   virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) ; 
35   virtual void Draw(Option_t *option) ;  
36   virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) ;
37   Int_t GetIndexInList() const { 
38     // returns the index of this in the list
39     return fIndexInList ; 
40   } 
41   virtual const Int_t GetNPrimaries() const {return 0 ;}
42   virtual const TParticle * GetPrimary(Int_t index=0) const  {return 0 ;} 
43   
44   const Int_t GetType() const { 
45     // returns the type of the particle
46     return fType ; 
47   } 
48   
49   void SetPIDBit(UInt_t fSet)
50   {
51   fType |= (1<<fSet) ; 
52   } 
53    
54   Bool_t TestPIDBit(UInt_t fTest){
55    if (fType & (1<<fTest) )
56      return  kTRUE ;    
57    else
58      return kFALSE ;
59    }
60
61   Bool_t IsPhotonHiPu_LoEf()  {
62     Bool_t pid=kFALSE ;
63     if(TestPIDBit(8)&&TestPIDBit(7)&&TestPIDBit(6)&& //PCA
64        TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)&& //TOF
65        TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))  //RCPV
66       pid = kTRUE;
67     return pid ;
68   }
69   Bool_t IsPhotonMed_Pu_Ef(){
70     Bool_t pid=kFALSE ;
71     if(TestPIDBit(7)&&TestPIDBit(6)&& //PCA
72        TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)&& //TOF
73        TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))  //RCPV
74       pid = kTRUE ;
75     return pid ;
76   }
77  
78   Bool_t IsPhotonHiEf_LoPu()  {
79     Bool_t pid=kFALSE ;
80     if(TestPIDBit(6)&& //PCA
81        TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)&& //TOF
82        TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))  //RCPV
83       pid = kTRUE ;
84     return pid ;
85   }
86
87   Bool_t IsPhoton()  {
88     Bool_t pid=kFALSE ;
89     if(IsPhotonHiEf_LoPu()) pid = kTRUE ;
90     return pid ;
91   }
92   
93   Bool_t IsFastChargedHadron()  {
94     Bool_t pid=kFALSE ;
95     if(TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)) //TOF
96       pid = kTRUE ;
97     return pid ;
98   }
99   Bool_t IsSlowChargedHadron()  {
100     Bool_t pid=kFALSE ;
101     if(TestPIDBit(1)||TestPIDBit(0)) //CPV
102       pid = kTRUE ;
103     return pid ;
104   }
105   Bool_t IsFastNeutralHadron()  {
106     Bool_t pid=kFALSE ;
107     if(TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)&& //TOF
108        TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))//RCPV
109       pid = kTRUE ;
110     return pid ;
111   }
112   Bool_t IsSlowNeutralHadron()  {
113     Bool_t pid=kFALSE ;
114     if(TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))//RCPV
115       pid = kTRUE ;
116     return pid ;
117   }
118
119   Bool_t IsFastChargedEM()  {
120     Bool_t pid=kFALSE ;
121     if((TestPIDBit(8)||TestPIDBit(7)||TestPIDBit(6))&&
122        TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3))//TOF
123       pid = kTRUE ;
124     return pid ;
125   }
126
127   Bool_t IsSlowChargedEM()  {
128     Bool_t pid=kFALSE ;
129     if(TestPIDBit(8)||TestPIDBit(7)||TestPIDBit(6))
130       pid = kTRUE ;
131     return pid ;
132   }
133   
134   TString Name() ; 
135   virtual void Paint(Option_t * option="");
136   virtual void Print(const char * opt) ; 
137   
138   void SetType(Int_t type) { 
139     // sets the particle type 
140     fType = type ; 
141   }         
142  
143   void SetIndexInList(Int_t val) { 
144     // sets the value of the index in the list 
145     fIndexInList = val ; 
146   } 
147   enum EParticleType { kUNDEFINED=-1, 
148                        kNEUTRALEMFAST, kNEUTRALHAFAST,  kNEUTRALEMSLOW, kNEUTRALHASLOW, 
149                        kCHARGEDEMFAST, kCHARGEDHAFAST,  kCHARGEDEMSLOW, kCHARGEDHASLOW } ; 
150   
151
152   typedef TClonesArray  FastRecParticlesList ; 
153
154  protected:
155
156   Int_t fIndexInList ; // the index of this RecParticle in the list stored in TreeR (to be set by analysis)
157   Int_t fType ;        // particle type obtained by "virtual" reconstruction
158
159  private:
160
161
162   ClassDef(AliPHOSFastRecParticle,2)  // Reconstructed Particle produced by the fast simulation 
163
164 };
165
166 #endif // AliPHOSFASTRECPARTICLE_H