Adding the possiblity to replay v0 online trigger, in the same way as it is done...
[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
67ebd013 25#ifndef ALIPWG4HIGHPTQATPCONLY_CXX
26#define ALIPWG4HIGHPTQATPCONLY_CXX
df943115 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"
67ebd013 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
67ebd013 204 fPtAllminPtTPCvsPtAllDCAR = new TH3F("fPtAllminPtTPCvsPtAllDCAR","PtAllminPtTPCvsPtAllDCAR",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-0.2,0.2);
fdceab34 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
67ebd013 210 fPtAllminPtTPCvsPtAllDCAZ = new TH3F("fPtAllminPtTPCvsPtAllDCAZ","PtAllminPtTPCvsPtAllDCAZ",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-2.,2.);
fdceab34 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
67ebd013 261 fPtITSminPtTPCvsPtITSDCAR = new TH3F("fPtITSminPtTPCvsPtITSDCAR","PtITSminPtTPCvsPtITSDCAR",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-0.2,0.2);
fdceab34 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
67ebd013 267 fPtITSminPtTPCvsPtITSDCAZ = new TH3F("fPtITSminPtTPCvsPtITSDCAZ","PtITSminPtTPCvsPtITSDCAZ",fgkNPtBins, fgkPtMin,fgkPtMax,fgkResPtBins,-1.,1.,80,-2.,2.);
fdceab34 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"));
67ebd013 324 // Post output data
325 PostData(0, fHistList);
326 PostData(1, fHistListTPC);
327 PostData(2, fHistListITS);
fdceab34 328 return;
329 }
330
67ebd013 331 Bool_t isSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
332 if(!isSelected) { //Select collison candidates
b5cc0c6d 333 AliDebug(2,Form(" Trigger Selection: event REJECTED ... "));
cd9a6fa2 334 // Post output data
67ebd013 335 PostData(0, fHistList);
336 PostData(1, fHistListTPC);
337 PostData(2, fHistListITS);
b5cc0c6d 338 return;
67ebd013 339 }
fdceab34 340
b5cc0c6d 341 const AliESDVertex *vtx = fESD->GetPrimaryVertexTracks();
fdceab34 342 // Need vertex cut
67ebd013 343 if (vtx->GetNContributors() < 2) {
344 // Post output data
345 PostData(0, fHistList);
346 PostData(1, fHistListTPC);
347 PostData(2, fHistListITS);
fdceab34 348 return;
67ebd013 349 }
fdceab34 350
df943115 351 AliDebug(2,Form("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors()));
b5cc0c6d 352 double primVtx[3];
353 vtx->GetXYZ(primVtx);
354 // printf("primVtx: %g %g %g \n",primVtx[0],primVtx[1],primVtx[2]);
67ebd013 355 if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){
cd9a6fa2 356 // Post output data
357 PostData(0, fHistList);
358 PostData(1, fHistListTPC);
359 PostData(2, fHistListITS);
360 return;
361 }
362 if(!fESD->GetNumberOfTracks() || fESD->GetNumberOfTracks()<2){
363 // Post output data
364 PostData(0, fHistList);
365 PostData(1, fHistListTPC);
366 PostData(2, fHistListITS);
367 return;
368 }
fdceab34 369 Int_t nTracks = fESD->GetNumberOfTracks();
b5cc0c6d 370 AliDebug(2,Form("nTracks %d\n", nTracks));
371
372 if(!fTrackCuts) return;
373
374 // Selected events for analysis
375 fNEventSel->Fill(0.);
df943115 376
fdceab34 377 for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
378
379 AliESDtrack *track = fESD->GetTrack(iTrack);
380 AliExternalTrackParam *trackTPC = (AliExternalTrackParam *)track->GetTPCInnerParam();
67ebd013 381 if(!track || !trackTPC) 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);
fdceab34 407 fPtSelTPC->Fill(ptTPC);
408 fPtAllminPtTPCvsPtAll->Fill(pt,(1./pt-1./ptTPC)/(1./pt) );
409 fPtAllminPtTPCvsPtAllNPointTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->GetTPCNcls());
410 fPtAllminPtTPCvsPtAllDCAR->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dca2D);
411 fPtAllminPtTPCvsPtAllDCAZ->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dcaZ);
412 fPtAllminPtTPCvsPtAllPhi->Fill(pt,(1./pt-1./ptTPC)/(1./pt),phi);
413 fPtAllminPtTPCvsPtAllNPointITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nPointITS);
414 fPtAllminPtTPCvsPtAllNSigmaToVertex->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nSigmaToVertex);
415 fPtAllminPtTPCvsPtAllChi2C->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2C);
416 fPtAllminPtTPCvsPtAllRel1PtUncertainty->Fill(pt,(1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt);
417 }//fTrackCuts selection
418
419
420 //ITSrefit selection
421 if (fTrackCutsITS->AcceptTrack(track)) {
422
423 fPtSelITS->Fill(pt);
424 fPtSelTPCITS->Fill(ptTPC);
425 fPtITSminPtTPCvsPtITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt) );
426 fPtITSminPtTPCvsPtITSNPointTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->GetTPCNcls());
427 fPtITSminPtTPCvsPtITSDCAR->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dca2D);
428 fPtITSminPtTPCvsPtITSDCAZ->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dcaZ);
429 fPtITSminPtTPCvsPtITSPhi->Fill(pt,(pt-ptTPC)/(pt),phi);
430 fPtITSminPtTPCvsPtITSNPointITS->Fill(pt,(pt-ptTPC)/(pt),nPointITS);
431 fPtITSminPtTPCvsPtITSNSigmaToVertex->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nSigmaToVertex);
432 fPtITSminPtTPCvsPtITSChi2C->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2C);
433 fPtITSminPtTPCvsPtITSRel1PtUncertainty->Fill(pt,(1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt);
434 }//fTrackCutsITS loop
435
67ebd013 436}//ESD track loop
fdceab34 437
438 // Post output data
439 PostData(0, fHistList);
440 PostData(1, fHistListTPC);
441 PostData(2, fHistListITS);
442
443}
444//________________________________________________________________________
445void AliPWG4HighPtQATPConly::Terminate(Option_t *)
446{
fdceab34 447
fdceab34 448}
df943115 449
450#endif