CPV identification bit is corrected
[u/mrichter/AliRoot.git] / PHOS / AliPHOSFastRecParticle.h
CommitLineData
a73f33f0 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
b2a60966 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)
a73f33f0 13
14// --- ROOT system ---
15
16#include "TParticle.h"
17#include "TVector3.h"
18
19// --- Standard library ---
20
21// --- AliRoot header files ---
22
a73f33f0 23class AliPHOSFastRecParticle : public TParticle {
cfeebab6 24
88714635 25 public:
a73f33f0 26
03c03c49 27 AliPHOSFastRecParticle() ;
cfeebab6 28
a73f33f0 29 AliPHOSFastRecParticle(const AliPHOSFastRecParticle & rp) ; // ctor
30 AliPHOSFastRecParticle(const TParticle & p) ; // ctor
88714635 31 virtual ~AliPHOSFastRecParticle(){
32 // dtor
33 }
a73f33f0 34 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) ;
35 virtual void Draw(Option_t *option) ;
b2a60966 36 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) ;
88714635 37 Int_t GetIndexInList() const {
38 // returns the index of this in the list
39 return fIndexInList ;
40 }
794c2bc3 41 virtual const Int_t GetNPrimaries() const {return 0 ;}
42 virtual const TParticle * GetPrimary(Int_t index=0) const {return 0 ;}
7b7c1533 43 const Int_t GetType() const {
88714635 44 // returns the type of the particle
45 return fType ;
46 }
6a40c29e 47
48 void SetPIDBit(UInt_t fSet)
cfeebab6 49 {
50 fType |= (1<<fSet) ;
51 }
52
6a40c29e 53 Bool_t TestPIDBit(UInt_t fTest){
cfeebab6 54 if (fType & (1<<fTest) )
55 return kTRUE ;
56 else
57 return kFALSE ;
58 }
59
a3d4377c 60 Bool_t IsPhotonHiPu_LoEf() {
03c03c49 61 Bool_t pid=kFALSE ;
cfeebab6 62 if(TestPIDBit(8)&& //PCA
63 TestPIDBit(5)&& //TOF
64 TestPIDBit(2)) //RCPV
03c03c49 65 pid = kTRUE;
66 return pid ;
67 }
cfeebab6 68
a3d4377c 69 Bool_t IsPhotonMed_Pu_Ef(){
03c03c49 70 Bool_t pid=kFALSE ;
cfeebab6 71 if(TestPIDBit(7)&& //PCA
72 TestPIDBit(4)&& //TOF
73 TestPIDBit(1)) //RCPV
03c03c49 74 pid = kTRUE ;
75 return pid ;
794c2bc3 76 }
cfeebab6 77
a3d4377c 78 Bool_t IsPhotonHiEf_LoPu() {
03c03c49 79 Bool_t pid=kFALSE ;
80 if(TestPIDBit(6)&& //PCA
cfeebab6 81 TestPIDBit(3)&& //TOF
82 TestPIDBit(0)) //RCPV
03c03c49 83 pid = kTRUE ;
84 return pid ;
85 }
794c2bc3 86 Bool_t IsPhoton() {
a3d4377c 87 Bool_t pid=kFALSE ;
88 if(IsPhotonHiEf_LoPu()) pid = kTRUE ;
89 return pid ;
90 }
794c2bc3 91
92 Bool_t IsFastChargedHadron() {
93 Bool_t pid=kFALSE ;
94 if(TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)) //TOF
95 pid = kTRUE ;
96 return pid ;
97 }
98 Bool_t IsSlowChargedHadron() {
99 Bool_t pid=kFALSE ;
100 if(TestPIDBit(1)||TestPIDBit(0)) //CPV
101 pid = kTRUE ;
102 return pid ;
103 }
104 Bool_t IsFastNeutralHadron() {
105 Bool_t pid=kFALSE ;
106 if(TestPIDBit(5)&&TestPIDBit(4)&&TestPIDBit(3)&& //TOF
107 TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))//RCPV
108 pid = kTRUE ;
109 return pid ;
110 }
111 Bool_t IsSlowNeutralHadron() {
112 Bool_t pid=kFALSE ;
113 if(TestPIDBit(2)&&TestPIDBit(1)&&TestPIDBit(0))//RCPV
114 pid = kTRUE ;
115 return pid ;
116 }
a3d4377c 117
794c2bc3 118 Bool_t IsFastChargedEM() {
119 Bool_t pid=kFALSE ;
6d980ed6 120 if( (TestPIDBit(8)||TestPIDBit(7)||TestPIDBit(6))&& // PCA
121 (TestPIDBit(5)||TestPIDBit(4)||TestPIDBit(3))&& // TOF
122 !(TestPIDBit(2)||TestPIDBit(1)||TestPIDBit(0))) // !CPV
794c2bc3 123 pid = kTRUE ;
124 return pid ;
125 }
cfeebab6 126
794c2bc3 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
14f6a871 134 TString Name() const ;
a73f33f0 135 virtual void Paint(Option_t * option="");
14f6a871 136 virtual void Print(Option_t * option = "") const ;
6a40c29e 137
14f6a871 138 void SetType(Int_t type) ;
cfeebab6 139
88714635 140 void SetIndexInList(Int_t val) {
141 // sets the value of the index in the list
142 fIndexInList = val ;
cfeebab6 143 }
144 //This has to disappear
a3d4377c 145 enum EParticleType { kUNDEFINED=-1,
146 kNEUTRALEMFAST, kNEUTRALHAFAST, kNEUTRALEMSLOW, kNEUTRALHASLOW,
147 kCHARGEDEMFAST, kCHARGEDHAFAST, kCHARGEDEMSLOW, kCHARGEDHASLOW } ;
148
cfeebab6 149
c0d5b57d 150 typedef TClonesArray FastRecParticlesList ;
cfeebab6 151
88714635 152 protected:
a73f33f0 153
83974468 154 Int_t fIndexInList ; // the index of this RecParticle in the list stored in TreeR (to be set by analysis)
83974468 155 Int_t fType ; // particle type obtained by "virtual" reconstruction
88714635 156 private:
157
88714635 158
794c2bc3 159 ClassDef(AliPHOSFastRecParticle,2) // Reconstructed Particle produced by the fast simulation
a73f33f0 160
161};
162
163#endif // AliPHOSFASTRECPARTICLE_H