]>
Commit | Line | Data |
---|---|---|
8df8e382 | 1 | /************************************************************************* |
2 | * Copyright(c) 1998-2009, 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 | **************************************************************************/ | |
15 | ||
16 | /////////////////////////////////////////////////////////////////////////// | |
17 | // Dielectron PID // | |
18 | // // | |
19 | // // | |
20 | /* | |
21 | Detailed description | |
22 | ||
23 | ||
24 | */ | |
25 | // // | |
26 | /////////////////////////////////////////////////////////////////////////// | |
27 | ||
28 | #include <TMath.h> | |
29 | #include <TF1.h> | |
48609e3d | 30 | #include <TGraph.h> |
8df8e382 | 31 | |
164bfb53 | 32 | #include <AliVTrack.h> |
5720c765 | 33 | #include <AliVCluster.h> |
8df8e382 | 34 | #include <AliLog.h> |
ffbede40 | 35 | #include <AliExternalTrackParam.h> |
5720c765 | 36 | #include <AliPIDResponse.h> |
6d5dea7c | 37 | #include <AliTRDPIDResponse.h> |
5720c765 | 38 | #include <AliESDtrack.h> //!!!!! Remove once Eta correction is treated in the tender |
8df8e382 | 39 | |
40 | #include "AliDielectronVarManager.h" | |
41 | ||
42 | #include "AliDielectronPID.h" | |
43 | ||
44 | ClassImp(AliDielectronPID) | |
45 | ||
48609e3d | 46 | TGraph *AliDielectronPID::fgFitCorr=0x0; |
47 | Double_t AliDielectronPID::fgCorr=0.0; | |
d327d9cd | 48 | Double_t AliDielectronPID::fgCorrdEdx=1.0; |
5720c765 | 49 | TF1 *AliDielectronPID::fgFunEtaCorr=0x0; |
d327d9cd | 50 | TGraph *AliDielectronPID::fgdEdxRunCorr=0x0; |
48609e3d | 51 | |
8df8e382 | 52 | AliDielectronPID::AliDielectronPID() : |
53 | AliAnalysisCuts(), | |
54 | fNcuts(0), | |
5720c765 | 55 | fPIDResponse(0x0) |
8df8e382 | 56 | { |
57 | // | |
58 | // Default Constructor | |
59 | // | |
60 | for (Int_t icut=0; icut<kNmaxPID; ++icut){ | |
61 | fDetType[icut]=kTPC; | |
62 | fPartType[icut]=AliPID::kPion; | |
63 | fNsigmaLow[icut]=0; | |
64 | fNsigmaUp[icut]=0; | |
5720c765 | 65 | fmin[icut]=0; |
66 | fmax[icut]=0; | |
8df8e382 | 67 | fExclude[icut]=kFALSE; |
68 | fFunUpperCut[icut]=0x0; | |
69 | fFunLowerCut[icut]=0x0; | |
61d106d3 | 70 | fRequirePIDbit[icut]=0; |
5720c765 | 71 | fActiveCuts[icut]=-1; |
88204efa | 72 | fSigmaFunLow[icut]=0; |
73 | fSigmaFunUp[icut]=0; | |
74 | fFunSigma[icut]=0x0; | |
8df8e382 | 75 | } |
76 | } | |
77 | ||
78 | //______________________________________________ | |
79 | AliDielectronPID::AliDielectronPID(const char* name, const char* title) : | |
80 | AliAnalysisCuts(name, title), | |
81 | fNcuts(0), | |
5720c765 | 82 | fPIDResponse(0x0) |
8df8e382 | 83 | { |
84 | // | |
85 | // Named Constructor | |
86 | // | |
87 | for (Int_t icut=0; icut<kNmaxPID; ++icut){ | |
88 | fDetType[icut]=kTPC; | |
89 | fPartType[icut]=AliPID::kPion; | |
90 | fNsigmaLow[icut]=0; | |
91 | fNsigmaUp[icut]=0; | |
5720c765 | 92 | fmin[icut]=0; |
93 | fmax[icut]=0; | |
8df8e382 | 94 | fExclude[icut]=kFALSE; |
95 | fFunUpperCut[icut]=0x0; | |
96 | fFunLowerCut[icut]=0x0; | |
61d106d3 | 97 | fRequirePIDbit[icut]=0; |
5720c765 | 98 | fActiveCuts[icut]=0; |
88204efa | 99 | fSigmaFunLow[icut]=0; |
100 | fSigmaFunUp[icut]=0; | |
101 | fFunSigma[icut]=0x0; | |
8df8e382 | 102 | } |
103 | } | |
104 | ||
105 | //______________________________________________ | |
106 | AliDielectronPID::~AliDielectronPID() | |
107 | { | |
108 | // | |
109 | // Default Destructor | |
110 | // | |
111 | } | |
112 | ||
113 | //______________________________________________ | |
114 | void AliDielectronPID::AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp/*=-99999.*/, | |
5720c765 | 115 | Double_t min/*=0*/, Double_t max/*=0*/, Bool_t exclude/*=kFALSE*/, |
116 | UInt_t pidBitType/*=AliDielectronPID::kRequire*/, Int_t var/*=-1*/) | |
8df8e382 | 117 | { |
118 | // | |
119 | // Add a pid nsigma cut | |
5720c765 | 120 | // use response of detector 'det' in the range ['min'] to ['max'] for var |
121 | // use a sigma band between 'nSigmaLow' and 'nSigmaUp' | |
8df8e382 | 122 | // if nSigmaUp==-99999. then nSigmaLow will be uesd as a symmetric band +- nSigmaLow |
123 | // specify whether to 'exclude' the given band | |
124 | // | |
125 | ||
45b2b1b8 | 126 | if (fNcuts>=kNmaxPID){ |
8df8e382 | 127 | AliError(Form("only %d pid cut ranges allowed",kNmaxPID)); |
45b2b1b8 | 128 | return; |
8df8e382 | 129 | } |
130 | if (TMath::Abs(nSigmaUp+99999.)<1e-20){ | |
131 | nSigmaUp=TMath::Abs(nSigmaLow); | |
132 | nSigmaLow=-1.*nSigmaUp; | |
133 | } | |
134 | fDetType[fNcuts]=det; | |
135 | fPartType[fNcuts]=type; | |
136 | fNsigmaLow[fNcuts]=nSigmaLow; | |
137 | fNsigmaUp[fNcuts]=nSigmaUp; | |
5720c765 | 138 | fmin[fNcuts]=min; |
139 | fmax[fNcuts]=max; | |
8df8e382 | 140 | fExclude[fNcuts]=exclude; |
61d106d3 | 141 | fRequirePIDbit[fNcuts]=pidBitType; |
5720c765 | 142 | fActiveCuts[fNcuts]=(var==-1 ? AliDielectronVarManager::kP : var); |
143 | ||
fd6ebd85 | 144 | AliDebug(1,Form("Add PID cut %d: sigma [% .1f,% .1f] \t cut [% .1f,% .f] \t var %d->%s \n", |
145 | fNcuts,nSigmaLow,nSigmaUp,min,max,fActiveCuts[fNcuts],AliDielectronVarManager::GetValueName(fActiveCuts[fNcuts]))); | |
8df8e382 | 146 | |
5720c765 | 147 | ++fNcuts; |
148 | ||
8df8e382 | 149 | } |
150 | ||
151 | //______________________________________________ | |
152 | void AliDielectronPID::AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, TF1 * const funUp, | |
5720c765 | 153 | Double_t min/*=0*/, Double_t max/*=0*/, Bool_t exclude/*=kFALSE*/, |
154 | UInt_t pidBitType/*=AliDielectronPID::kRequire*/, Int_t var/*=-1*/) | |
8df8e382 | 155 | { |
156 | // | |
157 | // cut using a TF1 as upper cut | |
158 | // | |
159 | if (funUp==0x0){ | |
160 | AliError("A valid function is required for the upper cut. Not adding the cut!"); | |
161 | return; | |
162 | } | |
163 | fFunUpperCut[fNcuts]=funUp; | |
5720c765 | 164 | AddCut(det,type,nSigmaLow,0.,min,max,exclude,pidBitType,var); |
8df8e382 | 165 | } |
166 | ||
167 | //______________________________________________ | |
168 | void AliDielectronPID::AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, Double_t nSigmaUp, | |
5720c765 | 169 | Double_t min/*=0*/, Double_t max/*=0*/, Bool_t exclude/*=kFALSE*/, |
170 | UInt_t pidBitType/*=AliDielectronPID::kRequire*/, Int_t var/*=-1*/) | |
8df8e382 | 171 | { |
172 | // | |
173 | // cut using a TF1 as lower cut | |
174 | // | |
175 | if (funLow==0x0){ | |
176 | AliError("A valid function is required for the lower cut. Not adding the cut!"); | |
177 | return; | |
178 | } | |
179 | fFunLowerCut[fNcuts]=funLow; | |
5720c765 | 180 | AddCut(det,type,0.,nSigmaUp,min,max,exclude,pidBitType,var); |
8df8e382 | 181 | } |
182 | ||
183 | //______________________________________________ | |
184 | void AliDielectronPID::AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, TF1 * const funUp, | |
5720c765 | 185 | Double_t min/*=0*/, Double_t max/*=0*/, Bool_t exclude/*=kFALSE*/, |
186 | UInt_t pidBitType/*=AliDielectronPID::kRequire*/, Int_t var/*=-1*/) | |
8df8e382 | 187 | { |
188 | // | |
189 | // cut using a TF1 as lower and upper cut | |
190 | // | |
191 | if ( (funUp==0x0) || (funLow==0x0) ){ | |
192 | AliError("A valid function is required for upper and lower cut. Not adding the cut!"); | |
193 | return; | |
194 | } | |
195 | fFunUpperCut[fNcuts]=funUp; | |
196 | fFunLowerCut[fNcuts]=funLow; | |
5720c765 | 197 | AddCut(det,type,0.,0.,min,max,exclude,pidBitType,var); |
8df8e382 | 198 | } |
199 | ||
88204efa | 200 | //______________________________________________ |
201 | void AliDielectronPID::AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp, | |
202 | Double_t min, Double_t max, Bool_t exclude, | |
203 | UInt_t pidBitType, TF1 * const funSigma) | |
204 | { | |
205 | // | |
206 | // cut using a TF1 as lower cut | |
207 | // | |
208 | if (funSigma==0x0){ | |
209 | AliError("A valid function is required for the sigma cut. Not adding the cut!"); | |
210 | return; | |
211 | } | |
212 | fFunSigma[fNcuts]=funSigma; | |
213 | fSigmaFunLow[fNcuts]=min; | |
214 | fSigmaFunUp[fNcuts]=max; | |
215 | ||
216 | AddCut(det,type,nSigmaLow,nSigmaUp,0,0,exclude,pidBitType,-1); | |
217 | } | |
218 | ||
8df8e382 | 219 | //______________________________________________ |
220 | Bool_t AliDielectronPID::IsSelected(TObject* track) | |
221 | { | |
222 | // | |
223 | // perform PID cuts | |
224 | // | |
225 | ||
226 | //loop over all cuts | |
164bfb53 | 227 | AliVTrack *part=static_cast<AliVTrack*>(track); |
5720c765 | 228 | AliESDtrack *esdTrack=0x0; |
229 | Double_t origdEdx=-1; | |
8df8e382 | 230 | |
5720c765 | 231 | // apply ETa correction, remove once this is in the tender |
232 | if( (part->IsA() == AliESDtrack::Class()) && fgFunEtaCorr ){ | |
233 | esdTrack=static_cast<AliESDtrack*>(part); | |
234 | origdEdx=esdTrack->GetTPCsignal(); | |
d327d9cd | 235 | esdTrack->SetTPCsignal(origdEdx/GetEtaCorr(esdTrack)/fgCorrdEdx,esdTrack->GetTPCsignalSigma(),esdTrack->GetTPCsignalN()); |
5720c765 | 236 | } |
8df8e382 | 237 | |
5720c765 | 238 | |
239 | //Fill values | |
240 | Double_t values[AliDielectronVarManager::kNMaxValues]; | |
241 | AliDielectronVarManager::Fill(track,values); | |
8df8e382 | 242 | |
5720c765 | 243 | Bool_t selected=kFALSE; |
244 | fPIDResponse=AliDielectronVarManager::GetPIDResponse(); | |
245 | for (UChar_t icut=0; icut<fNcuts; ++icut){ | |
246 | Double_t min=fmin[icut]; | |
247 | Double_t max=fmax[icut]; | |
248 | Double_t val=values[fActiveCuts[icut]]; | |
249 | ||
250 | // test var range. In case min==max do not cut | |
251 | if ( (TMath::Abs(min-max)>1e-20) && (val<min || val>=max) ) continue; | |
88204efa | 252 | |
253 | ||
254 | // check if fFunSigma is set, then check if 'part' is in sigma range of the function | |
255 | if(fFunSigma[icut]){ | |
256 | val= fPIDResponse->NumberOfSigmasTPC(part, fPartType[icut]); | |
257 | if (fPartType[icut]==AliPID::kElectron){ | |
258 | val-=fgCorr; | |
259 | } | |
260 | min= fFunSigma[icut]->Eval(part->GetTPCmomentum())+fSigmaFunLow[icut]; | |
261 | max= fFunSigma[icut]->Eval(part->GetTPCmomentum())+fSigmaFunUp[icut]; | |
262 | if(val<min || val>=max) continue; | |
263 | } | |
264 | ||
8df8e382 | 265 | switch (fDetType[icut]){ |
266 | case kITS: | |
267 | selected = IsSelectedITS(part,icut); | |
268 | break; | |
269 | case kTPC: | |
270 | selected = IsSelectedTPC(part,icut); | |
271 | break; | |
272 | case kTRD: | |
273 | selected = IsSelectedTRD(part,icut); | |
274 | break; | |
5720c765 | 275 | case kTRDeleEff: |
276 | selected = IsSelectedTRDeleEff(part,icut); | |
277 | break; | |
6d5dea7c | 278 | case kTRDeleEff2D: |
279 | selected = IsSelectedTRDeleEff(part,icut,AliTRDPIDResponse::kLQ2D); | |
280 | break; | |
8df8e382 | 281 | case kTOF: |
282 | selected = IsSelectedTOF(part,icut); | |
283 | break; | |
5720c765 | 284 | case kEMCAL: |
285 | selected = IsSelectedEMCAL(part,icut); | |
286 | break; | |
287 | } | |
288 | if (!selected) { | |
289 | if (esdTrack) esdTrack->SetTPCsignal(origdEdx,esdTrack->GetTPCsignalSigma(),esdTrack->GetTPCsignalN()); | |
290 | ||
291 | return kFALSE; | |
8df8e382 | 292 | } |
8df8e382 | 293 | } |
294 | ||
5720c765 | 295 | if (esdTrack) esdTrack->SetTPCsignal(origdEdx,esdTrack->GetTPCsignalSigma(),esdTrack->GetTPCsignalN()); |
8df8e382 | 296 | return selected; |
297 | } | |
298 | ||
299 | //______________________________________________ | |
ffbede40 | 300 | Bool_t AliDielectronPID::IsSelectedITS(AliVTrack * const part, Int_t icut) |
8df8e382 | 301 | { |
302 | // | |
303 | // ITS part of the PID check | |
304 | // Don't accept the track if there was no pid bit set | |
305 | // | |
8df8e382 | 306 | |
5720c765 | 307 | if (fRequirePIDbit[icut]==AliDielectronPID::kRequire&&!(part->GetStatus()&AliVTrack::kITSpid)) return kFALSE; |
308 | if (fRequirePIDbit[icut]==AliDielectronPID::kIfAvailable&&!(part->GetStatus()&AliVTrack::kITSpid)) return kTRUE; | |
ffbede40 | 309 | |
310 | Double_t mom=part->P(); | |
164bfb53 | 311 | |
5720c765 | 312 | Float_t numberOfSigmas=fPIDResponse->NumberOfSigmasITS(part, fPartType[icut]); |
ffbede40 | 313 | |
314 | // test if we are supposed to use a function for the cut | |
315 | if (fFunUpperCut[icut]) fNsigmaUp[icut] =fFunUpperCut[icut]->Eval(mom); | |
316 | if (fFunLowerCut[icut]) fNsigmaLow[icut]=fFunLowerCut[icut]->Eval(mom); | |
317 | ||
8df8e382 | 318 | Bool_t selected=((numberOfSigmas>=fNsigmaLow[icut])&&(numberOfSigmas<=fNsigmaUp[icut]))^fExclude[icut]; |
319 | return selected; | |
320 | } | |
321 | ||
322 | //______________________________________________ | |
ffbede40 | 323 | Bool_t AliDielectronPID::IsSelectedTPC(AliVTrack * const part, Int_t icut) |
8df8e382 | 324 | { |
325 | // | |
326 | // TPC part of the PID check | |
327 | // Don't accept the track if there was no pid bit set | |
328 | // | |
5720c765 | 329 | if (fRequirePIDbit[icut]==AliDielectronPID::kRequire&&!(part->GetStatus()&AliVTrack::kTPCpid)) return kFALSE; |
330 | if (fRequirePIDbit[icut]==AliDielectronPID::kIfAvailable&&!(part->GetStatus()&AliVTrack::kTPCpid)) return kTRUE; | |
48609e3d | 331 | |
5720c765 | 332 | Double_t mom=part->GetTPCmomentum(); |
ffbede40 | 333 | |
5720c765 | 334 | Float_t numberOfSigmas=fPIDResponse->NumberOfSigmasTPC(part, fPartType[icut]); |
335 | ||
2a14a7b1 | 336 | if (fPartType[icut]==AliPID::kElectron){ |
337 | numberOfSigmas-=fgCorr; | |
8df8e382 | 338 | } |
ffbede40 | 339 | |
340 | // test if we are supposed to use a function for the cut | |
341 | if (fFunUpperCut[icut]) fNsigmaUp[icut] =fFunUpperCut[icut]->Eval(mom); | |
342 | if (fFunLowerCut[icut]) fNsigmaLow[icut]=fFunLowerCut[icut]->Eval(mom); | |
343 | ||
8df8e382 | 344 | Bool_t selected=((numberOfSigmas>=fNsigmaLow[icut])&&(numberOfSigmas<=fNsigmaUp[icut]))^fExclude[icut]; |
345 | return selected; | |
346 | } | |
347 | ||
348 | //______________________________________________ | |
5720c765 | 349 | Bool_t AliDielectronPID::IsSelectedTRD(AliVTrack * const part, Int_t icut) |
8df8e382 | 350 | { |
351 | // | |
352 | // TRD part of the pid check | |
5720c765 | 353 | // the TRD checks on the probabilities. |
354 | // | |
355 | ||
356 | if (fRequirePIDbit[icut]==AliDielectronPID::kRequire&&!(part->GetStatus()&AliVTrack::kTRDpid)) return kFALSE; | |
357 | if (fRequirePIDbit[icut]==AliDielectronPID::kIfAvailable&&!(part->GetStatus()&AliVTrack::kTRDpid)) return kTRUE; | |
358 | if (fRequirePIDbit[icut]==AliDielectronPID::kIfAvailable && (part->GetTRDntrackletsPID()<4)) return kTRUE; | |
359 | ||
360 | Double_t p[AliPID::kSPECIES]={0.}; | |
361 | fPIDResponse->ComputeTRDProbability(part,AliPID::kSPECIES,p); | |
362 | Float_t particleProb=p[fPartType[icut]]; | |
363 | ||
364 | Bool_t selected=((particleProb>=fNsigmaLow[icut])&&(particleProb<=fNsigmaUp[icut]))^fExclude[icut]; | |
365 | return selected; | |
366 | } | |
367 | ||
368 | //______________________________________________ | |
6d5dea7c | 369 | Bool_t AliDielectronPID::IsSelectedTRDeleEff(AliVTrack * const part, Int_t icut, AliTRDPIDResponse::ETRDPIDMethod PIDmethod) |
5720c765 | 370 | { |
8df8e382 | 371 | // |
5720c765 | 372 | // TRD part of the pid check using electron efficiency requirement |
373 | // in this case the upper limit as well as the particle specie is ignored | |
374 | // and the lower limit regarded as the requested electron efficiency | |
375 | // | |
376 | ||
377 | if (fRequirePIDbit[icut]==AliDielectronPID::kRequire&&!(part->GetStatus()&AliVTrack::kTRDpid)) return kFALSE; | |
378 | if (fRequirePIDbit[icut]==AliDielectronPID::kIfAvailable&&!(part->GetStatus()&AliVTrack::kTRDpid)) return kTRUE; | |
379 | ||
6d5dea7c | 380 | Double_t centrality = -1.; |
381 | if(part->IsA() == AliESDtrack::Class()) | |
382 | centrality=(const_cast<AliESDEvent*>( (static_cast<const AliESDtrack*>(part))->GetESDEvent()) )->GetCentrality()->GetCentralityPercentile("V0M"); | |
383 | if(part->IsA() == AliAODTrack::Class()) | |
384 | centrality=(const_cast<AliAODEvent*>( (static_cast<const AliAODTrack*>(part))->GetAODEvent()) )->GetCentrality()->GetCentralityPercentile("V0M"); | |
385 | ||
386 | Bool_t selected=fPIDResponse->IdentifiedAsElectronTRD(part,fNsigmaLow[icut], centrality, PIDmethod)^fExclude[icut]; | |
5720c765 | 387 | return selected; |
8df8e382 | 388 | } |
389 | ||
390 | //______________________________________________ | |
ffbede40 | 391 | Bool_t AliDielectronPID::IsSelectedTOF(AliVTrack * const part, Int_t icut) |
8df8e382 | 392 | { |
393 | // | |
394 | // TOF part of the PID check | |
395 | // Don't accept the track if there was no pid bit set | |
396 | // | |
8df8e382 | 397 | |
5720c765 | 398 | if (fRequirePIDbit[icut]==AliDielectronPID::kRequire&&!(part->GetStatus()&AliVTrack::kTOFpid)) return kFALSE; |
399 | if (fRequirePIDbit[icut]==AliDielectronPID::kIfAvailable&&!(part->GetStatus()&AliVTrack::kTOFpid)) return kTRUE; | |
400 | ||
401 | Float_t numberOfSigmas=fPIDResponse->NumberOfSigmasTOF(part, fPartType[icut]); | |
8df8e382 | 402 | |
403 | Bool_t selected=((numberOfSigmas>=fNsigmaLow[icut])&&(numberOfSigmas<=fNsigmaUp[icut]))^fExclude[icut]; | |
404 | return selected; | |
405 | } | |
406 | ||
5720c765 | 407 | //______________________________________________ |
408 | Bool_t AliDielectronPID::IsSelectedEMCAL(AliVTrack * const part, Int_t icut) | |
409 | { | |
410 | // | |
411 | // emcal pid selecttion | |
412 | // | |
413 | ||
414 | //TODO: correct way to check for emcal pid? | |
415 | Float_t numberOfSigmas=fPIDResponse->NumberOfSigmasEMCAL(part, fPartType[icut]); | |
416 | ||
417 | Bool_t hasPID=numberOfSigmas>-998.; | |
418 | ||
419 | if (fRequirePIDbit[icut]==AliDielectronPID::kRequire&&!hasPID) return kFALSE; | |
420 | if (fRequirePIDbit[icut]==AliDielectronPID::kIfAvailable&&!hasPID) return kTRUE; | |
421 | ||
422 | ||
423 | Bool_t selected=((numberOfSigmas>=fNsigmaLow[icut])&&(numberOfSigmas<=fNsigmaUp[icut]))^fExclude[icut]; | |
424 | return selected; | |
425 | } | |
426 | ||
8df8e382 | 427 | //______________________________________________ |
428 | void AliDielectronPID::SetDefaults(Int_t def){ | |
429 | // | |
430 | // initialise default pid strategies | |
431 | // | |
432 | ||
433 | if (def==0){ | |
434 | // 2sigma bands TPC: | |
435 | // - include e | |
436 | // - exclude mu,K,pi,p | |
437 | // -complete p range | |
438 | AddCut(kTPC,AliPID::kElectron,2); | |
439 | AddCut(kTPC,AliPID::kMuon,-2.,2.,0.,0.,kTRUE); | |
440 | AddCut(kTPC,AliPID::kPion,-2.,2.,0.,0.,kTRUE); | |
441 | AddCut(kTPC,AliPID::kKaon,-2.,2.,0.,0.,kTRUE); | |
442 | AddCut(kTPC,AliPID::kProton,-2.,2.,0.,0.,kTRUE); | |
443 | } else if (def==1) { | |
444 | // 2sigma bands TPC: | |
445 | // - include e 0<p<inf | |
446 | // - exclude mu,K,pi,p 0<p<2 | |
8df8e382 | 447 | AddCut(kTPC,AliPID::kElectron,2.); |
448 | AddCut(kTPC,AliPID::kMuon,-2.,2.,0.,2.,kTRUE); | |
449 | AddCut(kTPC,AliPID::kPion,-2.,2.,0.,2.,kTRUE); | |
450 | AddCut(kTPC,AliPID::kKaon,-2.,2.,0.,2.,kTRUE); | |
451 | AddCut(kTPC,AliPID::kProton,-2.,2.,0.,2.,kTRUE); | |
452 | ||
453 | } else if (def==2) { | |
454 | // include 2sigma e TPC | |
455 | // 3sigma bands TOF | |
456 | // - exclude K,P | |
48609e3d | 457 | AddCut(kTPC,AliPID::kElectron,-3.,3.); |
3505bfad | 458 | AddCut(kTPC,AliPID::kPion,-3.,3.,0.,0.,kTRUE); |
459 | AddCut(kTPC,AliPID::kProton,-3.,3.,0.,0.,kTRUE); | |
8df8e382 | 460 | |
5720c765 | 461 | } else if (def==3 || def==4) { // def3 and def4 are the same?? |
8df8e382 | 462 | // include 2sigma e TPC |
463 | // 3sigma bands TOF | |
464 | // - exclude K 0<p<1 | |
465 | // - exclude P 0<p<2 | |
466 | AddCut(kTPC,AliPID::kElectron,2); | |
467 | AddCut(kTOF,AliPID::kKaon,-3.,3.,0.,1.,kTRUE); | |
468 | AddCut(kTOF,AliPID::kProton,-6.,6.,0.,1.,kTRUE); | |
469 | AddCut(kTOF,AliPID::kProton,-3.,3.,1.,2.,kTRUE); | |
470 | ||
8df8e382 | 471 | } else if (def==5) { |
472 | AddCut(kTPC,AliPID::kElectron,-0.5,3); | |
473 | AddCut(kTOF,AliPID::kElectron,-3,3,0,1.5); | |
474 | } else if (def==6) { | |
475 | // lower cut TPC: parametrisation by HFE | |
476 | // upper cut TPC: 3 sigma | |
477 | // TOF ele band 3sigma 0<p<1.5GeV | |
478 | TF1 *lowerCut=new TF1("lowerCut", "[0] * TMath::Exp([1]*x)", 0, 100); | |
479 | lowerCut->SetParameters(-2.7,-0.4357); | |
480 | AddCut(kTPC,AliPID::kElectron,lowerCut,3.); | |
481 | AddCut(kTOF,AliPID::kElectron,-3,3,0,1.5); | |
482 | } else if (def==7) { | |
61d106d3 | 483 | // wide TPC cut |
8df8e382 | 484 | // TOF ele band 3sigma 0<p<1.5GeV |
485 | AddCut(kTPC,AliPID::kElectron,10.); | |
486 | AddCut(kTOF,AliPID::kElectron,-3,3,0,1.5); | |
61d106d3 | 487 | } else if (def==8) { |
488 | // TOF 5 sigma inclusion if TOFpid available | |
489 | // this should reduce K,p,Pi to a large extent | |
490 | AddCut(kTOF,AliPID::kElectron,-5,5,0,200,kFALSE,AliDielectronPID::kIfAvailable); | |
491 | } else if (def==9) { | |
492 | // lower cut TPC: parametrisation by HFE | |
493 | // upper cut TPC: 3 sigma | |
494 | // TOF 5 sigma inclusion if TOFpid available | |
495 | // this should reduce K,p,Pi to a large extent | |
496 | TF1 *lowerCut=new TF1("lowerCut", "[0] * TMath::Exp([1]*x)", 0, 100); | |
164bfb53 | 497 | lowerCut->SetParameters(-2.65,-0.6757); |
498 | AddCut(kTPC,AliPID::kElectron,lowerCut,4.); | |
61d106d3 | 499 | AddCut(kTOF,AliPID::kElectron,-5,5,0,200,kFALSE,AliDielectronPID::kIfAvailable); |
ba15fdfb | 500 | |
61d106d3 | 501 | } else if (def==10) { |
502 | AddCut(kTOF,AliPID::kElectron,-5,5,0,200,kFALSE,AliDielectronPID::kIfAvailable); | |
503 | AddCut(kTPC,AliPID::kElectron,3.); | |
504 | AddCut(kTPC,AliPID::kPion,-3.,3.,0.,0.,kTRUE); | |
505 | AddCut(kTPC,AliPID::kProton,-3.,3.,0.,0.,kTRUE); | |
506 | ||
ba15fdfb | 507 | } else if (def==11) { |
508 | // lower cut TPC: parametrisation by HFE | |
509 | // only use from period d on !! | |
510 | // upper cut TPC: 3 sigma | |
511 | // TOF ele band 3sigma 0<p<2.0GeV | |
512 | TF1 *lowerCut=new TF1("lowerCut", "[0] * TMath::Exp([1]*x)+[2]", 0, 100); | |
513 | lowerCut->SetParameters(-3.718,-0.4,0.27); | |
514 | AddCut(kTPC,AliPID::kElectron,lowerCut,3.); | |
515 | AddCut(kTOF,AliPID::kElectron,-3,3,0,2.); | |
516 | } else if (def==12) { | |
517 | // lower cut TPC: parametrisation by HFE | |
518 | // only use from period d on !! | |
519 | // upper cut TPC: 3 sigma | |
520 | // TOF 5 sigma inclusion if TOFpid available | |
521 | // this should reduce K,p,Pi to a large extent | |
522 | TF1 *lowerCut=new TF1("lowerCut", "[0] * TMath::Exp([1]*x)+[2]", 0, 100); | |
523 | lowerCut->SetParameters(-3.718,-0.4,0.27); | |
524 | AddCut(kTPC,AliPID::kElectron,lowerCut,4.); | |
525 | AddCut(kTOF,AliPID::kElectron,-5,5,0,200,kFALSE,AliDielectronPID::kIfAvailable); | |
8df8e382 | 526 | } |
ba15fdfb | 527 | |
8df8e382 | 528 | } |
529 | ||
48609e3d | 530 | //______________________________________________ |
531 | void AliDielectronPID::SetCorrVal(Double_t run) | |
532 | { | |
533 | // | |
534 | // set correction value for run | |
535 | // | |
d327d9cd | 536 | fgCorr=0.; |
537 | fgCorrdEdx=1.; | |
538 | ||
539 | if (fgFitCorr){ | |
540 | fgCorr=fgFitCorr->Eval(run); | |
541 | if (run<fgFitCorr->GetX()[0]) fgCorr=fgFitCorr->GetY()[0]; | |
542 | if (run>fgFitCorr->GetX()[fgFitCorr->GetN()-1]) fgCorr=fgFitCorr->GetY()[fgFitCorr->GetN()-1]; | |
543 | } | |
544 | ||
545 | if (fgdEdxRunCorr){ | |
546 | fgCorrdEdx=fgdEdxRunCorr->Eval(run); | |
547 | if (run<fgdEdxRunCorr->GetX()[0]) fgCorrdEdx=fgdEdxRunCorr->GetY()[0]; | |
548 | if (run>fgdEdxRunCorr->GetX()[fgFitCorr->GetN()-1]) fgCorrdEdx=fgdEdxRunCorr->GetY()[fgdEdxRunCorr->GetN()-1]; | |
549 | } | |
48609e3d | 550 | } |
551 | ||
5720c765 | 552 | //______________________________________________ |
553 | Double_t AliDielectronPID::GetEtaCorr(AliVTrack *track) | |
554 | { | |
555 | // | |
556 | // return eta correction | |
557 | // | |
558 | if (!fgFunEtaCorr) return 1; | |
559 | return fgFunEtaCorr->Eval(track->Eta()); | |
560 | } |