1 /**************************************************************************
2 * Author: Panos Christakoglou. *
3 * Contributors are mentioned in the code where appropriate. *
5 * Permission to use, copy, modify and distribute this software and its *
6 * documentation strictly for non-commercial purposes is hereby granted *
7 * without fee, provided that the above copyright notice appears in all *
8 * copies and that both the copyright notice and this permission notice *
9 * appear in the supporting documentation. The authors make no claims *
10 * about the suitability of this software for any purpose. It is *
11 * provided "as is" without express or implied warranty. *
12 **************************************************************************/
14 /* $Id: AliProtonAnalysisBase.cxx 31056 2009-02-16 14:31:41Z pchrist $ */
16 //-----------------------------------------------------------------
17 // AliProtonAnalysisBase class
18 // This is the class to deal with the proton analysis
19 // Origin: Panos Christakoglou | Panos.Christakoglou@cern.ch
20 //-----------------------------------------------------------------
21 #include <Riostream.h>
28 #include <TParticle.h>
32 #include "AliProtonAnalysisBase.h"
34 #include <AliExternalTrackParam.h>
35 #include <AliESDEvent.h>
38 #include <AliESDVertex.h>
39 #include <AliVertexerTracks.h>
41 ClassImp(AliProtonAnalysisBase)
43 //____________________________________________________________________//
44 AliProtonAnalysisBase::AliProtonAnalysisBase() :
45 TObject(), fProtonAnalysisLevel("ESD"),
46 fTriggerMode(kMB2), fProtonAnalysisMode(kTPC), fProtonPIDMode(kBayesian),
47 fAnalysisEtaMode(kFALSE),
48 fVxMax(100.), fVyMax(100.), fVzMax(100.),
49 fNBinsX(0), fMinX(0), fMaxX(0),
50 fNBinsY(0), fMinY(0), fMaxY(0),
51 fMinTPCClusters(0), fMinITSClusters(0),
52 fMaxChi2PerTPCCluster(0), fMaxChi2PerITSCluster(0),
53 fMaxCov11(0), fMaxCov22(0), fMaxCov33(0), fMaxCov44(0), fMaxCov55(0),
54 fMaxSigmaToVertex(0), fMaxSigmaToVertexTPC(0),
55 fMaxDCAXY(0), fMaxDCAXYTPC(0),
56 fMaxDCAZ(0), fMaxDCAZTPC(0),
57 fMaxDCA3D(0), fMaxDCA3DTPC(0),
59 fMinTPCClustersFlag(kFALSE), fMinITSClustersFlag(kFALSE),
60 fMaxChi2PerTPCClusterFlag(kFALSE), fMaxChi2PerITSClusterFlag(kFALSE),
61 fMaxCov11Flag(kFALSE), fMaxCov22Flag(kFALSE),
62 fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
63 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
64 fMaxDCAXYFlag(kFALSE), fMaxDCAXYTPCFlag(kFALSE),
65 fMaxDCAZFlag(kFALSE), fMaxDCAZTPCFlag(kFALSE),
66 fMaxDCA3DFlag(kFALSE), fMaxDCA3DTPCFlag(kFALSE),
67 fMaxConstrainChi2Flag(kFALSE),
68 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
69 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
70 fPointOnITSLayer1Flag(0), fPointOnITSLayer2Flag(0),
71 fPointOnITSLayer3Flag(0), fPointOnITSLayer4Flag(0),
72 fPointOnITSLayer5Flag(0), fPointOnITSLayer6Flag(0),
73 fFunctionProbabilityFlag(kFALSE),
74 fElectronFunction(0), fMuonFunction(0),
75 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
78 for(Int_t i = 0; i < 5; i++) fPartFrac[i] = 0.0;
81 //____________________________________________________________________//
82 AliProtonAnalysisBase::~AliProtonAnalysisBase() {
84 if(fElectronFunction) delete fElectronFunction;
85 if(fMuonFunction) delete fMuonFunction;
86 if(fPionFunction) delete fPionFunction;
87 if(fKaonFunction) delete fKaonFunction;
88 if(fProtonFunction) delete fProtonFunction;
91 //____________________________________________________________________//
92 Double_t AliProtonAnalysisBase::GetParticleFraction(Int_t i, Double_t p) {
93 //Return the a priori probs
95 if(fFunctionProbabilityFlag) {
96 if(i == 0) partFrac = fElectronFunction->Eval(p);
97 if(i == 1) partFrac = fMuonFunction->Eval(p);
98 if(i == 2) partFrac = fPionFunction->Eval(p);
99 if(i == 3) partFrac = fKaonFunction->Eval(p);
100 if(i == 4) partFrac = fProtonFunction->Eval(p);
102 else partFrac = fPartFrac[i];
107 //____________________________________________________________________//
108 Bool_t AliProtonAnalysisBase::IsInPhaseSpace(AliESDtrack* const track) {
109 // Checks if the track is outside the analyzed y-Pt phase space
110 Double_t gPt = 0.0, gPx = 0.0, gPy = 0.0, gPz = 0.0;
114 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
116 gPt = 0.0; gPx = 0.0; gPy = 0.0; gPz = 0.0; eta = -10.0;
119 gPt = tpcTrack->Pt();
120 gPx = tpcTrack->Px();
121 gPy = tpcTrack->Py();
122 gPz = tpcTrack->Pz();
123 eta = tpcTrack->Eta();
134 if((gPt < fMinY) || (gPt > fMaxY)) {
136 Printf("IsInPhaseSpace: Track rejected because it has a Pt value of %lf (accepted interval: %lf - %lf)",gPt,fMinY,fMaxY);
139 if(fAnalysisEtaMode) {
140 if((eta < fMinX) || (eta > fMaxX)) {
142 Printf("IsInPhaseSpace: Track rejected because it has an eta value of %lf (accepted interval: %lf - %lf)",eta,fMinX,fMaxX);
147 if((Rapidity(gPx,gPy,gPz) < fMinX) || (Rapidity(gPx,gPy,gPz) > fMaxX)) {
149 Printf("IsInPhaseSpace: Track rejected because it has a y value of %lf (accepted interval: %lf - %lf)",Rapidity(gPx,gPy,gPz),fMinX,fMaxX);
157 //____________________________________________________________________//
158 Bool_t AliProtonAnalysisBase::IsAccepted(AliESDEvent *esd,
159 const AliESDVertex *vertex,
160 AliESDtrack* track) {
161 // Checks if the track is excluded from the cuts
162 Double_t gPt = 0.0, gPx = 0.0, gPy = 0.0, gPz = 0.0;
163 Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0}; //The impact parameters and their covariance.
164 Double_t dca3D = 0.0;
166 if((kTPC)&&(!kHybrid)) {
167 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
169 gPt = 0.0; gPx = 0.0; gPy = 0.0; gPz = 0.0;
170 dca[0] = -100.; dca[1] = -100.; dca3D = -100.;
171 cov[0] = -100.; cov[1] = -100.; cov[2] = -100.;
174 gPt = tpcTrack->Pt();
175 gPx = tpcTrack->Px();
176 gPy = tpcTrack->Py();
177 gPz = tpcTrack->Pz();
178 tpcTrack->PropagateToDCA(vertex,
179 esd->GetMagneticField(),
184 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
186 gPt = 0.0; gPx = 0.0; gPy = 0.0; gPz = 0.0;
187 dca[0] = -100.; dca[1] = -100.;
188 cov[0] = -100.; cov[1] = -100.; cov[2] = -100.;
191 gPt = tpcTrack->Pt();
192 gPx = tpcTrack->Px();
193 gPy = tpcTrack->Py();
194 gPz = tpcTrack->Pz();
195 tpcTrack->PropagateToDCA(vertex,
196 esd->GetMagneticField(),
205 track->PropagateToDCA(vertex,
206 esd->GetMagneticField(),
209 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
210 TMath::Power(dca[1],2));
213 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
214 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
216 Float_t chi2PerClusterITS = -1;
218 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
219 Float_t chi2PerClusterTPC = -1;
221 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
224 track->GetExternalCovariance(extCov);
226 if(fPointOnITSLayer1Flag) {
227 if(!track->HasPointOnITSLayer(0)) {
229 Printf("IsAccepted: Track rejected because it doesn't have a point on the 1st ITS layer");
233 if(fPointOnITSLayer2Flag) {
234 if(!track->HasPointOnITSLayer(1)) {
236 Printf("IsAccepted: Track rejected because it doesn't have a point on the 2nd ITS layer");
240 if(fPointOnITSLayer3Flag) {
241 if(!track->HasPointOnITSLayer(2)) {
243 Printf("IsAccepted: Track rejected because it doesn't have a point on the 3rd ITS layer");
247 if(fPointOnITSLayer4Flag) {
248 if(!track->HasPointOnITSLayer(3)) {
250 Printf("IsAccepted: Track rejected because it doesn't have a point on the 4th ITS layer");
254 if(fPointOnITSLayer5Flag) {
255 if(!track->HasPointOnITSLayer(4)) {
257 Printf("IsAccepted: Track rejected because it doesn't have a point on the 5th ITS layer");
261 if(fPointOnITSLayer6Flag) {
262 if(!track->HasPointOnITSLayer(5)) {
264 Printf("IsAccepted: Track rejected because it doesn't have a point on the 6th ITS layer");
268 if(fMinITSClustersFlag) {
269 if(nClustersITS < fMinITSClusters) {
271 Printf("IsAccepted: Track rejected because it has %d ITS points (min. requested: %d)",nClustersITS,fMinITSClusters);
275 if(fMaxChi2PerITSClusterFlag) {
276 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
278 Printf("IsAccepted: Track rejected because it has a chi2 per ITS cluster %lf (max. requested: %lf)",chi2PerClusterITS,fMaxChi2PerITSCluster);
282 if(fMinTPCClustersFlag) {
283 if(nClustersTPC < fMinTPCClusters) {
285 Printf("IsAccepted: Track rejected because it has %d TPC clusters (min. requested: %d)",nClustersTPC,fMinTPCClusters);
289 if(fMaxChi2PerTPCClusterFlag) {
290 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
292 Printf("IsAccepted: Track rejected because it has a chi2 per TPC cluster %lf (max. requested: %lf)",chi2PerClusterTPC,fMaxChi2PerTPCCluster);
297 if(extCov[0] > fMaxCov11) {
299 Printf("IsAccepted: Track rejected because it has a cov11 value of %lf (max. requested: %lf)",extCov[0],fMaxCov11);
304 if(extCov[2] > fMaxCov22) {
306 Printf("IsAccepted: Track rejected because it has a cov22 value of %lf (max. requested: %lf)",extCov[2],fMaxCov22);
311 if(extCov[5] > fMaxCov33) {
313 Printf("IsAccepted: Track rejected because it has a cov33 value of %lf (max. requested: %lf)",extCov[5],fMaxCov33);
318 if(extCov[9] > fMaxCov44) {
320 Printf("IsAccepted: Track rejected because it has a cov44 value of %lf (max. requested: %lf)",extCov[9],fMaxCov44);
325 if(extCov[14] > fMaxCov55) {
327 Printf("IsAccepted: Track rejected because it has a cov55 value of %lf (max. requested: %lf)",extCov[14],fMaxCov55);
331 if(fMaxSigmaToVertexFlag) {
332 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
334 Printf("IsAccepted: Track rejected because it has a %lf sigmas to vertex (max. requested: %lf)",GetSigmaToVertex(track),fMaxSigmaToVertex);
338 if(fMaxSigmaToVertexTPCFlag) {
339 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
341 Printf("IsAccepted: Track rejected because it has a %lf sigmas to vertex TPC (max. requested: %lf)",GetSigmaToVertex(track),fMaxSigmaToVertexTPC);
346 if(TMath::Abs(dca[0]) > fMaxDCAXY) {
348 Printf("IsAccepted: Track rejected because it has a value of dca(xy) of %lf (max. requested: %lf)",TMath::Abs(dca[0]),fMaxDCAXY);
352 if(fMaxDCAXYTPCFlag) {
353 if(TMath::Abs(dca[0]) > fMaxDCAXYTPC) {
355 Printf("IsAccepted: Track rejected because it has a value of dca(xy) (TPC) of %lf (max. requested: %lf)",TMath::Abs(dca[0]),fMaxDCAXYTPC);
360 if(TMath::Abs(dca[1]) > fMaxDCAZ) {
362 Printf("IsAccepted: Track rejected because it has a value of dca(z) of %lf (max. requested: %lf)",TMath::Abs(dca[1]),fMaxDCAZ);
366 if(fMaxDCAZTPCFlag) {
367 if(TMath::Abs(dca[1]) > fMaxDCAZTPC) {
369 Printf("IsAccepted: Track rejected because it has a value of dca(z) (TPC) of %lf (max. requested: %lf)",TMath::Abs(dca[1]),fMaxDCAZTPC);
374 if(TMath::Abs(dca3D) > fMaxDCA3D) {
376 Printf("IsAccepted: Track rejected because it has a value of dca(3D) of %lf (max. requested: %lf)",TMath::Abs(dca3D),fMaxDCA3D);
380 if(fMaxDCA3DTPCFlag) {
381 if(TMath::Abs(dca3D) > fMaxDCA3DTPC) {
383 Printf("IsAccepted: Track rejected because it has a value of dca(3D) (TPC) of %lf (max. requested: %lf)",TMath::Abs(dca3D),fMaxDCA3DTPC);
387 if(fMaxConstrainChi2Flag) {
388 if(track->GetConstrainedChi2() > 0)
389 if(TMath::Log(track->GetConstrainedChi2()) > fMaxConstrainChi2) {
391 Printf("IsAccepted: Track rejected because it has a value of the constrained chi2 to the vertex of %lf (max. requested: %lf)",TMath::Log(track->GetConstrainedChi2()),fMaxConstrainChi2);
396 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
398 Printf("IsAccepted: Track rejected because it has no ITS refit flag");
403 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
405 Printf("IsAccepted: Track rejected because it has no TPC refit flag");
410 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
412 Printf("IsAccepted: Track rejected because it has no ESD pid flag");
417 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
419 Printf("IsAccepted: Track rejected because it has no TPC pid flag");
427 //____________________________________________________________________//
428 Float_t AliProtonAnalysisBase::GetSigmaToVertex(AliESDtrack* esdTrack) const {
429 // Calculates the number of sigma to the vertex.
434 if((kTPC)&&(!kHybrid))
435 esdTrack->GetImpactParametersTPC(b,bCov);
437 esdTrack->GetImpactParameters(b,bCov);
439 if (bCov[0]<=0 || bCov[2]<=0) {
440 //AliDebug(1, "Estimated b resolution lower or equal zero!");
441 bCov[0]=0; bCov[2]=0;
443 bRes[0] = TMath::Sqrt(bCov[0]);
444 bRes[1] = TMath::Sqrt(bCov[2]);
446 if (bRes[0] == 0 || bRes[1] ==0) return -1;
448 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
450 if (TMath::Exp(-d * d / 2) < 1e-10) return 1000;
452 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
457 //____________________________________________________________________//
458 Double_t AliProtonAnalysisBase::Rapidity(Double_t gPx,
460 Double_t gPz) const {
461 //returns the rapidity of the proton - to be removed
462 Double_t fMass = 9.38270000000000048e-01;
464 Double_t gP = TMath::Sqrt(TMath::Power(gPx,2) +
465 TMath::Power(gPy,2) +
466 TMath::Power(gPz,2));
467 Double_t energy = TMath::Sqrt(gP*gP + fMass*fMass);
470 y = 0.5*TMath::Log((energy + gPz)/(energy - gPz));
475 //________________________________________________________________________
476 const AliESDVertex* AliProtonAnalysisBase::GetVertex(AliESDEvent* esd,
481 // Get the vertex from the ESD and returns it if the vertex is valid
482 // Second argument decides which vertex is used (this selects
483 // also the quality criteria that are applied)
484 const AliESDVertex* vertex = 0;
486 vertex = esd->GetPrimaryVertexSPD();
487 else if(mode == kTPC){
488 Double_t kBz = esd->GetMagneticField();
489 AliVertexerTracks vertexer(kBz);
490 vertexer.SetTPCMode();
491 AliESDVertex *vTPC = vertexer.FindPrimaryVertex(esd);
492 esd->SetPrimaryVertexTPC(vTPC);
493 for (Int_t i=0; i<esd->GetNumberOfTracks(); i++) {
494 AliESDtrack *t = esd->GetTrack(i);
495 t->RelateToVertexTPC(vTPC, kBz, kVeryBig);
498 vertex = esd->GetPrimaryVertexTPC();
500 else if(mode == kGlobal)
501 vertex = esd->GetPrimaryVertex();
503 Printf("GetVertex: ERROR: Invalid second argument %d", mode);
507 Printf("GetVertex: Event rejected because there is no valid vertex object");
511 // check Ncontributors
512 if(vertex->GetNContributors() <= 0) {
514 Printf("GetVertex: Event rejected because the number of contributors for the vertex determination is <= 0");
519 Double_t zRes = vertex->GetZRes();
522 Printf("GetVertex: Event rejected because the value of the vertex resolution in z is 0");
527 if(TMath::Abs(vertex->GetXv()) > gVxMax) {
529 Printf("GetVertex: Event rejected because it has a Vx value of %lf cm (accepted interval: -%lf - %lf)",TMath::Abs(vertex->GetXv()),gVxMax,gVxMax);
532 if(TMath::Abs(vertex->GetYv()) > gVyMax) {
534 Printf("GetVertex: Event rejected because it has a Vy value of %lf cm (accepted interval: -%lf - %lf)",TMath::Abs(vertex->GetYv()),gVyMax,gVyMax);
537 if(TMath::Abs(vertex->GetZv()) > gVzMax) {
539 Printf("GetVertex: Event rejected because it has a Vz value of %lf cm (accepted interval: -%lf - %lf)",TMath::Abs(vertex->GetZv()),gVzMax,gVzMax);
546 //________________________________________________________________________
547 Bool_t AliProtonAnalysisBase::IsEventTriggered(const AliESDEvent *esd,
548 TriggerMode trigger) {
549 // check if the event was triggered
550 ULong64_t triggerMask = esd->GetTriggerMask();
552 // definitions from p-p.cfg
553 ULong64_t spdFO = (1 << 14);
554 ULong64_t v0left = (1 << 11);
555 ULong64_t v0right = (1 << 12);
559 if (triggerMask & spdFO || ((triggerMask & v0left) || (triggerMask & v0right)))
564 if (triggerMask & spdFO && ((triggerMask & v0left) || (triggerMask & v0right)))
569 if (triggerMask & spdFO)
578 //________________________________________________________________________
579 TCanvas *AliProtonAnalysisBase::GetListOfCuts() {
580 // return the list of cuts and their cut values for reference
587 TCanvas *c = new TCanvas("cListOfCuts","List of cuts",0,0,900,600);
588 c->SetFillColor(10); c->SetHighLightColor(41);
591 c->cd(1)->SetFillColor(10);
592 l.DrawLatex(0.3,0.9,"Analysis details: List of cuts\n\n");
594 listOfCuts = "Analysis level: "; listOfCuts += fProtonAnalysisLevel;
595 l.DrawLatex(0.1,0.82,listOfCuts.Data());
596 listOfCuts = "Analysis mode: ";
597 if(fProtonAnalysisMode == kTPC) listOfCuts += "TPC standalone";
598 if(fProtonAnalysisMode == kHybrid) listOfCuts += "Hybrid TPC";
599 if(fProtonAnalysisMode == kGlobal) listOfCuts += "Global tracking";
600 l.DrawLatex(0.1,0.74,listOfCuts.Data());
601 listOfCuts = "Trigger mode: ";
602 if(fTriggerMode == kMB1) listOfCuts += "Minimum bias 1";
603 if(fTriggerMode == kMB2) listOfCuts += "Minimum bias 2";
604 if(fTriggerMode == kSPDFASTOR) listOfCuts += "FastOR (SPD)";
605 l.DrawLatex(0.1,0.66,listOfCuts.Data());
606 listOfCuts = "PID mode: ";
607 if(fProtonPIDMode == kBayesian) listOfCuts += "Bayesian PID";
608 if(fProtonPIDMode == kRatio) listOfCuts += "Z = ln((dE/dx)_{exp.}/(dE/dx)_{theor.})";
609 if(fProtonPIDMode == kSigma) listOfCuts += "N__{#sigma} area";
610 l.DrawLatex(0.1,0.58,listOfCuts.Data());
611 listOfCuts = "Accepted vertex diamond: ";
612 l.DrawLatex(0.1,0.5,listOfCuts.Data());
613 listOfCuts = "|V_{x}| < "; listOfCuts += fVxMax; listOfCuts += " [cm]";
614 l.DrawLatex(0.6,0.5,listOfCuts.Data());
615 listOfCuts = "|V_{y}| < "; listOfCuts += fVyMax; listOfCuts += " [cm]";
616 l.DrawLatex(0.6,0.4,listOfCuts.Data());
617 listOfCuts = "|V_{z}| < "; listOfCuts += fVzMax; listOfCuts += " [cm]";
618 l.DrawLatex(0.6,0.3,listOfCuts.Data());
619 listOfCuts = "Phase space: ";
620 l.DrawLatex(0.1,0.2,listOfCuts.Data());
621 if(fAnalysisEtaMode) listOfCuts = "|#eta| < ";
622 else listOfCuts = "|y| < ";
623 listOfCuts += TMath::Abs(fMinX);
624 l.DrawLatex(0.35,0.2,listOfCuts.Data());
625 listOfCuts = "N_{bins} = ";
626 listOfCuts += fNBinsX; listOfCuts += " (binning: ";
627 listOfCuts += (fMaxX-fMinX)/fNBinsX; listOfCuts += ")";
628 l.DrawLatex(0.35,0.15,listOfCuts.Data());
629 listOfCuts = ""; listOfCuts += fMinY; listOfCuts += " < P_{T} < ";
630 listOfCuts += fMaxY; listOfCuts += "GeV/c";
631 l.DrawLatex(0.35,0.1,listOfCuts.Data());
632 listOfCuts = "N_{bins} = ";
633 listOfCuts += fNBinsY; listOfCuts += " (binning: ";
634 listOfCuts += (fMaxY-fMinY)/fNBinsY; listOfCuts += ")";
635 l.DrawLatex(0.35,0.05,listOfCuts.Data());
637 c->cd(2)->SetFillColor(2);
638 l.DrawLatex(0.3,0.9,"ITS related cuts");
639 listOfCuts = "Request a cluster on SPD1: ";
640 listOfCuts += fPointOnITSLayer1Flag;
641 l.DrawLatex(0.1,0.8,listOfCuts.Data());
642 listOfCuts = "Request a cluster on SPD2: ";
643 listOfCuts += fPointOnITSLayer2Flag;
644 l.DrawLatex(0.1,0.7,listOfCuts.Data());
645 listOfCuts = "Request a cluster on SDD1: ";
646 listOfCuts += fPointOnITSLayer3Flag;
647 l.DrawLatex(0.1,0.6,listOfCuts.Data());
648 listOfCuts = "Request a cluster on SDD2: ";
649 listOfCuts += fPointOnITSLayer4Flag;
650 l.DrawLatex(0.1,0.5,listOfCuts.Data());
651 listOfCuts = "Request a cluster on SSD1: ";
652 listOfCuts += fPointOnITSLayer5Flag;
653 l.DrawLatex(0.1,0.4,listOfCuts.Data());
654 listOfCuts = "Request a cluster on SSD2: ";
655 listOfCuts += fPointOnITSLayer6Flag;
656 l.DrawLatex(0.1,0.3,listOfCuts.Data());
657 listOfCuts = "Minimum number of ITS clusters: ";
658 if(fMinITSClustersFlag) listOfCuts += fMinITSClusters;
659 else listOfCuts += "Not used";
660 l.DrawLatex(0.1,0.2,listOfCuts.Data());
661 listOfCuts = "Maximum #chi^{2} per ITS cluster: ";
662 if(fMaxChi2PerITSClusterFlag) listOfCuts += fMaxChi2PerITSCluster;
663 else listOfCuts += "Not used";
664 l.DrawLatex(0.1,0.1,listOfCuts.Data());
666 c->cd(3)->SetFillColor(3);
667 l.DrawLatex(0.3,0.9,"TPC related cuts");
668 listOfCuts = "Minimum number of TPC clusters: ";
669 if(fMinTPCClustersFlag) listOfCuts += fMinTPCClusters;
670 else listOfCuts += "Not used";
671 l.DrawLatex(0.1,0.7,listOfCuts.Data());
672 listOfCuts = "Maximum #chi^{2} per TPC cluster: ";
673 if(fMaxChi2PerTPCClusterFlag) listOfCuts += fMaxChi2PerTPCCluster;
674 else listOfCuts += "Not used";
675 l.DrawLatex(0.1,0.5,listOfCuts.Data());
677 c->cd(4)->SetFillColor(4);
678 l.DrawLatex(0.3,0.9,"Tracking related cuts");
679 listOfCuts = "Maximum cov11: ";
680 if(fMaxCov11Flag) listOfCuts += fMaxCov11;
681 else listOfCuts += "Not used";
682 l.DrawLatex(0.1,0.75,listOfCuts.Data());
683 listOfCuts = "Maximum cov22: ";
684 if(fMaxCov22Flag) listOfCuts += fMaxCov22;
685 else listOfCuts += "Not used";
686 l.DrawLatex(0.1,0.6,listOfCuts.Data());
687 listOfCuts = "Maximum cov33: ";
688 if(fMaxCov33Flag) listOfCuts += fMaxCov33;
689 else listOfCuts += "Not used";
690 l.DrawLatex(0.1,0.45,listOfCuts.Data());
691 listOfCuts = "Maximum cov44: ";
692 if(fMaxCov44Flag) listOfCuts += fMaxCov44;
693 else listOfCuts += "Not used";
694 l.DrawLatex(0.1,0.3,listOfCuts.Data());
695 listOfCuts = "Maximum cov55: ";
696 if(fMaxCov55Flag) listOfCuts += fMaxCov55;
697 else listOfCuts += "Not used";
698 l.DrawLatex(0.1,0.15,listOfCuts.Data());
700 c->cd(5)->SetFillColor(5);
701 l.DrawLatex(0.3,0.9,"DCA related cuts");
702 listOfCuts = "Maximum sigma to vertex: ";
703 if(fMaxSigmaToVertexFlag) listOfCuts += fMaxSigmaToVertex;
704 else listOfCuts += "Not used";
705 l.DrawLatex(0.1,0.8,listOfCuts.Data());
706 listOfCuts = "Maximum sigma to vertex (TPC): ";
707 if(fMaxSigmaToVertexTPCFlag) listOfCuts += fMaxSigmaToVertexTPC;
708 else listOfCuts += "Not used";
709 l.DrawLatex(0.1,0.72,listOfCuts.Data());
710 listOfCuts = "Maximum DCA in xy: ";
711 if(fMaxDCAXYFlag) listOfCuts += fMaxDCAXY;
712 else listOfCuts += "Not used";
713 l.DrawLatex(0.1,0.64,listOfCuts.Data());
714 listOfCuts = "Maximum DCA in z: ";
715 if(fMaxDCAZFlag) listOfCuts += fMaxDCAZ;
716 else listOfCuts += "Not used";
717 l.DrawLatex(0.1,0.56,listOfCuts.Data());
718 listOfCuts = "Maximum DCA in 3D: ";
719 if(fMaxDCA3DFlag) listOfCuts += fMaxDCA3D;
720 else listOfCuts += "Not used";
721 l.DrawLatex(0.1,0.48,listOfCuts.Data());
722 listOfCuts = "Maximum DCA in xy (TPC): ";
723 if(fMaxDCAXYFlag) listOfCuts += fMaxDCAXYTPC;
724 else listOfCuts += "Not used";
725 l.DrawLatex(0.1,0.4,listOfCuts.Data());
726 listOfCuts = "Maximum DCA in z (TPC): ";
727 if(fMaxDCAZFlag) listOfCuts += fMaxDCAZTPC;
728 else listOfCuts += "Not used";
729 l.DrawLatex(0.1,0.32,listOfCuts.Data());
730 listOfCuts = "Maximum DCA in 3D (TPC): ";
731 if(fMaxDCA3DFlag) listOfCuts += fMaxDCA3DTPC;
732 else listOfCuts += "Not used";
733 l.DrawLatex(0.1,0.24,listOfCuts.Data());
734 listOfCuts = "Maximum constrained #chi^{2} (vertex): ";
735 if(fMaxConstrainChi2Flag) listOfCuts += fMaxConstrainChi2;
736 else listOfCuts += "Not used";
737 l.DrawLatex(0.1,0.16,listOfCuts.Data());
739 c->cd(6)->SetFillColor(6);
740 l.DrawLatex(0.3,0.9,"Tracking bits related cuts");
741 listOfCuts = "Request the ITS refit bit: "; listOfCuts += fITSRefitFlag;
742 l.DrawLatex(0.1,0.7,listOfCuts.Data());
743 listOfCuts = "Request the TPC refit bit: "; listOfCuts += fTPCRefitFlag;
744 l.DrawLatex(0.1,0.5,listOfCuts.Data());
745 listOfCuts = "Request the TPC pid bit: "; listOfCuts += fTPCpidFlag;
746 l.DrawLatex(0.1,0.3,listOfCuts.Data());
747 listOfCuts = "Request the ESD pid bit: "; listOfCuts += fESDpidFlag;
748 l.DrawLatex(0.1,0.1,listOfCuts.Data());
753 //________________________________________________________________________
754 Bool_t AliProtonAnalysisBase::IsProton(AliESDtrack *track) {
755 //Function that checks if a track is a proton
756 Double_t probability[5];
757 Double_t gPt = 0.0, gP = 0.0;
758 Long64_t fParticleType = 0;
760 //Bayesian approach for the PID
761 if(fProtonPIDMode == kBayesian) {
762 if((fProtonAnalysisMode == kTPC)||(fProtonAnalysisMode == kHybrid)) {
763 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
765 gPt = tpcTrack->Pt();
767 track->GetTPCpid(probability);
769 }//TPC standalone or Hybrid TPC
770 else if(fProtonAnalysisMode == kGlobal) {
773 track->GetESDpid(probability);
777 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
778 rcc += probability[i]*GetParticleFraction(i,gP);
781 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
782 w[i] = probability[i]*GetParticleFraction(i,gP)/rcc;
783 fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
785 if(fParticleType == 4)
788 //Ratio of the measured over the theoretical dE/dx a la STAR
789 else if(fProtonPIDMode == kRatio) {
790 Printf("The kRatio mode is not implemented yet!!!");
793 //Definition of an N-sigma area around the dE/dx vs P band
794 else if(fProtonPIDMode == kSigma) {
795 Printf("The kSigma mode is not implemented yet!!!");