]>
Commit | Line | Data |
---|---|---|
fdceab34 | 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 | //----------------------------------------------------------------------- | |
17 | // This class compares the global reconstruction with the MC information | |
18 | // Momentum resolution is stored as function of track cuts and pt. | |
19 | // Output: Histograms for different set of cuts | |
20 | //----------------------------------------------------------------------- | |
21 | // Author : Marta Verweij - UU | |
22 | //----------------------------------------------------------------------- | |
23 | ||
df943115 | 24 | #ifndef ALIPWG4HighPtQAMC_CXX |
25 | #define ALIPWG4HighPtQAMC_CXX | |
26 | ||
fdceab34 | 27 | #include "AliPWG4HighPtQAMC.h" |
28 | ||
29 | #include "TH1.h" | |
30 | #include "TH2.h" | |
31 | #include "TH3.h" | |
32 | #include "TList.h" | |
33 | #include "TChain.h" | |
34 | #include "TH3F.h" | |
35 | #include "AliAnalysisManager.h" | |
36 | #include "AliESDInputHandler.h" | |
37 | #include "AliMCEvent.h" | |
38 | #include "AliMCEventHandler.h" | |
39 | #include "AliStack.h" | |
40 | #include "AliESDtrack.h" | |
41 | #include "AliESDtrackCuts.h" | |
42 | #include "AliExternalTrackParam.h" | |
df943115 | 43 | #include "AliLog.h" |
fdceab34 | 44 | |
45 | using namespace std; //required for resolving the 'cout' symbol | |
46 | ||
47 | ClassImp(AliPWG4HighPtQAMC) | |
48 | ||
49 | AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(): AliAnalysisTask("AliPWG4HighPtQAMC", ""), | |
50 | fESD(0), | |
b1cd0099 | 51 | fMC(0), |
fdceab34 | 52 | fTrackCuts(0), |
53 | fTrackCutsITS(0), | |
b1cd0099 | 54 | fPtMax(100.), |
8f0faa80 | 55 | fNEventAll(0), |
56 | fNEventSel(0), | |
df943115 | 57 | fPtAll(0), |
58 | fPtSel(0), | |
fdceab34 | 59 | fPtAllminPtMCvsPtAll(0), |
60 | fPtAllminPtMCvsPtAllNPointTPC(0), | |
61 | fPtAllminPtMCvsPtAllDCAR(0), | |
62 | fPtAllminPtMCvsPtAllDCAZ(0), | |
63 | fPtAllminPtMCvsPtAllPhi(0), | |
64 | fPtAllminPtMCvsPtAllNPointITS(0), | |
65 | fPtAllminPtMCvsPtAllNSigmaToVertex(0), | |
66 | fPtAllminPtMCvsPtAllChi2C(0), | |
67 | fPtAllminPtMCvsPtAllRel1PtUncertainty(0), | |
68 | fPtAllMC(0), | |
69 | fPtSelMC(0), | |
70 | fPtSelMCITS(0), | |
71 | fHistList(0), | |
72 | fPtSelITS(0), | |
73 | fPtITSminPtMCvsPtITS(0), | |
74 | fPtITSminPtMCvsPtITSNPointTPC(0), | |
75 | fPtITSminPtMCvsPtITSDCAR(0), | |
76 | fPtITSminPtMCvsPtITSDCAZ(0), | |
77 | fPtITSminPtMCvsPtITSPhi(0), | |
78 | fPtITSminPtMCvsPtITSNPointITS(0), | |
79 | fPtITSminPtMCvsPtITSNSigmaToVertex(0), | |
80 | fPtITSminPtMCvsPtITSChi2C(0), | |
81 | fPtITSminPtMCvsPtITSRel1PtUncertainty(0), | |
82 | fHistListITS(0) | |
83 | { | |
df943115 | 84 | |
fdceab34 | 85 | } |
86 | //________________________________________________________________________ | |
87 | AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(const char *name): | |
88 | AliAnalysisTask(name, ""), | |
89 | fESD(0), | |
b1cd0099 | 90 | fMC(0), |
fdceab34 | 91 | fTrackCuts(), |
92 | fTrackCutsITS(), | |
b1cd0099 | 93 | fPtMax(100.), |
8f0faa80 | 94 | fNEventAll(0), |
95 | fNEventSel(0), | |
df943115 | 96 | fPtAll(0), |
97 | fPtSel(0), | |
fdceab34 | 98 | fPtAllminPtMCvsPtAll(0), |
99 | fPtAllminPtMCvsPtAllNPointTPC(0), | |
100 | fPtAllminPtMCvsPtAllDCAR(0), | |
101 | fPtAllminPtMCvsPtAllDCAZ(0), | |
102 | fPtAllminPtMCvsPtAllPhi(0), | |
103 | fPtAllminPtMCvsPtAllNPointITS(0), | |
104 | fPtAllminPtMCvsPtAllNSigmaToVertex(0), | |
105 | fPtAllminPtMCvsPtAllChi2C(0), | |
106 | fPtAllminPtMCvsPtAllRel1PtUncertainty(0), | |
107 | fPtAllMC(0), | |
108 | fPtSelMC(0), | |
109 | fPtSelMCITS(0), | |
110 | fHistList(0), | |
111 | fPtSelITS(0), | |
112 | fPtITSminPtMCvsPtITS(0), | |
113 | fPtITSminPtMCvsPtITSNPointTPC(0), | |
114 | fPtITSminPtMCvsPtITSDCAR(0), | |
115 | fPtITSminPtMCvsPtITSDCAZ(0), | |
116 | fPtITSminPtMCvsPtITSPhi(0), | |
117 | fPtITSminPtMCvsPtITSNPointITS(0), | |
118 | fPtITSminPtMCvsPtITSNSigmaToVertex(0), | |
119 | fPtITSminPtMCvsPtITSChi2C(0), | |
120 | fPtITSminPtMCvsPtITSRel1PtUncertainty(0), | |
121 | fHistListITS(0) | |
122 | { | |
123 | // | |
124 | // Constructor. Initialization of Inputs and Outputs | |
125 | // | |
f51451be | 126 | AliDebug(2,Form("AliPWG4HighPtQAMC Calling Constructor")); |
fdceab34 | 127 | // Input slot #0 works with a TChain ESD |
128 | DefineInput(0, TChain::Class()); | |
129 | // Output slot #0 writes into a TList | |
130 | DefineOutput(0, TList::Class()); | |
131 | // Output slot #1 writes into a TList | |
132 | DefineOutput(1, TList::Class()); | |
133 | // Output slot #2 writes into a TList | |
134 | DefineOutput(2, TList::Class()); | |
df943115 | 135 | } |
fdceab34 | 136 | |
137 | //________________________________________________________________________ | |
138 | void AliPWG4HighPtQAMC::ConnectInputData(Option_t *) | |
139 | { | |
b1cd0099 | 140 | // Connect ESD and MC event handler here |
fdceab34 | 141 | // Called once |
df943115 | 142 | AliDebug(2,Form(">> AliPWG4HighPtSpectra::ConnectInputData \n")); |
fdceab34 | 143 | TTree* tree = dynamic_cast<TTree*> (GetInputData(0)); |
144 | if (!tree) { | |
b1cd0099 | 145 | AliDebug(2,Form( "ERROR: Could not read chain from input slot 0 \n")); |
146 | return; | |
fdceab34 | 147 | } |
b1cd0099 | 148 | |
149 | AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); | |
150 | ||
151 | if (!esdH) { | |
152 | AliDebug(2,Form("ERROR: Could not get ESDInputHandler")); | |
153 | return; | |
154 | } else | |
155 | fESD = esdH->GetEvent(); | |
156 | ||
157 | AliMCEventHandler *eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
158 | if (!eventHandler) { | |
159 | AliDebug(2,Form( "ERROR: Could not retrieve MC event handler \n")); | |
160 | } | |
161 | else | |
162 | fMC = eventHandler->MCEvent(); | |
163 | ||
fdceab34 | 164 | } |
165 | ||
fdceab34 | 166 | //________________________________________________________________________ |
167 | void AliPWG4HighPtQAMC::CreateOutputObjects() { | |
168 | //Create output objects | |
df943115 | 169 | AliDebug(2,Form(">> AliPWG4HighPtQATPConly::CreateOutputObjects \n")); |
170 | ||
171 | Bool_t oldStatus = TH1::AddDirectoryStatus(); | |
172 | TH1::AddDirectory(kFALSE); | |
173 | ||
fdceab34 | 174 | OpenFile(0); |
175 | fHistList = new TList(); | |
176 | OpenFile(1); | |
177 | fHistListITS = new TList(); | |
178 | ||
179 | Int_t fgkNPhiBins=18; | |
180 | Float_t kMinPhi = 0.; | |
181 | Float_t kMaxPhi = 2.*TMath::Pi(); | |
182 | ||
183 | Int_t fgkNPtBins=98; | |
184 | Float_t fgkPtMin=2.; | |
b1cd0099 | 185 | Float_t fgkPtMax=fPtMax; |
8f0faa80 | 186 | Int_t fgkResPtBins=80; |
fdceab34 | 187 | |
8f0faa80 | 188 | fNEventAll = new TH1F("fNEventAll","NEventAll",1,-0.5,0.5); |
189 | fHistList->Add(fNEventAll); | |
190 | fNEventSel = new TH1F("fNEventSel","NEvent Selected for analysis",1,-0.5,0.5); | |
191 | fHistList->Add(fNEventSel); | |
fdceab34 | 192 | fPtAll = new TH1F("fPtAll","PtAll",fgkNPtBins, fgkPtMin, fgkPtMax); |
193 | fHistList->Add(fPtAll); | |
194 | fPtSel = new TH1F("fPtSel","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax); | |
195 | fHistList->Add(fPtSel); | |
196 | ||
197 | fPtAllminPtMCvsPtAll = new TH2F("fPtAllminPtMCvsPtAll","PtAllminPtMCvsPtAll",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.); | |
198 | fPtAllminPtMCvsPtAll->SetXTitle("p_{t}^{MC}"); | |
199 | fPtAllminPtMCvsPtAll->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
200 | fHistList->Add(fPtAllminPtMCvsPtAll); | |
201 | ||
202 | fPtAllminPtMCvsPtAllNPointTPC = new TH3F("fPtAllminPtMCvsPtAllNPointTPC","PtAllminPtMCvsPtAllNPointTPC",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,160,0.5,160.5); | |
203 | fPtAllminPtMCvsPtAllNPointTPC->SetXTitle("p_{t}^{MC}"); | |
204 | fPtAllminPtMCvsPtAllNPointTPC->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
205 | fPtAllminPtMCvsPtAllNPointTPC->SetZTitle("N_{point,TPC}"); | |
206 | fHistList->Add(fPtAllminPtMCvsPtAllNPointTPC); | |
207 | ||
8f0faa80 | 208 | fPtAllminPtMCvsPtAllDCAR = new TH3F("fPtAllminPtMCvsPtAllDCAR","PtAllminPtMCvsPtAllDCAR",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-0.2,0.2); |
fdceab34 | 209 | fPtAllminPtMCvsPtAllDCAR->SetXTitle("p_{t}^{MC}"); |
210 | fPtAllminPtMCvsPtAllDCAR->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
211 | fPtAllminPtMCvsPtAllDCAR->SetZTitle("DCA_{R}"); | |
212 | fHistList->Add(fPtAllminPtMCvsPtAllDCAR); | |
213 | ||
8f0faa80 | 214 | fPtAllminPtMCvsPtAllDCAZ = new TH3F("fPtAllminPtMCvsPtAllDCAZ","PtAllminPtMCvsPtAllDCAZ",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-2.,2.); |
fdceab34 | 215 | fPtAllminPtMCvsPtAllDCAZ->SetXTitle("p_{t}^{MC}"); |
216 | fPtAllminPtMCvsPtAllDCAZ->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
217 | fPtAllminPtMCvsPtAllDCAZ->SetZTitle("DCA_{Z}"); | |
218 | fHistList->Add(fPtAllminPtMCvsPtAllDCAZ); | |
219 | ||
220 | fPtAllminPtMCvsPtAllPhi = new TH3F("fPtAllminPtMCvsPtAllPhi","PtAllminPtMCvsPtAllPhi",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,fgkNPhiBins,kMinPhi,kMaxPhi); | |
221 | fPtAllminPtMCvsPtAllPhi->SetXTitle("p_{t}^{MC}"); | |
222 | fPtAllminPtMCvsPtAllPhi->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
223 | fPtAllminPtMCvsPtAllPhi->SetZTitle("#phi"); | |
224 | fHistList->Add(fPtAllminPtMCvsPtAllPhi); | |
225 | ||
226 | fPtAllminPtMCvsPtAllNPointITS = new TH3F("fPtAllminPtMCvsPtAllNPointITS","PtAllminPtMCvsPtAllNPointITS",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,9,-0.5,8.5); | |
227 | fPtAllminPtMCvsPtAllNPointITS->SetXTitle("p_{t}^{MC}"); | |
228 | fPtAllminPtMCvsPtAllNPointITS->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
229 | fPtAllminPtMCvsPtAllNPointITS->SetZTitle("N_{point,ITS}}"); | |
230 | fHistList->Add(fPtAllminPtMCvsPtAllNPointITS); | |
231 | ||
232 | fPtAllminPtMCvsPtAllNSigmaToVertex = new TH3F("fPtAllminPtMCvsPtAllNSigmaToVertex","PtAllminPtMCvsPtAllNSigmaToVertex",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,40,0.,8.); | |
233 | fPtAllminPtMCvsPtAllNSigmaToVertex->SetXTitle("p_{t}^{MC}"); | |
234 | fPtAllminPtMCvsPtAllNSigmaToVertex->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
235 | fPtAllminPtMCvsPtAllNSigmaToVertex->SetZTitle("N#sigma to vertex"); | |
236 | fHistList->Add(fPtAllminPtMCvsPtAllNSigmaToVertex); | |
237 | ||
238 | fPtAllminPtMCvsPtAllChi2C = new TH3F("fPtAllminPtMCvsPtAllChi2C","PtAllminPtMCvsPtAllChi2C",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,20,0.,10.); | |
239 | fPtAllminPtMCvsPtAllChi2C->SetXTitle("p_{t}^{MC}"); | |
240 | fPtAllminPtMCvsPtAllChi2C->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
241 | fPtAllminPtMCvsPtAllChi2C->SetZTitle("Constrained #chi^{2}"); | |
242 | fHistList->Add(fPtAllminPtMCvsPtAllChi2C); | |
243 | ||
244 | fPtAllminPtMCvsPtAllRel1PtUncertainty = new TH3F("fPtAllminPtMCvsPtAllRel1PtUncertainty","PtAllminPtMCvsPtAllRel1PtUncertainty",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,30,0.,0.3); | |
245 | fPtAllminPtMCvsPtAllRel1PtUncertainty->SetXTitle("p_{t}^{MC}"); | |
246 | fPtAllminPtMCvsPtAllRel1PtUncertainty->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
247 | fPtAllminPtMCvsPtAllRel1PtUncertainty->SetZTitle("Rel1PtUncertainty"); | |
248 | fHistList->Add(fPtAllminPtMCvsPtAllRel1PtUncertainty); | |
249 | ||
250 | //ITSrefit | |
251 | fPtSelITS = new TH1F("fPtSelITSrefit","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax); | |
252 | fHistListITS->Add(fPtSelITS); | |
253 | ||
254 | fPtITSminPtMCvsPtITS = new TH2F("fPtITSminPtMCvsPtITS","PtITSminPtMCvsPtITS",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.); | |
255 | fPtITSminPtMCvsPtITS->SetXTitle("p_{t}^{MC}"); | |
256 | fPtITSminPtMCvsPtITS->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
257 | fHistListITS->Add(fPtITSminPtMCvsPtITS); | |
258 | ||
259 | fPtITSminPtMCvsPtITSNPointTPC = new TH3F("fPtITSminPtMCvsPtITSNPointTPC","PtITSminPtMCvsPtITSNPointTPC",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,160,0.5,160.5); | |
260 | fPtITSminPtMCvsPtITSNPointTPC->SetXTitle("p_{t}^{MC}"); | |
261 | fPtITSminPtMCvsPtITSNPointTPC->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
262 | fPtITSminPtMCvsPtITSNPointTPC->SetZTitle("N_{point,TPC}"); | |
263 | fHistListITS->Add(fPtITSminPtMCvsPtITSNPointTPC); | |
264 | ||
8f0faa80 | 265 | fPtITSminPtMCvsPtITSDCAR = new TH3F("fPtITSminPtMCvsPtITSDCAR","PtITSminPtMCvsPtITSDCAR",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-0.2,0.2); |
fdceab34 | 266 | fPtITSminPtMCvsPtITSDCAR->SetXTitle("p_{t}^{MC}"); |
267 | fPtITSminPtMCvsPtITSDCAR->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
268 | fPtITSminPtMCvsPtITSDCAR->SetZTitle("DCA_{R}"); | |
269 | fHistListITS->Add(fPtITSminPtMCvsPtITSDCAR); | |
270 | ||
8f0faa80 | 271 | fPtITSminPtMCvsPtITSDCAZ = new TH3F("fPtITSminPtMCvsPtITSDCAZ","PtITSminPtMCvsPtITSDCAZ",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-2.,2.); |
fdceab34 | 272 | fPtITSminPtMCvsPtITSDCAZ->SetXTitle("p_{t}^{MC}"); |
273 | fPtITSminPtMCvsPtITSDCAZ->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
274 | fPtITSminPtMCvsPtITSDCAZ->SetZTitle("DCA_{Z}"); | |
275 | fHistListITS->Add(fPtITSminPtMCvsPtITSDCAZ); | |
276 | ||
277 | fPtITSminPtMCvsPtITSPhi = new TH3F("fPtITSminPtMCvsPtITSPhi","PtITSminPtMCvsPtITSPhi",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,fgkNPhiBins,kMinPhi,kMaxPhi); | |
278 | fPtITSminPtMCvsPtITSPhi->SetXTitle("p_{t}^{MC}"); | |
279 | fPtITSminPtMCvsPtITSPhi->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
280 | fPtITSminPtMCvsPtITSPhi->SetZTitle("#phi"); | |
281 | fHistListITS->Add(fPtITSminPtMCvsPtITSPhi); | |
282 | ||
283 | fPtITSminPtMCvsPtITSNPointITS = new TH3F("fPtITSminPtMCvsPtITSNPointITS","PtITSminPtMCvsPtITSNPointITS",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,9,-0.5,8.5); | |
284 | fPtITSminPtMCvsPtITSNPointITS->SetXTitle("p_{t}^{MC}"); | |
285 | fPtITSminPtMCvsPtITSNPointITS->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})}"); | |
286 | fPtITSminPtMCvsPtITSNPointITS->SetZTitle("N_{point,ITS}}"); | |
287 | fHistListITS->Add(fPtITSminPtMCvsPtITSNPointITS); | |
288 | ||
289 | fPtITSminPtMCvsPtITSNSigmaToVertex = new TH3F("fPtITSminPtMCvsPtITSNSigmaToVertex","PtITSminPtMCvsPtITSNSigmaToVertex",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,40,0.,8.); | |
290 | fPtITSminPtMCvsPtITSNSigmaToVertex->SetXTitle("p_{t}^{MC}"); | |
291 | fPtITSminPtMCvsPtITSNSigmaToVertex->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
292 | fPtITSminPtMCvsPtITSNSigmaToVertex->SetZTitle("N#sigma to vertex"); | |
293 | fHistListITS->Add(fPtITSminPtMCvsPtITSNSigmaToVertex); | |
294 | ||
295 | fPtITSminPtMCvsPtITSChi2C = new TH3F("fPtITSminPtMCvsPtITSChi2C","PtITSminPtMCvsPtITSChi2C",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,20,0.,10.); | |
296 | fPtITSminPtMCvsPtITSChi2C->SetXTitle("p_{t}^{MC}"); | |
297 | fPtITSminPtMCvsPtITSChi2C->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
298 | fPtITSminPtMCvsPtITSChi2C->SetZTitle("Constrained #chi^{2}"); | |
299 | fHistListITS->Add(fPtITSminPtMCvsPtITSChi2C); | |
300 | ||
301 | fPtITSminPtMCvsPtITSRel1PtUncertainty = new TH3F("fPtITSminPtMCvsPtITSRel1PtUncertainty","PtITSminPtMCvsPtITSRel1PtUncertainty",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,30,0.,0.3); | |
302 | fPtITSminPtMCvsPtITSRel1PtUncertainty->SetXTitle("p_{t}^{MC}"); | |
303 | fPtITSminPtMCvsPtITSRel1PtUncertainty->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{MC})/(1/p_{t}^{MC})"); | |
304 | fPtITSminPtMCvsPtITSRel1PtUncertainty->SetZTitle("Rel1PtUncertainty"); | |
305 | fHistListITS->Add(fPtITSminPtMCvsPtITSRel1PtUncertainty); | |
306 | ||
307 | fPtAllMC = new TH1F("fPtAllMC","PtAll",fgkNPtBins, fgkPtMin, fgkPtMax); | |
308 | fHistList->Add(fPtAllMC); | |
309 | fPtSelMC = new TH1F("fPtSelMC","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax); | |
310 | fHistList->Add(fPtSelMC); | |
311 | fPtSelMCITS = new TH1F("fPtSelMCITS","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax); | |
312 | fHistList->Add(fPtSelMCITS); | |
313 | ||
df943115 | 314 | TH1::AddDirectory(oldStatus); |
315 | ||
fdceab34 | 316 | } |
317 | //________________________________________________________________________ | |
318 | void AliPWG4HighPtQAMC::Exec(Option_t *) { | |
319 | // Main loop | |
320 | // Called for each event | |
df943115 | 321 | AliDebug(2,Form(">> AliPWG4HighPtQATPConly::Exec \n")); |
8f0faa80 | 322 | // All events without selection |
323 | fNEventAll->Fill(0.); | |
324 | ||
fdceab34 | 325 | if (!fESD) { |
b1cd0099 | 326 | AliDebug(2,Form("ERROR: fESD not available\n")); |
8f0faa80 | 327 | PostData(0, fHistList); |
328 | PostData(1, fHistListITS); | |
fdceab34 | 329 | return; |
330 | } | |
331 | ||
bfd58011 | 332 | UInt_t isSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected(); |
333 | if(!(isSelected&AliVEvent::kMB)) { //Select collison candidates | |
8f0faa80 | 334 | AliDebug(2,Form(" Trigger Selection: event REJECTED ... ")); |
335 | // Post output data | |
336 | PostData(0, fHistList); | |
337 | PostData(1, fHistListITS); | |
338 | return; | |
339 | } | |
340 | ||
b1cd0099 | 341 | AliStack* stack = 0x0; |
342 | ||
343 | if(fMC) { | |
344 | AliDebug(2,Form("MC particles: %d", fMC->GetNumberOfTracks())); | |
345 | stack = fMC->Stack(); //Particles Stack | |
346 | AliDebug(2,Form("MC particles stack: %d", stack->GetNtrack())); | |
347 | } else { | |
348 | AliDebug(2,Form("ERROR: Could not retrieve MC eventHandler")); | |
8f0faa80 | 349 | PostData(0, fHistList); |
350 | PostData(1, fHistListITS); | |
fdceab34 | 351 | return; |
352 | } | |
353 | ||
fdceab34 | 354 | const AliESDVertex *vtx = fESD->GetPrimaryVertex(); |
fdceab34 | 355 | // Need vertex cut |
75946d5d | 356 | TString vtxName(vtx->GetName()); |
357 | if(vtx->GetNContributors() < 2 || (vtxName.Contains("TPCVertex")) ) { | |
358 | // SPD vertex | |
359 | vtx = fESD->GetPrimaryVertexSPD(); | |
360 | if(vtx->GetNContributors()<2) { | |
361 | vtx = 0x0; | |
362 | // Post output data | |
363 | PostData(0, fHistList); | |
364 | PostData(1, fHistListITS); | |
365 | return; | |
366 | } | |
8f0faa80 | 367 | } |
75946d5d | 368 | |
369 | double primVtx[3]; | |
8f0faa80 | 370 | vtx->GetXYZ(primVtx); |
8f0faa80 | 371 | if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){ |
372 | // Post output data | |
373 | PostData(0, fHistList); | |
374 | PostData(1, fHistListITS); | |
375 | return; | |
376 | } | |
df943115 | 377 | |
378 | AliDebug(2,Form("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors())); | |
fdceab34 | 379 | |
fdceab34 | 380 | // Need to keep track of evts without vertex |
8f0faa80 | 381 | fNEventSel->Fill(0.); |
382 | ||
383 | if(!fESD->GetNumberOfTracks() || fESD->GetNumberOfTracks()<2) { | |
384 | PostData(0, fHistList); | |
385 | PostData(1, fHistListITS); | |
386 | return; | |
387 | } | |
fdceab34 | 388 | |
fdceab34 | 389 | Int_t nTracks = fESD->GetNumberOfTracks(); |
b1cd0099 | 390 | AliDebug(2,Form("nTracks ESD%d", nTracks)); |
df943115 | 391 | |
cba109a0 | 392 | int nMCtracks = stack->GetNtrack(); |
393 | ||
fdceab34 | 394 | for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) { |
395 | ||
396 | AliESDtrack *track = fESD->GetTrack(iTrack); | |
397 | if(!track) continue; | |
398 | Int_t label = TMath::Abs(track->GetLabel()); | |
cba109a0 | 399 | if(label>=nMCtracks)continue; |
fdceab34 | 400 | TParticle *particle = stack->Particle(label) ; |
401 | if(!particle) continue; | |
402 | ||
403 | Float_t pt = track->Pt(); | |
404 | Float_t ptMC = particle->Pt(); | |
405 | Float_t phi = track->Phi(); | |
406 | Float_t dca2D, dcaZ; | |
407 | track->GetImpactParameters(dca2D,dcaZ); | |
408 | UChar_t itsMap = track->GetITSClusterMap(); | |
409 | Int_t nPointITS = 0; | |
410 | for (Int_t i=0; i < 6; i++) { | |
411 | if (itsMap & (1 << i)) | |
412 | nPointITS ++; | |
413 | } | |
414 | Float_t nSigmaToVertex = fTrackCuts->GetSigmaToVertex(track);// Calculates the number of sigma to the vertex for a track. | |
415 | Float_t chi2C = track->GetConstrainedChi2(); | |
416 | Float_t relUncertainty1Pt = TMath::Sqrt(track->GetSigma1Pt2())*pt; | |
417 | ||
418 | fPtAll->Fill(pt); | |
419 | fPtAllMC->Fill(ptMC); | |
420 | ||
421 | if (fTrackCuts->AcceptTrack(track)) { | |
422 | ||
423 | fPtSel->Fill(pt); | |
424 | ||
425 | fPtSelMC->Fill(ptMC); | |
426 | fPtAllminPtMCvsPtAll->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC) ); | |
427 | fPtAllminPtMCvsPtAllNPointTPC->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),track->GetTPCNcls()); | |
428 | fPtAllminPtMCvsPtAllDCAR->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),dca2D); | |
429 | fPtAllminPtMCvsPtAllDCAZ->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),dcaZ); | |
430 | fPtAllminPtMCvsPtAllPhi->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),phi); | |
431 | fPtAllminPtMCvsPtAllNPointITS->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),nPointITS); | |
432 | fPtAllminPtMCvsPtAllNSigmaToVertex->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),nSigmaToVertex); | |
433 | fPtAllminPtMCvsPtAllChi2C->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),chi2C); | |
434 | fPtAllminPtMCvsPtAllRel1PtUncertainty->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),relUncertainty1Pt); | |
435 | }//fTrackCuts selection | |
436 | ||
437 | ||
438 | //ITSrefit selection | |
439 | if (fTrackCutsITS->AcceptTrack(track)) { | |
440 | ||
441 | fPtSelITS->Fill(pt); | |
442 | fPtSelMCITS->Fill(ptMC); | |
443 | fPtITSminPtMCvsPtITS->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC) ); | |
444 | fPtITSminPtMCvsPtITSNPointTPC->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),track->GetTPCNcls()); | |
445 | fPtITSminPtMCvsPtITSDCAR->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),dca2D); | |
446 | fPtITSminPtMCvsPtITSDCAZ->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),dcaZ); | |
447 | fPtITSminPtMCvsPtITSPhi->Fill(ptMC,(pt-ptMC)/(pt),phi); | |
448 | fPtITSminPtMCvsPtITSNPointITS->Fill(ptMC,(pt-ptMC)/(pt),nPointITS); | |
449 | fPtITSminPtMCvsPtITSNSigmaToVertex->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),nSigmaToVertex); | |
450 | fPtITSminPtMCvsPtITSChi2C->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),chi2C); | |
451 | fPtITSminPtMCvsPtITSRel1PtUncertainty->Fill(ptMC,(1./pt-1./ptMC)/(1./ptMC),relUncertainty1Pt); | |
452 | }//fTrackCutsITS loop | |
453 | ||
454 | }//ESD track loop | |
455 | ||
456 | // Post output data | |
457 | PostData(0, fHistList); | |
458 | PostData(1, fHistListITS); | |
459 | ||
460 | } | |
461 | //________________________________________________________________________ | |
462 | void AliPWG4HighPtQAMC::Terminate(Option_t *) | |
463 | { | |
df943115 | 464 | // The Terminate() function is the last function to be called during |
465 | // a query. It always runs on the client, it can be used to present | |
466 | // the results graphically or save the results to file. | |
fdceab34 | 467 | |
fdceab34 | 468 | } |
df943115 | 469 | |
470 | #endif |