Adding the QA plot for the pid efficiency/contamination vs the number of TPC points...
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / macros / configProtonAnalysis.C
CommitLineData
0ab648ea 1//__________________________________________________//
2AliProtonAnalysis *GetProtonAnalysisObject(const char* analysisLevel = "ESD",
3 const char* esdAnalysisType = "Hybrid",
4 const char* pidMode = "Bayesian") {
5 //Function to setup the AliProtonAnalysis object and return it
6 AliProtonAnalysisBase *baseAnalysis = GetProtonAnalysisBaseObject(analysisLevel,esdAnalysisType,pidMode);
7
8 AliProtonAnalysis *analysis = new AliProtonAnalysis();
9 analysis->SetBaseAnalysis(baseAnalysis);
10 //if(analysisBase->GetEtaMode()) analysis->SetEtaMode();
11 analysis->InitAnalysisHistograms(baseAnalysis->GetNBinsX(),
12 baseAnalysis->GetMinX(),
13 baseAnalysis->GetMaxX(),
14 baseAnalysis->GetNBinsY(),
15 baseAnalysis->GetMinY(),
16 baseAnalysis->GetMaxY());
17
18 return analysis;
19}
20
21//__________________________________________________//
22AliProtonQAAnalysis *GetProtonQAAnalysisObject(const char* analysisLevel = "ESD",
23 const char* esdAnalysisType = "Hybrid",
24 const char* pidMode = "Bayesian") {
25 //Function to setup the AliProtonQAAnalysis object and return it
e7df5638 26 AliProtonAnalysisBase *baseAnalysis = GetProtonAnalysisBaseObject(analysisLevel,esdAnalysisType,pidMode);
27
0ab648ea 28 AliProtonQAAnalysis *analysis = new AliProtonQAAnalysis();
57e749bb 29 analysis->SetBaseAnalysis(baseAnalysis);
e7df5638 30 analysis->SetRunMCAnalysis();
31 //analysis->SetMCProcessId(4);//4: weak decay - 13: hadronic interaction
32 //analysis->SetMotherParticlePDGCode(3122);//3122: Lambda
57e749bb 33 analysis->SetRunEfficiencyAnalysis(kFALSE);//use cuts in the eff. analysis
e7df5638 34 analysis->SetQAYPtBins(baseAnalysis->GetNBinsX(),
35 baseAnalysis->GetMinX(),
36 baseAnalysis->GetMaxX(),
37 baseAnalysis->GetNBinsY(),
38 baseAnalysis->GetMinY(),
39 baseAnalysis->GetMaxY());
0ab648ea 40
41 return analysis;
42}
43
44//__________________________________________________//
45AliProtonAnalysisBase *GetProtonAnalysisBaseObject(const char* analysisLevel = "ESD",
46 const char* esdAnalysisType = "Hybrid",
47 const char* pidMode = "Bayesian") {
48 //Function to setup the AliProtonAnalysisBase object and return it
49 AliProtonAnalysisBase *baseAnalysis = new AliProtonAnalysisBase();
50 //baseAnalysis->SetDebugMode();
51 baseAnalysis->SetAnalysisLevel(analysisLevel);
52 if(analysisLevel == "ESD") {
53 baseAnalysis->SetTriggerMode(AliProtonAnalysisBase::kMB2);
9a316962 54 baseAnalysis->SetMinTPCClusters(110);
55 baseAnalysis->SetMaxChi2PerTPCCluster(2.2);
56 baseAnalysis->SetMaxCov11(0.5);
57 baseAnalysis->SetMaxCov22(0.5);
58 baseAnalysis->SetMaxCov33(0.5);
59 baseAnalysis->SetMaxCov44(0.5);
60 baseAnalysis->SetMaxCov55(0.5);
61 baseAnalysis->SetMinTPCdEdxPoints(80);
0ab648ea 62 switch(esdAnalysisType) {
63 case "TPC":
64 baseAnalysis->SetAnalysisMode(AliProtonAnalysisBase::kTPC);
65 baseAnalysis->SetPhaseSpace(10, -0.5, 0.5, 16, 0.5, 0.9);
66 baseAnalysis->SetTPCpid();
0ab648ea 67 baseAnalysis->SetMaxSigmaToVertexTPC(2.0);
68 //baseAnalysis->SetMaxDCAXYTPC(1.5);
69 //baseAnalysis->SetMaxDCAZTPC(1.5);
70 break;
71 case "Hybrid":
72 baseAnalysis->SetAnalysisMode(AliProtonAnalysisBase::kHybrid);
73 baseAnalysis->SetPhaseSpace(10, -0.5, 0.5, 16, 0.5, 0.9);
74 baseAnalysis->SetTPCpid();
0ab648ea 75 baseAnalysis->SetMaxSigmaToVertex(2.0);
76 /*baseAnalysis->SetMaxDCAXY(1.5);
77 baseAnalysis->SetMaxDCAZ(1.5);*/
78 baseAnalysis->SetPointOnITSLayer6();
79 baseAnalysis->SetPointOnITSLayer5();
80 //baseAnalysis->SetPointOnITSLayer4();
81 //baseAnalysis->SetPointOnITSLayer3();
82 baseAnalysis->SetPointOnITSLayer2();
83 baseAnalysis->SetPointOnITSLayer1();
9a316962 84 baseAnalysis->SetMinITSClusters(4);
0ab648ea 85 break;
86 case "Global":
87 baseAnalysis->SetAnalysisMode(AliProtonAnalysisBase::kGlobal);
88 baseAnalysis->SetPhaseSpace(20, -1.0, 1.0, 48, 0.3, 1.5);
0ab648ea 89 baseAnalysis->SetMaxSigmaToVertex(2.0);
90 //baseAnalysis->SetMaxDCAXY(2.0);
91 //baseAnalysis->SetMaxDCAZ(2.0);
92 baseAnalysis->SetTPCRefit();
93 baseAnalysis->SetPointOnITSLayer1();
94 baseAnalysis->SetPointOnITSLayer2();
95 //baseAnalysis->SetPointOnITSLayer3();
96 //baseAnalysis->SetPointOnITSLayer4();
97 baseAnalysis->SetPointOnITSLayer5();
98 baseAnalysis->SetPointOnITSLayer6();
99 baseAnalysis->SetMinITSClusters(5);
100 baseAnalysis->SetITSRefit();
101 baseAnalysis->SetESDpid();
102 break;
103 default:
104 break;
105 }
106 baseAnalysis->SetAcceptedVertexDiamond(5.,5.,15.);
107 baseAnalysis->SetEtaMode();
108 switch(pidMode) {
109 case "Bayesian":
110 baseAnalysis->SetPIDMode(AliProtonAnalysisBase::kBayesian);
111 //Momentum dependent priors
87a55728 112 /*TFile *f = TFile::Open("$ALICE_ROOT/PWG2/data/PriorProbabilities.root ");
0ab648ea 113 TF1 *fitElectrons = (TF1 *)f->Get("fitElectrons");
114 TF1 *fitMuons = (TF1 *)f->Get("fitMuons");
115 TF1 *fitPions = (TF1 *)f->Get("fitPions");
116 TF1 *fitKaons = (TF1 *)f->Get("fitKaons");
117 TF1 *fitProtons = (TF1 *)f->Get("fitProtons");
118 baseAnalysis->SetPriorProbabilityFunctions(fitElectrons,
119 fitMuons,
120 fitPions,
121 fitKaons,
122 fitProtons);*/
123 //Fixed prior probabilities
124 Double_t partFrac[5] = {0.01, 0.01, 0.85, 0.10, 0.05};
125 if(!baseAnalysis->IsPriorProbabilityFunctionUsed())
126 baseAnalysis->SetPriorProbabilities(partFrac);
127 break;
128 case "Ratio":
129 baseAnalysis->SetPIDMode(AliProtonAnalysisBase::kRatio);
130 break;
87a55728 131 case "Sigma1":
132 baseAnalysis->SetPIDMode(AliProtonAnalysisBase::kSigma1);
133 baseAnalysis->SetNSigma(3);
134 baseAnalysis->SetdEdxBandInfo("$ALICE_ROOT/PWG2/data/protonsdEdxInfo.dat");
135 break;
136 case "Sigma2":
137 baseAnalysis->SetPIDMode(AliProtonAnalysisBase::kSigma2);
138 baseAnalysis->SetNSigma(3);
139 baseAnalysis->SetdEdxBandInfo("$ALICE_ROOT/PWG2/data/protonsdEdxInfo.dat");
0ab648ea 140 break;
141 default:
142 break;
143 }//PID mode
144 }//ESD
145 if(analysisLevel == "MC")
146 baseAnalysis->SetPhaseSpace(56, -1.0, 1.0, 16, 0.1, 1.5);
147
148 return baseAnalysis;
149}