]>
Commit | Line | Data |
---|---|---|
29bf19f2 | 1 | #ifndef ALIPIDRESPONSE_H |
2 | #define ALIPIDRESPONSE_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | //---------------------------------------------------------------// | |
7 | // Base class for handling the pid response // | |
8 | // functions of all detectors // | |
9 | // and give access to the nsigmas // | |
10 | // // | |
11 | // Origin: Jens Wiechula, Uni Tuebingen, jens.wiechula@cern.ch // | |
12 | //---------------------------------------------------------------// | |
13 | ||
14 | #include "AliITSPIDResponse.h" | |
15 | #include "AliTPCPIDResponse.h" | |
16 | #include "AliTRDPIDResponse.h" | |
17 | #include "AliTOFPIDResponse.h" | |
e96b9916 | 18 | #include "AliEMCALPIDResponse.h" |
29bf19f2 | 19 | |
b79db598 | 20 | |
29bf19f2 | 21 | #include "AliVParticle.h" |
22 | #include "AliVTrack.h" | |
23 | ||
24 | #include "TNamed.h" | |
25 | ||
26 | class AliVEvent; | |
4ec8e76d | 27 | class TF1; |
db0e2c5f | 28 | class AliTRDPIDResponseObject; |
29bf19f2 | 29 | |
30 | class AliPIDResponse : public TNamed { | |
31 | public: | |
4ec8e76d | 32 | AliPIDResponse(Bool_t isMC=kFALSE); |
33 | virtual ~AliPIDResponse(); | |
29bf19f2 | 34 | |
fd21ec8d | 35 | enum EDetCode { |
36 | kDetITS = 0x1, | |
37 | kDetTPC = 0x2, | |
38 | kDetTRD = 0x4, | |
39 | kDetTOF = 0x8, | |
40 | kDetHMPID = 0x10, | |
41 | kDetEMCAL = 0x20, | |
42 | kDetPHOS = 0x40 | |
43 | }; | |
44 | ||
29bf19f2 | 45 | enum EStartTimeType_t {kFILL_T0,kTOF_T0, kT0_T0, kBest_T0}; |
fd21ec8d | 46 | |
47 | enum ITSPIDmethod { kITSTruncMean, kITSLikelihood }; | |
48 | ||
49 | enum EDetPidStatus { | |
50 | kDetNoSignal=0, | |
51 | kDetPidOk=1, | |
52 | kDetMismatch=2 | |
53 | }; | |
29bf19f2 | 54 | |
55 | AliITSPIDResponse &GetITSResponse() {return fITSResponse;} | |
56 | AliTPCPIDResponse &GetTPCResponse() {return fTPCResponse;} | |
57 | AliTOFPIDResponse &GetTOFResponse() {return fTOFResponse;} | |
58 | AliTRDPIDResponse &GetTRDResponse() {return fTRDResponse;} | |
e96b9916 | 59 | AliEMCALPIDResponse &GetEMCALResponse() {return fEMCALResponse;} |
fd21ec8d | 60 | |
61 | Float_t NumberOfSigmas(EDetCode detCode, const AliVParticle *track, AliPID::EParticleType type) const; | |
29bf19f2 | 62 | |
63 | virtual Float_t NumberOfSigmasITS(const AliVParticle *track, AliPID::EParticleType type) const; | |
64 | virtual Float_t NumberOfSigmasTPC(const AliVParticle *track, AliPID::EParticleType type) const; | |
e96b9916 | 65 | virtual Float_t NumberOfSigmasEMCAL(const AliVTrack *track, AliPID::EParticleType type) const; |
6d0064aa | 66 | virtual Float_t NumberOfSigmasEMCAL(const AliVTrack *track, AliPID::EParticleType type, Double_t &eop, Double_t showershape[4]) const; |
29bf19f2 | 67 | virtual Float_t NumberOfSigmasTOF(const AliVParticle *track, AliPID::EParticleType type) const = 0; |
ea235c90 | 68 | virtual Bool_t IdentifiedAsElectronTRD(const AliVTrack *track, Double_t efficiencyLevel) const; |
29bf19f2 | 69 | |
fd21ec8d | 70 | EDetPidStatus ComputePIDProbability (EDetCode detCode, const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; |
71 | ||
72 | EDetPidStatus ComputeITSProbability (const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; | |
73 | EDetPidStatus ComputeTPCProbability (const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; | |
74 | EDetPidStatus ComputeTOFProbability (const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; | |
75 | EDetPidStatus ComputeTRDProbability (const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; | |
76 | EDetPidStatus ComputeEMCALProbability(const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; | |
77 | EDetPidStatus ComputePHOSProbability (const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; | |
78 | EDetPidStatus ComputeHMPIDProbability(const AliVTrack *track, Int_t nSpecies, Double_t p[]) const; | |
79 | ||
f2762b1c | 80 | void SetTRDPIDmethod(AliTRDPIDResponse::ETRDPIDMethod method=AliTRDPIDResponse::kLQ1D); |
81 | ||
fd21ec8d | 82 | void SetITSPIDmethod(ITSPIDmethod pmeth) { fITSPIDmethod = pmeth; } |
ea235c90 | 83 | void SetTRDslicesForPID(UInt_t slice1, UInt_t slice2) {fTRDslicesForPID[0]=slice1;fTRDslicesForPID[1]=slice2;} |
84 | ||
4ec8e76d | 85 | void SetOADBPath(const char* path) {fOADBPath=path;} |
80f28562 | 86 | const char *GetOADBPath() const {return fOADBPath.Data();} |
4ec8e76d | 87 | void InitialiseEvent(AliVEvent *event, Int_t pass); |
ea235c90 | 88 | void SetCurrentFile(const char* file) { fCurrentFile=file; } |
4ec8e76d | 89 | |
e96b9916 | 90 | AliVEvent * GetCurrentEvent() const {return fCurrentEvent;} |
91 | ||
fd21ec8d | 92 | // User settings for the MC period and reco pass |
93 | void SetMCperiod(const char *mcPeriod) {fMCperiodUser=mcPeriod;} | |
94 | void SetRecoPass(Int_t recoPass) {fRecoPassUser=recoPass;} | |
80f28562 | 95 | |
96 | // event info | |
97 | Float_t GetCurrentCentrality() const {return fCurrCentrality;}; | |
98 | ||
0b39f221 | 99 | // TOF setting |
100 | void SetTOFtail(Float_t tail=1.1){if(tail > 0) fTOFtail=tail; else printf("TOF tail should be greater than 0 (nothing done)\n");}; | |
5f8db5fe | 101 | void SetTOFResponse(AliVEvent *vevent,EStartTimeType_t option); |
0b39f221 | 102 | |
4ec8e76d | 103 | AliPIDResponse(const AliPIDResponse &other); |
104 | AliPIDResponse& operator=(const AliPIDResponse &other); | |
80f28562 | 105 | |
29bf19f2 | 106 | |
107 | protected: | |
108 | AliITSPIDResponse fITSResponse; //PID response function of the ITS | |
109 | AliTPCPIDResponse fTPCResponse; //PID response function of the TPC | |
110 | AliTRDPIDResponse fTRDResponse; //PID response function of the TRD | |
111 | AliTOFPIDResponse fTOFResponse; //PID response function of the TOF | |
e96b9916 | 112 | AliEMCALPIDResponse fEMCALResponse; //PID response function of the EMCAL |
4ec8e76d | 113 | |
fd21ec8d | 114 | Float_t fRange; // nSigma max in likelihood |
115 | ITSPIDmethod fITSPIDmethod; // 0 = trunc mean; 1 = likelihood | |
116 | ||
4ec8e76d | 117 | private: |
118 | Bool_t fIsMC; // If we run on MC data | |
119 | ||
120 | TString fOADBPath; // OADB path to use | |
121 | ||
122 | TString fBeamType; //! beam type (PP) or (PBPB) | |
123 | TString fLHCperiod; //! LHC period | |
124 | TString fMCperiodTPC; //! corresponding MC period to use for the TPC splines | |
fd21ec8d | 125 | TString fMCperiodUser; // MC prodution requested by the user |
ea235c90 | 126 | TString fCurrentFile; //! name of currently processed file |
4ec8e76d | 127 | Int_t fRecoPass; //! reconstruction pass |
fd21ec8d | 128 | Int_t fRecoPassUser; // reconstruction pass explicitly set by the user |
4ec8e76d | 129 | Int_t fRun; //! current run number |
130 | Int_t fOldRun; //! current run number | |
fd21ec8d | 131 | |
4ec8e76d | 132 | TObjArray *fArrPidResponseMaster; //! TPC pid splines |
133 | TF1 *fResolutionCorrection; //! TPC resolution correction | |
134 | ||
db0e2c5f | 135 | AliTRDPIDResponseObject *fTRDPIDResponseObject; //! TRD PID Response Object |
ea235c90 | 136 | UInt_t fTRDslicesForPID[2]; //! TRD PID slices |
137 | ||
0b39f221 | 138 | Float_t fTOFtail; //! TOF tail effect used in TOF probability |
b79db598 | 139 | AliTOFPIDParams *fTOFPIDParams; //! TOF PID Params - period depending (OADB loaded) |
e96b9916 | 140 | |
b2138b40 | 141 | TObjArray *fEMCALPIDParams; //! EMCAL PID Params |
142 | ||
e96b9916 | 143 | AliVEvent *fCurrentEvent; //! event currently being processed |
80f28562 | 144 | |
145 | Float_t fCurrCentrality; //! current centrality | |
4ec8e76d | 146 | |
147 | void ExecNewRun(); | |
148 | ||
149 | // | |
150 | //setup parametrisations | |
151 | // | |
152 | ||
153 | //ITS | |
154 | void SetITSParametrisation(); | |
155 | ||
156 | //TPC | |
157 | void SetTPCPidResponseMaster(); | |
158 | void SetTPCParametrisation(); | |
159 | Double_t GetTPCMultiplicityBin(const AliVEvent * const event); | |
160 | ||
ea235c90 | 161 | //TRD |
162 | void SetTRDPidResponseMaster(); | |
163 | void InitializeTRDResponse(); | |
164 | ||
4ec8e76d | 165 | //TOF |
b79db598 | 166 | void SetTOFPidResponseMaster(); |
167 | void InitializeTOFResponse(); | |
b2138b40 | 168 | |
169 | //EMCAL | |
170 | void SetEMCALPidResponseMaster(); | |
171 | void InitializeEMCALResponse(); | |
172 | ||
4ec8e76d | 173 | // |
174 | void SetRecoInfo(); | |
29bf19f2 | 175 | |
d2719870 | 176 | ClassDef(AliPIDResponse, 7); //PID response handling |
29bf19f2 | 177 | }; |
178 | ||
179 | inline Float_t AliPIDResponse::NumberOfSigmasTPC(const AliVParticle *vtrack, AliPID::EParticleType type) const { | |
180 | AliVTrack *track=(AliVTrack*)vtrack; | |
181 | Double_t mom = track->GetTPCmomentum(); | |
182 | Double_t sig = track->GetTPCsignal(); | |
183 | UInt_t sigN = track->GetTPCsignalN(); | |
184 | ||
185 | Double_t nSigma = -999.; | |
186 | if (sigN>0) nSigma=fTPCResponse.GetNumberOfSigmas(mom,sig,sigN,type); | |
187 | ||
188 | return nSigma; | |
189 | } | |
190 | ||
191 | inline Float_t AliPIDResponse::NumberOfSigmasITS(const AliVParticle *vtrack, AliPID::EParticleType type) const { | |
192 | AliVTrack *track=(AliVTrack*)vtrack; | |
193 | Float_t dEdx=track->GetITSsignal(); | |
194 | if (dEdx<=0) return -999.; | |
195 | ||
196 | UChar_t clumap=track->GetITSClusterMap(); | |
197 | Int_t nPointsForPid=0; | |
198 | for(Int_t i=2; i<6; i++){ | |
199 | if(clumap&(1<<i)) ++nPointsForPid; | |
200 | } | |
201 | Float_t mom=track->P(); | |
202 | Bool_t isSA=kTRUE; | |
203 | if(track->GetTPCNcls()>0) isSA=kFALSE; | |
204 | return fITSResponse.GetNumberOfSigmas(mom,dEdx,type,nPointsForPid,isSA); | |
205 | } | |
206 | ||
207 | #endif |