SUMMARY :
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowTasks / AliFlowTrackCuts.cxx
CommitLineData
daf66719 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 **************************************************************************/
15
16/* $Id$ */
17
18// AliFlowTrackCuts:
19// ESD track cuts for flow framework
20//
21// origin: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)
5559ce24 22//
23// This class gurantees consistency of cut methods, trackparameter
24// selection (global tracks, TPC only, etc..) and parameter mixing
25// in the flow framework. Transparently handles different input types:
26// ESD, MC, AOD.
27// This class works in 2 steps: first the requested track parameters are
28// constructed (to be set by SetParamType() ), then cuts are applied.
29// the constructed track can be requested AFTER checking the cuts by
30// calling GetTrack(), in this case the cut object stays in control,
31// caller does not have to delete the track.
32// Additionally caller can request an AliFlowTrack object to be constructed
33// according the parameter mixing scenario requested by SetParamMix().
34// AliFlowTrack is made using MakeFlowTrack() method, its an 'object factory'
35// so caller needs to take care of the freshly created object.
daf66719 36
37#include <limits.h>
38#include <float.h>
32b846cd 39#include <TMatrix.h>
9a0783cc 40#include "TParticle.h"
2948ac5a 41#include "TObjArray.h"
9a0783cc 42#include "AliStack.h"
daf66719 43#include "AliMCEvent.h"
9a0783cc 44#include "AliESDEvent.h"
daf66719 45#include "AliVParticle.h"
46#include "AliMCParticle.h"
47#include "AliESDtrack.h"
12b2b8bc 48#include "AliMultiplicity.h"
daf66719 49#include "AliAODTrack.h"
50#include "AliFlowTrack.h"
51#include "AliFlowTrackCuts.h"
52#include "AliLog.h"
32b846cd 53#include "AliESDpid.h"
daf66719 54
55ClassImp(AliFlowTrackCuts)
56
57//-----------------------------------------------------------------------
58AliFlowTrackCuts::AliFlowTrackCuts():
59 AliFlowTrackSimpleCuts(),
441ea1cf 60 fAliESDtrackCuts(NULL),
61 fQA(NULL),
62 fCutMC(kFALSE),
63 fCutMCprocessType(kFALSE),
64 fMCprocessType(kPNoProcess),
65 fCutMCPID(kFALSE),
66 fMCPID(0),
67 fIgnoreSignInPID(kFALSE),
68 fCutMCisPrimary(kFALSE),
69 fRequireTransportBitForPrimaries(kTRUE),
70 fMCisPrimary(kFALSE),
71 fRequireCharge(kFALSE),
72 fFakesAreOK(kTRUE),
73 fCutSPDtrackletDeltaPhi(kFALSE),
74 fSPDtrackletDeltaPhiMax(FLT_MAX),
75 fSPDtrackletDeltaPhiMin(-FLT_MAX),
76 fIgnoreTPCzRange(kFALSE),
77 fIgnoreTPCzRangeMax(FLT_MAX),
78 fIgnoreTPCzRangeMin(-FLT_MAX),
79 fCutChi2PerClusterTPC(kFALSE),
80 fMaxChi2PerClusterTPC(FLT_MAX),
81 fMinChi2PerClusterTPC(-FLT_MAX),
82 fCutNClustersTPC(kFALSE),
83 fNClustersTPCMax(INT_MAX),
84 fNClustersTPCMin(INT_MIN),
85 fParamType(kGlobal),
86 fParamMix(kPure),
87 fTrack(NULL),
88 fTrackPhi(0.),
89 fTrackEta(0.),
90 fTrackWeight(0.),
91 fTrackLabel(INT_MIN),
92 fMCevent(NULL),
93 fMCparticle(NULL),
94 fEvent(NULL),
95 fTPCtrack(),
96 fESDpid(NULL),
97 fPIDsource(kTPCTOFpid),
98 fTPCpidCuts(NULL),
99 fTOFpidCuts(NULL),
100 fTPCTOFpidCrossOverPt(0.4),
101 fAliPID(AliPID::kPion)
102{
103 //io constructor
104}
105
106//-----------------------------------------------------------------------
107AliFlowTrackCuts::AliFlowTrackCuts(const char* name):
108 AliFlowTrackSimpleCuts(),
daf66719 109 fAliESDtrackCuts(new AliESDtrackCuts()),
a1c43d26 110 fQA(NULL),
1ff4bda1 111 fCutMC(kFALSE),
daf66719 112 fCutMCprocessType(kFALSE),
113 fMCprocessType(kPNoProcess),
114 fCutMCPID(kFALSE),
115 fMCPID(0),
4cbcbead 116 fIgnoreSignInPID(kFALSE),
daf66719 117 fCutMCisPrimary(kFALSE),
441ea1cf 118 fRequireTransportBitForPrimaries(kTRUE),
daf66719 119 fMCisPrimary(kFALSE),
957517fa 120 fRequireCharge(kFALSE),
127a5825 121 fFakesAreOK(kTRUE),
9a0783cc 122 fCutSPDtrackletDeltaPhi(kFALSE),
123 fSPDtrackletDeltaPhiMax(FLT_MAX),
124 fSPDtrackletDeltaPhiMin(-FLT_MAX),
1ff4bda1 125 fIgnoreTPCzRange(kFALSE),
126 fIgnoreTPCzRangeMax(FLT_MAX),
127 fIgnoreTPCzRangeMin(-FLT_MAX),
2948ac5a 128 fCutChi2PerClusterTPC(kFALSE),
129 fMaxChi2PerClusterTPC(FLT_MAX),
130 fMinChi2PerClusterTPC(-FLT_MAX),
32b846cd 131 fCutNClustersTPC(kFALSE),
132 fNClustersTPCMax(INT_MAX),
133 fNClustersTPCMin(INT_MIN),
12b2b8bc 134 fParamType(kGlobal),
daf66719 135 fParamMix(kPure),
daf66719 136 fTrack(NULL),
12b2b8bc 137 fTrackPhi(0.),
138 fTrackEta(0.),
139 fTrackWeight(0.),
127a5825 140 fTrackLabel(INT_MIN),
957517fa 141 fMCevent(NULL),
9a0783cc 142 fMCparticle(NULL),
1ff4bda1 143 fEvent(NULL),
32b846cd 144 fTPCtrack(),
145 fESDpid(NULL),
146 fPIDsource(kTPCTOFpid),
147 fTPCpidCuts(NULL),
148 fTOFpidCuts(NULL),
149 fTPCTOFpidCrossOverPt(0.4),
150 fAliPID(AliPID::kPion)
daf66719 151{
152 //constructor
441ea1cf 153 SetName(name);
154 SetTitle("AliFlowTrackCuts");
daf66719 155}
156
157//-----------------------------------------------------------------------
ee242db3 158AliFlowTrackCuts::AliFlowTrackCuts(const AliFlowTrackCuts& that):
159 AliFlowTrackSimpleCuts(that),
441ea1cf 160 fAliESDtrackCuts(NULL),
a1c43d26 161 fQA(NULL),
1ff4bda1 162 fCutMC(that.fCutMC),
ee242db3 163 fCutMCprocessType(that.fCutMCprocessType),
164 fMCprocessType(that.fMCprocessType),
165 fCutMCPID(that.fCutMCPID),
166 fMCPID(that.fMCPID),
4cbcbead 167 fIgnoreSignInPID(that.fIgnoreSignInPID),
ee242db3 168 fCutMCisPrimary(that.fCutMCisPrimary),
441ea1cf 169 fRequireTransportBitForPrimaries(that.fRequireTransportBitForPrimaries),
ee242db3 170 fMCisPrimary(that.fMCisPrimary),
171 fRequireCharge(that.fRequireCharge),
172 fFakesAreOK(that.fFakesAreOK),
173 fCutSPDtrackletDeltaPhi(that.fCutSPDtrackletDeltaPhi),
174 fSPDtrackletDeltaPhiMax(that.fSPDtrackletDeltaPhiMax),
175 fSPDtrackletDeltaPhiMin(that.fSPDtrackletDeltaPhiMin),
1ff4bda1 176 fIgnoreTPCzRange(that.fIgnoreTPCzRange),
177 fIgnoreTPCzRangeMax(that.fIgnoreTPCzRangeMax),
178 fIgnoreTPCzRangeMin(that.fIgnoreTPCzRangeMin),
2948ac5a 179 fCutChi2PerClusterTPC(that.fCutChi2PerClusterTPC),
180 fMaxChi2PerClusterTPC(that.fMaxChi2PerClusterTPC),
181 fMinChi2PerClusterTPC(that.fMinChi2PerClusterTPC),
32b846cd 182 fCutNClustersTPC(that.fCutNClustersTPC),
183 fNClustersTPCMax(that.fNClustersTPCMax),
184 fNClustersTPCMin(that.fNClustersTPCMin),
ee242db3 185 fParamType(that.fParamType),
186 fParamMix(that.fParamMix),
daf66719 187 fTrack(NULL),
ee242db3 188 fTrackPhi(0.),
189 fTrackEta(0.),
190 fTrackWeight(0.),
127a5825 191 fTrackLabel(INT_MIN),
957517fa 192 fMCevent(NULL),
9a0783cc 193 fMCparticle(NULL),
1ff4bda1 194 fEvent(NULL),
32b846cd 195 fTPCtrack(),
196 fESDpid(that.fESDpid),
197 fPIDsource(that.fPIDsource),
198 fTPCpidCuts(NULL),
199 fTOFpidCuts(NULL),
200 fTPCTOFpidCrossOverPt(that.fTPCTOFpidCrossOverPt),
201 fAliPID(that.fAliPID)
daf66719 202{
203 //copy constructor
32b846cd 204 if (that.fTPCpidCuts) fTPCpidCuts = new TMatrixF(*(that.fTPCpidCuts));
205 if (that.fTOFpidCuts) fTOFpidCuts = new TMatrixF(*(that.fTOFpidCuts));
441ea1cf 206 if (that.fAliESDtrackCuts) fAliESDtrackCuts = new AliESDtrackCuts(*(that.fAliESDtrackCuts));
daf66719 207}
208
209//-----------------------------------------------------------------------
ee242db3 210AliFlowTrackCuts& AliFlowTrackCuts::operator=(const AliFlowTrackCuts& that)
daf66719 211{
212 //assignment
ee242db3 213 AliFlowTrackSimpleCuts::operator=(that);
441ea1cf 214 if (that.fAliESDtrackCuts) *fAliESDtrackCuts=*(that.fAliESDtrackCuts);
a1c43d26 215 fQA=NULL;
1ff4bda1 216 fCutMC=that.fCutMC;
ee242db3 217 fCutMCprocessType=that.fCutMCprocessType;
218 fMCprocessType=that.fMCprocessType;
219 fCutMCPID=that.fCutMCPID;
220 fMCPID=that.fMCPID;
4cbcbead 221 fIgnoreSignInPID=that.fIgnoreSignInPID,
ee242db3 222 fCutMCisPrimary=that.fCutMCisPrimary;
441ea1cf 223 fRequireTransportBitForPrimaries=that.fRequireTransportBitForPrimaries;
ee242db3 224 fMCisPrimary=that.fMCisPrimary;
225 fRequireCharge=that.fRequireCharge;
226 fFakesAreOK=that.fFakesAreOK;
227 fCutSPDtrackletDeltaPhi=that.fCutSPDtrackletDeltaPhi;
228 fSPDtrackletDeltaPhiMax=that.fSPDtrackletDeltaPhiMax;
229 fSPDtrackletDeltaPhiMin=that.fSPDtrackletDeltaPhiMin;
1ff4bda1 230 fIgnoreTPCzRange=that.fIgnoreTPCzRange;
231 fIgnoreTPCzRangeMax=that.fIgnoreTPCzRangeMax;
232 fIgnoreTPCzRangeMin=that.fIgnoreTPCzRangeMin;
2948ac5a 233 fCutChi2PerClusterTPC=that.fCutChi2PerClusterTPC;
234 fMaxChi2PerClusterTPC=that.fMaxChi2PerClusterTPC;
235 fMinChi2PerClusterTPC=that.fMinChi2PerClusterTPC;
32b846cd 236 fCutNClustersTPC=that.fCutNClustersTPC;
237 fNClustersTPCMax=that.fNClustersTPCMax;
238 fNClustersTPCMin=that.fNClustersTPCMin;
ee242db3 239 fParamType=that.fParamType;
240 fParamMix=that.fParamMix;
daf66719 241
daf66719 242 fTrack=NULL;
ee242db3 243 fTrackPhi=0.;
244 fTrackPhi=0.;
245 fTrackWeight=0.;
127a5825 246 fTrackLabel=INT_MIN;
957517fa 247 fMCevent=NULL;
daf66719 248 fMCparticle=NULL;
9a0783cc 249 fEvent=NULL;
daf66719 250
32b846cd 251 fESDpid = that.fESDpid;
252 fPIDsource = that.fPIDsource;
253
254 if (that.fTPCpidCuts) fTPCpidCuts = new TMatrixF(*(that.fTPCpidCuts));
255 if (that.fTOFpidCuts) fTOFpidCuts = new TMatrixF(*(that.fTOFpidCuts));
256 fTPCTOFpidCrossOverPt=that.fTPCTOFpidCrossOverPt;
257
258 fAliPID=that.fAliPID;
259
daf66719 260 return *this;
261}
262
263//-----------------------------------------------------------------------
264AliFlowTrackCuts::~AliFlowTrackCuts()
265{
266 //dtor
daf66719 267 delete fAliESDtrackCuts;
32b846cd 268 delete fTPCpidCuts;
269 delete fTOFpidCuts;
daf66719 270}
271
272//-----------------------------------------------------------------------
12b2b8bc 273Bool_t AliFlowTrackCuts::IsSelected(TObject* obj, Int_t id)
daf66719 274{
275 //check cuts
276 AliVParticle* vparticle = dynamic_cast<AliVParticle*>(obj);
277 if (vparticle) return PassesCuts(vparticle);
278 AliFlowTrackSimple* flowtrack = dynamic_cast<AliFlowTrackSimple*>(obj);
279 if (flowtrack) return PassesCuts(flowtrack);
12b2b8bc 280 AliMultiplicity* tracklets = dynamic_cast<AliMultiplicity*>(obj);
281 if (tracklets) return PassesCuts(tracklets,id);
daf66719 282 return kFALSE; //default when passed wrong type of object
283}
284
285//-----------------------------------------------------------------------
1ff4bda1 286Bool_t AliFlowTrackCuts::IsSelectedMCtruth(TObject* obj, Int_t id)
287{
288 //check cuts
289 AliVParticle* vparticle = dynamic_cast<AliVParticle*>(obj);
290 if (vparticle)
291 {
292 return PassesMCcuts(fMCevent,vparticle->GetLabel());
293 }
294 AliMultiplicity* tracklets = dynamic_cast<AliMultiplicity*>(obj);
295 if (tracklets)
296 {
297 Int_t label0 = tracklets->GetLabel(id,0);
298 Int_t label1 = tracklets->GetLabel(id,1);
299 Int_t label = (label0==label1)?tracklets->GetLabel(id,1):-666;
300 return PassesMCcuts(fMCevent,label);
301 }
302 return kFALSE; //default when passed wrong type of object
303}
304
305//-----------------------------------------------------------------------
daf66719 306Bool_t AliFlowTrackCuts::PassesCuts(AliFlowTrackSimple* track)
307{
308 //check cuts on a flowtracksimple
5559ce24 309
310 //clean up from last iteration
1ff4bda1 311 fTrack = NULL;
daf66719 312 return AliFlowTrackSimpleCuts::PassesCuts(track);
313}
314
315//-----------------------------------------------------------------------
12b2b8bc 316Bool_t AliFlowTrackCuts::PassesCuts(AliMultiplicity* tracklet, Int_t id)
317{
318 //check cuts on a tracklets
319
9a0783cc 320 //clean up from last iteration, and init label
1ff4bda1 321 fTrack = NULL;
12b2b8bc 322 fMCparticle=NULL;
9a0783cc 323 fTrackLabel=-1;
12b2b8bc 324
325 fTrackPhi = tracklet->GetPhi(id);
326 fTrackEta = tracklet->GetEta(id);
327 fTrackWeight = 1.0;
328 if (fCutEta) {if ( fTrackEta < fEtaMin || fTrackEta >= fEtaMax ) return kFALSE;}
329 if (fCutPhi) {if ( fTrackPhi < fPhiMin || fTrackPhi >= fPhiMax ) return kFALSE;}
330
331 //check MC info if available
9a0783cc 332 //if the 2 clusters have different label track cannot be good
333 //and should therefore not pass the mc cuts
334 Int_t label0 = tracklet->GetLabel(id,0);
335 Int_t label1 = tracklet->GetLabel(id,1);
d0471ea0 336 //if possible get label and mcparticle
9a0783cc 337 fTrackLabel = (label0==label1)?tracklet->GetLabel(id,1):-1;
7afa829c 338 if (!fFakesAreOK && fTrackLabel<0) return kFALSE;
d0471ea0 339 if (fTrackLabel>=0 && fMCevent) fMCparticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(fTrackLabel));
340 //check MC cuts
1ff4bda1 341 if (fCutMC && !PassesMCcuts()) return kFALSE;
12b2b8bc 342 return kTRUE;
343}
344
345//-----------------------------------------------------------------------
1ff4bda1 346Bool_t AliFlowTrackCuts::PassesMCcuts(AliMCEvent* mcEvent, Int_t label)
12b2b8bc 347{
348 //check the MC info
1ff4bda1 349 if (!mcEvent) return kFALSE;
350 if (label<0) return kFALSE;//otherwise AliCMevent prints a warning before returning NULL
351 AliMCParticle* mcparticle = static_cast<AliMCParticle*>(mcEvent->GetTrack(label));
352 if (!mcparticle) {AliError("no MC track"); return kFALSE;}
12b2b8bc 353
354 if (fCutMCisPrimary)
355 {
441ea1cf 356 if (IsPhysicalPrimary(mcEvent,label,fRequireTransportBitForPrimaries) != fMCisPrimary) return kFALSE;
12b2b8bc 357 }
358 if (fCutMCPID)
359 {
1ff4bda1 360 Int_t pdgCode = mcparticle->PdgCode();
4cbcbead 361 if (fIgnoreSignInPID)
362 {
363 if (TMath::Abs(fMCPID) != TMath::Abs(pdgCode)) return kFALSE;
364 }
365 else
366 {
367 if (fMCPID != pdgCode) return kFALSE;
368 }
12b2b8bc 369 }
370 if ( fCutMCprocessType )
371 {
1ff4bda1 372 TParticle* particle = mcparticle->Particle();
12b2b8bc 373 Int_t processID = particle->GetUniqueID();
374 if (processID != fMCprocessType ) return kFALSE;
375 }
376 return kTRUE;
377}
1ff4bda1 378//-----------------------------------------------------------------------
379Bool_t AliFlowTrackCuts::PassesMCcuts()
380{
381 if (!fMCevent) return kFALSE;
382 if (fTrackLabel<0) return kFALSE;//otherwise AliCMevent prints a warning before returning NULL
383 fMCparticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(fTrackLabel));
384 return PassesMCcuts(fMCevent,fTrackLabel);
385}
12b2b8bc 386
387//-----------------------------------------------------------------------
daf66719 388Bool_t AliFlowTrackCuts::PassesCuts(AliVParticle* vparticle)
389{
390 //check cuts for an ESD vparticle
391
127a5825 392 ////////////////////////////////////////////////////////////////
393 // start by preparing the track parameters to cut on //////////
394 ////////////////////////////////////////////////////////////////
5559ce24 395 //clean up from last iteration
1ff4bda1 396 fTrack=NULL;
5559ce24 397
957517fa 398 //get the label and the mc particle
127a5825 399 fTrackLabel = (fFakesAreOK)?TMath::Abs(vparticle->GetLabel()):vparticle->GetLabel();
400 if (fMCevent) fMCparticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(fTrackLabel));
daf66719 401 else fMCparticle=NULL;
402
957517fa 403 Bool_t isMCparticle = kFALSE; //some things are different for MC particles, check!
daf66719 404 AliESDtrack* esdTrack = dynamic_cast<AliESDtrack*>(vparticle);
405 if (esdTrack)
406 HandleESDtrack(esdTrack);
407 else
957517fa 408 {
daf66719 409 HandleVParticle(vparticle);
957517fa 410 //now check if produced particle is MC
411 isMCparticle = (dynamic_cast<AliMCParticle*>(fTrack))!=NULL;
412 }
127a5825 413 ////////////////////////////////////////////////////////////////
414 ////////////////////////////////////////////////////////////////
415
1ff4bda1 416 if (!fTrack) return kFALSE;
441ea1cf 417 if (esdTrack) esdTrack=static_cast<AliESDtrack*>(fTrack); //because it may be different from global
2948ac5a 418
924b02b0 419 Bool_t pass=kTRUE;
9a0783cc 420 //check the common cuts for the current particle fTrack (MC,AOD,ESD)
32b846cd 421 Double_t pt = fTrack->Pt();
7afa829c 422 if (!fFakesAreOK) {if (fTrackLabel<0) pass=kFALSE;}
32b846cd 423 if (fCutPt) {if (pt < fPtMin || pt >= fPtMax ) pass=kFALSE;}
924b02b0 424 if (fCutEta) {if (fTrack->Eta() < fEtaMin || fTrack->Eta() >= fEtaMax ) pass=kFALSE;}
425 if (fCutPhi) {if (fTrack->Phi() < fPhiMin || fTrack->Phi() >= fPhiMax ) pass=kFALSE;}
426 if (fRequireCharge) {if (fTrack->Charge() == 0) pass=kFALSE;}
427 if (fCutCharge && !isMCparticle) {if (fTrack->Charge() != fCharge) pass=kFALSE;}
957517fa 428 if (fCutCharge && isMCparticle)
429 {
430 //in case of an MC particle the charge is stored in units of 1/3|e|
431 Int_t charge = TMath::Nint(fTrack->Charge()/3.0); //mc particles have charge in units of 1/3e
32b846cd 432 if (charge!=fCharge) pass=kFALSE;
957517fa 433 }
924b02b0 434 //if(fCutPID) {if (fTrack->PID() != fPID) pass=kFALSE;}
daf66719 435
957517fa 436 //when additionally MC info is required
1ff4bda1 437 if (fCutMC && !PassesMCcuts()) pass=kFALSE;
daf66719 438
439 //check all else for ESDs using aliesdtrackcuts
924b02b0 440 if (esdTrack && (fParamType!=kMC) )
1ff4bda1 441 {
442 if (fIgnoreTPCzRange)
443 {
444 const AliExternalTrackParam* pin = esdTrack->GetOuterParam();
445 const AliExternalTrackParam* pout = esdTrack->GetInnerParam();
446 if (pin&&pout)
447 {
448 Double_t zin = pin->GetZ();
449 Double_t zout = pout->GetZ();
450 if (zin*zout<0) pass=kFALSE; //reject if cross the membrane
451 if (zin < fIgnoreTPCzRangeMin || zin > fIgnoreTPCzRangeMax) pass=kFALSE;
452 if (zout < fIgnoreTPCzRangeMin || zout > fIgnoreTPCzRangeMax) pass=kFALSE;
453 }
454 }
32b846cd 455
441ea1cf 456 if (fAliESDtrackCuts)
457 {
458 if (!fAliESDtrackCuts->IsSelected(static_cast<AliESDtrack*>(fTrack))) pass=kFALSE;
459 }
32b846cd 460
461 Int_t ntpccls = ( fParamType==kESD_TPConly )?
462 esdTrack->GetTPCNclsIter1():esdTrack->GetTPCNcls();
2948ac5a 463 if (fCutChi2PerClusterTPC)
464 {
465 Float_t tpcchi2 = (fParamType==kESD_TPConly)?
466 esdTrack->GetTPCchi2Iter1():esdTrack->GetTPCchi2();
2948ac5a 467 tpcchi2 = (ntpccls>0)?tpcchi2/ntpccls:-FLT_MAX;
468 if (tpcchi2<fMinChi2PerClusterTPC || tpcchi2 >=fMaxChi2PerClusterTPC)
469 pass=kFALSE;
470 }
32b846cd 471
472 if (fCutNClustersTPC)
473 {
474 if (ntpccls < fNClustersTPCMin || ntpccls > fNClustersTPCMax) pass=kFALSE;
475 }
476
477 if (fCutPID)
478 {
479 switch (fPIDsource)
480 {
481 case kTPCpid:
482 if (!PassesTPCpidCut(esdTrack)) pass=kFALSE;
483 break;
484 case kTOFpid:
485 if (!PassesTOFpidCut(esdTrack)) pass=kFALSE;
486 break;
487 case kTPCTOFpid:
488 if (pt< fTPCTOFpidCrossOverPt)
489 {
490 if (!PassesTPCpidCut(esdTrack)) pass=kFALSE;
491 }
492 else //if (pt>=fTPCTOFpidCrossOverPt)
493 {
494 if (!PassesTOFpidCut(esdTrack)) pass=kFALSE;
495 }
496 break;
497 default:
498 printf("AliFlowTrackCuts::PassesCuts() this should never be called!\n");
499 pass=kFALSE;
500 break;
501 }
502 }
1ff4bda1 503 }
daf66719 504
924b02b0 505 return pass; //true by default, if we didn't set any cuts
daf66719 506}
507
508//-----------------------------------------------------------------------
509void AliFlowTrackCuts::HandleVParticle(AliVParticle* track)
510{
511 //handle the general case
daf66719 512 switch (fParamType)
513 {
daf66719 514 default:
daf66719 515 fTrack = track;
32b846cd 516 break;
daf66719 517 }
518}
519
520//-----------------------------------------------------------------------
521void AliFlowTrackCuts::HandleESDtrack(AliESDtrack* track)
522{
523 //handle esd track
daf66719 524 switch (fParamType)
525 {
12b2b8bc 526 case kGlobal:
daf66719 527 fTrack = track;
daf66719 528 break;
529 case kESD_TPConly:
1ff4bda1 530 if (!track->FillTPCOnlyTrack(fTPCtrack))
531 {
532 fTrack=NULL;
533 fMCparticle=NULL;
534 fTrackLabel=-1;
535 return;
536 }
537 fTrack = &fTPCtrack;
957517fa 538 //recalculate the label and mc particle, they may differ as TPClabel != global label
127a5825 539 fTrackLabel = (fFakesAreOK)?TMath::Abs(fTrack->GetLabel()):fTrack->GetLabel();
540 if (fMCevent) fMCparticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(fTrackLabel));
957517fa 541 else fMCparticle=NULL;
daf66719 542 break;
daf66719 543 default:
544 fTrack = track;
32b846cd 545 break;
daf66719 546 }
547}
548
549//-----------------------------------------------------------------------
550AliFlowTrackCuts* AliFlowTrackCuts::GetStandardTPCOnlyTrackCuts()
551{
552 //get standard cuts
441ea1cf 553 AliFlowTrackCuts* cuts = new AliFlowTrackCuts("standard TPConly cuts");
daf66719 554 delete cuts->fAliESDtrackCuts;
555 cuts->fAliESDtrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
5559ce24 556 cuts->SetParamType(kESD_TPConly);
daf66719 557 return cuts;
558}
559
560//-----------------------------------------------------------------------
561AliFlowTrackCuts* AliFlowTrackCuts::GetStandardITSTPCTrackCuts2009(Bool_t selPrimaries)
562{
563 //get standard cuts
441ea1cf 564 AliFlowTrackCuts* cuts = new AliFlowTrackCuts("standard global track cuts 2009");
daf66719 565 delete cuts->fAliESDtrackCuts;
566 cuts->fAliESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2009(selPrimaries);
12b2b8bc 567 cuts->SetParamType(kGlobal);
daf66719 568 return cuts;
569}
570
571//-----------------------------------------------------------------------
6e214c87 572AliFlowTrack* AliFlowTrackCuts::MakeFlowTrack(int index) const
daf66719 573{
574 //get a flow track constructed from whatever we applied cuts on
575 //caller is resposible for deletion
9a0783cc 576 //if construction fails return NULL
daf66719 577 AliFlowTrack* flowtrack=NULL;
d0471ea0 578 TParticle *tmpTParticle=NULL;
579 AliMCParticle* tmpAliMCParticle=NULL;
12b2b8bc 580 if (fParamType==kESD_SPDtracklet)
daf66719 581 {
9a0783cc 582 switch (fParamMix)
583 {
584 case kPure:
d0471ea0 585 flowtrack = new AliFlowTrack();
9a0783cc 586 flowtrack->SetPhi(fTrackPhi);
587 flowtrack->SetEta(fTrackEta);
588 break;
589 case kTrackWithMCkine:
590 if (!fMCparticle) return NULL;
d0471ea0 591 flowtrack = new AliFlowTrack();
9a0783cc 592 flowtrack->SetPhi( fMCparticle->Phi() );
593 flowtrack->SetEta( fMCparticle->Eta() );
594 flowtrack->SetPt( fMCparticle->Pt() );
595 break;
596 case kTrackWithMCpt:
597 if (!fMCparticle) return NULL;
d0471ea0 598 flowtrack = new AliFlowTrack();
9a0783cc 599 flowtrack->SetPhi(fTrackPhi);
600 flowtrack->SetEta(fTrackEta);
601 flowtrack->SetPt(fMCparticle->Pt());
602 break;
d0471ea0 603 case kTrackWithPtFromFirstMother:
604 if (!fMCparticle) return NULL;
605 flowtrack = new AliFlowTrack();
606 flowtrack->SetPhi(fTrackPhi);
607 flowtrack->SetEta(fTrackEta);
608 tmpTParticle = fMCparticle->Particle();
609 tmpAliMCParticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(tmpTParticle->GetFirstMother()));
610 flowtrack->SetPt(tmpAliMCParticle->Pt());
32b846cd 611 break;
9a0783cc 612 default:
d0471ea0 613 flowtrack = new AliFlowTrack();
9a0783cc 614 flowtrack->SetPhi(fTrackPhi);
615 flowtrack->SetEta(fTrackEta);
32b846cd 616 break;
9a0783cc 617 }
12b2b8bc 618 flowtrack->SetSource(AliFlowTrack::kFromTracklet);
619 }
620 else
621 {
1ff4bda1 622 if (!fTrack) return NULL;
12b2b8bc 623 switch(fParamMix)
624 {
625 case kPure:
626 flowtrack = new AliFlowTrack(fTrack);
627 break;
628 case kTrackWithMCkine:
629 flowtrack = new AliFlowTrack(fMCparticle);
630 break;
631 case kTrackWithMCPID:
632 flowtrack = new AliFlowTrack(fTrack);
9a0783cc 633 //flowtrack->setPID(...) from mc, when implemented
12b2b8bc 634 break;
9a0783cc 635 case kTrackWithMCpt:
636 if (!fMCparticle) return NULL;
637 flowtrack = new AliFlowTrack(fTrack);
638 flowtrack->SetPt(fMCparticle->Pt());
32b846cd 639 break;
d0471ea0 640 case kTrackWithPtFromFirstMother:
641 if (!fMCparticle) return NULL;
642 flowtrack = new AliFlowTrack(fTrack);
643 tmpTParticle = fMCparticle->Particle();
644 tmpAliMCParticle = static_cast<AliMCParticle*>(fMCevent->GetTrack(tmpTParticle->GetFirstMother()));
645 flowtrack->SetPt(tmpAliMCParticle->Pt());
32b846cd 646 break;
12b2b8bc 647 default:
648 flowtrack = new AliFlowTrack(fTrack);
32b846cd 649 break;
12b2b8bc 650 }
651 if (fParamType==kMC) flowtrack->SetSource(AliFlowTrack::kFromMC);
652 else if (dynamic_cast<AliESDtrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromESD);
653 else if (dynamic_cast<AliAODTrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromAOD);
654 else if (dynamic_cast<AliMCParticle*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromMC);
daf66719 655 }
6e214c87 656
657 if(flowtrack)
658 flowtrack->SetIndexOnCollection(index);
daf66719 659 return flowtrack;
660}
127a5825 661
662//-----------------------------------------------------------------------
663Bool_t AliFlowTrackCuts::IsPhysicalPrimary() const
664{
665 //check if current particle is a physical primary
9a0783cc 666 if (!fMCevent) return kFALSE;
667 if (fTrackLabel<0) return kFALSE;
441ea1cf 668 return IsPhysicalPrimary(fMCevent, fTrackLabel, fRequireTransportBitForPrimaries);
9a0783cc 669}
670
671//-----------------------------------------------------------------------
441ea1cf 672Bool_t AliFlowTrackCuts::IsPhysicalPrimary(AliMCEvent* mcEvent, Int_t label, Bool_t requiretransported)
9a0783cc 673{
674 //check if current particle is a physical primary
675 Bool_t physprim=mcEvent->IsPhysicalPrimary(label);
9a0783cc 676 AliMCParticle* track = static_cast<AliMCParticle*>(mcEvent->GetTrack(label));
677 if (!track) return kFALSE;
678 TParticle* particle = track->Particle();
679 Bool_t transported = particle->TestBit(kTransportBit);
441ea1cf 680 //printf("label: %i prim: %s, transp: %s, pass: %s\n",label, (physprim)?"YES":"NO ",(transported)?"YES":"NO ",
681 //(physprim && (transported || !requiretransported))?"YES":"NO" );
682 return (physprim && (transported || !requiretransported));
127a5825 683}
12b2b8bc 684
685//-----------------------------------------------------------------------
686const char* AliFlowTrackCuts::GetParamTypeName(trackParameterType type)
687{
688 //return the name of the selected parameter type
689 switch (type)
690 {
691 case kMC:
692 return "MC";
693 case kGlobal:
694 return "ESD global";
695 case kESD_TPConly:
696 return "TPC only";
697 case kESD_SPDtracklet:
2a745a5f 698 return "SPD tracklet";
12b2b8bc 699 default:
2a745a5f 700 return "unknown";
12b2b8bc 701 }
12b2b8bc 702}
924b02b0 703
704//-----------------------------------------------------------------------
705void AliFlowTrackCuts::DefineHistograms()
706{
2a745a5f 707 //define qa histograms
924b02b0 708}
9a0783cc 709
710//-----------------------------------------------------------------------
711Int_t AliFlowTrackCuts::GetNumberOfInputObjects() const
712{
713 //get the number of tracks in the input event according source
714 //selection (ESD tracks, tracklets, MC particles etc.)
715 AliESDEvent* esd=NULL;
716 switch (fParamType)
717 {
718 case kESD_SPDtracklet:
719 esd = dynamic_cast<AliESDEvent*>(fEvent);
720 if (!esd) return 0;
721 return esd->GetMultiplicity()->GetNumberOfTracklets();
722 case kMC:
723 if (!fMCevent) return 0;
724 return fMCevent->GetNumberOfTracks();
725 default:
726 if (!fEvent) return 0;
727 return fEvent->GetNumberOfTracks();
728 }
729 return 0;
730}
731
732//-----------------------------------------------------------------------
733TObject* AliFlowTrackCuts::GetInputObject(Int_t i)
734{
735 //get the input object according the data source selection:
736 //(esd tracks, traclets, mc particles,etc...)
737 AliESDEvent* esd=NULL;
738 switch (fParamType)
739 {
740 case kESD_SPDtracklet:
741 esd = dynamic_cast<AliESDEvent*>(fEvent);
742 if (!esd) return NULL;
743 return const_cast<AliMultiplicity*>(esd->GetMultiplicity());
744 case kMC:
745 if (!fMCevent) return NULL;
746 return fMCevent->GetTrack(i);
747 default:
748 if (!fEvent) return NULL;
749 return fEvent->GetTrack(i);
750 }
751}
a1c43d26 752
753//-----------------------------------------------------------------------
754void AliFlowTrackCuts::Clear(Option_t*)
755{
756 //clean up
757 fTrack=NULL;
758 fMCevent=NULL;
759 fMCparticle=NULL;
760 fTrackLabel=0;
761 fTrackWeight=0.0;
762 fTrackEta=0.0;
763 fTrackPhi=0.0;
764}
32b846cd 765
766//-----------------------------------------------------------------------
767Bool_t AliFlowTrackCuts::PassesTOFpidCut(AliESDtrack* t )
768{
769 //check if passes PID cut using timing in TOF
770 if (!fESDpid) return kFALSE;
771 if (!(t && (t->GetStatus() & AliESDtrack::kTOFout) && (t->GetStatus() & AliESDtrack::kTIME)
772 && (t->GetTOFsignal() > 12000) && (t->GetTOFsignal() < 100000) && (t->GetIntegratedLength() > 365)))
773 return kFALSE;
774 Float_t pt = t->Pt();
775 Float_t p = t->GetP();
776 Float_t trackT0 = fESDpid->GetTOFResponse().GetStartTime(p);
777 Float_t timeTOF = t->GetTOFsignal()- trackT0;
778 //2=pion 3=kaon 4=protons
779 Double_t inttimes[5] = {-1.0,-1.0,-1.0,-1.0,-1.0};
780 t->GetIntegratedTimes(inttimes);
781 //construct the pid index because it's screwed up in TOF
782 Int_t pid = 0;
783 switch (fAliPID)
784 {
785 case AliPID::kPion:
786 pid=2;
787 break;
788 case AliPID::kKaon:
789 pid=3;
790 break;
791 case AliPID::kProton:
792 pid=4;
793 break;
794 default:
795 return kFALSE;
796 }
797 Float_t s = timeTOF-inttimes[pid];
798
799 Float_t* arr = fTOFpidCuts->GetMatrixArray();
800 Int_t col = TMath::BinarySearch(fTOFpidCuts->GetNcols(),arr,static_cast<Float_t>(pt));
801 if (col<0) return kFALSE;
802 Float_t min = (*fTOFpidCuts)(1,col);
803 Float_t max = (*fTOFpidCuts)(2,col);
804
2a745a5f 805 //printf("--------------TOF pid cut %s\n",(s>min && s<max)?"PASS":"FAIL");
32b846cd 806 return (s>min && s<max);
807}
808
809//-----------------------------------------------------------------------
810Bool_t AliFlowTrackCuts::PassesTPCpidCut(AliESDtrack* track)
811{
812 //check if passes PID cut using dedx signal in the TPC
813 if (!fESDpid)
814 {
815 return kFALSE;
816 }
817 if (!fTPCpidCuts)
818 {
819 printf("no TPCpidCuts\n");
820 return kFALSE;
821 }
822
823 const AliExternalTrackParam* tpcparam = track->GetInnerParam();
824 if (!tpcparam) return kFALSE;
825 Float_t sigExp = fESDpid->GetTPCResponse().GetExpectedSignal(tpcparam->GetP(), fAliPID);
826 Float_t sigTPC = track->GetTPCsignal();
827 Float_t s = (sigTPC-sigExp)/sigExp;
828 Double_t pt = track->Pt();
829
830 Float_t* arr = fTPCpidCuts->GetMatrixArray();
831 Int_t col = TMath::BinarySearch(fTPCpidCuts->GetNcols(),arr,static_cast<Float_t>(pt));
832 if (col<0) return kFALSE;
833 Float_t min = (*fTPCpidCuts)(1,col);
834 Float_t max = (*fTPCpidCuts)(2,col);
835
836 //printf("------------TPC pid cut %s\n",(s>min && s<max)?"PASS":"FAIL");
837 return (s>min && s<max);
838}
839
840//-----------------------------------------------------------------------
841void AliFlowTrackCuts::InitPIDcuts()
842{
843 //init matrices with PID cuts
844 TMatrixF* t = NULL;
845 if (!fTPCpidCuts)
846 {
847 if (fAliPID==AliPID::kPion)
848 {
849 t = new TMatrixF(3,10);
850 (*t)(0,0) = 0.20; (*t)(1,0) = -0.4; (*t)(2,0) = 0.2;
851 (*t)(0,1) = 0.25; (*t)(1,1) = -0.4; (*t)(2,1) = 0.2;
852 (*t)(0,2) = 0.30; (*t)(1,2) = -0.4; (*t)(2,2) = 0.25;
853 (*t)(0,3) = 0.35; (*t)(1,3) = -0.4; (*t)(2,3) = 0.25;
854 (*t)(0,4) = 0.40; (*t)(1,4) = -0.4; (*t)(2,4) = 0.3;
855 (*t)(0,5) = 0.45; (*t)(1,5) = -0.4; (*t)(2,5) = 0.3;
856 (*t)(0,6) = 0.50; (*t)(1,6) = -0.4; (*t)(2,6) = 0.25;
857 (*t)(0,7) = 0.55; (*t)(1,7) = -0.4; (*t)(2,7) = 0.15;
858 (*t)(0,8) = 0.60; (*t)(1,8) = -0.4; (*t)(2,8) = 0.1;
859 (*t)(0,9) = 0.65; (*t)(1,9) = 0; (*t)(2,9) = 0;
860 }
861 else
3ca4688a 862 if (fAliPID==AliPID::kKaon)
863 {
864 t = new TMatrixF(3,7);
865 (*t)(0,0) = 0.20; (*t)(1,0) = -0.2; (*t)(2,0) = 0.4;
866 (*t)(0,1) = 0.25; (*t)(1,1) =-0.15; (*t)(2,1) = 0.4;
867 (*t)(0,2) = 0.30; (*t)(1,2) = -0.1; (*t)(2,2) = 0.4;
868 (*t)(0,3) = 0.35; (*t)(1,3) = -0.1; (*t)(2,3) = 0.4;
869 (*t)(0,4) = 0.40; (*t)(1,4) = -0.1; (*t)(2,4) = 0.6;
870 (*t)(0,5) = 0.45; (*t)(1,5) = -0.1; (*t)(2,5) = 0.6;
871 (*t)(0,6) = 0.50; (*t)(1,6) = 0; (*t)(2,6) = 0;
872 }
873 else
32b846cd 874 if (fAliPID==AliPID::kProton)
875 {
876 t = new TMatrixF(3,16);
3ca4688a 877 (*t)(0,0) = 0.20; (*t)(1,0) = 0; (*t)(2,0) = 0;
878 (*t)(0,1) = 0.25; (*t)(1,1) = -0.2; (*t)(2,1) = 0.3;
32b846cd 879 (*t)(0,2) = 0.30; (*t)(1,2) = -0.2; (*t)(2,2) = 0.6;
880 (*t)(0,3) = 0.35; (*t)(1,3) = -0.2; (*t)(2,3) = 0.6;
881 (*t)(0,4) = 0.40; (*t)(1,4) = -0.2; (*t)(2,4) = 0.6;
882 (*t)(0,5) = 0.45; (*t)(1,5) = -0.15; (*t)(2,5) = 0.6;
883 (*t)(0,6) = 0.50; (*t)(1,6) = -0.1; (*t)(2,6) = 0.6;
3ca4688a 884 (*t)(0,7) = 0.55; (*t)(1,7) = -0.05; (*t)(2,7) = 0.6;
32b846cd 885 (*t)(0,8) = 0.60; (*t)(1,8) = -0.05; (*t)(2,8) = 0.45;
886 (*t)(0,9) = 0.65; (*t)(1,9) = -0.05; (*t)(2,9) = 0.45;
887 (*t)(0,10) = 0.70; (*t)(1,10) = -0.05; (*t)(2,10) = 0.45;
888 (*t)(0,11) = 0.75; (*t)(1,11) = -0.05; (*t)(2,11) = 0.45;
889 (*t)(0,12) = 0.80; (*t)(1,12) = 0; (*t)(2,12) = 0.45;
890 (*t)(0,13) = 0.85; (*t)(1,13) = 0; (*t)(2,13) = 0.45;
891 (*t)(0,14) = 0.90; (*t)(1,14) = 0; (*t)(2,14) = 0.45;
892 (*t)(0,15) = 0.95; (*t)(1,15) = 0; (*t)(2,15) = 0;
893 }
32b846cd 894 fTPCpidCuts=t;
895 }
7d9ab4fb 896 t = NULL;
32b846cd 897 if (!fTOFpidCuts)
898 {
899 if (fAliPID==AliPID::kPion)
900 {
441ea1cf 901 t = new TMatrixF(3,27);
32b846cd 902 (*t)(0,0) = 0.3; (*t)(1,0) = -700; (*t)(2,0) = 700;
903 (*t)(0,1) = 0.35; (*t)(1,1) = -800; (*t)(2,1) = 800;
904 (*t)(0,2) = 0.40; (*t)(1,2) = -600; (*t)(2,2) = 800;
905 (*t)(0,3) = 0.45; (*t)(1,3) = -500; (*t)(2,3) = 700;
906 (*t)(0,4) = 0.50; (*t)(1,4) = -400; (*t)(2,4) = 700;
907 (*t)(0,5) = 0.55; (*t)(1,5) = -400; (*t)(2,5) = 700;
908 (*t)(0,6) = 0.60; (*t)(1,6) = -400; (*t)(2,6) = 700;
909 (*t)(0,7) = 0.65; (*t)(1,7) = -400; (*t)(2,7) = 700;
910 (*t)(0,8) = 0.70; (*t)(1,8) = -400; (*t)(2,8) = 700;
911 (*t)(0,9) = 0.75; (*t)(1,9) = -400; (*t)(2,9) = 700;
912 (*t)(0,10) = 0.80; (*t)(1,10) = -400; (*t)(2,10) = 600;
913 (*t)(0,11) = 0.85; (*t)(1,11) = -400; (*t)(2,11) = 600;
914 (*t)(0,12) = 0.90; (*t)(1,12) = -400; (*t)(2,12) = 600;
915 (*t)(0,13) = 0.95; (*t)(1,13) = -400; (*t)(2,13) = 600;
916 (*t)(0,14) = 1.00; (*t)(1,14) = -400; (*t)(2,14) = 550;
917 (*t)(0,15) = 1.10; (*t)(1,15) = -400; (*t)(2,15) = 450;
918 (*t)(0,16) = 1.20; (*t)(1,16) = -400; (*t)(2,16) = 400;
919 (*t)(0,17) = 1.30; (*t)(1,17) = -400; (*t)(2,17) = 300;
920 (*t)(0,18) = 1.40; (*t)(1,18) = -400; (*t)(2,18) = 300;
921 (*t)(0,19) = 1.50; (*t)(1,19) = -400; (*t)(2,19) = 250;
922 (*t)(0,20) = 1.60; (*t)(1,20) = -400; (*t)(2,20) = 200;
923 (*t)(0,21) = 1.70; (*t)(1,21) = -400; (*t)(2,21) = 150;
924 (*t)(0,22) = 1.80; (*t)(1,22) = -400; (*t)(2,22) = 100;
925 (*t)(0,23) = 1.90; (*t)(1,23) = -400; (*t)(2,23) = 70;
926 (*t)(0,24) = 2.00; (*t)(1,24) = -400; (*t)(2,24) = 50;
441ea1cf 927 (*t)(0,25) = 2.10; (*t)(1,25) = -400; (*t)(2,25) = 0;
928 (*t)(0,26) = 2.20; (*t)(1,26) = 0; (*t)(2,26) = 0;
32b846cd 929 }
930 else
931 if (fAliPID==AliPID::kProton)
932 {
933 t = new TMatrixF(3,39);
3ca4688a 934 (*t)(0,0) = 0.3; (*t)(1,0) = 0; (*t)(2,0) = 0;
935 (*t)(0,1) = 0.35; (*t)(1,1) = 0; (*t)(2,1) = 0;
936 (*t)(0,2) = 0.40; (*t)(1,2) = 0; (*t)(2,2) = 0;
937 (*t)(0,3) = 0.45; (*t)(1,3) = 0; (*t)(2,3) = 0;
938 (*t)(0,4) = 0.50; (*t)(1,4) = 0; (*t)(2,4) = 0;
32b846cd 939 (*t)(0,5) = 0.55; (*t)(1,5) = -900; (*t)(2,5) = 600;
940 (*t)(0,6) = 0.60; (*t)(1,6) = -800; (*t)(2,6) = 600;
941 (*t)(0,7) = 0.65; (*t)(1,7) = -800; (*t)(2,7) = 600;
942 (*t)(0,8) = 0.70; (*t)(1,8) = -800; (*t)(2,8) = 600;
943 (*t)(0,9) = 0.75; (*t)(1,9) = -700; (*t)(2,9) = 500;
944 (*t)(0,10) = 0.80; (*t)(1,10) = -700; (*t)(2,10) = 500;
945 (*t)(0,11) = 0.85; (*t)(1,11) = -700; (*t)(2,11) = 500;
946 (*t)(0,12) = 0.90; (*t)(1,12) = -600; (*t)(2,12) = 500;
947 (*t)(0,13) = 0.95; (*t)(1,13) = -600; (*t)(2,13) = 500;
948 (*t)(0,14) = 1.00; (*t)(1,14) = -600; (*t)(2,14) = 500;
949 (*t)(0,15) = 1.10; (*t)(1,15) = -600; (*t)(2,15) = 500;
950 (*t)(0,16) = 1.20; (*t)(1,16) = -500; (*t)(2,16) = 500;
951 (*t)(0,17) = 1.30; (*t)(1,17) = -500; (*t)(2,17) = 500;
952 (*t)(0,18) = 1.40; (*t)(1,18) = -500; (*t)(2,18) = 500;
953 (*t)(0,19) = 1.50; (*t)(1,19) = -500; (*t)(2,19) = 500;
954 (*t)(0,20) = 1.60; (*t)(1,20) = -400; (*t)(2,20) = 500;
955 (*t)(0,21) = 1.70; (*t)(1,21) = -400; (*t)(2,21) = 500;
956 (*t)(0,22) = 1.80; (*t)(1,22) = -400; (*t)(2,22) = 500;
957 (*t)(0,23) = 1.90; (*t)(1,23) = -400; (*t)(2,23) = 500;
958 (*t)(0,24) = 2.00; (*t)(1,24) = -400; (*t)(2,24) = 500;
959 (*t)(0,25) = 2.10; (*t)(1,25) = -350; (*t)(2,25) = 500;
960 (*t)(0,26) = 2.20; (*t)(1,26) = -350; (*t)(2,26) = 500;
961 (*t)(0,27) = 2.30; (*t)(1,27) = -300; (*t)(2,27) = 500;
962 (*t)(0,28) = 2.40; (*t)(1,28) = -300; (*t)(2,28) = 500;
2a745a5f 963 (*t)(0,29) = 2.50; (*t)(1,29) = -300; (*t)(2,29) = 500;
964 (*t)(0,30) = 2.60; (*t)(1,30) = -250; (*t)(2,30) = 500;
965 (*t)(0,31) = 2.70; (*t)(1,31) = -200; (*t)(2,31) = 500;
966 (*t)(0,32) = 2.80; (*t)(1,32) = -150; (*t)(2,32) = 500;
967 (*t)(0,33) = 2.90; (*t)(1,33) = -150; (*t)(2,33) = 500;
968 (*t)(0,34) = 3.00; (*t)(1,34) = -100; (*t)(2,34) = 400;
969 (*t)(0,35) = 3.10; (*t)(1,35) = -100; (*t)(2,35) = 400;
970 (*t)(0,36) = 3.20; (*t)(1,36) = 0; (*t)(2,36) = 0;
32b846cd 971 (*t)(0,37) = 3.30; (*t)(1,37) = 0; (*t)(2,37) = 0;
2a745a5f 972 (*t)(0,38) = 3.40; (*t)(1,38) = 0; (*t)(2,38) = 0;
32b846cd 973 }
974 else
975 if (fAliPID==AliPID::kKaon)
976 {
977 t = new TMatrixF(3,23);
978 (*t)(0,0) = 0.3; (*t)(1,0) = 0; (*t)(2,0) = 0;
979 (*t)(0,1) = 0.35; (*t)(1,1) = 0; (*t)(2,1) = 0;
980 (*t)(0,2) = 0.40; (*t)(1,2) = -800; (*t)(2,2) = 600;
981 (*t)(0,3) = 0.45; (*t)(1,3) = -800; (*t)(2,3) = 600;
982 (*t)(0,4) = 0.50; (*t)(1,4) = -800; (*t)(2,4) = 600;
983 (*t)(0,5) = 0.55; (*t)(1,5) = -800; (*t)(2,5) = 600;
984 (*t)(0,6) = 0.60; (*t)(1,6) = -800; (*t)(2,6) = 600;
985 (*t)(0,7) = 0.65; (*t)(1,7) = -700; (*t)(2,7) = 600;
986 (*t)(0,8) = 0.70; (*t)(1,8) = -600; (*t)(2,8) = 600;
987 (*t)(0,9) = 0.75; (*t)(1,9) = -600; (*t)(2,9) = 500;
988 (*t)(0,10) = 0.80; (*t)(1,10) = -500; (*t)(2,10) = 500;
989 (*t)(0,11) = 0.85; (*t)(1,11) = -500; (*t)(2,11) = 500;
990 (*t)(0,12) = 0.90; (*t)(1,12) = -400; (*t)(2,12) = 500;
991 (*t)(0,13) = 0.95; (*t)(1,13) = -400; (*t)(2,13) = 500;
992 (*t)(0,14) = 1.00; (*t)(1,14) = -400; (*t)(2,14) = 500;
993 (*t)(0,15) = 1.10; (*t)(1,15) = -350; (*t)(2,15) = 450;
994 (*t)(0,16) = 1.20; (*t)(1,16) = -300; (*t)(2,16) = 400;
995 (*t)(0,17) = 1.30; (*t)(1,17) = -300; (*t)(2,17) = 400;
996 (*t)(0,18) = 1.40; (*t)(1,18) = -250; (*t)(2,18) = 400;
997 (*t)(0,19) = 1.50; (*t)(1,19) = -200; (*t)(2,19) = 400;
998 (*t)(0,20) = 1.60; (*t)(1,20) = -150; (*t)(2,20) = 400;
999 (*t)(0,21) = 1.70; (*t)(1,21) = -100; (*t)(2,21) = 400;
1000 (*t)(0,22) = 1.80; (*t)(1,22) = 0; (*t)(2,22) = 0;
1001 }
1002 fTOFpidCuts=t;
1003 }
1004}