]>
Commit | Line | Data |
---|---|---|
809a4336 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
50685501 | 15 | // |
16 | // Class for TPC PID | |
17 | // Implements the abstract base class AliHFEpidBase | |
18 | // | |
19 | // Class contains TPC specific cuts and QA histograms | |
20 | // Two selection strategies are offered: Selection of certain value | |
21 | // regions in the TPC dE/dx (by IsSelected), and likelihoods | |
22 | // | |
23 | // Authors: | |
24 | // | |
25 | // Markus Fasel <M.Fasel@gsi.de> | |
26 | // Markus Heide <mheide@uni-muenster.de> | |
27 | // | |
faee3b18 | 28 | #include <TF1.h> |
809a4336 | 29 | #include <TMath.h> |
1a319cb5 | 30 | #include <TH2D.h> |
809a4336 | 31 | |
cedf0381 | 32 | #include "AliTPCdEdxInfo.h" |
6555e2ad | 33 | #include "AliAODPid.h" |
722347d8 | 34 | #include "AliAODTrack.h" |
35 | #include "AliAODMCParticle.h" | |
809a4336 | 36 | #include "AliESDtrack.h" |
37 | #include "AliExternalTrackParam.h" | |
38 | #include "AliLog.h" | |
722347d8 | 39 | #include "AliMCParticle.h" |
809a4336 | 40 | #include "AliPID.h" |
8c1c76e9 | 41 | #include "AliPIDResponse.h" |
809a4336 | 42 | |
43 | #include "AliHFEpidTPC.h" | |
3a72645a | 44 | #include "AliHFEpidQAmanager.h" |
809a4336 | 45 | |
faee3b18 | 46 | ClassImp(AliHFEpidTPC) |
809a4336 | 47 | |
3a72645a | 48 | //___________________________________________________________________ |
49 | AliHFEpidTPC::AliHFEpidTPC() : | |
50 | // add a list here | |
51 | AliHFEpidBase() | |
3a72645a | 52 | , fLineCrossingsEnabled(0) |
11ff28c5 | 53 | , fkEtaCorrection(NULL) |
959ea9d8 | 54 | , fkCentralityCorrection(NULL) |
38be5083 | 55 | , fkEtaMeanCorrection(NULL) |
56 | , fkEtaWidthCorrection(NULL) | |
57 | , fkCentralityMeanCorrection(NULL) | |
58 | , fkCentralityWidthCorrection(NULL) | |
e156c3bb | 59 | , fHasCutModel(kFALSE) |
cedf0381 | 60 | , fUseOnlyOROC(kFALSE) |
3a72645a | 61 | , fNsigmaTPC(3) |
62 | , fRejectionEnabled(0) | |
4437a0d2 | 63 | , fUsedEdx(kFALSE) |
3a72645a | 64 | { |
65 | // | |
66 | // default constructor | |
67 | // | |
e156c3bb | 68 | |
69 | memset(fkUpperSigmaCut, 0, sizeof(const TF1 *) * 12); | |
70 | memset(fkLowerSigmaCut, 0, sizeof(const TF1 *) * 12); | |
71 | ||
bf892a6a | 72 | memset(fRejection, 0, sizeof(Float_t) * 4 * AliPID::kSPECIES); |
73 | memset(fLineCrossingSigma, 0, sizeof(Double_t) * AliPID::kSPECIES); | |
74 | memset(fPAsigCut, 0, sizeof(Float_t) * 2); | |
75 | memset(fNAsigmaTPC, 0, sizeof(Float_t) * 2); | |
76 | ||
3a72645a | 77 | } |
78 | ||
809a4336 | 79 | //___________________________________________________________________ |
80 | AliHFEpidTPC::AliHFEpidTPC(const char* name) : | |
81 | // add a list here | |
9bcfd1ab | 82 | AliHFEpidBase(name) |
809a4336 | 83 | , fLineCrossingsEnabled(0) |
11ff28c5 | 84 | , fkEtaCorrection(NULL) |
959ea9d8 | 85 | , fkCentralityCorrection(NULL) |
38be5083 | 86 | , fkEtaMeanCorrection(NULL) |
87 | , fkEtaWidthCorrection(NULL) | |
88 | , fkCentralityMeanCorrection(NULL) | |
89 | , fkCentralityWidthCorrection(NULL) | |
1a319cb5 | 90 | , fkCentralityEtaCorrectionMeanJpsi(NULL) |
91 | , fkCentralityEtaCorrectionWidthJpsi(NULL) | |
e156c3bb | 92 | , fHasCutModel(kFALSE) |
cedf0381 | 93 | , fUseOnlyOROC(kFALSE) |
75d81601 | 94 | , fNsigmaTPC(3) |
0792aa82 | 95 | , fRejectionEnabled(0) |
4437a0d2 | 96 | , fUsedEdx(kFALSE) |
809a4336 | 97 | { |
98 | // | |
99 | // default constructor | |
100 | // | |
bf892a6a | 101 | // |
e156c3bb | 102 | memset(fkUpperSigmaCut, 0, sizeof(const TF1 *) * 12); |
103 | memset(fkLowerSigmaCut, 0, sizeof(const TF1 *) * 12); | |
104 | ||
bf892a6a | 105 | memset(fRejection, 0, sizeof(Float_t) * 4 * AliPID::kSPECIES); |
809a4336 | 106 | memset(fLineCrossingSigma, 0, sizeof(Double_t) * AliPID::kSPECIES); |
722347d8 | 107 | memset(fPAsigCut, 0, sizeof(Float_t) * 2); |
108 | memset(fNAsigmaTPC, 0, sizeof(Float_t) * 2); | |
809a4336 | 109 | } |
110 | ||
111 | //___________________________________________________________________ | |
112 | AliHFEpidTPC::AliHFEpidTPC(const AliHFEpidTPC &ref) : | |
9bcfd1ab | 113 | AliHFEpidBase("") |
809a4336 | 114 | , fLineCrossingsEnabled(0) |
11ff28c5 | 115 | , fkEtaCorrection(NULL) |
959ea9d8 | 116 | , fkCentralityCorrection(NULL) |
38be5083 | 117 | , fkEtaMeanCorrection(NULL) |
118 | , fkEtaWidthCorrection(NULL) | |
119 | , fkCentralityMeanCorrection(NULL) | |
120 | , fkCentralityWidthCorrection(NULL) | |
1a319cb5 | 121 | , fkCentralityEtaCorrectionMeanJpsi(NULL) |
122 | , fkCentralityEtaCorrectionWidthJpsi(NULL) | |
e156c3bb | 123 | , fHasCutModel(ref.fHasCutModel) |
cedf0381 | 124 | , fUseOnlyOROC(ref.fUseOnlyOROC) |
809a4336 | 125 | , fNsigmaTPC(2) |
0792aa82 | 126 | , fRejectionEnabled(0) |
4437a0d2 | 127 | , fUsedEdx(kFALSE) |
809a4336 | 128 | { |
129 | // | |
130 | // Copy constructor | |
131 | // | |
132 | ref.Copy(*this); | |
133 | } | |
134 | ||
135 | //___________________________________________________________________ | |
136 | AliHFEpidTPC &AliHFEpidTPC::operator=(const AliHFEpidTPC &ref){ | |
137 | // | |
138 | // Assignment operator | |
139 | // | |
140 | if(this != &ref){ | |
141 | ref.Copy(*this); | |
142 | } | |
143 | return *this; | |
144 | } | |
75d81601 | 145 | //___________________________________________________________________ |
809a4336 | 146 | void AliHFEpidTPC::Copy(TObject &o) const{ |
147 | // | |
148 | // Copy function | |
149 | // called in copy constructor and assigment operator | |
150 | // | |
151 | AliHFEpidTPC &target = dynamic_cast<AliHFEpidTPC &>(o); | |
152 | ||
959ea9d8 | 153 | target.fkEtaCorrection = fkEtaCorrection; |
154 | target.fkCentralityCorrection = fkCentralityCorrection; | |
38be5083 | 155 | target.fkEtaMeanCorrection = fkEtaMeanCorrection; |
156 | target.fkEtaWidthCorrection = fkEtaWidthCorrection; | |
157 | target.fkCentralityMeanCorrection = fkCentralityMeanCorrection; | |
158 | target.fkCentralityWidthCorrection = fkCentralityWidthCorrection; | |
809a4336 | 159 | target.fLineCrossingsEnabled = fLineCrossingsEnabled; |
e156c3bb | 160 | target.fHasCutModel = fHasCutModel; |
cedf0381 | 161 | target.fUseOnlyOROC = fUseOnlyOROC; |
809a4336 | 162 | target.fNsigmaTPC = fNsigmaTPC; |
0792aa82 | 163 | target.fRejectionEnabled = fRejectionEnabled; |
e156c3bb | 164 | |
165 | memcpy(target.fkUpperSigmaCut, fkUpperSigmaCut, sizeof(const TF1 *) * 12); | |
166 | memcpy(target.fkLowerSigmaCut, fkLowerSigmaCut, sizeof(const TF1 *) * 12); | |
167 | ||
75d81601 | 168 | memcpy(target.fLineCrossingSigma, fLineCrossingSigma, sizeof(Double_t) * AliPID::kSPECIES); |
722347d8 | 169 | memcpy(target.fPAsigCut, fPAsigCut, sizeof(Float_t) * 2); |
170 | memcpy(target.fNAsigmaTPC, fNAsigmaTPC, sizeof(Float_t) * 2); | |
171 | ||
809a4336 | 172 | AliHFEpidBase::Copy(target); |
173 | } | |
174 | ||
175 | //___________________________________________________________________ | |
176 | AliHFEpidTPC::~AliHFEpidTPC(){ | |
177 | // | |
178 | // Destructor | |
179 | // | |
809a4336 | 180 | } |
181 | ||
182 | //___________________________________________________________________ | |
8c1c76e9 | 183 | Bool_t AliHFEpidTPC::InitializePID(Int_t /*run*/){ |
809a4336 | 184 | // |
185 | // Add TPC dE/dx Line crossings | |
186 | // | |
75d81601 | 187 | //AddTPCdEdxLineCrossing(AliPID::kKaon, 0.3, 0.018); |
188 | //AddTPCdEdxLineCrossing(AliPID::kProton, 0.9, 0.054); | |
809a4336 | 189 | return kTRUE; |
190 | } | |
191 | ||
192 | //___________________________________________________________________ | |
6555e2ad | 193 | Int_t AliHFEpidTPC::IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const |
809a4336 | 194 | { |
195 | // | |
196 | // For the TPC pid we use the 2-sigma band around the bethe bloch curve | |
197 | // for electrons | |
198 | // exclusion of the crossing points | |
199 | // | |
3a72645a | 200 | |
8c1c76e9 | 201 | if(!fkPIDResponse) return 0; |
11ff28c5 | 202 | |
203 | AliHFEpidObject::AnalysisType_t anatype = track->IsESDanalysis() ? AliHFEpidObject::kESDanalysis : AliHFEpidObject::kAODanalysis; | |
204 | ||
205 | // Make clone track in order to be able to apply correction | |
206 | const AliVTrack *rectrack; | |
207 | AliESDtrack esdtrack; | |
208 | AliAODTrack aodtrack; | |
38be5083 | 209 | Double_t correctedTPCnSigma=0.; |
210 | Bool_t TPCnSigmaCorrected=kFALSE; | |
211 | if((fkEtaMeanCorrection&&fkEtaWidthCorrection)|| | |
212 | (fkCentralityMeanCorrection&&fkCentralityWidthCorrection)){ | |
213 | TPCnSigmaCorrected=kTRUE; | |
214 | correctedTPCnSigma=GetCorrectedTPCnSigma(track->GetRecTrack()->Eta(), track->GetMultiplicity(), fkPIDResponse->NumberOfSigmasTPC(track->GetRecTrack(), AliPID::kElectron)); | |
215 | } | |
1a319cb5 | 216 | // jpsi |
217 | if((fkCentralityEtaCorrectionMeanJpsi)&& | |
218 | (fkCentralityEtaCorrectionWidthJpsi)){ | |
219 | TPCnSigmaCorrected=kTRUE; | |
220 | correctedTPCnSigma=GetCorrectedTPCnSigmaJpsi(track->GetRecTrack()->Eta(), track->GetMultiplicity(), fkPIDResponse->NumberOfSigmasTPC(track->GetRecTrack(), AliPID::kElectron)); | |
221 | } | |
959ea9d8 | 222 | if(fkEtaCorrection || fkCentralityCorrection){ |
11ff28c5 | 223 | // Correction available |
224 | // apply it on copy | |
225 | if(track->IsESDanalysis()){ | |
226 | esdtrack.~AliESDtrack(); | |
227 | new(&esdtrack) AliESDtrack(*(static_cast<const AliESDtrack *>(track->GetRecTrack()))); | |
959ea9d8 | 228 | if(track->IsPbPb() && HasCentralityCorrection()) |
229 | ApplyCentralityCorrection(&esdtrack, track->GetMultiplicity(), anatype); | |
230 | if(HasEtaCorrection()) | |
231 | ApplyEtaCorrection(&esdtrack, anatype); | |
11ff28c5 | 232 | rectrack = &esdtrack; |
233 | } else { | |
234 | aodtrack.~AliAODTrack(); | |
235 | new(&aodtrack) AliAODTrack(*(static_cast<const AliAODTrack *>(track->GetRecTrack()))); | |
959ea9d8 | 236 | if(track->IsPbPb() && HasCentralityCorrection()) |
237 | ApplyCentralityCorrection(&aodtrack, track->GetMultiplicity(), anatype); | |
238 | if(HasEtaCorrection()) | |
239 | ApplyEtaCorrection(&aodtrack, anatype); | |
11ff28c5 | 240 | rectrack = &aodtrack; |
241 | } | |
242 | } else { | |
243 | // Correction not available - no need to copy | |
244 | rectrack = track->GetRecTrack(); | |
245 | } | |
246 | AliHFEpidObject tpctrack(*track); | |
247 | tpctrack.SetRecTrack(rectrack); | |
38be5083 | 248 | if(TPCnSigmaCorrected)tpctrack.SetCorrectedTPCnSigma(correctedTPCnSigma); |
3a72645a | 249 | |
11ff28c5 | 250 | // QA before selection (after correction) |
251 | if(pidqa) pidqa->ProcessTrack(&tpctrack, AliHFEpid::kTPCpid, AliHFEdetPIDqa::kBeforePID); | |
e3fc062d | 252 | AliDebug(1, "Doing TPC PID based on n-Sigma cut approach"); |
11ff28c5 | 253 | |
254 | // make copy of the track in order to allow for applying the correction | |
38be5083 | 255 | Float_t nsigma=correctedTPCnSigma; |
256 | if(!TPCnSigmaCorrected) | |
257 | nsigma = fUsedEdx ? rectrack->GetTPCsignal() : fkPIDResponse->NumberOfSigmasTPC(rectrack, AliPID::kElectron); | |
3a72645a | 258 | AliDebug(1, Form("TPC NSigma: %f", nsigma)); |
809a4336 | 259 | // exclude crossing points: |
260 | // Determine the bethe values for each particle species | |
809a4336 | 261 | Bool_t isLineCrossing = kFALSE; |
262 | for(Int_t ispecies = 0; ispecies < AliPID::kSPECIES; ispecies++){ | |
75d81601 | 263 | if(ispecies == AliPID::kElectron) continue; |
809a4336 | 264 | if(!(fLineCrossingsEnabled & 1 << ispecies)) continue; |
11ff28c5 | 265 | if(TMath::Abs(fkPIDResponse->NumberOfSigmasTPC(rectrack, (AliPID::EParticleType)ispecies)) < fLineCrossingSigma[ispecies] && TMath::Abs(nsigma) < fNsigmaTPC){ |
9bcfd1ab | 266 | // Point in a line crossing region, no PID possible, but !PID still possible ;-) |
70da6c5a | 267 | isLineCrossing = kTRUE; |
809a4336 | 268 | break; |
269 | } | |
270 | } | |
271 | if(isLineCrossing) return 0; | |
0792aa82 | 272 | |
273 | // Check particle rejection | |
274 | if(HasParticleRejection()){ | |
11ff28c5 | 275 | Int_t reject = Reject(rectrack, anatype); |
0792aa82 | 276 | if(reject != 0) return reject; |
277 | } | |
722347d8 | 278 | |
faee3b18 | 279 | // Check if we have an asymmetric sigma model set |
0792aa82 | 280 | Int_t pdg = 0; |
e156c3bb | 281 | if(fHasCutModel){ |
11ff28c5 | 282 | pdg = CutSigmaModel(&tpctrack) ? 11 : 0; |
faee3b18 | 283 | } else { |
284 | // Perform Asymmetric n-sigma cut if required, else perform symmetric TPC sigma cut | |
5cd679b7 | 285 | Float_t p = rectrack->P(); |
286 | if(HasAsymmetricSigmaCut()) { | |
287 | ||
288 | //printf("p %f, fPAsigCut[0] %f, fPAsigCut[1] %f\n",p,fPAsigCut[0],fPAsigCut[1]); | |
289 | if(p >= fPAsigCut[0] && p <= fPAsigCut[1]) { | |
4437a0d2 | 290 | if(nsigma >= fNAsigmaTPC[0] && nsigma <= fNAsigmaTPC[1]) pdg = 11; |
291 | else pdg = 0; | |
5cd679b7 | 292 | } |
293 | else pdg = 0; | |
294 | ||
295 | } | |
296 | else { | |
faee3b18 | 297 | if(TMath::Abs(nsigma) < fNsigmaTPC ) pdg = 11; |
298 | } | |
70da6c5a | 299 | } |
11ff28c5 | 300 | if(pidqa && pdg != 0) pidqa->ProcessTrack(&tpctrack, AliHFEpid::kTPCpid, AliHFEdetPIDqa::kAfterPID); |
0792aa82 | 301 | return pdg; |
722347d8 | 302 | |
809a4336 | 303 | } |
304 | ||
faee3b18 | 305 | //___________________________________________________________________ |
e156c3bb | 306 | Bool_t AliHFEpidTPC::CutSigmaModel(const AliHFEpidObject * const track) const { |
faee3b18 | 307 | // |
308 | // N SigmaCut using parametrization of the cuts | |
309 | // | |
310 | Bool_t isSelected = kTRUE; | |
e156c3bb | 311 | AliHFEpidObject::AnalysisType_t anatype = track->IsESDanalysis() ? AliHFEpidObject::kESDanalysis : AliHFEpidObject::kAODanalysis; |
4437a0d2 | 312 | Float_t nsigma = fUsedEdx ? track->GetRecTrack()->GetTPCsignal() : fkPIDResponse->NumberOfSigmasTPC(track->GetRecTrack(), AliPID::kElectron); |
e156c3bb | 313 | Double_t p = GetP(track->GetRecTrack(), anatype); |
314 | Int_t centrality = track->IsPbPb() ? track->GetCentrality() + 1 : 0; | |
315 | AliDebug(2, Form("Centrality: %d\n", centrality)); | |
8c1c76e9 | 316 | if(centrality > 11) return kFALSE; |
e156c3bb | 317 | const TF1 *cutfunction; |
318 | if((cutfunction = fkUpperSigmaCut[centrality]) && nsigma > cutfunction->Eval(p)) isSelected = kFALSE; | |
319 | if((cutfunction = fkLowerSigmaCut[centrality]) && nsigma < cutfunction->Eval(p)) isSelected = kFALSE; | |
faee3b18 | 320 | return isSelected; |
321 | } | |
322 | ||
0792aa82 | 323 | //___________________________________________________________________ |
6555e2ad | 324 | Int_t AliHFEpidTPC::Reject(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const{ |
0792aa82 | 325 | // |
326 | // reject particles based on asymmetric sigma cut | |
327 | // | |
328 | Int_t pdc[AliPID::kSPECIES] = {11,13,211,321,2212}; | |
6555e2ad | 329 | Double_t p = GetP(track, anaType); |
0792aa82 | 330 | for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){ |
331 | if(!TESTBIT(fRejectionEnabled, ispec)) continue; | |
0792aa82 | 332 | // Particle rejection enabled |
333 | if(p < fRejection[4*ispec] || p > fRejection[4*ispec+2]) continue; | |
8c1c76e9 | 334 | Double_t sigma = fkPIDResponse->NumberOfSigmasTPC(track, static_cast<AliPID::EParticleType>(ispec)); |
0792aa82 | 335 | if(sigma >= fRejection[4*ispec+1] && sigma <= fRejection[4*ispec+3]) return pdc[ispec] * track->Charge(); |
336 | } | |
337 | return 0; | |
338 | } | |
339 | ||
11ff28c5 | 340 | //___________________________________________________________________ |
341 | void AliHFEpidTPC::ApplyEtaCorrection(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const{ | |
342 | // | |
343 | // Apply correction for the eta dependence | |
344 | // N.B. This correction has to be applied on a copy track | |
345 | // | |
346 | AliDebug(1, Form("Applying correction function %s\n", fkEtaCorrection->GetName())); | |
347 | Double_t original = track->GetTPCsignal(), | |
348 | eta = track->Eta(); | |
349 | if(anatype == AliHFEpidObject::kESDanalysis){ | |
350 | AliESDtrack *esdtrack = static_cast<AliESDtrack *>(track); | |
959ea9d8 | 351 | if(fkEtaCorrection->Eval(eta)>0.0) esdtrack->SetTPCsignal(original/fkEtaCorrection->Eval(eta), esdtrack->GetTPCsignalSigma(), esdtrack->GetTPCsignalN()); |
11ff28c5 | 352 | } else { |
353 | AliAODTrack *aodtrack = static_cast<AliAODTrack *>(track); | |
354 | AliAODPid *pid = aodtrack->GetDetPid(); | |
959ea9d8 | 355 | if(pid && fkEtaCorrection->Eval(eta)>0.0) pid->SetTPCsignal(original/fkEtaCorrection->Eval(eta)); |
11ff28c5 | 356 | } |
357 | } | |
959ea9d8 | 358 | |
359 | //___________________________________________________________________ | |
360 | void AliHFEpidTPC::ApplyCentralityCorrection(AliVTrack *track, Double_t centralityEstimator, AliHFEpidObject::AnalysisType_t anatype) const{ | |
361 | // | |
362 | // Apply correction for the eta dependence | |
363 | // N.B. This correction has to be applied on a copy track | |
364 | // | |
365 | AliDebug(1, Form("Applying correction function %s\n", fkCentralityCorrection->GetName())); | |
366 | Double_t original = track->GetTPCsignal(); | |
367 | if(anatype == AliHFEpidObject::kESDanalysis){ | |
368 | AliESDtrack *esdtrack = static_cast<AliESDtrack *>(track); | |
369 | if(fkCentralityCorrection->Eval(centralityEstimator)>0.0) esdtrack->SetTPCsignal(original/fkCentralityCorrection->Eval(centralityEstimator), esdtrack->GetTPCsignalSigma(), esdtrack->GetTPCsignalN()); | |
370 | } else { | |
371 | AliAODTrack *aodtrack = static_cast<AliAODTrack *>(track); | |
372 | AliAODPid *pid = aodtrack->GetDetPid(); | |
373 | if(pid && fkCentralityCorrection->Eval(centralityEstimator)>0.0) pid->SetTPCsignal(original/fkCentralityCorrection->Eval(centralityEstimator)); | |
374 | } | |
375 | } | |
376 | ||
38be5083 | 377 | //___________________________________________________________________ |
378 | Double_t AliHFEpidTPC::GetCorrectedTPCnSigma(Double_t eta, Double_t centralityEstimator, Double_t tpcNsigma) const{ | |
379 | // | |
380 | // Apply correction for the eta dependence | |
381 | // N.B. This correction has to be applied on a copy track | |
382 | // | |
383 | Double_t corrtpcNsigma = tpcNsigma; | |
38be5083 | 384 | if(fkEtaMeanCorrection&&fkEtaWidthCorrection){ |
385 | if(TMath::Abs(fkEtaWidthCorrection->Eval(eta))>0.0000001) corrtpcNsigma=(corrtpcNsigma-fkEtaMeanCorrection->Eval(eta))/fkEtaWidthCorrection->Eval(eta); | |
386 | } | |
387 | if(fkCentralityMeanCorrection&&fkCentralityWidthCorrection) { | |
388 | if(TMath::Abs(fkCentralityWidthCorrection->Eval(centralityEstimator))>0.0000001) corrtpcNsigma=(corrtpcNsigma-fkCentralityMeanCorrection->Eval(centralityEstimator))/fkCentralityWidthCorrection->Eval(centralityEstimator); | |
389 | } | |
390 | return corrtpcNsigma; | |
391 | } | |
392 | ||
1a319cb5 | 393 | //___________________________________________________________________ |
394 | Double_t AliHFEpidTPC::GetCorrectedTPCnSigmaJpsi(Double_t eta, Double_t centralityEstimator, Double_t tpcNsigma) const{ | |
395 | // | |
396 | // Apply correction for the eta dependence | |
397 | // N.B. This correction has to be applied on a copy track | |
398 | // | |
399 | Double_t corrtpcNsigma = tpcNsigma; | |
400 | if(fkCentralityEtaCorrectionMeanJpsi&&fkCentralityEtaCorrectionWidthJpsi){ | |
70df496d | 401 | const TAxis *caxis = fkCentralityEtaCorrectionMeanJpsi->GetXaxis(); |
402 | const TAxis *eaxis = fkCentralityEtaCorrectionMeanJpsi->GetYaxis(); | |
e0165b6b | 403 | Int_t cbin = caxis->FindFixBin(centralityEstimator); |
404 | Int_t ebin = eaxis->FindFixBin(eta); | |
1a319cb5 | 405 | Double_t cbinlowedge = caxis->GetBinLowEdge(cbin); |
406 | Double_t cbinupedge = caxis->GetBinUpEdge(cbin); | |
407 | Double_t ebinlowedge = eaxis->GetBinLowEdge(ebin); | |
408 | Double_t ebinupedge = eaxis->GetBinUpEdge(ebin); | |
409 | Double_t center = fkCentralityEtaCorrectionMeanJpsi->GetBinContent(cbin,ebin); | |
410 | Double_t width = fkCentralityEtaCorrectionWidthJpsi->GetBinContent(cbin,ebin); | |
411 | //printf("cbin %d, cbinlowe %f, cbinupe %f, centrality %f\n",cbin,cbinlowedge,cbinupedge,centralityEstimator); | |
412 | //printf("ebin %d, ebinlowe %f, ebinupe %f, eta %f\n",ebin,ebinlowedge,ebinupedge,eta); | |
413 | //printf("mean %f, width %f\n",center,width); | |
414 | if(TMath::Abs(width)>0.0000001) corrtpcNsigma=(corrtpcNsigma-center)/width; | |
415 | } | |
416 | return corrtpcNsigma; | |
417 | } | |
418 | ||
cedf0381 | 419 | //___________________________________________________________________ |
420 | void AliHFEpidTPC::UseOROC(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const{ | |
421 | // | |
422 | // Use TPC signal from the OROC | |
423 | // N.B. This correction has to be applied on a copy track | |
424 | // | |
425 | //Double_t original = track->GetTPCsignal(); | |
426 | ||
427 | if(anatype == AliHFEpidObject::kESDanalysis){ | |
428 | AliESDtrack *esdtrack = static_cast<AliESDtrack *>(track); | |
429 | AliTPCdEdxInfo *dEdxInfo = track->GetTPCdEdxInfo(); | |
430 | Double32_t TPCsignalRegion[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used) | |
431 | Char_t TPCsignalNRegion[3]; // number of clusters above threshold used in the dEdx calculation | |
432 | Char_t TPCsignalNRowRegion[3]; // number of crosed rows used in the dEdx calculation - signal below threshold included | |
433 | dEdxInfo->GetTPCSignalRegionInfo(TPCsignalRegion,TPCsignalNRegion,TPCsignalNRowRegion); | |
434 | esdtrack->SetTPCsignal(TPCsignalRegion[3],esdtrack->GetTPCsignalSigma(),(TPCsignalNRegion[1]+TPCsignalNRegion[2])); // the two last are not ok | |
435 | } else { | |
436 | AliAODTrack *aodtrack = static_cast<AliAODTrack *>(track); | |
437 | AliTPCdEdxInfo *dEdxInfo = track->GetTPCdEdxInfo(); | |
438 | Double32_t TPCsignalRegion[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used) | |
439 | Char_t TPCsignalNRegion[3]; // number of clusters above threshold used in the dEdx calculation | |
440 | Char_t TPCsignalNRowRegion[3]; // number of crosed rows used in the dEdx calculation - signal below threshold included | |
441 | dEdxInfo->GetTPCSignalRegionInfo(TPCsignalRegion,TPCsignalNRegion,TPCsignalNRowRegion); | |
442 | AliAODPid *pid = aodtrack->GetDetPid(); | |
443 | if(pid) pid->SetTPCsignal(TPCsignalRegion[3]); | |
444 | if(pid) pid->SetTPCsignalN((TPCsignalNRegion[1]+TPCsignalNRegion[2])); | |
445 | } | |
11ff28c5 | 446 | |
cedf0381 | 447 | } |
809a4336 | 448 | //___________________________________________________________________ |
75d81601 | 449 | void AliHFEpidTPC::AddTPCdEdxLineCrossing(Int_t species, Double_t sigma){ |
809a4336 | 450 | // |
451 | // Add exclusion point for the TPC PID where a dEdx line crosses the electron line | |
452 | // Stores line center and line sigma | |
453 | // | |
454 | if(species >= AliPID::kSPECIES){ | |
455 | AliError("Species doesn't exist"); | |
456 | return; | |
457 | } | |
458 | fLineCrossingsEnabled |= 1 << species; | |
75d81601 | 459 | fLineCrossingSigma[species] = sigma; |
809a4336 | 460 | } |
461 | ||
6555e2ad | 462 | //___________________________________________________________________ |
463 | Double_t AliHFEpidTPC::GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anatype) const { | |
464 | // | |
465 | // Get the momentum at the inner wall of the TPC | |
466 | // | |
467 | Double_t p = -1; | |
468 | if(anatype == AliHFEpidObject::kESDanalysis){ | |
469 | // ESD analysis: Use Inner Params for the momentum estimate | |
470 | const AliESDtrack *esdtrack = dynamic_cast<const AliESDtrack *>(track); | |
bf892a6a | 471 | if(esdtrack) p = esdtrack->GetInnerParam() ? esdtrack->GetInnerParam()->GetP() : esdtrack->P(); |
58d0bf42 | 472 | } |
473 | ||
474 | if(anatype == AliHFEpidObject::kAODanalysis) | |
475 | { | |
6555e2ad | 476 | // AOD analysis: Use TPC momentum stored in the AliAODpid object |
477 | const AliAODTrack *aodtrack = dynamic_cast<const AliAODTrack *>(track); | |
bf892a6a | 478 | if(aodtrack) p = aodtrack->GetDetPid() ? aodtrack->GetDetPid()->GetTPCmomentum() : aodtrack->P(); |
6555e2ad | 479 | } |
480 | return p; | |
481 | } |