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