New book-keeping class
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliPWG4HighPtQATPConly.cxx
CommitLineData
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 TPConly
18// reconstruction
19// Momentum resolution is stored as function of track cuts and pt.
20// Output: Histograms for different set of cuts
21//-----------------------------------------------------------------------
22// Author : Marta Verweij - UU
23//-----------------------------------------------------------------------
24
df943115 25#ifndef ALIPWG4HighPtQATPCONLY_CXX
26#define ALIPWG4HighPtQATPCONLY_CXX
27
fdceab34 28#include "AliPWG4HighPtQATPConly.h"
29
b5cc0c6d 30#include "TVector3.h"
31#include <iostream>
fdceab34 32#include "TH1.h"
33#include "TH2.h"
34#include "TH3.h"
35#include "TList.h"
36#include "TChain.h"
37#include "TH3F.h"
b5cc0c6d 38
fdceab34 39#include "AliAnalysisManager.h"
40#include "AliESDInputHandler.h"
41#include "AliESDtrack.h"
42#include "AliESDtrackCuts.h"
43#include "AliExternalTrackParam.h"
df943115 44#include "AliLog.h"
b5cc0c6d 45#include "AliAnalysisHelperJetTasks.h"
fdceab34 46
47using namespace std; //required for resolving the 'cout' symbol
48
49ClassImp(AliPWG4HighPtQATPConly)
50
51AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(): AliAnalysisTask("AliPWG4HighPtQATPConly", ""),
52 fESD(0),
53 fTrackCuts(0),
54 fTrackCutsITS(0),
b5cc0c6d 55 fTrigger(0),
56 fNEventAll(0),
57 fNEventSel(0),
df943115 58 fPtAll(0),
59 fPtSel(0),
fdceab34 60 fPtAllminPtTPCvsPtAll(0),
61 fPtAllminPtTPCvsPtAllNPointTPC(0),
62 fPtAllminPtTPCvsPtAllDCAR(0),
63 fPtAllminPtTPCvsPtAllDCAZ(0),
64 fPtAllminPtTPCvsPtAllPhi(0),
65 fPtAllminPtTPCvsPtAllNPointITS(0),
66 fPtAllminPtTPCvsPtAllNSigmaToVertex(0),
67 fPtAllminPtTPCvsPtAllChi2C(0),
68 fPtAllminPtTPCvsPtAllRel1PtUncertainty(0),
69 fHistList(0),
70 fPtAllTPC(0),
71 fPtSelTPC(0),
72 fPtSelTPCITS(0),
73 fHistListTPC(0),
74 fPtSelITS(0),
75 fPtITSminPtTPCvsPtITS(0),
76 fPtITSminPtTPCvsPtITSNPointTPC(0),
77 fPtITSminPtTPCvsPtITSDCAR(0),
78 fPtITSminPtTPCvsPtITSDCAZ(0),
79 fPtITSminPtTPCvsPtITSPhi(0),
80 fPtITSminPtTPCvsPtITSNPointITS(0),
81 fPtITSminPtTPCvsPtITSNSigmaToVertex(0),
82 fPtITSminPtTPCvsPtITSChi2C(0),
83 fPtITSminPtTPCvsPtITSRel1PtUncertainty(0),
84 fHistListITS(0)
85{
df943115 86
fdceab34 87}
88//________________________________________________________________________
89AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(const char *name):
90 AliAnalysisTask(name, ""),
91 fESD(0),
92 fTrackCuts(),
93 fTrackCutsITS(),
b5cc0c6d 94 fTrigger(0),
95 fNEventAll(0),
96 fNEventSel(0),
df943115 97 fPtAll(0),
98 fPtSel(0),
fdceab34 99 fPtAllminPtTPCvsPtAll(0),
100 fPtAllminPtTPCvsPtAllNPointTPC(0),
101 fPtAllminPtTPCvsPtAllDCAR(0),
102 fPtAllminPtTPCvsPtAllDCAZ(0),
103 fPtAllminPtTPCvsPtAllPhi(0),
104 fPtAllminPtTPCvsPtAllNPointITS(0),
105 fPtAllminPtTPCvsPtAllNSigmaToVertex(0),
106 fPtAllminPtTPCvsPtAllChi2C(0),
107 fPtAllminPtTPCvsPtAllRel1PtUncertainty(0),
108 fHistList(0),
109 fPtAllTPC(0),
110 fPtSelTPC(0),
111 fPtSelTPCITS(0),
112 fHistListTPC(0),
113 fPtSelITS(0),
114 fPtITSminPtTPCvsPtITS(0),
115 fPtITSminPtTPCvsPtITSNPointTPC(0),
116 fPtITSminPtTPCvsPtITSDCAR(0),
117 fPtITSminPtTPCvsPtITSDCAZ(0),
118 fPtITSminPtTPCvsPtITSPhi(0),
119 fPtITSminPtTPCvsPtITSNPointITS(0),
120 fPtITSminPtTPCvsPtITSNSigmaToVertex(0),
121 fPtITSminPtTPCvsPtITSChi2C(0),
122 fPtITSminPtTPCvsPtITSRel1PtUncertainty(0),
123 fHistListITS(0)
124{
125 //
126 // Constructor. Initialization of Inputs and Outputs
127 //
128 Info("AliPWG4HighPtQATPConly","Calling Constructor");
129 // Input slot #0 works with a TChain ESD
130 DefineInput(0, TChain::Class());
131 // Output slot #0 writes into a TList
132 DefineOutput(0, TList::Class());
133 // Output slot #1 writes into a TList
134 DefineOutput(1, TList::Class());
135 // Output slot #2 writes into a TList
136 DefineOutput(2, TList::Class());
df943115 137}
fdceab34 138
139//________________________________________________________________________
140void AliPWG4HighPtQATPConly::ConnectInputData(Option_t *)
141{
142 // Connect ESD here
143 // Called once
df943115 144 AliDebug(2,Form(">> AliPWG4HighPtSpectra::ConnectInputData \n"));
fdceab34 145 TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
146 if (!tree) {
147 Printf("ERROR: Could not read chain from input slot 0");
148 } else {
149
150 AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
151
152 if (!esdH) {
df943115 153 AliDebug(2,Form("ERROR: Could not get ESDInputHandler"));
b5cc0c6d 154 } else {
fdceab34 155 fESD = esdH->GetEvent();
b5cc0c6d 156 }
fdceab34 157 }
158}
159
160//________________________________________________________________________
fdceab34 161void AliPWG4HighPtQATPConly::CreateOutputObjects() {
162 //Create output objects
df943115 163 AliDebug(2,Form(">> AliPWG4HighPtQATPConly::CreateOutputObjects \n"));
164
165 Bool_t oldStatus = TH1::AddDirectoryStatus();
166 TH1::AddDirectory(kFALSE);
167
fdceab34 168 OpenFile(0);
169 fHistList = new TList();
170 OpenFile(1);
171 fHistListTPC = new TList();
172 OpenFile(2);
173 fHistListITS = new TList();
174
175 Int_t fgkNPhiBins=18;
176 Float_t kMinPhi = 0.;
177 Float_t kMaxPhi = 2.*TMath::Pi();
178
179 Int_t fgkNPtBins=98;
180 Float_t fgkPtMin=2.;
181 Float_t fgkPtMax=100.;
b5cc0c6d 182 Int_t fgkResPtBins=80;
fdceab34 183
b5cc0c6d 184 fNEventAll = new TH1F("fNEventAll","NEventAll",1,-0.5,0.5);
185 fHistList->Add(fNEventAll);
186 fNEventSel = new TH1F("fNEventSel","NEvent Selected for analysis",1,-0.5,0.5);
187 fHistList->Add(fNEventSel);
fdceab34 188 fPtAll = new TH1F("fPtAll","PtAll",fgkNPtBins, fgkPtMin, fgkPtMax);
189 fHistList->Add(fPtAll);
190 fPtSel = new TH1F("fPtSel","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax);
191 fHistList->Add(fPtSel);
192
193 fPtAllminPtTPCvsPtAll = new TH2F("fPtAllminPtTPCvsPtAll","PtAllminPtTPCvsPtAll",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.);
194 fPtAllminPtTPCvsPtAll->SetXTitle("p_{t}^{All}");
195 fPtAllminPtTPCvsPtAll->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
196 fHistList->Add(fPtAllminPtTPCvsPtAll);
197
198 fPtAllminPtTPCvsPtAllNPointTPC = new TH3F("fPtAllminPtTPCvsPtAllNPointTPC","PtAllminPtTPCvsPtAllNPointTPC",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,160,0.5,160.5);
199 fPtAllminPtTPCvsPtAllNPointTPC->SetXTitle("p_{t}^{All}");
200 fPtAllminPtTPCvsPtAllNPointTPC->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
201 fPtAllminPtTPCvsPtAllNPointTPC->SetZTitle("N_{point,TPC}");
202 fHistList->Add(fPtAllminPtTPCvsPtAllNPointTPC);
203
204 fPtAllminPtTPCvsPtAllDCAR = new TH3F("fPtAllminPtTPCvsPtAllDCAR","PtAllminPtTPCvsPtAllDCAR",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,20,-1.,1.);
205 fPtAllminPtTPCvsPtAllDCAR->SetXTitle("p_{t}^{All}");
206 fPtAllminPtTPCvsPtAllDCAR->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
207 fPtAllminPtTPCvsPtAllDCAR->SetZTitle("DCA_{R}");
208 fHistList->Add(fPtAllminPtTPCvsPtAllDCAR);
209
210 fPtAllminPtTPCvsPtAllDCAZ = new TH3F("fPtAllminPtTPCvsPtAllDCAZ","PtAllminPtTPCvsPtAllDCAZ",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,40,-2.,2.);
211 fPtAllminPtTPCvsPtAllDCAZ->SetXTitle("p_{t}^{All}");
212 fPtAllminPtTPCvsPtAllDCAZ->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
213 fPtAllminPtTPCvsPtAllDCAZ->SetZTitle("DCA_{Z}");
214 fHistList->Add(fPtAllminPtTPCvsPtAllDCAZ);
215
216 fPtAllminPtTPCvsPtAllPhi = new TH3F("fPtAllminPtTPCvsPtAllPhi","PtAllminPtTPCvsPtAllPhi",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,fgkNPhiBins,kMinPhi,kMaxPhi);
217 fPtAllminPtTPCvsPtAllPhi->SetXTitle("p_{t}^{All}");
218 fPtAllminPtTPCvsPtAllPhi->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
219 fPtAllminPtTPCvsPtAllPhi->SetZTitle("#phi");
220 fHistList->Add(fPtAllminPtTPCvsPtAllPhi);
221
222 fPtAllminPtTPCvsPtAllNPointITS = new TH3F("fPtAllminPtTPCvsPtAllNPointITS","PtAllminPtTPCvsPtAllNPointITS",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,9,-0.5,8.5);
223 fPtAllminPtTPCvsPtAllNPointITS->SetXTitle("p_{t}^{All}");
224 fPtAllminPtTPCvsPtAllNPointITS->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
225 fPtAllminPtTPCvsPtAllNPointITS->SetZTitle("N_{point,ITS}}");
226 fHistList->Add(fPtAllminPtTPCvsPtAllNPointITS);
227
228 fPtAllminPtTPCvsPtAllNSigmaToVertex = new TH3F("fPtAllminPtTPCvsPtAllNSigmaToVertex","PtAllminPtTPCvsPtAllNSigmaToVertex",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,40,0.,8.);
229 fPtAllminPtTPCvsPtAllNSigmaToVertex->SetXTitle("p_{t}^{All}");
230 fPtAllminPtTPCvsPtAllNSigmaToVertex->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
231 fPtAllminPtTPCvsPtAllNSigmaToVertex->SetZTitle("N#sigma to vertex");
232 fHistList->Add(fPtAllminPtTPCvsPtAllNSigmaToVertex);
233
234 fPtAllminPtTPCvsPtAllChi2C = new TH3F("fPtAllminPtTPCvsPtAllChi2C","PtAllminPtTPCvsPtAllChi2C",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,20,0.,10.);
235 fPtAllminPtTPCvsPtAllChi2C->SetXTitle("p_{t}^{All}");
236 fPtAllminPtTPCvsPtAllChi2C->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
237 fPtAllminPtTPCvsPtAllChi2C->SetZTitle("Constrained #chi^{2}");
238 fHistList->Add(fPtAllminPtTPCvsPtAllChi2C);
239
240 fPtAllminPtTPCvsPtAllRel1PtUncertainty = new TH3F("fPtAllminPtTPCvsPtAllRel1PtUncertainty","PtAllminPtTPCvsPtAllRel1PtUncertainty",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,30,0.,0.3);
241 fPtAllminPtTPCvsPtAllRel1PtUncertainty->SetXTitle("p_{t}^{All}");
242 fPtAllminPtTPCvsPtAllRel1PtUncertainty->SetYTitle("(1/p_{t}^{All}-1/p_{t}^{TPC})/(1/p_{t}^{All})");
243 fPtAllminPtTPCvsPtAllRel1PtUncertainty->SetZTitle("Rel1PtUncertainty");
244 fHistList->Add(fPtAllminPtTPCvsPtAllRel1PtUncertainty);
245
246 //ITSrefit
247 fPtSelITS = new TH1F("fPtSelITSrefit","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax);
248 fHistListITS->Add(fPtSelITS);
249
250 fPtITSminPtTPCvsPtITS = new TH2F("fPtITSminPtTPCvsPtITS","PtITSminPtTPCvsPtITS",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.);
251 fPtITSminPtTPCvsPtITS->SetXTitle("p_{t}^{ITS}");
252 fPtITSminPtTPCvsPtITS->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{TPC})/(1/p_{t}^{ITS})");
253 fHistListITS->Add(fPtITSminPtTPCvsPtITS);
254
255 fPtITSminPtTPCvsPtITSNPointTPC = new TH3F("fPtITSminPtTPCvsPtITSNPointTPC","PtITSminPtTPCvsPtITSNPointTPC",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,160,0.5,160.5);
256 fPtITSminPtTPCvsPtITSNPointTPC->SetXTitle("p_{t}^{ITSrefit}");
257 fPtITSminPtTPCvsPtITSNPointTPC->SetYTitle("(1/p_{t}^{ITSrefit}-1/p_{t}^{TPC})/(1/p_{t}^{ITSrefit})");
258 fPtITSminPtTPCvsPtITSNPointTPC->SetZTitle("N_{point,TPC}");
259 fHistListITS->Add(fPtITSminPtTPCvsPtITSNPointTPC);
260
261 fPtITSminPtTPCvsPtITSDCAR = new TH3F("fPtITSminPtTPCvsPtITSDCAR","PtITSminPtTPCvsPtITSDCAR",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,20,-1.,1.);
262 fPtITSminPtTPCvsPtITSDCAR->SetXTitle("p_{t}^{ITSrefit}");
263 fPtITSminPtTPCvsPtITSDCAR->SetYTitle("(1/p_{t}^{ITSrefit}-1/p_{t}^{TPC})/(1/p_{t}^{ITSrefit})");
264 fPtITSminPtTPCvsPtITSDCAR->SetZTitle("DCA_{R}");
265 fHistListITS->Add(fPtITSminPtTPCvsPtITSDCAR);
266
267 fPtITSminPtTPCvsPtITSDCAZ = new TH3F("fPtITSminPtTPCvsPtITSDCAZ","PtITSminPtTPCvsPtITSDCAZ",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,40,-2.,2.);
268 fPtITSminPtTPCvsPtITSDCAZ->SetXTitle("p_{t}^{ITSrefit}");
269 fPtITSminPtTPCvsPtITSDCAZ->SetYTitle("(1/p_{t}^{ITSrefit}-1/p_{t}^{TPC})/(1/p_{t}^{ITSrefit})");
270 fPtITSminPtTPCvsPtITSDCAZ->SetZTitle("DCA_{Z}");
271 fHistListITS->Add(fPtITSminPtTPCvsPtITSDCAZ);
272
273 fPtITSminPtTPCvsPtITSPhi = new TH3F("fPtITSminPtTPCvsPtITSPhi","PtITSminPtTPCvsPtITSPhi",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,fgkNPhiBins,kMinPhi,kMaxPhi);
274 fPtITSminPtTPCvsPtITSPhi->SetXTitle("p_{t}^{ITSrefit}");
275 fPtITSminPtTPCvsPtITSPhi->SetYTitle("(1/p_{t}^{ITSrefit}-1/p_{t}^{TPC})/(1/p_{t}^{ITSrefit})");
276 fPtITSminPtTPCvsPtITSPhi->SetZTitle("#phi");
277 fHistListITS->Add(fPtITSminPtTPCvsPtITSPhi);
278
279 fPtITSminPtTPCvsPtITSNPointITS = new TH3F("fPtITSminPtTPCvsPtITSNPointITS","PtITSminPtTPCvsPtITSNPointITS",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,9,-0.5,8.5);
280 fPtITSminPtTPCvsPtITSNPointITS->SetXTitle("p_{t}^{ITSrefit}");
281 fPtITSminPtTPCvsPtITSNPointITS->SetYTitle("(1/p_{t}^{ITSrefit}-1/p_{t}^{TPC})/(1/p_{t}^{ITSrefit})");
282 fPtITSminPtTPCvsPtITSNPointITS->SetZTitle("N_{point,ITS}}");
283 fHistListITS->Add(fPtITSminPtTPCvsPtITSNPointITS);
284
285 fPtITSminPtTPCvsPtITSNSigmaToVertex = new TH3F("fPtITSminPtTPCvsPtITSNSigmaToVertex","PtITSminPtTPCvsPtITSNSigmaToVertex",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,40,0.,8.);
286 fPtITSminPtTPCvsPtITSNSigmaToVertex->SetXTitle("p_{t}^{ITS}");
287 fPtITSminPtTPCvsPtITSNSigmaToVertex->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{TPC})/(1/p_{t}^{ITS})");
288 fPtITSminPtTPCvsPtITSNSigmaToVertex->SetZTitle("N#sigma to vertex");
289 fHistListITS->Add(fPtITSminPtTPCvsPtITSNSigmaToVertex);
290
291 fPtITSminPtTPCvsPtITSChi2C = new TH3F("fPtITSminPtTPCvsPtITSChi2C","PtITSminPtTPCvsPtITSChi2C",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,20,0.,10.);
292 fPtITSminPtTPCvsPtITSChi2C->SetXTitle("p_{t}^{ITS}");
293 fPtITSminPtTPCvsPtITSChi2C->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{TPC})/(1/p_{t}^{ITS})");
294 fPtITSminPtTPCvsPtITSChi2C->SetZTitle("Constrained #chi^{2}");
295 fHistListITS->Add(fPtITSminPtTPCvsPtITSChi2C);
296
297 fPtITSminPtTPCvsPtITSRel1PtUncertainty = new TH3F("fPtITSminPtTPCvsPtITSRel1PtUncertainty","PtITSminPtTPCvsPtITSRel1PtUncertainty",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,30,0.,0.3);
298 fPtITSminPtTPCvsPtITSRel1PtUncertainty->SetXTitle("p_{t}^{ITS}");
299 fPtITSminPtTPCvsPtITSRel1PtUncertainty->SetYTitle("(1/p_{t}^{ITS}-1/p_{t}^{TPC})/(1/p_{t}^{ITS})");
300 fPtITSminPtTPCvsPtITSRel1PtUncertainty->SetZTitle("Rel1PtUncertainty");
301 fHistListITS->Add(fPtITSminPtTPCvsPtITSRel1PtUncertainty);
302
303 fPtAllTPC = new TH1F("fPtAllTPC","PtAll",fgkNPtBins, fgkPtMin, fgkPtMax);
304 fHistListTPC->Add(fPtAllTPC);
305 fPtSelTPC = new TH1F("fPtSelTPC","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax);
306 fHistListTPC->Add(fPtSelTPC);
307 fPtSelTPCITS = new TH1F("fPtSelTPCITS","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax);
308 fHistListTPC->Add(fPtSelTPCITS);
df943115 309
310 TH1::AddDirectory(oldStatus);
311
fdceab34 312}
313//________________________________________________________________________
314void AliPWG4HighPtQATPConly::Exec(Option_t *) {
315 // Main loop
316 // Called for each event
df943115 317 AliDebug(2,Form(">> AliPWG4HighPtQATPConly::Exec \n"));
318
b5cc0c6d 319 // All events without selection
b5cc0c6d 320 fNEventAll->Fill(0.);
321
df943115 322 if (!fESD) {
323 AliDebug(2,Form("ERROR: fESD not available"));
fdceab34 324 return;
325 }
326
b5cc0c6d 327 //Trigger selection
328 AliAnalysisHelperJetTasks::Trigger trig;
cd9a6fa2 329 trig = (AliAnalysisHelperJetTasks::Trigger)fTrigger;
b5cc0c6d 330 if (AliAnalysisHelperJetTasks::IsTriggerFired(fESD,trig)){
331 AliDebug(2,Form(" Trigger Selection: event ACCEPTED ... "));
332 }else{
333 AliDebug(2,Form(" Trigger Selection: event REJECTED ... "));
cd9a6fa2 334 // Post output data
335 PostData(0, fHistList);
336 PostData(1, fHistListTPC);
337 PostData(2, fHistListITS);
b5cc0c6d 338 return;
339 }
fdceab34 340
b5cc0c6d 341// if(!fESD->IsTriggerClassFired("CINT1B-ABCE-NOPF-ALL") || !fESD->IsTriggerClassFired("CSMBB-ABCE-NOPF-ALL")) return;
342
343 const AliESDVertex *vtx = fESD->GetPrimaryVertexTracks();
fdceab34 344 // Need vertex cut
345 if (vtx->GetNContributors() < 2)
346 return;
347
df943115 348 AliDebug(2,Form("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors()));
b5cc0c6d 349 double primVtx[3];
350 vtx->GetXYZ(primVtx);
351 // printf("primVtx: %g %g %g \n",primVtx[0],primVtx[1],primVtx[2]);
cd9a6fa2 352 if(TMath::Abs(primVtx[0]>1.) || TMath::Abs(primVtx[1]>1.) || TMath::Abs(primVtx[2])>10.){
353 // Post output data
354 PostData(0, fHistList);
355 PostData(1, fHistListTPC);
356 PostData(2, fHistListITS);
357 return;
358 }
359 if(!fESD->GetNumberOfTracks() || fESD->GetNumberOfTracks()<2){
360 // Post output data
361 PostData(0, fHistList);
362 PostData(1, fHistListTPC);
363 PostData(2, fHistListITS);
364 return;
365 }
fdceab34 366 Int_t nTracks = fESD->GetNumberOfTracks();
b5cc0c6d 367 AliDebug(2,Form("nTracks %d\n", nTracks));
368
369 if(!fTrackCuts) return;
370
371 // Selected events for analysis
372 fNEventSel->Fill(0.);
df943115 373
fdceab34 374 for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
375
376 AliESDtrack *track = fESD->GetTrack(iTrack);
377 AliExternalTrackParam *trackTPC = (AliExternalTrackParam *)track->GetTPCInnerParam();
b5cc0c6d 378 // AliESDtrack *trackTPConly = fTrackCuts->GetTPCOnlyTrack(fESD,iTrack);
379 if(!track) continue;
380 if(!trackTPC) continue;
381// if(!trackTPConly) continue;
fdceab34 382 Float_t pt = track->Pt();
383 Float_t ptTPC = trackTPC->Pt();
384 Float_t phi = track->Phi();
385 Float_t dca2D, dcaZ;
386 track->GetImpactParameters(dca2D,dcaZ);
387 // Float_t dca2DTPC, dcaZTPC;
388 //track->GetImpactParametersTPC(dca2DTPC,dcaZTPC);
389 UChar_t itsMap = track->GetITSClusterMap();
390 Int_t nPointITS = 0;
391 for (Int_t i=0; i < 6; i++) {
392 if (itsMap & (1 << i))
393 nPointITS ++;
394 }
b5cc0c6d 395 double mom[3];
396 track->GetPxPyPz(mom);
fdceab34 397 Float_t nSigmaToVertex = fTrackCuts->GetSigmaToVertex(track);// Calculates the number of sigma to the vertex for a track.
398 Float_t chi2C = track->GetConstrainedChi2();
b5cc0c6d 399 Float_t relUncertainty1Pt = TMath::Sqrt(TMath::Abs(track->GetSigma1Pt2()))*pt;
fdceab34 400
401 fPtAll->Fill(pt);
402 fPtAllTPC->Fill(ptTPC);
403
404 if (fTrackCuts->AcceptTrack(track)) {
405
406 fPtSel->Fill(pt);
407
408 fPtSelTPC->Fill(ptTPC);
409 fPtAllminPtTPCvsPtAll->Fill(pt,(1./pt-1./ptTPC)/(1./pt) );
410 fPtAllminPtTPCvsPtAllNPointTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->GetTPCNcls());
411 fPtAllminPtTPCvsPtAllDCAR->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dca2D);
412 fPtAllminPtTPCvsPtAllDCAZ->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dcaZ);
413 fPtAllminPtTPCvsPtAllPhi->Fill(pt,(1./pt-1./ptTPC)/(1./pt),phi);
414 fPtAllminPtTPCvsPtAllNPointITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nPointITS);
415 fPtAllminPtTPCvsPtAllNSigmaToVertex->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nSigmaToVertex);
416 fPtAllminPtTPCvsPtAllChi2C->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2C);
417 fPtAllminPtTPCvsPtAllRel1PtUncertainty->Fill(pt,(1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt);
418 }//fTrackCuts selection
419
420
421 //ITSrefit selection
422 if (fTrackCutsITS->AcceptTrack(track)) {
423
424 fPtSelITS->Fill(pt);
425 fPtSelTPCITS->Fill(ptTPC);
426 fPtITSminPtTPCvsPtITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt) );
427 fPtITSminPtTPCvsPtITSNPointTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->GetTPCNcls());
428 fPtITSminPtTPCvsPtITSDCAR->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dca2D);
429 fPtITSminPtTPCvsPtITSDCAZ->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dcaZ);
430 fPtITSminPtTPCvsPtITSPhi->Fill(pt,(pt-ptTPC)/(pt),phi);
431 fPtITSminPtTPCvsPtITSNPointITS->Fill(pt,(pt-ptTPC)/(pt),nPointITS);
432 fPtITSminPtTPCvsPtITSNSigmaToVertex->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nSigmaToVertex);
433 fPtITSminPtTPCvsPtITSChi2C->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2C);
434 fPtITSminPtTPCvsPtITSRel1PtUncertainty->Fill(pt,(1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt);
435 }//fTrackCutsITS loop
436
437 }//ESD track loop
438
439 // Post output data
440 PostData(0, fHistList);
441 PostData(1, fHistListTPC);
442 PostData(2, fHistListITS);
443
444}
445//________________________________________________________________________
446void AliPWG4HighPtQATPConly::Terminate(Option_t *)
447{
fdceab34 448
fdceab34 449}
df943115 450
451#endif