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