]>
Commit | Line | Data |
---|---|---|
7b59a00b | 1 | #include "TChain.h" |
2 | #include "TTree.h" | |
3 | #include "TString.h" | |
4 | #include "TList.h" | |
5 | #include "TH2F.h" | |
6 | #include "TH1I.h" | |
7 | #include "TF1.h" | |
8 | #include "TCanvas.h" | |
9 | #include "TLorentzVector.h" | |
10 | ||
11 | #include "AliAnalysisTask.h" | |
12 | #include "AliAnalysisManager.h" | |
13 | ||
14 | #include "AliESDEvent.h" | |
15 | #include "AliESDInputHandler.h" | |
16 | #include "AliMCEventHandler.h" | |
17 | #include "AliMCEvent.h" | |
18 | #include "AliStack.h" | |
19 | ||
5ae0977e | 20 | #include "AliProtonQAAnalysis.h" |
7b59a00b | 21 | #include "AliAnalysisTaskProtonsQA.h" |
22 | ||
23 | // Analysis task used for the QA of the (anti)proton analysis | |
24 | // Author: Panos Cristakoglou | |
25 | ||
26 | ClassImp(AliAnalysisTaskProtonsQA) | |
27 | ||
28 | //________________________________________________________________________ | |
29 | AliAnalysisTaskProtonsQA::AliAnalysisTaskProtonsQA() | |
30 | : AliAnalysisTask(), fESD(0), fMC(0), | |
9c0b9f24 | 31 | fList0(0), fList1(0), fList2(0), fList3(0), fList4(0), fList5(0), |
d4733690 | 32 | fAnalysis(0) { |
7b59a00b | 33 | //Dummy constructor |
7b59a00b | 34 | } |
35 | ||
36 | //________________________________________________________________________ | |
37 | AliAnalysisTaskProtonsQA::AliAnalysisTaskProtonsQA(const char *name) | |
f99662ca | 38 | : AliAnalysisTask(name, ""), fESD(0), fMC(0), |
9c0b9f24 | 39 | fList0(0), fList1(0), fList2(0), fList3(0), fList4(0), fList5(0), |
d4733690 | 40 | fAnalysis(0) { |
7b59a00b | 41 | // Constructor |
42 | ||
43 | // Define input and output slots here | |
44 | // Input slot #0 works with a TChain | |
45 | DefineInput(0, TChain::Class()); | |
46 | // Output slot #0 writes into a TList container | |
47 | DefineOutput(0, TList::Class()); | |
d4733690 | 48 | DefineOutput(1, TList::Class()); |
49 | DefineOutput(2, TList::Class()); | |
5b8133c7 | 50 | DefineOutput(3, TList::Class()); |
51 | DefineOutput(4, TList::Class()); | |
9c0b9f24 | 52 | DefineOutput(5, TList::Class()); |
7b59a00b | 53 | } |
54 | ||
55 | //________________________________________________________________________ | |
56 | void AliAnalysisTaskProtonsQA::ConnectInputData(Option_t *) { | |
57 | // Connect ESD or AOD here | |
58 | // Called once | |
59 | ||
60 | TTree* tree = dynamic_cast<TTree*> (GetInputData(0)); | |
61 | if (!tree) { | |
62 | Printf("ERROR: Could not read chain from input slot 0"); | |
63 | } else { | |
7b59a00b | 64 | AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); |
65 | ||
66 | if (!esdH) { | |
67 | Printf("ERROR: Could not get ESDInputHandler"); | |
68 | } else | |
69 | fESD = esdH->GetEvent(); | |
70 | } | |
71 | ||
72 | AliMCEventHandler* mcH = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
73 | if (!mcH) { | |
74 | Printf("ERROR: Could not retrieve MC event handler"); | |
75 | } | |
76 | else | |
77 | fMC = mcH->MCEvent(); | |
78 | } | |
79 | ||
80 | //________________________________________________________________________ | |
81 | void AliAnalysisTaskProtonsQA::CreateOutputObjects() { | |
82 | // Create histograms | |
83 | // Called once | |
84 | //Prior probabilities | |
85 | Double_t partFrac[5] = {0.01, 0.01, 0.85, 0.10, 0.05}; | |
86 | ||
87 | //proton analysis object | |
3e6c06f4 | 88 | fAnalysis = new AliProtonQAAnalysis(); |
d4733690 | 89 | fAnalysis->SetRunMCAnalysis(); |
5ae0977e | 90 | fAnalysis->SetRunEfficiencyAnalysis(kTRUE,kTRUE); //kTRUE,kTRUE for eta-pT efficiencies and if the cuts should be used in the reco and pid efficiencies |
e13bbda6 | 91 | //fAnalysis->SetMCProcessId(13);//4: weak decay - 13: hadronic interaction |
5b8133c7 | 92 | //fAnalysis->SetMotherParticlePDGCode(3122);//3122: Lambda |
7b59a00b | 93 | |
3a954fe7 | 94 | //Use of TPConly tracks |
e13bbda6 | 95 | /*fAnalysis->SetQAYPtBins(10, -0.5, 0.5, 12, 0.5, 0.9); //TPC only |
7b59a00b | 96 | fAnalysis->UseTPCOnly(); |
5ae0977e | 97 | fAnalysis->SetTPCpid(); |
e13bbda6 | 98 | fAnalysis->SetMinTPCClusters(100); |
99 | fAnalysis->SetMaxChi2PerTPCCluster(2.2); | |
100 | fAnalysis->SetMaxCov11(0.5); | |
101 | fAnalysis->SetMaxCov22(0.5); | |
0326e385 | 102 | fAnalysis->SetMaxCov33(0.5); |
103 | fAnalysis->SetMaxCov44(0.5); | |
e13bbda6 | 104 | fAnalysis->SetMaxCov55(0.5); |
105 | //fAnalysis->SetMaxSigmaToVertexTPC(2.0); | |
106 | fAnalysis->SetMaxDCAXYTPC(1.5); | |
5ae0977e | 107 | fAnalysis->SetMaxDCAZTPC(1.5);*/ |
7b59a00b | 108 | |
0326e385 | 109 | //Use of HybridTPC tracks |
5ae0977e | 110 | fAnalysis->SetQAYPtBins(20, -1.0, 1.0, 26, 0.2, 1.5); //HybridTPC |
0326e385 | 111 | fAnalysis->UseHybridTPC(); |
5ae0977e | 112 | fAnalysis->SetTPCpid(); |
e13bbda6 | 113 | fAnalysis->SetMinTPCClusters(110); |
114 | fAnalysis->SetMaxChi2PerTPCCluster(2.2); | |
115 | fAnalysis->SetMaxCov11(0.5); | |
116 | fAnalysis->SetMaxCov22(0.5); | |
0326e385 | 117 | fAnalysis->SetMaxCov33(0.5); |
118 | fAnalysis->SetMaxCov44(0.5); | |
e13bbda6 | 119 | fAnalysis->SetMaxCov55(0.5); |
5ae0977e | 120 | fAnalysis->SetMaxSigmaToVertex(2.0); |
121 | //fAnalysis->SetMaxDCAXY(1.5); | |
122 | //fAnalysis->SetMaxDCAZ(1.5); | |
e13bbda6 | 123 | //fAnalysis->SetPointOnITSLayer6(); |
5ae0977e | 124 | //fAnalysis->SetPointOnITSLayer5(); |
125 | //fAnalysis->SetPointOnITSLayer4(); | |
126 | //fAnalysis->SetPointOnITSLayer3(); | |
127 | fAnalysis->SetPointOnITSLayer2(); | |
128 | fAnalysis->SetPointOnITSLayer1(); | |
e13bbda6 | 129 | fAnalysis->SetMinITSClusters(5); |
0326e385 | 130 | |
7b59a00b | 131 | //Combined tracking |
e13bbda6 | 132 | /*fAnalysis->SetQAYPtBins(10, -0.5, 0.5, 12, 0.5, 0.9); //HybridTPC |
133 | //fAnalysis->SetQAYPtBins(20, -1.0, 1.0, 27, 0.4, 3.1); //combined tracking | |
134 | fAnalysis->SetMinTPCClusters(110); | |
135 | fAnalysis->SetMaxChi2PerTPCCluster(2.2); | |
136 | fAnalysis->SetMaxCov11(0.5); | |
137 | fAnalysis->SetMaxCov22(0.5); | |
0326e385 | 138 | fAnalysis->SetMaxCov33(0.5); |
139 | fAnalysis->SetMaxCov44(0.5); | |
e13bbda6 | 140 | fAnalysis->SetMaxCov55(0.5); |
0326e385 | 141 | fAnalysis->SetMaxSigmaToVertex(2.0); |
142 | //fAnalysis->SetMaxDCAXY(2.0); | |
143 | //fAnalysis->SetMaxDCAZ(2.0); | |
144 | fAnalysis->SetTPCRefit(); | |
145 | fAnalysis->SetPointOnITSLayer1(); | |
146 | fAnalysis->SetPointOnITSLayer2(); | |
e13bbda6 | 147 | //fAnalysis->SetPointOnITSLayer3(); |
148 | //fAnalysis->SetPointOnITSLayer4(); | |
149 | //fAnalysis->SetPointOnITSLayer5(); | |
150 | //fAnalysis->SetPointOnITSLayer6(); | |
0326e385 | 151 | fAnalysis->SetMinITSClusters(1); |
152 | fAnalysis->SetITSRefit(); | |
153 | fAnalysis->SetESDpid();*/ | |
7b59a00b | 154 | |
155 | fAnalysis->SetPriorProbabilities(partFrac); | |
156 | ||
d4733690 | 157 | fList0 = new TList(); |
158 | fList0 = fAnalysis->GetGlobalQAList(); | |
159 | ||
160 | fList1 = new TList(); | |
161 | fList1 = fAnalysis->GetPDGList(); | |
162 | ||
163 | fList2 = new TList(); | |
164 | fList2 = fAnalysis->GetMCProcessesList(); | |
5b8133c7 | 165 | |
166 | fList3 = new TList(); | |
167 | fList3 = fAnalysis->GetAcceptedCutList(); | |
168 | ||
169 | fList4 = new TList(); | |
170 | fList4 = fAnalysis->GetAcceptedDCAList(); | |
9c0b9f24 | 171 | |
172 | fList5 = new TList(); | |
173 | fList5 = fAnalysis->GetEfficiencyQAList(); | |
7b59a00b | 174 | } |
175 | ||
176 | //________________________________________________________________________ | |
177 | void AliAnalysisTaskProtonsQA::Exec(Option_t *) { | |
178 | // Main loop | |
179 | // Called for each event | |
180 | ||
181 | if (!fESD) { | |
182 | Printf("ERROR: fESD not available"); | |
183 | return; | |
184 | } | |
185 | ||
186 | if (!fMC) { | |
187 | Printf("ERROR: Could not retrieve MC event"); | |
188 | return; | |
189 | } | |
190 | ||
191 | AliStack* stack = fMC->Stack(); | |
192 | if (!stack) { | |
193 | Printf("ERROR: Could not retrieve the stack"); | |
194 | return; | |
195 | } | |
196 | ||
9c0b9f24 | 197 | fAnalysis->RunQAAnalysis(stack, fESD); |
d4733690 | 198 | fAnalysis->RunMCAnalysis(stack); |
9c0b9f24 | 199 | fAnalysis->RunEfficiencyAnalysis(stack, fESD); |
d4733690 | 200 | |
7b59a00b | 201 | // Post output data. |
d4733690 | 202 | PostData(0, fList0); |
203 | PostData(1, fList1); | |
204 | PostData(2, fList2); | |
5b8133c7 | 205 | PostData(3, fList3); |
206 | PostData(4, fList4); | |
9c0b9f24 | 207 | PostData(5, fList5); |
7b59a00b | 208 | } |
209 | ||
210 | //________________________________________________________________________ | |
211 | void AliAnalysisTaskProtonsQA::Terminate(Option_t *) { | |
212 | // Draw result to the screen | |
213 | // Called once at the end of the query | |
214 | ||
d4733690 | 215 | fList0 = dynamic_cast<TList*> (GetOutputData(0)); |
216 | if (!fList0) { | |
7b59a00b | 217 | Printf("ERROR: fList not available"); |
218 | return; | |
219 | } | |
220 | } | |
221 | ||
222 |