]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/JetTasks/AliPWG4HighPtTrackQA.cxx
code migration for pi/K/p spectra analysis in ITSsa
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliPWG4HighPtTrackQA.cxx
CommitLineData
d756027f 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 stores QA variables as function of pT for different type
18// of tracks and track selection criteria
19// Output: Histograms for different set of cuts
20//-----------------------------------------------------------------------
21// Author : Marta Verweij - UU
22//-----------------------------------------------------------------------
23
24#ifndef ALIPWG4HIGHPTTRACKQA_CXX
25#define ALIPWG4HIGHPTTRACKQA_CXX
26
27#include "AliPWG4HighPtTrackQA.h"
28
29#include "TH1.h"
30#include "TH2.h"
31#include "TH3.h"
32#include "TProfile.h"
33#include "TList.h"
34#include "TFile.h"
35#include "TChain.h"
36#include "TH3F.h"
37#include "TKey.h"
38#include "TSystem.h"
39#include "TBits.h"
40
41#include "AliAnalysisManager.h"
42#include "AliESDInputHandler.h"
43#include "AliMCEvent.h"
44#include "AliMCEventHandler.h"
45#include "AliStack.h"
46#include "AliESDtrack.h"
47#include "AliESDtrackCuts.h"
48#include "AliExternalTrackParam.h"
49#include "AliLog.h"
50#include "AliGenPythiaEventHeader.h"
51#include "AliGenCocktailEventHeader.h"
52#include "AliCentrality.h"
53#include "AliAODVertex.h"
54#include "AliAODEvent.h"
55//#include "AliAnalysisHelperJetTasks.h"
56
57using namespace std; //required for resolving the 'cout' symbol
58
59ClassImp(AliPWG4HighPtTrackQA)
60
61AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
62: AliAnalysisTaskSE(),
63 fDataType(kESD),
64 fEvent(0x0),
65 fESD(0x0),
66 fVtx(0x0),
44684f3b 67 fTrackCuts(0x0),
68 fTrackCutsITSLoose(0x0),
69 fTrackCutsTPConly(0x0),
d756027f 70 fTrackType(0),
71 fFilterMask(0),
aa3ba8d2 72 fSigmaConstrainedMax(-1.),
d756027f 73 fPtMax(100.),
74 fIsPbPb(0),
75 fCentClass(10),
a5e0d236 76 fNVariables(25),
d756027f 77 fVariables(0x0),
b8f6bad5 78 fITSClusterMap(0),
d756027f 79 fAvgTrials(1),
80 fNEventAll(0),
81 fNEventSel(0),
82 fNEventReject(0),
83 fh1Centrality(0x0),
84 fh1Xsec(0),
85 fh1Trials(0),
86 fh1PtHard(0),
87 fh1PtHardTrials(0),
88 fh1NTracksAll(0x0),
89 fh1NTracksReject(0x0),
90 fh1NTracksSel(0x0),
91 fPtAll(0),
92 fPtSel(0),
93 fPtPhi(0x0),
94 fPtEta(0x0),
95 fPtDCA2D(0x0),
96 fPtDCAZ(0x0),
97 fPtNClustersTPC(0x0),
0f76d8ae 98 fPtNClustersTPCIter1(0x0),
a5e0d236 99 fPtNClustersTPCIter1Phi(0x0),
d889ce29 100 fPtNClustersTPCShared(0x0),
101 fPtNClustersTPCSharedFrac(0x0),
d756027f 102 fPtNPointITS(0x0),
103 fPtChi2C(0x0),
104 fPtNSigmaToVertex(0x0),
105 fPtRelUncertainty1Pt(0x0),
05cb235d 106 fPtRelUncertainty1PtNClus(0x0),
0f76d8ae 107 fPtRelUncertainty1PtNClusIter1(0x0),
b8f6bad5 108 fPtRelUncertainty1PtNPointITS(0x0),
109 fPtRelUncertainty1PtITSClusterMap(0x0),
05cb235d 110 fPtRelUncertainty1PtChi2(0x0),
0f76d8ae 111 fPtRelUncertainty1PtChi2Iter1(0x0),
112 fPtRelUncertainty1PtPhi(0x0),
2b553e6f 113 fPtUncertainty1Pt(0x0),
d756027f 114 fPtChi2PerClusterTPC(0x0),
0f76d8ae 115 fPtChi2PerClusterTPCIter1(0x0),
d756027f 116 fPtNCrossedRows(0x0),
a337a5a9 117 fPtNCrossedRowsPhi(0x0),
b8f6bad5 118 fPtNCrossedRowsNClusFPhi(0x0),
d756027f 119 fPtNCrRNCrRNClusF(0x0),
a5e0d236 120 fPtNCrossedRowsFit(0x0),
a337a5a9 121 fPtNCrossedRowsFitPhi(0x0),
b8f6bad5 122 fPtNCrossedRowsNClusFFitPhi(0x0),
a337a5a9 123 fNCrossedRowsNCrossedRowsFit(0x0),
124 fNClustersNCrossedRows(0x0),
125 fNClustersNCrossedRowsFit(0x0),
b8f6bad5 126 fPtRelUncertainty1PtNCrossedRows(0x0),
127 fPtRelUncertainty1PtNCrossedRowsFit(0x0),
dae7dd67 128 fPtChi2Gold(0x0),
129 fPtChi2GGC(0x0),
130 fPtChi2GoldPhi(0x0),
131 fPtChi2GGCPhi(0x0),
132 fChi2GoldChi2GGC(0x0),
2b553e6f 133 fPtSigmaY2(0x0),
134 fPtSigmaZ2(0x0),
135 fPtSigmaSnp2(0x0),
136 fPtSigmaTgl2(0x0),
137 fPtSigma1Pt2(0x0),
aa3ba8d2 138 fProfPtSigmaY2(0x0),
139 fProfPtSigmaZ2(0x0),
140 fProfPtSigmaSnp2(0x0),
141 fProfPtSigmaTgl2(0x0),
142 fProfPtSigma1Pt2(0x0),
143 fProfPtSigma1Pt(0x0),
144 fProfPtPtSigma1Pt(0x0),
d756027f 145 fHistList(0)
146{
a5e0d236 147 SetNVariables(25);
aa3ba8d2 148
149 fPtBinEdges[0][0] = 10.;
150 fPtBinEdges[0][1] = 1.;
151 fPtBinEdges[1][0] = 20.;
152 fPtBinEdges[1][1] = 2.;
b1041e3b 153 fPtBinEdges[2][0] = 100.;
aa3ba8d2 154 fPtBinEdges[2][1] = 5.;
155
d756027f 156}
157//________________________________________________________________________
158AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
159 AliAnalysisTaskSE(name),
160 fDataType(kESD),
161 fEvent(0x0),
162 fESD(0x0),
163 fVtx(0x0),
44684f3b 164 fTrackCuts(0x0),
165 fTrackCutsITSLoose(0x0),
166 fTrackCutsTPConly(0x0),
d756027f 167 fTrackType(0),
168 fFilterMask(0),
aa3ba8d2 169 fSigmaConstrainedMax(-1.),
d756027f 170 fPtMax(100.),
171 fIsPbPb(0),
172 fCentClass(10),
a5e0d236 173 fNVariables(25),
d756027f 174 fVariables(0x0),
b8f6bad5 175 fITSClusterMap(0),
d756027f 176 fAvgTrials(1),
177 fNEventAll(0),
178 fNEventSel(0),
179 fNEventReject(0),
180 fh1Centrality(0x0),
181 fh1Xsec(0),
182 fh1Trials(0),
183 fh1PtHard(0),
184 fh1PtHardTrials(0),
185 fh1NTracksAll(0x0),
186 fh1NTracksReject(0x0),
187 fh1NTracksSel(0x0),
188 fPtAll(0),
189 fPtSel(0),
190 fPtPhi(0x0),
191 fPtEta(0x0),
192 fPtDCA2D(0x0),
193 fPtDCAZ(0x0),
194 fPtNClustersTPC(0x0),
0f76d8ae 195 fPtNClustersTPCIter1(0x0),
a5e0d236 196 fPtNClustersTPCIter1Phi(0x0),
d889ce29 197 fPtNClustersTPCShared(0x0),
198 fPtNClustersTPCSharedFrac(0x0),
d756027f 199 fPtNPointITS(0x0),
200 fPtChi2C(0x0),
201 fPtNSigmaToVertex(0x0),
202 fPtRelUncertainty1Pt(0x0),
05cb235d 203 fPtRelUncertainty1PtNClus(0x0),
0f76d8ae 204 fPtRelUncertainty1PtNClusIter1(0x0),
b8f6bad5 205 fPtRelUncertainty1PtNPointITS(0x0),
206 fPtRelUncertainty1PtITSClusterMap(0x0),
05cb235d 207 fPtRelUncertainty1PtChi2(0x0),
0f76d8ae 208 fPtRelUncertainty1PtChi2Iter1(0x0),
209 fPtRelUncertainty1PtPhi(0x0),
2b553e6f 210 fPtUncertainty1Pt(0x0),
d756027f 211 fPtChi2PerClusterTPC(0x0),
0f76d8ae 212 fPtChi2PerClusterTPCIter1(0x0),
d756027f 213 fPtNCrossedRows(0x0),
a337a5a9 214 fPtNCrossedRowsPhi(0x0),
b8f6bad5 215 fPtNCrossedRowsNClusFPhi(0x0),
d756027f 216 fPtNCrRNCrRNClusF(0x0),
a5e0d236 217 fPtNCrossedRowsFit(0x0),
a337a5a9 218 fPtNCrossedRowsFitPhi(0x0),
b8f6bad5 219 fPtNCrossedRowsNClusFFitPhi(0x0),
a337a5a9 220 fNCrossedRowsNCrossedRowsFit(0x0),
221 fNClustersNCrossedRows(0x0),
222 fNClustersNCrossedRowsFit(0x0),
b8f6bad5 223 fPtRelUncertainty1PtNCrossedRows(0x0),
224 fPtRelUncertainty1PtNCrossedRowsFit(0x0),
dae7dd67 225 fPtChi2Gold(0x0),
226 fPtChi2GGC(0x0),
227 fPtChi2GoldPhi(0x0),
228 fPtChi2GGCPhi(0x0),
229 fChi2GoldChi2GGC(0x0),
2b553e6f 230 fPtSigmaY2(0x0),
231 fPtSigmaZ2(0x0),
232 fPtSigmaSnp2(0x0),
233 fPtSigmaTgl2(0x0),
234 fPtSigma1Pt2(0x0),
aa3ba8d2 235 fProfPtSigmaY2(0x0),
236 fProfPtSigmaZ2(0x0),
237 fProfPtSigmaSnp2(0x0),
238 fProfPtSigmaTgl2(0x0),
239 fProfPtSigma1Pt2(0x0),
240 fProfPtSigma1Pt(0x0),
241 fProfPtPtSigma1Pt(0x0),
d756027f 242 fHistList(0)
243{
244 //
245 // Constructor. Initialization of Inputs and Outputs
246 //
247 AliDebug(2,Form("AliPWG4HighPtTrackQA Calling Constructor"));
248
a5e0d236 249 SetNVariables(25);
d756027f 250
aa3ba8d2 251 fPtBinEdges[0][0] = 10.;
252 fPtBinEdges[0][1] = 1.;
253 fPtBinEdges[1][0] = 20.;
254 fPtBinEdges[1][1] = 2.;
b1041e3b 255 fPtBinEdges[2][0] = 100.;
aa3ba8d2 256 fPtBinEdges[2][1] = 5.;
257
d756027f 258 // Input slot #0 works with a TChain ESD
259 DefineInput(0, TChain::Class());
260 // Output slot #1 write into a TList
261 DefineOutput(1, TList::Class());
262}
263
aa3ba8d2 264//________________________________________________________________________
265void AliPWG4HighPtTrackQA::SetPtBinEdges(Int_t region, Double_t ptmax, Double_t ptBinWidth) {
266
267 if(region<3) {
268 fPtBinEdges[region][0] = ptmax;
269 fPtBinEdges[region][1] = ptBinWidth;
270 }
271 else {
272 AliError("Only 3 regions alowed. Use region 0/1/2\n");
273 return;
274 }
275
276}
277
d756027f 278//________________________________________________________________________
279void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
280 //Create output objects
281 AliDebug(2,Form(">> AliPWG4HighPtTrackQA::UserCreateOutputObjects \n"));
282
283 Bool_t oldStatus = TH1::AddDirectoryStatus();
284 TH1::AddDirectory(kFALSE);
285
286 OpenFile(1);
287 fHistList = new TList();
288 fHistList->SetOwner(kTRUE);
289
290 Float_t fgkPtMin = 0.;
59869f97 291 // Float_t fgkPtMax = fPtMax;
d756027f 292
aa3ba8d2 293 //fPtBinEdges[region][0] = ptmax of region ; fPtBinEdges[region][1] = binWidth of region
d756027f 294 const Float_t ptmin1 = fgkPtMin;
aa3ba8d2 295 const Float_t ptmax1 = fPtBinEdges[0][0];
d756027f 296 const Float_t ptmin2 = ptmax1 ;
aa3ba8d2 297 const Float_t ptmax2 = fPtBinEdges[1][0];
d756027f 298 const Float_t ptmin3 = ptmax2 ;
b1041e3b 299 const Float_t ptmax3 = fPtBinEdges[2][0];//fgkPtMax;
aa3ba8d2 300 const Int_t nbin11 = (int)((ptmax1-ptmin1)/fPtBinEdges[0][1]);
301 const Int_t nbin12 = (int)((ptmax2-ptmin2)/fPtBinEdges[1][1])+nbin11;
2793fe00 302 const Int_t nbin13 = (int)((ptmax3-ptmin3)/fPtBinEdges[2][1])+nbin12;
d756027f 303 Int_t fgkNPtBins=nbin13;
304 //Create array with low edges of each bin
305 Double_t *binsPt=new Double_t[fgkNPtBins+1];
306 for(Int_t i=0; i<=fgkNPtBins; i++) {
307 if(i<=nbin11) binsPt[i]=(Double_t)ptmin1 + (ptmax1-ptmin1)/nbin11*(Double_t)i ;
308 if(i<=nbin12 && i>nbin11) binsPt[i]=(Double_t)ptmin2 + (ptmax2-ptmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ;
309 if(i<=nbin13 && i>nbin12) binsPt[i]=(Double_t)ptmin3 + (ptmax3-ptmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ;
310 }
311
312 Int_t fgkNPhiBins = 18*6;
313 Float_t kMinPhi = 0.;
314 Float_t kMaxPhi = 2.*TMath::Pi();
315 Double_t *binsPhi = new Double_t[fgkNPhiBins+1];
316 for(Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(Double_t)i ;
317
318 Int_t fgkNEtaBins=20;
319 Float_t fgkEtaMin = -1.;
320 Float_t fgkEtaMax = 1.;
321 Double_t *binsEta=new Double_t[fgkNEtaBins+1];
322 for(Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(Double_t)i ;
323
324 Int_t fgkNNClustersTPCBins=80;
325 Float_t fgkNClustersTPCMin = 0.5;
326 Float_t fgkNClustersTPCMax = 160.5;
327 Double_t *binsNClustersTPC=new Double_t[fgkNNClustersTPCBins+1];
328 for(Int_t i=0; i<=fgkNNClustersTPCBins; i++) binsNClustersTPC[i]=(Double_t)fgkNClustersTPCMin + (fgkNClustersTPCMax-fgkNClustersTPCMin)/fgkNNClustersTPCBins*(Double_t)i ;
329
330 Int_t fgkNDCA2DBins=80;
331 Float_t fgkDCA2DMin = -0.2;
332 Float_t fgkDCA2DMax = 0.2;
dae7dd67 333 if(fTrackType==1 || fTrackType==2 || fTrackType==4 || fTrackType==7) {
2b553e6f 334 fgkDCA2DMin = -2.;
335 fgkDCA2DMax = 2.;
336 }
d756027f 337 Double_t *binsDCA2D=new Double_t[fgkNDCA2DBins+1];
338 for(Int_t i=0; i<=fgkNDCA2DBins; i++) binsDCA2D[i]=(Double_t)fgkDCA2DMin + (fgkDCA2DMax-fgkDCA2DMin)/fgkNDCA2DBins*(Double_t)i ;
339
340 Int_t fgkNDCAZBins=80;
341 Float_t fgkDCAZMin = -2.;
342 Float_t fgkDCAZMax = 2.;
aa3ba8d2 343 if(fTrackType==1 || fTrackType==2 || fTrackType==4) {
2b553e6f 344 fgkDCAZMin = -5.;
345 fgkDCAZMax = 5.;
346 }
d756027f 347 Double_t *binsDCAZ=new Double_t[fgkNDCAZBins+1];
348 for(Int_t i=0; i<=fgkNDCAZBins; i++) binsDCAZ[i]=(Double_t)fgkDCAZMin + (fgkDCAZMax-fgkDCAZMin)/fgkNDCAZBins*(Double_t)i ;
349
350 Int_t fgkNNPointITSBins=9;
351 Float_t fgkNPointITSMin = -0.5;
352 Float_t fgkNPointITSMax = 8.5;
353 Double_t *binsNPointITS=new Double_t[fgkNNPointITSBins+1];
354 for(Int_t i=0; i<=fgkNNPointITSBins; i++) binsNPointITS[i]=(Double_t)fgkNPointITSMin + (fgkNPointITSMax-fgkNPointITSMin)/fgkNNPointITSBins*(Double_t)i ;
355
b8f6bad5 356 Int_t fgkNITSClusterMapBins=65;
357 Float_t fgkITSClusterMapMin = -0.5;
358 Float_t fgkITSClusterMapMax = 64.5;
359 Double_t *binsITSClusterMap=new Double_t[fgkNITSClusterMapBins+1];
360 for(Int_t i=0; i<=fgkNITSClusterMapBins; i++) binsITSClusterMap[i]=(Double_t)fgkITSClusterMapMin + (fgkITSClusterMapMax-fgkITSClusterMapMin)/fgkNITSClusterMapBins*(Double_t)i ;
361
362
dae7dd67 363 Int_t fgkNNSigmaToVertexBins=9;
d756027f 364 Float_t fgkNSigmaToVertexMin = 0.;
dae7dd67 365 Float_t fgkNSigmaToVertexMax = 9.;
d756027f 366 Double_t *binsNSigmaToVertex=new Double_t[fgkNNSigmaToVertexBins+1];
367 for(Int_t i=0; i<=fgkNNSigmaToVertexBins; i++) binsNSigmaToVertex[i]=(Double_t)fgkNSigmaToVertexMin + (fgkNSigmaToVertexMax-fgkNSigmaToVertexMin)/fgkNNSigmaToVertexBins*(Double_t)i ;
368
dae7dd67 369 Int_t fgkNChi2CBins=10;
370 // Float_t fgkChi2CMin = 0.;
371 // Float_t fgkChi2CMax = 100.; //10 sigma
d756027f 372 Double_t *binsChi2C=new Double_t[fgkNChi2CBins+1];
dae7dd67 373 for(Int_t i=0; i<=fgkNChi2CBins; i++) binsChi2C[i] = (Double_t)i * (Double_t)i;
d756027f 374
5ad580fa 375 Int_t fgkNRel1PtUncertaintyBins=50;
d756027f 376 Float_t fgkRel1PtUncertaintyMin = 0.;
5ad580fa 377 Float_t fgkRel1PtUncertaintyMax = 1.;
c3ff0a6e 378 if(fTrackType!=0 && fTrackType!=3) {
0f76d8ae 379 fgkNRel1PtUncertaintyBins = 50;
380 fgkRel1PtUncertaintyMax = 1.;
381 }
d756027f 382 Double_t *binsRel1PtUncertainty=new Double_t[fgkNRel1PtUncertaintyBins+1];
383 for(Int_t i=0; i<=fgkNRel1PtUncertaintyBins; i++) binsRel1PtUncertainty[i]=(Double_t)fgkRel1PtUncertaintyMin + (fgkRel1PtUncertaintyMax-fgkRel1PtUncertaintyMin)/fgkNRel1PtUncertaintyBins*(Double_t)i ;
384
2b553e6f 385 Int_t fgkNUncertainty1PtBins = 30;
386 Float_t fgkUncertainty1PtMin = 0.;
387 Float_t fgkUncertainty1PtMax = 0.1;
aa3ba8d2 388 if(fTrackType==1 || fTrackType==2 || fTrackType==4)
389 fgkUncertainty1PtMax = 0.2;
2b553e6f 390 Double_t *binsUncertainty1Pt=new Double_t[fgkNUncertainty1PtBins+1];
391 for(Int_t i=0; i<=fgkNUncertainty1PtBins; i++) binsUncertainty1Pt[i]=(Double_t)fgkUncertainty1PtMin + (fgkUncertainty1PtMax-fgkUncertainty1PtMin)/fgkNUncertainty1PtBins*(Double_t)i ;
392
d756027f 393 Float_t fgkChi2PerClusMin = 0.;
394 Float_t fgkChi2PerClusMax = 4.;
395 Int_t fgkNChi2PerClusBins = (int)(fgkChi2PerClusMax*10.);
396 Double_t *binsChi2PerClus=new Double_t[fgkNChi2PerClusBins+1];
397 for(Int_t i=0; i<=fgkNChi2PerClusBins; i++) binsChi2PerClus[i]=(Double_t)fgkChi2PerClusMin + (fgkChi2PerClusMax-fgkChi2PerClusMin)/fgkNChi2PerClusBins*(Double_t)i ;
398
b8f6bad5 399 Int_t fgkNCrossedRowsNClusFBins = 45;
d756027f 400 Float_t fgkNCrossedRowsNClusFMin = 0.;
b8f6bad5 401 Float_t fgkNCrossedRowsNClusFMax = 1.5;
d756027f 402 Double_t *binsNCrossedRowsNClusF=new Double_t[fgkNCrossedRowsNClusFBins+1];
403 for(Int_t i=0; i<=fgkNCrossedRowsNClusFBins; i++) binsNCrossedRowsNClusF[i]=(Double_t)fgkNCrossedRowsNClusFMin + (fgkNCrossedRowsNClusFMax-fgkNCrossedRowsNClusFMin)/fgkNCrossedRowsNClusFBins*(Double_t)i ;
404
2b553e6f 405 Float_t fgk1PtMin = 0.;
406 Float_t fgk1PtMax = 6.;
aa3ba8d2 407 Float_t binEdge1Pt1 = 1.;
408 Float_t binWidth1Pt1 = 0.05;
409 Int_t fgkN1PtBins1 = (int)((binEdge1Pt1-fgk1PtMin)/binWidth1Pt1);
410 Float_t binWidth1Pt2 = 0.1;
411 Int_t fgkN1PtBins2 = (int)((fgk1PtMax-binEdge1Pt1)/binWidth1Pt2);
412 Int_t fgkN1PtBins = fgkN1PtBins1+fgkN1PtBins2;
2b553e6f 413 Double_t *bins1Pt=new Double_t[fgkN1PtBins+1];
aa3ba8d2 414
415 for(Int_t i=0; i<=fgkN1PtBins; i++) {
416 if(i<=fgkN1PtBins1)
417 bins1Pt[i]=(Double_t)fgk1PtMin + (Double_t)(binEdge1Pt1-fgk1PtMin)/(Double_t)fgkN1PtBins1*(Double_t)i;
418 if(i<=fgkN1PtBins && i>fgkN1PtBins1)
419 bins1Pt[i]=(Double_t)binEdge1Pt1 + (Double_t)(fgk1PtMax-binEdge1Pt1)/(Double_t)fgkN1PtBins2*(Double_t)(i-fgkN1PtBins1);
420 }
2b553e6f 421
422 Int_t fgkNSigmaY2Bins = 50;
423 Float_t fgkSigmaY2Min = 0.;
aa3ba8d2 424 Float_t fgkSigmaY2Max = 1.;
425 if(fTrackType==1) fgkSigmaY2Max = 4.;
426 if(fTrackType==2 || fTrackType==4) fgkSigmaY2Max = 0.1;
2b553e6f 427 Double_t *binsSigmaY2=new Double_t[fgkNSigmaY2Bins+1];
428 for(Int_t i=0; i<=fgkNSigmaY2Bins; i++) binsSigmaY2[i]=(Double_t)fgkSigmaY2Min + (fgkSigmaY2Max-fgkSigmaY2Min)/fgkNSigmaY2Bins*(Double_t)i ;
429
430 Int_t fgkNSigmaZ2Bins = 50;
431 Float_t fgkSigmaZ2Min = 0.;
aa3ba8d2 432 Float_t fgkSigmaZ2Max = 0.4;
2b553e6f 433 Double_t *binsSigmaZ2=new Double_t[fgkNSigmaZ2Bins+1];
434 for(Int_t i=0; i<=fgkNSigmaZ2Bins; i++) binsSigmaZ2[i]=(Double_t)fgkSigmaZ2Min + (fgkSigmaZ2Max-fgkSigmaZ2Min)/fgkNSigmaZ2Bins*(Double_t)i ;
435
436 Int_t fgkNSigmaSnp2Bins = 50;
437 Float_t fgkSigmaSnp2Min = 0.;
aa3ba8d2 438 Float_t fgkSigmaSnp2Max = 0.05;
439 if(fTrackType==1) fgkSigmaSnp2Max = 0.2;
440 if(fTrackType==2 || fTrackType==4) fgkSigmaSnp2Max = 0.1;
2b553e6f 441 Double_t *binsSigmaSnp2=new Double_t[fgkNSigmaSnp2Bins+1];
442 for(Int_t i=0; i<=fgkNSigmaSnp2Bins; i++) binsSigmaSnp2[i]=(Double_t)fgkSigmaSnp2Min + (fgkSigmaSnp2Max-fgkSigmaSnp2Min)/fgkNSigmaSnp2Bins*(Double_t)i ;
443
444 Int_t fgkNSigmaTgl2Bins = 50;
445 Float_t fgkSigmaTgl2Min = 0.;
aa3ba8d2 446 Float_t fgkSigmaTgl2Max = 0.1;
447 if(fTrackType==1) fgkSigmaTgl2Max = 0.2;
448 if(fTrackType==2 || fTrackType==4) fgkSigmaTgl2Max = 0.1;
2b553e6f 449 Double_t *binsSigmaTgl2=new Double_t[fgkNSigmaTgl2Bins+1];
450 for(Int_t i=0; i<=fgkNSigmaTgl2Bins; i++) binsSigmaTgl2[i]=(Double_t)fgkSigmaTgl2Min + (fgkSigmaTgl2Max-fgkSigmaTgl2Min)/fgkNSigmaTgl2Bins*(Double_t)i ;
451
452 Int_t fgkNSigma1Pt2Bins = 50;
453 Float_t fgkSigma1Pt2Min = 0.;
aa3ba8d2 454 Float_t fgkSigma1Pt2Max = 1.;
2b553e6f 455 Double_t *binsSigma1Pt2=new Double_t[fgkNSigma1Pt2Bins+1];
456 for(Int_t i=0; i<=fgkNSigma1Pt2Bins; i++) binsSigma1Pt2[i]=(Double_t)fgkSigma1Pt2Min + (fgkSigma1Pt2Max-fgkSigma1Pt2Min)/fgkNSigma1Pt2Bins*(Double_t)i ;
457
458
d756027f 459 fNEventAll = new TH1F("fNEventAll","NEventAll",1,-0.5,0.5);
460 fHistList->Add(fNEventAll);
461 fNEventSel = new TH1F("fNEventSel","NEvent Selected for analysis",1,-0.5,0.5);
462 fHistList->Add(fNEventSel);
463 fNEventReject = new TH1F("fNEventReject","Reason events are rejectected for analysis",20,0,20);
464 //Set labels
465 fNEventReject->Fill("noESD",0);
466 fNEventReject->Fill("Trigger",0);
467 fNEventReject->Fill("NTracks<2",0);
468 fNEventReject->Fill("noVTX",0);
469 fNEventReject->Fill("VtxStatus",0);
470 fNEventReject->Fill("NCont<2",0);
471 fNEventReject->Fill("ZVTX>10",0);
472 fNEventReject->Fill("cent",0);
473 fNEventReject->Fill("cent>90",0);
474 fHistList->Add(fNEventReject);
475
476 fh1Centrality = new TH1F("fh1Centrality","fh1Centrality; Centrality %",100,0,100);
477 fHistList->Add(fh1Centrality);
478
479 fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1);
480 fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
481 fHistList->Add(fh1Xsec);
482
483 fh1Trials = new TH1F("fh1Trials","trials root file",1,0,1);
484 fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
485 fHistList->Add(fh1Trials);
486
487 fh1PtHard = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5);
488 fHistList->Add(fh1PtHard);
489 fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5);
490 fHistList->Add(fh1PtHardTrials);
491
492 fh1NTracksAll = new TH1F("fh1NTracksAll","fh1NTracksAll",1,-0.5,0.5);
493 fHistList->Add(fh1NTracksAll);
494
495 fh1NTracksReject = new TH1F("fh1NTracksReject","fh1NTracksReject",1,-0.5,0.5);
496 fh1NTracksReject->Fill("noESDtrack",0);
497 fh1NTracksReject->Fill("noTPCInner",0);
498 fh1NTracksReject->Fill("FillTPC",0);
499 fh1NTracksReject->Fill("noTPConly",0);
500 fh1NTracksReject->Fill("relate",0);
501 fh1NTracksReject->Fill("trackCuts",0);
502 fh1NTracksReject->Fill("laser",0);
2b553e6f 503 fh1NTracksReject->Fill("chi2",0);
d756027f 504 fHistList->Add(fh1NTracksReject);
505
506 fh1NTracksSel = new TH1F("fh1NTracksSel","fh1NTracksSel",1,-0.5,0.5);
507 fHistList->Add(fh1NTracksSel);
508
d756027f 509 fPtAll = new TH1F("fPtAll","PtAll",fgkNPtBins, binsPt);
510 fHistList->Add(fPtAll);
511 fPtSel = new TH1F("fPtSel","PtSel",fgkNPtBins, binsPt);
512 fHistList->Add(fPtSel);
513
514 fPtPhi = new TH2F("fPtPhi","fPtPhi",fgkNPtBins,binsPt,fgkNPhiBins,binsPhi);
515 fHistList->Add(fPtPhi);
516
517 fPtEta = new TH2F("fPtEta","fPtEta",fgkNPtBins,binsPt,fgkNEtaBins,binsEta);
518 fHistList->Add(fPtEta);
519
520 fPtDCA2D = new TH2F("fPtDCA2D","fPtDCA2D",fgkNPtBins,binsPt,fgkNDCA2DBins,binsDCA2D);
521 fHistList->Add(fPtDCA2D);
522
523 fPtDCAZ = new TH2F("fPtDCAZ","fPtDCAZ",fgkNPtBins,binsPt,fgkNDCAZBins,binsDCAZ);
524 fHistList->Add(fPtDCAZ);
525
526 fPtNClustersTPC = new TH2F("fPtNClustersTPC","fPtNClustersTPC",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC);
527 fHistList->Add(fPtNClustersTPC);
0f76d8ae 528
529 fPtNClustersTPCIter1 = new TH2F("fPtNClustersTPCIter1","fPtNClustersTPCIter1",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC);
530 fHistList->Add(fPtNClustersTPCIter1);
d889ce29 531
a5e0d236 532 fPtNClustersTPCIter1Phi = new TH3F("fPtNClustersTPCIter1Phi","fPtNClustersTPCIter1Phi",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC,fgkNPhiBins,binsPhi);
533 fHistList->Add(fPtNClustersTPCIter1Phi);
534
d889ce29 535 fPtNClustersTPCShared = new TH2F("fPtNClustersTPCShared","fPtNClustersTPCShared",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC);
536 fHistList->Add(fPtNClustersTPCShared);
537
538 fPtNClustersTPCSharedFrac = new TH2F("fPtNClustersTPCSharedFrac","fPtNClustersTPCSharedFrac",fgkNPtBins,binsPt,fgkNSigma1Pt2Bins,binsSigma1Pt2);
539 fHistList->Add(fPtNClustersTPCSharedFrac);
d756027f 540
541 fPtNPointITS = new TH2F("fPtNPointITS","fPtNPointITS",fgkNPtBins,binsPt,fgkNNPointITSBins,binsNPointITS);
542 fHistList->Add(fPtNPointITS);
543
544 fPtChi2C = new TH2F("fPtChi2C","fPtChi2C",fgkNPtBins,binsPt,fgkNChi2CBins,binsChi2C);
545 fHistList->Add(fPtChi2C);
546
547 fPtNSigmaToVertex = new TH2F("fPtNSigmaToVertex","fPtNSigmaToVertex",fgkNPtBins,binsPt,fgkNNSigmaToVertexBins,binsNSigmaToVertex);
548 fHistList->Add(fPtNSigmaToVertex);
549
550 fPtRelUncertainty1Pt = new TH2F("fPtRelUncertainty1Pt","fPtRelUncertainty1Pt",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty);
551 fHistList->Add(fPtRelUncertainty1Pt);
2b553e6f 552
05cb235d 553 fPtRelUncertainty1PtNClus = new TH3F("fPtRelUncertainty1PtNClus","fPtRelUncertainty1PtNClus",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNNClustersTPCBins,binsNClustersTPC);
554 fHistList->Add(fPtRelUncertainty1PtNClus);
555
0f76d8ae 556 fPtRelUncertainty1PtNClusIter1 = new TH3F("fPtRelUncertainty1PtNClusIter1","fPtRelUncertainty1PtNClusIter1",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNNClustersTPCBins,binsNClustersTPC);
557 fHistList->Add(fPtRelUncertainty1PtNClusIter1);
558
b8f6bad5 559 fPtRelUncertainty1PtNPointITS = new TH3F("fPtRelUncertainty1PtNPointITS","fPtRelUncertainty1PtNPointITS",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNNPointITSBins,binsNPointITS);
560 fHistList->Add(fPtRelUncertainty1PtNPointITS);
561
562 fPtRelUncertainty1PtITSClusterMap = new TH3F("fPtRelUncertainty1PtITSClusterMap","fPtRelUncertainty1PtITSClusterMap",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNITSClusterMapBins,binsITSClusterMap);
563 fHistList->Add(fPtRelUncertainty1PtITSClusterMap);
564
05cb235d 565 fPtRelUncertainty1PtChi2 = new TH3F("fPtRelUncertainty1PtChi2","fPtRelUncertainty1PtChi2",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNChi2PerClusBins,binsChi2PerClus);
566 fHistList->Add(fPtRelUncertainty1PtChi2);
567
0f76d8ae 568 fPtRelUncertainty1PtChi2Iter1 = new TH3F("fPtRelUncertainty1PtChi2Iter1","fPtRelUncertainty1PtChi2Iter1",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNChi2PerClusBins,binsChi2PerClus);
569 fHistList->Add(fPtRelUncertainty1PtChi2Iter1);
570
571 fPtRelUncertainty1PtPhi = new TH3F("fPtRelUncertainty1PtPhi","fPtRelUncertainty1PtPhi",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNPhiBins,binsPhi);
572 fHistList->Add(fPtRelUncertainty1PtPhi);
573
2b553e6f 574 fPtUncertainty1Pt = new TH2F("fPtUncertainty1Pt","fPtUncertainty1Pt",fgkNPtBins,binsPt,fgkNUncertainty1PtBins,binsUncertainty1Pt);
575 fHistList->Add(fPtUncertainty1Pt);
d756027f 576
577 fPtChi2PerClusterTPC = new TH2F("fPtChi2PerClusterTPC","fPtChi2PerClusterTPC",fgkNPtBins,binsPt,fgkNChi2PerClusBins,binsChi2PerClus);
578 fHistList->Add(fPtChi2PerClusterTPC);
0f76d8ae 579
580 fPtChi2PerClusterTPCIter1 = new TH2F("fPtChi2PerClusterTPCIter1","fPtChi2PerClusterTPCIter1",fgkNPtBins,binsPt,fgkNChi2PerClusBins,binsChi2PerClus);
581 fHistList->Add(fPtChi2PerClusterTPCIter1);
d756027f 582
583 fPtNCrossedRows = new TH2F("fPtNCrossedRows","fPtNCrossedRows",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC);
584 fHistList->Add(fPtNCrossedRows);
585
a337a5a9 586 fPtNCrossedRowsPhi = new TH3F("fPtNCrossedRowsPhi","fPtNCrossedRowsPhi",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC,fgkNPhiBins,binsPhi);
587 fHistList->Add(fPtNCrossedRowsPhi);
588
b8f6bad5 589 fPtNCrossedRowsNClusFPhi = new TH3F("fPtNCrossedRowsNClusFPhi","fPtNCrossedRowsNClusFPhi",fgkNPtBins,binsPt,fgkNCrossedRowsNClusFBins,binsNCrossedRowsNClusF,fgkNPhiBins,binsPhi);
590 fHistList->Add(fPtNCrossedRowsNClusFPhi);
d756027f 591
592 fPtNCrRNCrRNClusF = new TH3F("fPtNCrRNCrRNClusF","fPtNCrRNCrRNClusF",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC,fgkNCrossedRowsNClusFBins,binsNCrossedRowsNClusF);
593 fHistList->Add(fPtNCrRNCrRNClusF);
2b553e6f 594
a5e0d236 595 fPtNCrossedRowsFit = new TH2F("fPtNCrossedRowsFit","fPtNCrossedRowsFit",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC);
596 fHistList->Add(fPtNCrossedRowsFit);
597
a337a5a9 598 fPtNCrossedRowsFitPhi = new TH3F("fPtNCrossedRowsFitPhi","fPtNCrossedRowsFitPhi",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC,fgkNPhiBins,binsPhi);
599 fHistList->Add(fPtNCrossedRowsFitPhi);
600
b8f6bad5 601 fPtNCrossedRowsNClusFFitPhi = new TH3F("fPtNCrossedRowsNClusFFitPhi","fPtNCrossedRowsNClusFFitPhi",fgkNPtBins,binsPt,fgkNCrossedRowsNClusFBins,binsNCrossedRowsNClusF,fgkNPhiBins,binsPhi);
602 fHistList->Add(fPtNCrossedRowsNClusFFitPhi);
a5e0d236 603
a337a5a9 604 fNCrossedRowsNCrossedRowsFit = new TH2F("fNCrossedRowsNCrossedRowsFit","fNCrossedRowsNCrossedRowsFit",fgkNNClustersTPCBins,binsNClustersTPC,fgkNNClustersTPCBins,binsNClustersTPC);
605 fHistList->Add(fNCrossedRowsNCrossedRowsFit);
606
607 fNClustersNCrossedRows = new TH2F("fNClustersNCrossedRows","fNClustersNCrossedRows",fgkNNClustersTPCBins,binsNClustersTPC,fgkNNClustersTPCBins,binsNClustersTPC);
608 fHistList->Add(fNClustersNCrossedRows);
609
610 fNClustersNCrossedRowsFit = new TH2F("fNClustersNCrossedRowsFit","fNClustersNCrossedRowsFit",fgkNNClustersTPCBins,binsNClustersTPC,fgkNNClustersTPCBins,binsNClustersTPC);
611 fHistList->Add(fNClustersNCrossedRowsFit);
612
b8f6bad5 613 fPtRelUncertainty1PtNCrossedRows = new TH3F("fPtRelUncertainty1PtNCrossedRows","fPtRelUncertainty1PtNCrossedRows",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNNClustersTPCBins,binsNClustersTPC);
614 fHistList->Add(fPtRelUncertainty1PtNCrossedRows);
615
616 fPtRelUncertainty1PtNCrossedRowsFit = new TH3F("fPtRelUncertainty1PtNCrossedRowsFit","fPtRelUncertainty1PtNCrossedRowsFit",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNNClustersTPCBins,binsNClustersTPC);
617 fHistList->Add(fPtRelUncertainty1PtNCrossedRowsFit);
618
dae7dd67 619 fPtChi2Gold = new TH2F("fPtChi2Gold","fPtChi2Gold",fgkNPtBins,binsPt,fgkNChi2CBins,binsChi2C);
620 fHistList->Add(fPtChi2Gold);
621
622 fPtChi2GGC = new TH2F("fPtChi2GGC","fPtChi2GGC",fgkNPtBins,binsPt,fgkNChi2CBins,binsChi2C);
623 fHistList->Add(fPtChi2GGC);
624
625 fPtChi2GoldPhi = new TH3F("fPtChi2GoldPhi","fPtChi2GoldPhi",fgkNPtBins,binsPt,fgkNChi2CBins,binsChi2C,fgkNPhiBins,binsPhi);
626 fHistList->Add(fPtChi2GoldPhi);
627
628 fPtChi2GGCPhi = new TH3F("fPtChi2GGCPhi","fPtChi2GGCPhi",fgkNPtBins,binsPt,fgkNChi2CBins,binsChi2C,fgkNPhiBins,binsPhi);
629 fHistList->Add(fPtChi2GGCPhi);
630
631 fChi2GoldChi2GGC = new TH2F("fChi2GoldChi2GGC","fChi2GoldChi2GGC;#chi^{2}_{gold};#chi^{2}_{ggc}",fgkNChi2CBins,binsChi2C,fgkNChi2CBins,binsChi2C);
632 fHistList->Add(fChi2GoldChi2GGC);
633
634
aa3ba8d2 635 fPtSigmaY2 = new TH2F("fPtSigmaY2","fPtSigmaY2",fgkN1PtBins,bins1Pt,fgkNSigmaY2Bins,binsSigmaY2);
2b553e6f 636 fHistList->Add(fPtSigmaY2);
637
638 fPtSigmaZ2 = new TH2F("fPtSigmaZ2","fPtSigmaZ2",fgkN1PtBins,bins1Pt,fgkNSigmaZ2Bins,binsSigmaZ2);
639 fHistList->Add(fPtSigmaZ2);
640
aa3ba8d2 641 fPtSigmaSnp2 = new TH2F("fPtSigmaSnp2","fPtSigmaSnp2",fgkN1PtBins,bins1Pt,fgkNSigmaSnp2Bins,binsSigmaSnp2);
2b553e6f 642 fHistList->Add(fPtSigmaSnp2);
643
aa3ba8d2 644 fPtSigmaTgl2 = new TH2F("fPtSigmaTgl2","fPtSigmaTgl2",fgkN1PtBins,bins1Pt,fgkNSigmaTgl2Bins,binsSigmaTgl2);
2b553e6f 645 fHistList->Add(fPtSigmaTgl2);
646
aa3ba8d2 647 fPtSigma1Pt2 = new TH2F("fPtSigma1Pt2","fPtSigma1Pt2",fgkN1PtBins,bins1Pt,fgkNSigma1Pt2Bins,binsSigma1Pt2);
2b553e6f 648 fHistList->Add(fPtSigma1Pt2);
649
aa3ba8d2 650 fProfPtSigmaY2 = new TProfile("fProfPtSigmaY2","fProfPtSigmaY2",fgkN1PtBins,bins1Pt);
651 fHistList->Add(fProfPtSigmaY2);
652
653 fProfPtSigmaZ2 = new TProfile("fProfPtSigmaZ2","fProfPtSigmaZ2",fgkN1PtBins,bins1Pt);
654 fHistList->Add(fProfPtSigmaZ2);
655
656 fProfPtSigmaSnp2 = new TProfile("fProfPtSigmaSnp2","fProfPtSigmaSnp2",fgkN1PtBins,bins1Pt);
657 fHistList->Add(fProfPtSigmaSnp2);
658
659 fProfPtSigmaTgl2 = new TProfile("fProfPtSigmaTgl2","fProfPtSigmaTgl2",fgkN1PtBins,bins1Pt);
660 fHistList->Add(fProfPtSigmaTgl2);
661
662 fProfPtSigma1Pt2 = new TProfile("fProfPtSigma1Pt2","fProfPtSigma1Pt2",fgkN1PtBins,bins1Pt);
663 fHistList->Add(fProfPtSigma1Pt2);
664
665 fProfPtSigma1Pt = new TProfile("fProfPtSigma1Pt","fProfPtSigma1Pt;p_{T};#sigma(1/p_{T})",fgkNPtBins,binsPt);
666 fHistList->Add(fProfPtSigma1Pt);
667
668 fProfPtPtSigma1Pt = new TProfile("fProfPtPtSigma1Pt","fProfPtPtSigma1Pt;p_{T};p_{T}#sigma(1/p_{T})",fgkNPtBins,binsPt);
669 fHistList->Add(fProfPtPtSigma1Pt);
670
d756027f 671 TH1::AddDirectory(oldStatus);
672
673 PostData(1, fHistList);
674
675 if(binsPhi) delete [] binsPhi;
676 if(binsPt) delete [] binsPt;
677 if(binsNClustersTPC) delete [] binsNClustersTPC;
678 if(binsDCA2D) delete [] binsDCA2D;
679 if(binsDCAZ) delete [] binsDCAZ;
680 if(binsNPointITS) delete [] binsNPointITS;
681 if(binsNSigmaToVertex) delete [] binsNSigmaToVertex;
682 if(binsChi2C) delete [] binsChi2C;
683 if(binsEta) delete [] binsEta;
684 if(binsRel1PtUncertainty) delete [] binsRel1PtUncertainty;
2b553e6f 685 if(binsUncertainty1Pt) delete [] binsUncertainty1Pt;
d756027f 686 if(binsChi2PerClus) delete [] binsChi2PerClus;
687 if(binsChi2PerClus) delete [] binsNCrossedRowsNClusF;
2b553e6f 688 if(bins1Pt) delete [] bins1Pt;
689 if(binsSigmaY2) delete [] binsSigmaY2;
690 if(binsSigmaZ2) delete [] binsSigmaZ2;
691 if(binsSigmaSnp2) delete [] binsSigmaSnp2;
692 if(binsSigmaTgl2) delete [] binsSigmaTgl2;
693 if(binsSigma1Pt2) delete [] binsSigma1Pt2;
d756027f 694}
695
696//________________________________________________________________________
697Bool_t AliPWG4HighPtTrackQA::SelectEvent() {
698 //
699 // Decide if event should be selected for analysis
700 //
701
702 // Checks following requirements:
703 // - fEvent available
704 // - trigger info from AliPhysicsSelection
705 // - MCevent available
706 // - number of reconstructed tracks > 1
707 // - primary vertex reconstructed
708 // - z-vertex < 10 cm
709 // - centrality in case of PbPb
710
711 Bool_t selectEvent = kTRUE;
712
713 //fEvent object available?
714 if (!fEvent) {
715 AliDebug(2,Form("ERROR: fInputEvent not available\n"));
716 fNEventReject->Fill("noAliVEvent",1);
717 selectEvent = kFALSE;
718 return selectEvent;
719 }
720
721 //Check if number of reconstructed tracks is larger than 1
722 if(!fEvent->GetNumberOfTracks() || fEvent->GetNumberOfTracks()<2) {
723 fNEventReject->Fill("NTracks<2",1);
724 selectEvent = kFALSE;
725 return selectEvent;
726 }
727
728 //Check if vertex is reconstructed
1ea145ef 729 if(fDataType==kESD&&dynamic_cast<AliESDEvent*>(fEvent)) {
a5e0d236 730 fVtx = ((AliESDEvent*)fEvent)->GetPrimaryVertexTracks();
731
732 if (!fVtx || !fVtx->GetStatus())
733 fVtx = ((AliESDEvent*)fEvent)->GetPrimaryVertexSPD();
d756027f 734
735 if(!fVtx) {
736 fNEventReject->Fill("noVTX",1);
737 selectEvent = kFALSE;
738 return selectEvent;
739 }
740
741 if(!fVtx->GetStatus()) {
742 fNEventReject->Fill("VtxStatus",1);
743 selectEvent = kFALSE;
744 return selectEvent;
745 }
746
747 // Need vertex cut
748 if(fVtx->GetNContributors()<2) {
749 fNEventReject->Fill("NCont<2",1);
750 selectEvent = kFALSE;
751 return selectEvent;
752 }
753
754 //Check if z-vertex < 10 cm
755 double primVtx[3];
756 fVtx->GetXYZ(primVtx);
757 if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){
758 fNEventReject->Fill("ZVTX>10",1);
759 selectEvent = kFALSE;
760 return selectEvent;
761 }
762 }
1ea145ef 763 else if(fDataType==kAOD&&dynamic_cast<AliAODEvent*>(fEvent)) {
764 const AliAODVertex *vtx = ((AliAODEvent*)fEvent)->GetPrimaryVertexSPD();
d756027f 765 if(!vtx) {
766 fNEventReject->Fill("noVTX",1);
767 selectEvent = kFALSE;
768 return selectEvent;
769 }
770
771 // Need vertex cut
772 if(vtx->GetNContributors()<2) {
773 fNEventReject->Fill("NCont<2",1);
774 selectEvent = kFALSE;
775 return selectEvent;
776 }
777
778 //Check if z-vertex < 10 cm
779 double primVtx[3];
780 vtx->GetXYZ(primVtx);
781 if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){
782 fNEventReject->Fill("ZVTX>10",1);
783 selectEvent = kFALSE;
784 return selectEvent;
785 }
786
787 }
788
789 //Centrality selection should only be done in case of PbPb
790 if(IsPbPb()) {
791 Float_t cent = 0.;
792 if(fCentClass!=CalculateCentrality(fEvent) && fCentClass!=10) {
793 fNEventReject->Fill("cent",1);
794 selectEvent = kFALSE;
795 return selectEvent;
796 }
797 else {
798 if(fDataType==kESD) {
799 if(dynamic_cast<AliESDEvent*>(fEvent)->GetCentrality()) {
800 cent = dynamic_cast<AliESDEvent*>(fEvent)->GetCentrality()->GetCentralityPercentile("V0M");
801 }
802 }
803 else if(fDataType==kAOD) {
804 if(dynamic_cast<AliAODEvent*>(fEvent)->GetHeader()->GetCentrality())
805 cent = dynamic_cast<AliAODEvent*>(fEvent)->GetHeader()->GetCentrality();
806 }
807 if(cent>90.) {
808 fNEventReject->Fill("cent>90",1);
809 selectEvent = kFALSE;
810 return selectEvent;
811 }
812 fh1Centrality->Fill(cent);
813 }
814 }
815
816 return selectEvent;
817
818}
819
820//________________________________________________________________________
821Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliVEvent *ev){
669e2312 822 //
823 // Get centrality from ESD or AOD
824 //
825
d756027f 826 if(fDataType==kESD)
827 return CalculateCentrality(dynamic_cast<AliESDEvent*>(ev));
828 else if(fDataType==kAOD)
829 return CalculateCentrality(dynamic_cast<AliAODEvent*>(ev));
830 else
831 return 5;
832}
833
834//________________________________________________________________________
835Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliESDEvent *esd){
669e2312 836 //
837 // Get centrality from ESD
838 //
d756027f 839
669e2312 840 Float_t cent = -1;
1ea145ef 841
842 if(esd){
843 if(esd->GetCentrality()){
844 cent = esd->GetCentrality()->GetCentralityPercentile("V0M");
669e2312 845 if(fDebug>3) printf("centrality: %f\n",cent);
1ea145ef 846 }
d756027f 847 }
848
669e2312 849 return GetCentralityClass(cent);
d756027f 850
851}
852
853//________________________________________________________________________
854Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliAODEvent *aod){
669e2312 855 //
856 // Get centrality from AOD
857 //
d756027f 858
669e2312 859 if(!aod) return 5;
d756027f 860 Float_t cent = aod->GetHeader()->GetCentrality();
669e2312 861 if(fDebug>3) printf("centrality: %f\n",cent);
862
863 return GetCentralityClass(cent);
864
865}
866
867//________________________________________________________________________
868Int_t AliPWG4HighPtTrackQA::GetCentralityClass(Float_t cent) {
869 //
870 // Get centrality class
871 //
872
873 if(cent<0) return 5; // OB - cent sometimes negative
874 if(cent>80) return 4;
875 if(cent>50) return 3;
876 if(cent>30) return 2;
877 if(cent>10) return 1;
d756027f 878 return 0;
879
880}
881
882//________________________________________________________________________
883void AliPWG4HighPtTrackQA::UserExec(Option_t *) {
884 // Main loop
885 // Called for each event
886 AliDebug(2,Form(">> AliPWG4HighPtTrackQA::UserExec \n"));
887
888 fEvent = InputEvent();
889 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
890
891 // All events without selection
892 fNEventAll->Fill(0.);
893
894 if(!SelectEvent()) {
895 // Post output data
896 PostData(1, fHistList);
897 return;
898 }
899
900
901 //Need to keep track of selected events
902 fNEventSel->Fill(0.);
903
904 fVariables = new TArrayF(fNVariables);
905
906 if(fDataType==kESD) DoAnalysisESD();
907 if(fDataType==kAOD) DoAnalysisAOD();
908
909 //Delete old fVariables
910 if(fVariables) delete fVariables;
911
912 // Post output data
913 PostData(1, fHistList);
914
915}
916
917//________________________________________________________________________
918void AliPWG4HighPtTrackQA::DoAnalysisESD() {
05cb235d 919 //
920 // Run analysis on ESD
921 //
d756027f 922
923 if(!fESD) {
924 PostData(1, fHistList);
925 return;
926 }
927
928 // ---- Get MC Header information (for MC productions in pThard bins) ----
929 Double_t ptHard = 0.;
930 Double_t nTrials = 1; // trials for MC trigger weight for real data
931
932 AliMCEventHandler *eventHandlerMC = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
933 if (eventHandlerMC) {
934
935 if(eventHandlerMC->MCEvent()){
936 AliGenPythiaEventHeader* pythiaGenHeader = GetPythiaEventHeader(eventHandlerMC->MCEvent());
937 if(pythiaGenHeader){
938 nTrials = pythiaGenHeader->Trials();
939 ptHard = pythiaGenHeader->GetPtHard();
940
941 fh1PtHard->Fill(ptHard);
942 fh1PtHardTrials->Fill(ptHard,nTrials);
943
944 fh1Trials->Fill("#sum{ntrials}",fAvgTrials);
945 }
946 }
947 }
948
949 Int_t nTracks = fESD->GetNumberOfTracks();
950 AliDebug(2,Form("nTracks ESD%d", nTracks));
951
952 /*
953 Variables to be put in fVariables
954 0: pt
955 1: phi
956 2: eta
957 3: dca2D
958 4: dcaZ
959 5: nClustersTPC
960 6: nPointITS
961 7: chi2C
962 8: nSigmaToVertex
05cb235d 963 9: trackLengthTPC
d756027f 964 10: chi2PerClusterTPC
965 11: #crossed rows
966 12: (#crossed rows)/(#findable clusters)
2b553e6f 967 13: SigmaY2
968 14: SigmaZ2
969 15: SigmaSnp2
970 16: SigmaTgl2
971 17: Sigma1Pt2
0f76d8ae 972 18: NClustersTPCIter1
973 19: Chi2TPCIter1
d889ce29 974 20: nClustersTPCShared
dae7dd67 975 21: Golden Chi2 - global vs TPC constrained
976 22: Chi2 between global and global constrained
d756027f 977 */
978
979 for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
980 fh1NTracksAll->Fill(0.);
981
982 //Get track for analysis
2b553e6f 983 AliESDtrack *track = 0x0;
d756027f 984 AliESDtrack *esdtrack = fESD->GetTrack(iTrack);
985 if(!esdtrack) {
986 fh1NTracksReject->Fill("noESDtrack",1);
987 continue;
988 }
509dc845 989 AliESDtrack *origtrack = new AliESDtrack(*esdtrack);
2926ddbb 990 if(!origtrack)
991 continue;
d756027f 992
aa3ba8d2 993 if(fTrackType==4) {
aa3ba8d2 994 if (!(fTrackCuts->AcceptTrack(esdtrack))) {
995 fh1NTracksReject->Fill("trackCuts",1);
42881dab 996 if(origtrack) delete origtrack;
aa3ba8d2 997 continue;
998 }
999 }
1000
d756027f 1001 if(fTrackType==1)
1002 track = AliESDtrackCuts::GetTPCOnlyTrack(fESD,esdtrack->GetID());
aa3ba8d2 1003 else if(fTrackType==2 || fTrackType==4) {
d756027f 1004 track = AliESDtrackCuts::GetTPCOnlyTrack(fESD,esdtrack->GetID());
1005 if(!track) {
1006 fh1NTracksReject->Fill("noTPConly",1);
42881dab 1007 if(origtrack) delete origtrack;
d756027f 1008 continue;
1009 }
1010 AliExternalTrackParam exParam;
1011 Bool_t relate = track->RelateToVertexTPC(fVtx,fESD->GetMagneticField(),kVeryBig,&exParam);
1012 if( !relate ) {
1013 fh1NTracksReject->Fill("relate",1);
fb4a2fc7 1014 if(track) delete track;
42881dab 1015 if(origtrack) delete origtrack;
d756027f 1016 continue;
1017 }
1018 track->Set(exParam.GetX(),exParam.GetAlpha(),exParam.GetParameter(),exParam.GetCovariance());
1019 }
44684f3b 1020 else if(fTrackType==5 || fTrackType==6) {
1021 if(fTrackCuts->AcceptTrack(esdtrack)) {
42881dab 1022 if(origtrack) delete origtrack;
44684f3b 1023 continue;
1024 }
1025 else {
1026 if( !(fTrackCutsITSLoose->AcceptTrack(esdtrack)) && fTrackCutsTPConly->AcceptTrack(esdtrack) ) {
1027
1028 if(fTrackType==5) {
1029 //use TPConly constrained track
1030 track = AliESDtrackCuts::GetTPCOnlyTrack(fESD,esdtrack->GetID());
2bdab66e 1031 if(!track) {
1032 fh1NTracksReject->Fill("noTPConly",1);
42881dab 1033 if(origtrack) delete origtrack;
2bdab66e 1034 continue;
1035 }
44684f3b 1036 AliExternalTrackParam exParam;
1037 Bool_t relate = track->RelateToVertexTPC(fVtx,fESD->GetMagneticField(),kVeryBig,&exParam);
1038 if( !relate ) {
1039 fh1NTracksReject->Fill("relate",1);
fb4a2fc7 1040 if(track) delete track;
42881dab 1041 if(origtrack) delete origtrack;
44684f3b 1042 continue;
1043 }
1044 track->Set(exParam.GetX(),exParam.GetAlpha(),exParam.GetParameter(),exParam.GetCovariance());
1045 }
1046 else if(fTrackType==6) {
1047 //use global constrained track
42881dab 1048 track = new AliESDtrack(*esdtrack);
44684f3b 1049 track->Set(esdtrack->GetConstrainedParam()->GetX(),esdtrack->GetConstrainedParam()->GetAlpha(),esdtrack->GetConstrainedParam()->GetParameter(),esdtrack->GetConstrainedParam()->GetCovariance());
1050
1051 }
1052 }
1053 }
1054 }
d3a3f33d 1055 else if(fTrackType==7) {
1056 //use global constrained track
dae7dd67 1057 track = new AliESDtrack(*esdtrack);
d3a3f33d 1058 }
d756027f 1059 else
1060 track = esdtrack;
1061
42881dab 1062 if(!track) {
1063 if(origtrack) delete origtrack;
d756027f 1064 continue;
42881dab 1065 }
d756027f 1066
fb4a2fc7 1067 if(fTrackType==2 || fTrackType==4 || fTrackType==5) {
2b553e6f 1068 //Cut on chi2 of constrained fit
aa3ba8d2 1069 if(track->GetConstrainedChi2TPC() > fSigmaConstrainedMax*fSigmaConstrainedMax && fSigmaConstrainedMax>0.) {
2b553e6f 1070 fh1NTracksReject->Fill("chi2",1);
fb4a2fc7 1071 if(track) delete track;
42881dab 1072 if(origtrack) delete origtrack;
2b553e6f 1073 continue;
1074 }
1075 }
1076
d756027f 1077 fPtAll->Fill(track->Pt());
1078
44684f3b 1079 if (!(fTrackCuts->AcceptTrack(track)) && fTrackType!=4 && fTrackType!=5 && fTrackType!=6) {
d756027f 1080 fh1NTracksReject->Fill("trackCuts",1);
42881dab 1081 if(fTrackType==1 || fTrackType==2 || fTrackType==7) {
fb4a2fc7 1082 if(track) delete track;
1083 }
42881dab 1084 if(origtrack) delete origtrack;
d756027f 1085 continue;
1086 }
aa3ba8d2 1087
031aac8e 1088 if(fTrackType==7) {
327d12da 1089 if(fTrackCutsITSLoose ) {
dae7dd67 1090 if(fTrackCutsITSLoose->AcceptTrack(track) ) {
1091 if(track) delete track;
42881dab 1092 if(origtrack) delete origtrack;
327d12da 1093 continue;
dae7dd67 1094 }
327d12da 1095 }
1096
031aac8e 1097 if(esdtrack->GetConstrainedParam())
1098 track->Set(esdtrack->GetConstrainedParam()->GetX(),esdtrack->GetConstrainedParam()->GetAlpha(),esdtrack->GetConstrainedParam()->GetParameter(),esdtrack->GetConstrainedParam()->GetCovariance());
031aac8e 1099 }
1100
dae7dd67 1101 if(!track) {
42881dab 1102 if(fTrackType==1 || fTrackType==2 || fTrackType==4 || fTrackType==5 || fTrackType==6 || fTrackType==7) {
dae7dd67 1103 if(track) delete track;
1104 }
42881dab 1105 if(origtrack) delete origtrack;
dae7dd67 1106 continue;
1107 }
1108
d756027f 1109 fh1NTracksSel->Fill(0.);
1110
1111 fVariables->Reset(0.);
1112
2b553e6f 1113 fVariables->SetAt(track->Pt(),0);
1114 fVariables->SetAt(track->Phi(),1);
1115 fVariables->SetAt(track->Eta(),2);
d756027f 1116
1117 Float_t dca2D = 0.;
1118 Float_t dcaz = 0.;
031aac8e 1119
1120 if(fTrackType==1 || fTrackType==2 || fTrackType==4) {
1121 track->GetImpactParametersTPC(dca2D,dcaz); //TPConly
d756027f 1122 }
031aac8e 1123 else
1124 track->GetImpactParameters(dca2D,dcaz); //Global
1125
d756027f 1126 fVariables->SetAt(dca2D,3);
dae7dd67 1127 fVariables->SetAt(dcaz,4);
d756027f 1128
1129 fVariables->SetAt((float)track->GetTPCNcls(),5);
1130
1131 Int_t nPointITS = 0;
b8f6bad5 1132 fITSClusterMap = track->GetITSClusterMap();
d756027f 1133 UChar_t itsMap = track->GetITSClusterMap();
1134 for (Int_t i=0; i < 6; i++) {
1135 if (itsMap & (1 << i))
1136 nPointITS ++;
1137 }
1138 fVariables->SetAt((float)nPointITS,6);
2b553e6f 1139 Float_t chi2C = (float)track->GetConstrainedChi2();
aa3ba8d2 1140 if(fTrackType==1 || fTrackType==2 || fTrackType==4)
2b553e6f 1141 chi2C = (float)track->GetConstrainedChi2TPC();
1142 fVariables->SetAt(chi2C,7);
d756027f 1143 fVariables->SetAt(fTrackCuts->GetSigmaToVertex(track),8);// Calculates the number of sigma to the vertex for a track.
1144
05cb235d 1145 fVariables->SetAt(GetTrackLengthTPC(track),9);
d756027f 1146
1147 if(fVariables->At(5)>0.) fVariables->SetAt(track->GetTPCchi2()/fVariables->At(5),10);
1148
a337a5a9 1149 //fVariables->SetAt(track->GetTPCClusterInfo(2,1),11); //#crossed rows
a5e0d236 1150 fVariables->SetAt(track->GetTPCCrossedRows(),11); //#crossed rows
a337a5a9 1151
44684f3b 1152 Float_t crossedRowsTPCNClsF = 1.;//track->GetTPCClusterInfo(2,0);
1153 if(track->GetTPCNclsF()>0.) crossedRowsTPCNClsF = fVariables->At(11)/track->GetTPCNclsF();
d756027f 1154 fVariables->SetAt(crossedRowsTPCNClsF,12);//(#crossed rows)/(#findable clusters)
2b553e6f 1155 fVariables->SetAt(track->GetSigmaY2(),13);
1156 fVariables->SetAt(track->GetSigmaZ2(),14);
1157 fVariables->SetAt(track->GetSigmaSnp2(),15);
1158 fVariables->SetAt(track->GetSigmaTgl2(),16);
1159 fVariables->SetAt(track->GetSigma1Pt2(),17);
0f76d8ae 1160
1161 fVariables->SetAt(track->GetTPCNclsIter1(),18);
1162 fVariables->SetAt(track->GetTPCchi2Iter1(),19);
d889ce29 1163
1164 fVariables->SetAt(track->GetTPCnclsS(),20);
dae7dd67 1165
a5e0d236 1166 Float_t chi2Gold = origtrack->GetChi2TPCConstrainedVsGlobal(fVtx);//GetGoldenChi2(origtrack);
42881dab 1167 Float_t chi2GGC = GetGGCChi2(origtrack);
dae7dd67 1168
1169 fVariables->SetAt(chi2Gold,21);
1170 fVariables->SetAt(chi2GGC,22);
a5e0d236 1171
1172 fVariables->SetAt(GetTPCClusterInfoFitMap(track,2,1),23);
1173 Float_t crossedRowsTPCNClsFFit = 1.;
1174 if(track->GetTPCNclsF()>0.) crossedRowsTPCNClsFFit = fVariables->At(23)/track->GetTPCNclsF();
1175 fVariables->SetAt(crossedRowsTPCNClsFFit,24);
d756027f 1176
1177 FillHistograms();
1178
1179 // int mult = fTrackCuts->CountAcceptedTracks(fESD);
1180
42881dab 1181 if(fTrackType==1 || fTrackType==2 || fTrackType==4 || fTrackType==5 || fTrackType==6 || fTrackType==7) {
fb4a2fc7 1182 if(track) delete track;
1183 }
509dc845 1184 if(origtrack) delete origtrack;
d756027f 1185
1186 }//track loop
1187
1188}
1189
1190//________________________________________________________________________
1191void AliPWG4HighPtTrackQA::DoAnalysisAOD() {
1192
1193 AliAODEvent *aod = dynamic_cast<AliAODEvent*>(fEvent);
1ea145ef 1194 if(!aod)return;
c3ff0a6e 1195 AliExternalTrackParam *exParam = new AliExternalTrackParam();
d756027f 1196 for (Int_t iTrack = 0; iTrack < fEvent->GetNumberOfTracks(); iTrack++) {
1197
1198 AliAODTrack *aodtrack = aod->GetTrack(iTrack);
1199 if( !aodtrack->TestFilterMask(fFilterMask) ) continue;
1200
1201 fVariables->Reset(0.);
1202
1203 fVariables->SetAt(aodtrack->Pt(),0);
1204 fVariables->SetAt(aodtrack->Phi(),1);
1205 fVariables->SetAt(aodtrack->Eta(),2);
1206
1207 Double_t dca[2] = {1e6,1e6};
1208 Double_t covar[3] = {1e6,1e6,1e6};
1209 if(aodtrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),100.,dca,covar)) {
1210 fVariables->SetAt(dca[0],3);
1211 fVariables->SetAt(dca[1],4);
1212 }
1213
1214 fVariables->SetAt((float)aodtrack->GetTPCNcls(),5);
1215 fVariables->SetAt((float)aodtrack->GetITSNcls(),6);
aa3ba8d2 1216 fVariables->SetAt(aodtrack->Chi2perNDF(),7);
d756027f 1217 fVariables->SetAt(0.,8);
c3ff0a6e 1218 fVariables->SetAt(GetTrackLengthTPC(aodtrack),9);
d756027f 1219 fVariables->SetAt(aodtrack->Chi2perNDF(),10);
a5e0d236 1220 fVariables->SetAt(GetTPCClusterInfo(aodtrack,2,1),11);
d756027f 1221 Float_t crossedRowsTPCNClsF = 0.;
1222 if(aodtrack->GetTPCNclsF()>0.) crossedRowsTPCNClsF = fVariables->At(11)/aodtrack->GetTPCNclsF();
1223 fVariables->SetAt(crossedRowsTPCNClsF,12);
c3ff0a6e 1224
1225 //get covariance matrix
1226 Double_t cov[21] = {0,};
1227 aodtrack->GetCovMatrix(cov);
1228 Double_t pxpypz[3] = {0,};
1229 aodtrack->PxPyPz(pxpypz);
1230 Double_t xyz[3] = {0,};
1231 aodtrack->GetXYZ(xyz);
1232 Short_t sign = aodtrack->Charge();
1233 exParam->Set(xyz,pxpypz,cov,sign);
1234
1235 fVariables->SetAt(exParam->GetSigmaY2(),13);
1236 fVariables->SetAt(exParam->GetSigmaZ2(),14);
1237 fVariables->SetAt(exParam->GetSigmaSnp2(),15);
1238 fVariables->SetAt(exParam->GetSigmaTgl2(),16);
1239 fVariables->SetAt(exParam->GetSigma1Pt2(),17);
1240
1241 fVariables->SetAt(0.,18);
1242 fVariables->SetAt(0.,19);
d889ce29 1243
1244 TBits sharedClusterMap = aodtrack->GetTPCSharedMap();
1245 fVariables->SetAt(sharedClusterMap.CountBits(),20);
d756027f 1246
dae7dd67 1247 fVariables->SetAt(0.,21); //not available in AOD
1248 fVariables->SetAt(0.,22); //not available in AOD
1249
a5e0d236 1250 fVariables->SetAt(0.,23); //not available in AOD
1251 fVariables->SetAt(0.,24); //not available in AOD
1252
d756027f 1253 fPtAll->Fill(fVariables->At(0));
1254
1255 FillHistograms();
1256
1257 }
1258
1259}
1260
1261//________________________________________________________________________
1262void AliPWG4HighPtTrackQA::FillHistograms() {
1263
1264 fPtSel->Fill(fVariables->At(0));
1265 fPtPhi->Fill(fVariables->At(0),fVariables->At(1));
1266 fPtEta->Fill(fVariables->At(0),fVariables->At(2));
1267 fPtDCA2D->Fill(fVariables->At(0),fVariables->At(3));
1268 fPtDCAZ->Fill(fVariables->At(0),fVariables->At(4));
1269 fPtNClustersTPC->Fill(fVariables->At(0),fVariables->At(5));
1270 fPtNPointITS->Fill(fVariables->At(0),fVariables->At(6));
c3ff0a6e 1271
1272
1273 fPtNClustersTPCIter1->Fill(fVariables->At(0),fVariables->At(18));
a5e0d236 1274 fPtNClustersTPCIter1Phi->Fill(fVariables->At(0),fVariables->At(18),fVariables->At(1));
d889ce29 1275 fPtNClustersTPCShared->Fill(fVariables->At(0),fVariables->At(20));
1276 if(fVariables->At(5)>0.)
1277 fPtNClustersTPCSharedFrac->Fill(fVariables->At(0),fVariables->At(20)/fVariables->At(5));
1278
c3ff0a6e 1279 if(fVariables->At(18)>0.)
1280 fPtChi2PerClusterTPCIter1->Fill(fVariables->At(0),fVariables->At(19)/fVariables->At(18));
1281
1282 fPtChi2C->Fill(fVariables->At(0),fVariables->At(7));
1283 fPtNSigmaToVertex->Fill(fVariables->At(0),fVariables->At(8));
1284 fPtRelUncertainty1Pt->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)));
1285 fPtRelUncertainty1PtNClus->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(5));
1286 fPtRelUncertainty1PtNClusIter1->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(18));
b8f6bad5 1287 fPtRelUncertainty1PtNPointITS->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(6));
1288
1289 fPtRelUncertainty1PtITSClusterMap->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),(int)fITSClusterMap);
1290
c3ff0a6e 1291 fPtRelUncertainty1PtChi2->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(10));
1292 if(fVariables->At(18)>0.)
1293 fPtRelUncertainty1PtChi2Iter1->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(19)/fVariables->At(18));
1294 fPtRelUncertainty1PtPhi->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(1));
c3ff0a6e 1295
1296 fPtUncertainty1Pt->Fill(fVariables->At(0),TMath::Sqrt(fVariables->At(17)));
1297 fPtSigmaY2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(13)));
1298 fPtSigmaZ2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(14)));
1299 fPtSigmaSnp2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(15)));
1300 fPtSigmaTgl2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(16)));
1301 fPtSigma1Pt2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(17)));
1302
1303 fProfPtSigmaY2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(13)));
1304 fProfPtSigmaZ2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(14)));
1305 fProfPtSigmaSnp2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(15)));
1306 fProfPtSigmaTgl2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(16)));
1307 fProfPtSigma1Pt2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(17)));
1308 fProfPtSigma1Pt->Fill(fVariables->At(0),TMath::Sqrt(fVariables->At(17)));
1309 fProfPtPtSigma1Pt->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)));
1310
d756027f 1311 fPtChi2PerClusterTPC->Fill(fVariables->At(0),fVariables->At(10));
1312 fPtNCrossedRows->Fill(fVariables->At(0),fVariables->At(11));
a337a5a9 1313 fPtNCrossedRowsPhi->Fill(fVariables->At(0),fVariables->At(11),fVariables->At(1));
b8f6bad5 1314 fPtNCrossedRowsNClusFPhi->Fill(fVariables->At(0),fVariables->At(12),fVariables->At(1));
d756027f 1315 fPtNCrRNCrRNClusF->Fill(fVariables->At(0),fVariables->At(11),fVariables->At(12));
d889ce29 1316
dae7dd67 1317 fPtChi2Gold->Fill(fVariables->At(0),fVariables->At(21));
1318 fPtChi2GGC->Fill(fVariables->At(0),fVariables->At(22));
1319
1320 fPtChi2GoldPhi->Fill(fVariables->At(0),fVariables->At(21),fVariables->At(1));
1321 fPtChi2GGCPhi->Fill(fVariables->At(0),fVariables->At(22),fVariables->At(1));
1322
1323 fChi2GoldChi2GGC->Fill(fVariables->At(21),fVariables->At(22));
1324
a5e0d236 1325 fPtNCrossedRowsFit->Fill(fVariables->At(0),fVariables->At(23));
a337a5a9 1326 fPtNCrossedRowsFitPhi->Fill(fVariables->At(0),fVariables->At(23),fVariables->At(1));
b8f6bad5 1327 fPtNCrossedRowsNClusFFitPhi->Fill(fVariables->At(0),fVariables->At(24),fVariables->At(1));
a337a5a9 1328 fNCrossedRowsNCrossedRowsFit->Fill(fVariables->At(11),fVariables->At(23));
a5e0d236 1329
a337a5a9 1330 fNClustersNCrossedRows->Fill(fVariables->At(5),fVariables->At(11));
1331 fNClustersNCrossedRowsFit->Fill(fVariables->At(5),fVariables->At(23));
dae7dd67 1332
b8f6bad5 1333 fPtRelUncertainty1PtNCrossedRows->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(11));
1334 fPtRelUncertainty1PtNCrossedRowsFit->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(23));
1335
d756027f 1336}
1337
1338//________________________________________________________________________
1339Bool_t AliPWG4HighPtTrackQA::PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials){
1340 //
1341 // get the cross section and the trails either from pyxsec.root or from pysec_hists.root
1342 // This is to called in Notify and should provide the path to the AOD/ESD file
1343 // Copied from AliAnalysisTaskJetSpectrum2
1344 //
1345
1346 TString file(currFile);
1347 fXsec = 0;
1348 fTrials = 1;
1349
1350 if(file.Contains("root_archive.zip#")){
1351 Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact);
1352 Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
1353 file.Replace(pos+1,20,"");
1354 }
1355 else {
1356 // not an archive take the basename....
1357 file.ReplaceAll(gSystem->BaseName(file.Data()),"");
1358 }
1359 // Printf("%s",file.Data());
1360
1361
1362 TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")); // problem that we cannot really test the existance of a file in a archive so we have to lvie with open error message from root
1363 if(!fxsec){
1364 // next trial fetch the histgram file
1365 fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
1366 if(!fxsec){
1367 // not a severe condition but inciate that we have no information
1368 return kFALSE;
1369 }
1370 else{
1371 // find the tlist we want to be independtent of the name so use the Tkey
1372 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
1373 if(!key){
1374 fxsec->Close();
1375 return kFALSE;
1376 }
1377 TList *list = dynamic_cast<TList*>(key->ReadObj());
1378 if(!list){
1379 fxsec->Close();
1380 return kFALSE;
1381 }
1382 fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
1383 fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
1384 fxsec->Close();
1385 }
1386 } // no tree pyxsec.root
1387 else {
1388 TTree *xtree = (TTree*)fxsec->Get("Xsection");
1389 if(!xtree){
1390 fxsec->Close();
1391 return kFALSE;
1392 }
1393 UInt_t ntrials = 0;
1394 Double_t xsection = 0;
1395 xtree->SetBranchAddress("xsection",&xsection);
1396 xtree->SetBranchAddress("ntrials",&ntrials);
1397 xtree->GetEntry(0);
1398 fTrials = ntrials;
1399 fXsec = xsection;
1400 fxsec->Close();
1401 }
1402 return kTRUE;
1403}
1404//________________________________________________________________________
1405Bool_t AliPWG4HighPtTrackQA::Notify()
1406{
1407 //
1408 // Implemented Notify() to read the cross sections
1409 // and number of trials from pyxsec.root
1410 // Copied from AliAnalysisTaskJetSpectrum2
1411 //
1412
1413 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
1414 Float_t xsection = 0;
1415 Float_t ftrials = 1;
1416
1417 fAvgTrials = 1;
1418 if(tree){
1419 TFile *curfile = tree->GetCurrentFile();
1420 if (!curfile) {
1421 Error("Notify","No current file");
1422 return kFALSE;
1423 }
1424 if(!fh1Xsec||!fh1Trials){
1425 // Printf("%s%d No Histogram fh1Xsec",(char*)__FILE__,__LINE__);
1426 return kFALSE;
1427 }
1428 PythiaInfoFromFile(curfile->GetName(),xsection,ftrials);
1429 fh1Xsec->Fill("<#sigma>",xsection);
1430 // construct a poor man average trials
1431 Float_t nEntries = (Float_t)tree->GetTree()->GetEntries();
1432 if(ftrials>=nEntries && nEntries>0.)fAvgTrials = ftrials/nEntries;
1433 }
1434 return kTRUE;
1435}
1436
1437//________________________________________________________________________
1438AliGenPythiaEventHeader* AliPWG4HighPtTrackQA::GetPythiaEventHeader(AliMCEvent *mcEvent){
1439
1440 if(!mcEvent)return 0;
1441 AliGenEventHeader* genHeader = mcEvent->GenEventHeader();
1442 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
1443 if(!pythiaGenHeader){
1444 // cocktail ??
1445 AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(genHeader);
1446
1447 if (!genCocktailHeader) {
1448 // AliWarningGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),"Unknown header type (not Pythia or Cocktail)");
1449 // AliWarning(Form("%s %d: Unknown header type (not Pythia or Cocktail)",(char*)__FILE__,__LINE__));
1450 return 0;
1451 }
1452 TList* headerList = genCocktailHeader->GetHeaders();
1453 for (Int_t i=0; i<headerList->GetEntries(); i++) {
1454 pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
1455 if (pythiaGenHeader)
1456 break;
1457 }
1458 if(!pythiaGenHeader){
1459 AliWarningGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),"Pythia event header not found");
1460 return 0;
1461 }
1462 }
1463 return pythiaGenHeader;
1464
1465}
1466
1467//_______________________________________________________________________
1468Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfo(AliAODTrack *tr,Int_t nNeighbours/*=3*/, Int_t type/*=0*/, Int_t row0, Int_t row1) const
1469{
1470 //MV: copied from AliESDtrack since method is not available in AliAODTrack
1471
1472 //
1473 // TPC cluster information
1474 // type 0: get fraction of found/findable clusters with neighbourhood definition
1475 // 1: findable clusters with neighbourhood definition
1476 // 2: found clusters
1477 //
1478 // definition of findable clusters:
1479 // a cluster is defined as findable if there is another cluster
1480 // within +- nNeighbours pad rows. The idea is to overcome threshold
1481 // effects with a very simple algorithm.
1482 //
1483
1484 TBits fTPCClusterMap = tr->GetTPCClusterMap();
1485 if (type==2) return fTPCClusterMap.CountBits();
1486
1487 Int_t found=0;
1488 Int_t findable=0;
1489 Int_t last=-nNeighbours;
1490
1491 for (Int_t i=row0; i<row1; ++i){
1492 //look to current row
1493 if (fTPCClusterMap[i]) {
1494 last=i;
1495 ++found;
1496 ++findable;
1497 continue;
1498 }
1499 //look to nNeighbours before
1500 if ((i-last)<=nNeighbours) {
1501 ++findable;
1502 continue;
1503 }
1504 //look to nNeighbours after
1505 for (Int_t j=i+1; j<i+1+nNeighbours; ++j){
1506 if (fTPCClusterMap[j]){
1507 ++findable;
1508 break;
1509 }
1510 }
1511 }
1512 if (type==1) return findable;
1513
1514 if (type==0){
1515 Float_t fraction=0;
1516 if (findable>0)
1517 fraction=(Float_t)found/(Float_t)findable;
1518 else
1519 fraction=0;
1520 return fraction;
1521 }
1522 return 0; // undefined type - default value
1523}
1524
a5e0d236 1525//_______________________________________________________________________
1526Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfoFitMap(AliESDtrack *tr,Int_t nNeighbours/*=3*/, Int_t type/*=0*/, Int_t row0, Int_t row1) const
1527{
1528 //
1529 // TPC cluster information from fit map
1530 // type 0: get fraction of found/findable clusters with neighbourhood definition
1531 // 1: findable clusters with neighbourhood definition
1532 // 2: found clusters
1533 //
1534 // definition of findable clusters:
1535 // a cluster is defined as findable if there is another cluster
1536 // within +- nNeighbours pad rows. The idea is to overcome threshold
1537 // effects with a very simple algorithm.
1538 //
1539
1540 TBits fTPCFitMap = tr->GetTPCFitMap();
1541 if (type==2) return fTPCFitMap.CountBits();
1542
1543 Int_t found=0;
1544 Int_t findable=0;
1545 Int_t last=-nNeighbours;
1546
1547 for (Int_t i=row0; i<row1; ++i){
1548 //look to current row
1549 if (fTPCFitMap[i]) {
1550 last=i;
1551 ++found;
1552 ++findable;
1553 continue;
1554 }
1555 //look to nNeighbours before
1556 if ((i-last)<=nNeighbours) {
1557 ++findable;
1558 continue;
1559 }
1560 //look to nNeighbours after
1561 for (Int_t j=i+1; j<i+1+nNeighbours; ++j){
1562 if (fTPCFitMap[j]){
1563 ++findable;
1564 break;
1565 }
1566 }
1567 }
1568 if (type==1) return findable;
1569
1570 if (type==0){
1571 Float_t fraction=0;
1572 if (findable>0)
1573 fraction=(Float_t)found/(Float_t)findable;
1574 else
1575 fraction=0;
1576 return fraction;
1577 }
1578 return 0; // undefined type - default value
1579}
1580
05cb235d 1581//_______________________________________________________________________
1582Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(AliESDtrack *track) {
1583 //
c3ff0a6e 1584 // returns distance between 1st and last hit in TPC
1585 // distance given in number of padrows
1586 //
1587
1588 TBits fTPCClusterMap = track->GetTPCClusterMap();
1589 int firstHit = 0;
1590 int lastHit = 0;
1591
1592 for(int i=0; i<=159; i++) {
1593 if(fTPCClusterMap[i]>0) firstHit = i;
1594 }
1595 for(int i=159; i>=0; i--) {
1596 if(fTPCClusterMap[i]>0) lastHit = i;
1597 }
1598
1599 Int_t trackLength = lastHit - firstHit;
1600
1601 return trackLength;
1602}
1603
1604//_______________________________________________________________________
1605Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(AliAODTrack *track) {
1606 //
1607 // returns distance between 1st and last hit in TPC
05cb235d 1608 // distance given in number of padrows
1609 //
1610
1611 TBits fTPCClusterMap = track->GetTPCClusterMap();
1612 int firstHit = 0;
1613 int lastHit = 0;
1614
c3ff0a6e 1615 for(int i=0; i<=159; i++) {
1616 if(fTPCClusterMap[i]>0) firstHit = i;
05cb235d 1617 }
1618 for(int i=159; i>=0; i--) {
c3ff0a6e 1619 if(fTPCClusterMap[i]>0) lastHit = i;
05cb235d 1620 }
1621
c3ff0a6e 1622 Int_t trackLength = lastHit - firstHit;
1623
1624 return trackLength;
05cb235d 1625}
1626
dae7dd67 1627//_______________________________________________________________________
42881dab 1628Float_t AliPWG4HighPtTrackQA::GetGoldenChi2(AliESDtrack *origtrack) {
dae7dd67 1629 //
1630 // Return chi2 between global and TPC constrained track
42881dab 1631 // track should be the global unconstrained track
dae7dd67 1632 //
1633
1634 Float_t chi2Gold = 0.;
1635
dae7dd67 1636 AliESDtrack *tpcTrack = 0x0;
42881dab 1637 tpcTrack = AliESDtrackCuts::GetTPCOnlyTrack(fESD,origtrack->GetID());
dae7dd67 1638 if(tpcTrack) {
1639 AliExternalTrackParam exParam;
1640 Bool_t relate = tpcTrack->RelateToVertexTPC(fVtx,fESD->GetMagneticField(),kVeryBig,&exParam);
1641 if( relate ) {
1642 tpcTrack->Set(exParam.GetX(),exParam.GetAlpha(),exParam.GetParameter(),exParam.GetCovariance());
1643 // Double_t pTPC[2],covTPC[3]; tpcTrack->PropagateToDCA(fVtx, fESD->GetMagneticField(), 10000, pTPC, covTPC);
1644 }
1645
42881dab 1646 tpcTrack->Propagate(origtrack->GetAlpha(), origtrack->GetX(), fESD->GetMagneticField());
1647 chi2Gold = (Float_t)origtrack->GetPredictedChi2(tpcTrack);
dae7dd67 1648 }
1649
1650 if(tpcTrack) delete tpcTrack;
1651
1652 return chi2Gold;
1653
1654}
1655
1656//_______________________________________________________________________
42881dab 1657Float_t AliPWG4HighPtTrackQA::GetGGCChi2(AliESDtrack *origtrack) {
dae7dd67 1658 //
1659 // Return chi2 between global and global constrained track
42881dab 1660 // track should be the global unconstrained track
dae7dd67 1661 //
1662
1663 Float_t chi2GGC = 0.;
1664
42881dab 1665 AliESDtrack *esdtrackC = new AliESDtrack(*origtrack);
1666 if(esdtrackC) {
c49eda44 1667 if(origtrack->GetConstrainedParam()) {
1668 esdtrackC->Set(origtrack->GetConstrainedParam()->GetX(),origtrack->GetConstrainedParam()->GetAlpha(),origtrack->GetConstrainedParam()->GetParameter(),origtrack->GetConstrainedParam()->GetCovariance());
1669 chi2GGC = (Float_t)origtrack->GetPredictedChi2(esdtrackC);
1670 }
42881dab 1671 delete esdtrackC;
dae7dd67 1672 }
42881dab 1673
dae7dd67 1674 return chi2GGC;
1675
1676}
1677
d756027f 1678//________________________________________________________________________
1679void AliPWG4HighPtTrackQA::Terminate(Option_t *)
1680{
1681 // The Terminate() function is the last function to be called during
1682 // a query. It always runs on the client, it can be used to present
1683 // the results graphically or save the results to file.
1684
1685}
1686
1687#endif