Macros moved from oldmacros on the standard ITS directory
[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 {
24
88714635 25 public:
a73f33f0 26
03c03c49 27 AliPHOSFastRecParticle() ;
78022019 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 ;}
6a40c29e 43
7b7c1533 44 const Int_t GetType() const {
88714635 45 // returns the type of the particle
46 return fType ;
47 }
6a40c29e 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 }
03c03c49 60
a3d4377c 61 Bool_t IsPhotonHiPu_LoEf() {
03c03c49 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 }
a3d4377c 69 Bool_t IsPhotonMed_Pu_Ef(){
03c03c49 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 ;
794c2bc3 76 }
77
a3d4377c 78 Bool_t IsPhotonHiEf_LoPu() {
03c03c49 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
794c2bc3 87 Bool_t IsPhoton() {
a3d4377c 88 Bool_t pid=kFALSE ;
89 if(IsPhotonHiEf_LoPu()) pid = kTRUE ;
90 return pid ;
91 }
794c2bc3 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 }
a3d4377c 118
794c2bc3 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
a73f33f0 134 TString Name() ;
135 virtual void Paint(Option_t * option="");
2f04ed65 136 virtual void Print(const char * opt) ;
6a40c29e 137
88714635 138 void SetType(Int_t type) {
139 // sets the particle type
140 fType = type ;
6a40c29e 141 }
142
88714635 143 void SetIndexInList(Int_t val) {
144 // sets the value of the index in the list
145 fIndexInList = val ;
146 }
a3d4377c 147 enum EParticleType { kUNDEFINED=-1,
148 kNEUTRALEMFAST, kNEUTRALHAFAST, kNEUTRALEMSLOW, kNEUTRALHASLOW,
149 kCHARGEDEMFAST, kCHARGEDHAFAST, kCHARGEDEMSLOW, kCHARGEDHASLOW } ;
150
9ec91567 151
c0d5b57d 152 typedef TClonesArray FastRecParticlesList ;
153
88714635 154 protected:
a73f33f0 155
83974468 156 Int_t fIndexInList ; // the index of this RecParticle in the list stored in TreeR (to be set by analysis)
83974468 157 Int_t fType ; // particle type obtained by "virtual" reconstruction
a73f33f0 158
88714635 159 private:
160
88714635 161
794c2bc3 162 ClassDef(AliPHOSFastRecParticle,2) // Reconstructed Particle produced by the fast simulation
a73f33f0 163
164};
165
166#endif // AliPHOSFASTRECPARTICLE_H