]>
Commit | Line | Data |
---|---|---|
045571a6 | 1 | #include "AliAnalysisTaskSE.h" |
045571a6 | 2 | #include "AliAnalysisManager.h" |
3 | #include "AliAnalysisDataContainer.h" | |
4 | #include "AliESDEvent.h" | |
5 | #include "AliESDfriend.h" | |
31a96e36 | 6 | #include "AliCDBManager.h" |
7 | #include "AliCDBEntry.h" | |
8 | #include "AliTriggerConfiguration.h" | |
045571a6 | 9 | #include "AliStack.h" |
10 | #include "AliPID.h" | |
a9130d15 | 11 | #include "AliCentrality.h" |
045571a6 | 12 | #include "AliITSPIDResponse.h" |
13 | #include "AliMCEventHandler.h" | |
14 | #include "AliMCEvent.h" | |
a9130d15 | 15 | #include "AliMultiplicity.h" |
045571a6 | 16 | #include <TParticle.h> |
17 | #include <TSystem.h> | |
18 | #include <TTree.h> | |
2afdea69 | 19 | #include <TNtuple.h> |
045571a6 | 20 | #include <TH1F.h> |
21 | #include <TH2F.h> | |
22 | #include <TChain.h> | |
23 | #include "AliESDInputHandlerRP.h" | |
24 | #include "AliAnalysisTaskITSsaTracks.h" | |
25 | ||
26 | /************************************************************************** | |
27 | * Copyright(c) 1998-2012, ALICE Experiment at CERN, All rights reserved. * | |
28 | * * | |
29 | * Author: The ALICE Off-line Project. * | |
30 | * Contributors are mentioned in the code where appropriate. * | |
31 | * * | |
32 | * Permission to use, copy, modify and distribute this software and its * | |
33 | * documentation strictly for non-commercial purposes is hereby granted * | |
34 | * without fee, provided that the above copyright notice appears in all * | |
35 | * copies and that both the copyright notice and this permission notice * | |
36 | * appear in the supporting documentation. The authors make no claims * | |
37 | * about the suitability of this software for any purpose. It is * | |
38 | * provided "as is" without express or implied warranty. * | |
39 | **************************************************************************/ | |
40 | ||
41 | //************************************************************************* | |
42 | // Implementation of class AliAnalysisTaskITSsaTracks | |
43 | // AliAnalysisTaskSE to extract QA and performance histos for ITS standalone tracks | |
44 | // | |
45 | // | |
46 | // Authors: L. Milano, milano@to.infn.it | |
47 | // F. Prino, prino@to.infn.it | |
48 | // | |
49 | //************************************************************************* | |
50 | ||
51 | ClassImp(AliAnalysisTaskITSsaTracks) | |
52 | //______________________________________________________________________________ | |
53 | AliAnalysisTaskITSsaTracks::AliAnalysisTaskITSsaTracks() : AliAnalysisTaskSE("ITSsa resolution"), | |
54 | fOutput(0), | |
55 | fHistNEvents(0), | |
2afdea69 | 56 | fHistMCPhiResid(0), |
57 | fHistPhiResid(0), | |
58 | fNtupleTracks(0), | |
045571a6 | 59 | fNPtBins(kMaxPtBins), |
60 | fMinITSpts(4), | |
61 | fMinSPDpts(1), | |
2afdea69 | 62 | fMinPtsforPid(3), |
045571a6 | 63 | fMinTPCpts(50), |
2afdea69 | 64 | fMaxITSChi2Clu(100.), |
a9130d15 | 65 | fMinCentrality(0.), |
66 | fMaxCentrality(100.), | |
2afdea69 | 67 | fFillNtuple(kFALSE), |
045571a6 | 68 | fReadMC(kFALSE), |
a9130d15 | 69 | fUseMCId(kFALSE), |
31a96e36 | 70 | fUseCentrality(kFALSE), |
71 | fRequireSPD(kTRUE), | |
72 | fRequireSDD(kTRUE), | |
73 | fRequireSSD(kTRUE), | |
74 | fTrigConfig(0) | |
045571a6 | 75 | { |
76 | // | |
77 | for(Int_t ilay=0; ilay<6;ilay++) fRequirePoint[ilay]=kFALSE; | |
78 | DefineInput(0, TChain::Class()); | |
79 | DefineOutput(1, TList::Class()); | |
a9130d15 | 80 | const Int_t nbins = 35; |
045571a6 | 81 | Double_t xbins[nbins+1]={0.06,0.08,0.10,0.12,0.14,0.16,0.18,0.20,0.25,0.30, |
82 | 0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.70,0.75,0.80, | |
a9130d15 | 83 | 0.85,0.90,0.95,1.00,1.20,1.40,1.60,1.80,1.90,2.00, |
84 | 3.00,4.00,5.00,10.0,20.0,30.0}; | |
045571a6 | 85 | SetPtBins(nbins,xbins); |
86 | } | |
87 | ||
88 | ||
89 | //___________________________________________________________________________ | |
90 | AliAnalysisTaskITSsaTracks::~AliAnalysisTaskITSsaTracks(){ | |
91 | // | |
9c12af5f | 92 | if (AliAnalysisManager::GetAnalysisManager()->IsProofMode()) return; |
93 | // RS: why do we delete all histos? they are owned by the output!!! | |
94 | /* | |
2afdea69 | 95 | delete fHistNEvents; |
9c12af5f | 96 | for(Int_t iType=0; iType<kNtrackTypes; iType++){ |
2afdea69 | 97 | delete fHistPt[iType]; |
98 | delete fHistPtGood[iType]; | |
99 | delete fHistPtFake[iType]; | |
100 | delete fHistEtaPhi[iType]; | |
101 | delete fHistEtaPhiGood[iType]; | |
102 | delete fHistEtaPhiFake[iType]; | |
519eed9b | 103 | delete fHistEtaPhiAny[iType]; |
104 | delete fHistEtaPhi1SPD[iType]; | |
105 | delete fHistEtaPhi4Clu[iType]; | |
106 | delete fHistEtaPhi6Clu[iType]; | |
2afdea69 | 107 | delete fHistChi2[iType]; |
108 | delete fHistChi2Good[iType]; | |
109 | delete fHistChi2Fake[iType]; | |
110 | delete fHistNclu[iType]; | |
111 | delete fHistNcluGood[iType]; | |
112 | delete fHistNcluFake[iType]; | |
519eed9b | 113 | delete fHistdedxvsP2cls[iType]; |
114 | delete fHistdedxvsP3cls[iType]; | |
115 | delete fHistdedxvsP4cls[iType]; | |
2afdea69 | 116 | } |
117 | for(Int_t iSpec=0; iSpec<kNspecies; iSpec++){ | |
118 | delete fHistPtTPCITS[iSpec]; | |
119 | delete fHistPtITSsa[iSpec]; | |
120 | delete fHistPtITSpureSA[iSpec]; | |
121 | delete fHistEtaPhiTPCITS[iSpec]; | |
122 | delete fHistEtaPhiITSsa[iSpec]; | |
123 | delete fHistEtaPhiITSpureSA[iSpec]; | |
124 | delete fHistNcluTPCITS[iSpec]; | |
125 | delete fHistNcluITSsa[iSpec]; | |
126 | delete fHistNcluITSpureSA[iSpec]; | |
127 | delete fHistd0rphiITSpureSA[iSpec]; | |
128 | delete fHistd0zITSpureSA[iSpec]; | |
129 | delete fHistCluInLayTPCITS[iSpec]; | |
130 | delete fHistCluInLayITSsa[iSpec]; | |
131 | delete fHistCluInLayITSpureSA[iSpec]; | |
132 | delete fHistOuterLayITSpureSA[iSpec]; | |
133 | delete fHistPtResid[iSpec]; | |
134 | delete fHistPtRelResid[iSpec]; | |
135 | delete fHistInvPtResid[iSpec]; | |
136 | delete fHistInvPtRelResid[iSpec]; | |
137 | delete fHistMCPtResid[iSpec]; | |
138 | delete fHistMCPtRelResid[iSpec]; | |
139 | delete fHistMCInvPtResid[iSpec]; | |
140 | delete fHistMCInvPtRelResid[iSpec]; | |
141 | } | |
9c12af5f | 142 | */ |
2afdea69 | 143 | delete fHistMCPhiResid; |
144 | delete fHistPhiResid; | |
145 | delete fNtupleTracks; | |
045571a6 | 146 | if (fOutput) { |
147 | delete fOutput; | |
148 | fOutput = 0; | |
149 | } | |
150 | } | |
151 | ||
152 | //________________________________________________________________________ | |
153 | void AliAnalysisTaskITSsaTracks::SetPtBins(Int_t n, Double_t* lim){ | |
154 | // define pt bins for analysis | |
155 | if(n>kMaxPtBins){ | |
156 | printf("Max. number of Pt bins = %d\n",kMaxPtBins); | |
157 | return; | |
158 | }else{ | |
159 | fNPtBins=n; | |
160 | for(Int_t i=0; i<fNPtBins+1; i++) fPtLimits[i]=lim[i]; | |
161 | for(Int_t i=fNPtBins+1; i<kMaxPtBins+1; i++) fPtLimits[i]=99999999.; | |
162 | } | |
163 | } | |
164 | //___________________________________________________________________________ | |
165 | void AliAnalysisTaskITSsaTracks::UserCreateOutputObjects() { | |
166 | // create output histos | |
167 | ||
168 | fOutput = new TList(); | |
169 | fOutput->SetOwner(); | |
170 | fOutput->SetName("OutputHistos"); | |
171 | ||
a9130d15 | 172 | fNtupleTracks= new TNtuple("ntupleTracks","ntupleTracks","pt:px:py:pz:eta:phi:d0xy:d0z:dedx3:dedx4:dedx5:dedx6:truncmean:chi2:status:ITSrefit:TPCin:TPCrefit:ITSpureSA:nITSclu:nTPCclu:clumap:spdin:spdout:sddin:sddout:ssdin:ssdout:label:ptgen:pxgen:pygen:pzgen:etagen:phigen:ntracks:ntracklets:centr:iEvent"); |
2afdea69 | 173 | // kinematics: pt, p eta,phi -> 6 variables |
174 | // impact parameters: d0xy, d0z -> 2 variables | |
175 | // dE/dx: 4 Layers + trunc mean -> 5 variables | |
176 | // chi2 and track status: -> 6 variables | |
177 | // cluster infos: -> 9 variables | |
178 | // MC info: -> 7 variables | |
179 | // Multiplicity -> 1 variable | |
180 | // Total: 36 | |
181 | fOutput->Add(fNtupleTracks); | |
182 | ||
31a96e36 | 183 | fHistNEvents = new TH1F("hNEvents", "Number of processed events",7,-0.5,6.5); |
045571a6 | 184 | fHistNEvents->Sumw2(); |
185 | fHistNEvents->SetMinimum(0); | |
31a96e36 | 186 | fHistNEvents->GetXaxis()->SetBinLabel(1,"All events"); |
187 | fHistNEvents->GetXaxis()->SetBinLabel(2,"Good vertex"); | |
188 | fHistNEvents->GetXaxis()->SetBinLabel(3,"In centrality range"); | |
189 | fHistNEvents->GetXaxis()->SetBinLabel(4,"Without SPD"); | |
190 | fHistNEvents->GetXaxis()->SetBinLabel(5,"Without SDD"); | |
191 | fHistNEvents->GetXaxis()->SetBinLabel(6,"Without SSD"); | |
192 | fHistNEvents->GetXaxis()->SetBinLabel(7,"Analyzed events"); | |
045571a6 | 193 | fOutput->Add(fHistNEvents); |
194 | ||
195 | //binning for the dedx histogram | |
196 | const Int_t hnbinsdedx=400; | |
197 | Double_t hxmindedx = 0.01; | |
198 | Double_t hxmaxdedx = 10; | |
199 | Double_t hlogxmindedx = TMath::Log10(hxmindedx); | |
200 | Double_t hlogxmaxdedx = TMath::Log10(hxmaxdedx); | |
201 | Double_t hbinwidthdedx = (hlogxmaxdedx-hlogxmindedx)/hnbinsdedx; | |
202 | Double_t hxbinsdedx[hnbinsdedx+1]; | |
203 | hxbinsdedx[0] = 0.01; | |
204 | for (Int_t i=1;i<=hnbinsdedx;i++) { | |
205 | hxbinsdedx[i] = hxmindedx + TMath::Power(10,hlogxmindedx+i*hbinwidthdedx); | |
206 | } | |
207 | ||
2afdea69 | 208 | TString tit[kNtrackTypes]={"TPCITS","ITSsa","ITSpureSA"}; |
209 | for(Int_t iType=0; iType<kNtrackTypes; iType++){ | |
210 | fHistPt[iType]=new TH1F(Form("hPt%s",tit[iType].Data()),"",100,0.,2.); | |
211 | fHistPt[iType]->Sumw2(); | |
212 | fOutput->Add(fHistPt[iType]); | |
213 | fHistPtGood[iType]=new TH1F(Form("hPtGood%s",tit[iType].Data()),"",100,0.,2.); | |
214 | fHistPtGood[iType]->Sumw2(); | |
215 | fOutput->Add(fHistPtGood[iType]); | |
216 | fHistPtFake[iType]=new TH1F(Form("hPtFake%s",tit[iType].Data()),"",100,0.,2.); | |
217 | fHistPtFake[iType]->Sumw2(); | |
218 | fOutput->Add(fHistPtFake[iType]); | |
219 | ||
220 | fHistEtaPhi[iType] = new TH2F(Form("hEtaPhi%s",tit[iType].Data()),"",50,-1,1.,100,0.,2.*TMath::Pi()); | |
221 | fHistEtaPhi[iType]->Sumw2(); | |
222 | fOutput->Add(fHistEtaPhi[iType]); | |
223 | fHistEtaPhiGood[iType] = new TH2F(Form("hEtaPhiGood%s",tit[iType].Data()),"",50,-1,1.,100,0.,2.*TMath::Pi()); | |
224 | fHistEtaPhiGood[iType]->Sumw2(); | |
225 | fOutput->Add(fHistEtaPhiGood[iType]); | |
226 | fHistEtaPhiFake[iType] = new TH2F(Form("hEtaPhiFake%s",tit[iType].Data()),"",50,-1,1.,100,0.,2.*TMath::Pi()); | |
227 | fHistEtaPhiFake[iType]->Sumw2(); | |
228 | fOutput->Add(fHistEtaPhiFake[iType]); | |
229 | ||
519eed9b | 230 | fHistEtaPhiAny[iType] = new TH2F(Form("hEtaPhiAny%s",tit[iType].Data()),"",50,-1,1.,100,0.,2.*TMath::Pi()); |
231 | fHistEtaPhiAny[iType]->Sumw2(); | |
232 | fOutput->Add(fHistEtaPhiAny[iType]); | |
233 | fHistEtaPhi1SPD[iType] = new TH2F(Form("hEtaPhi1SPD%s",tit[iType].Data()),"",50,-1,1.,100,0.,2.*TMath::Pi()); | |
234 | fHistEtaPhi1SPD[iType]->Sumw2(); | |
235 | fOutput->Add(fHistEtaPhi1SPD[iType]); | |
236 | fHistEtaPhi4Clu[iType] = new TH2F(Form("hEtaPhi4Clu%s",tit[iType].Data()),"",50,-1,1.,100,0.,2.*TMath::Pi()); | |
237 | fHistEtaPhi4Clu[iType]->Sumw2(); | |
238 | fOutput->Add(fHistEtaPhi4Clu[iType]); | |
239 | fHistEtaPhi6Clu[iType] = new TH2F(Form("hEtaPhi6Clu%s",tit[iType].Data()),"",50,-1,1.,100,0.,2.*TMath::Pi()); | |
240 | fHistEtaPhi6Clu[iType]->Sumw2(); | |
241 | fOutput->Add(fHistEtaPhi6Clu[iType]); | |
242 | ||
2afdea69 | 243 | fHistChi2[iType]=new TH1F(Form("hChi2%s",tit[iType].Data()),"",100,0.,10.); |
244 | fHistChi2[iType]->Sumw2(); | |
245 | fOutput->Add(fHistChi2[iType]); | |
246 | fHistChi2Good[iType]=new TH1F(Form("hChi2Good%s",tit[iType].Data()),"",100,0.,10.); | |
247 | fHistChi2Good[iType]->Sumw2(); | |
248 | fOutput->Add(fHistChi2Good[iType]); | |
249 | fHistChi2Fake[iType]=new TH1F(Form("hChi2Fake%s",tit[iType].Data()),"",100,0.,10.); | |
250 | fHistChi2Fake[iType]->Sumw2(); | |
251 | fOutput->Add(fHistChi2Fake[iType]); | |
252 | ||
253 | fHistNclu[iType]=new TH1F(Form("hNclu%s",tit[iType].Data()),"",7,-0.5,6.5); | |
254 | fHistNclu[iType]->Sumw2(); | |
255 | fOutput->Add(fHistNclu[iType]); | |
256 | fHistNcluGood[iType]=new TH1F(Form("hNcluGood%s",tit[iType].Data()),"",7,-0.5,6.5); | |
257 | fHistNcluGood[iType]->Sumw2(); | |
258 | fOutput->Add(fHistNcluGood[iType]); | |
259 | fHistNcluFake[iType]=new TH1F(Form("hNcluFake%s",tit[iType].Data()),"",7,-0.5,6.5); | |
260 | fHistNcluFake[iType]->Sumw2(); | |
261 | fOutput->Add(fHistNcluFake[iType]); | |
262 | ||
519eed9b | 263 | fHistdedxvsP2cls[iType] = new TH2F(Form("hdedxvsP2cls%s",tit[iType].Data()),"",hnbinsdedx,hxbinsdedx,900,0,1000); |
264 | fHistdedxvsP2cls[iType]->Sumw2(); | |
265 | fOutput->Add(fHistdedxvsP2cls[iType]); | |
266 | ||
267 | fHistdedxvsP3cls[iType] = new TH2F(Form("hdedxvsP3cls%s",tit[iType].Data()),"",hnbinsdedx,hxbinsdedx,900,0,1000); | |
268 | fHistdedxvsP3cls[iType]->Sumw2(); | |
269 | fOutput->Add(fHistdedxvsP3cls[iType]); | |
2afdea69 | 270 | |
519eed9b | 271 | fHistdedxvsP4cls[iType] = new TH2F(Form("hdedxvsP4cls%s",tit[iType].Data()),"",hnbinsdedx,hxbinsdedx,900,0,1000); |
272 | fHistdedxvsP4cls[iType]->Sumw2(); | |
273 | fOutput->Add(fHistdedxvsP4cls[iType]); | |
2afdea69 | 274 | } |
275 | ||
276 | //----------------------------------------------------------- | |
277 | ||
045571a6 | 278 | TString spname[3]={"Pion","Kaon","Proton"}; |
279 | TString hisname; | |
280 | const Int_t nbins = fNPtBins; | |
281 | Double_t xbins[nbins+1]; | |
282 | for(Int_t ibin=0; ibin<=nbins; ibin++) xbins[ibin]=fPtLimits[ibin]; | |
283 | ||
045571a6 | 284 | for(Int_t iSpec=0; iSpec<kNspecies; iSpec++){ |
285 | ||
286 | hisname.Form("hPtTPCITS%s",spname[iSpec].Data()); | |
287 | fHistPtTPCITS[iSpec] = new TH1F(hisname.Data(),"",100,0.,2.); | |
288 | fHistPtTPCITS[iSpec]->Sumw2(); | |
289 | fOutput->Add(fHistPtTPCITS[iSpec]); | |
290 | ||
291 | hisname.Form("hPtITSsa%s",spname[iSpec].Data()); | |
292 | fHistPtITSsa[iSpec] = new TH1F(hisname.Data(),"",100,0.,2.); | |
293 | fHistPtITSsa[iSpec]->Sumw2(); | |
294 | fOutput->Add(fHistPtITSsa[iSpec]); | |
295 | ||
296 | hisname.Form("hPtITSpureSA%s",spname[iSpec].Data()); | |
297 | fHistPtITSpureSA[iSpec] = new TH1F(hisname.Data(),"",100,0.,2.); | |
298 | fHistPtITSpureSA[iSpec]->Sumw2(); | |
299 | fOutput->Add(fHistPtITSpureSA[iSpec]); | |
300 | ||
301 | //--- | |
302 | ||
303 | hisname.Form("hEtaPhiTPCITS%s",spname[iSpec].Data()); | |
304 | fHistEtaPhiTPCITS[iSpec] = new TH2F(hisname.Data(),"",50,-1,1.,50,0.,2.*TMath::Pi()); | |
305 | fHistEtaPhiTPCITS[iSpec]->Sumw2(); | |
306 | fOutput->Add(fHistEtaPhiTPCITS[iSpec]); | |
307 | ||
308 | hisname.Form("hEtaPhiITSsa%s",spname[iSpec].Data()); | |
309 | fHistEtaPhiITSsa[iSpec] = new TH2F(hisname.Data(),"",50,-1,1.,50,0.,2.*TMath::Pi()); | |
310 | fHistEtaPhiITSsa[iSpec]->Sumw2(); | |
311 | fOutput->Add(fHistEtaPhiITSsa[iSpec]); | |
312 | ||
313 | hisname.Form("hEtaPhiITSpureSA%s",spname[iSpec].Data()); | |
314 | fHistEtaPhiITSpureSA[iSpec] = new TH2F(hisname.Data(),"",50,-1,1.,50,0.,2.*TMath::Pi()); | |
315 | fHistEtaPhiITSpureSA[iSpec]->Sumw2(); | |
316 | fOutput->Add(fHistEtaPhiITSpureSA[iSpec]); | |
317 | ||
318 | //--- | |
319 | ||
320 | hisname.Form("hNcluTPCITS%s",spname[iSpec].Data()); | |
321 | fHistNcluTPCITS[iSpec] = new TH2F(hisname.Data(),"",100,0.,2.,7,-0.5,6.5); | |
322 | fHistNcluTPCITS[iSpec]->Sumw2(); | |
323 | fOutput->Add(fHistNcluTPCITS[iSpec]); | |
324 | ||
325 | hisname.Form("hNcluITSsa%s",spname[iSpec].Data()); | |
326 | fHistNcluITSsa[iSpec] = new TH2F(hisname.Data(),"",100,0.,2.,7,-0.5,6.5); | |
327 | fHistNcluITSsa[iSpec]->Sumw2(); | |
328 | fOutput->Add(fHistNcluITSsa[iSpec]); | |
329 | ||
330 | hisname.Form("hNcluITSpureSA%s",spname[iSpec].Data()); | |
331 | fHistNcluITSpureSA[iSpec] = new TH2F(hisname.Data(),"",100,0.,2.,7,-0.5,6.5); | |
332 | fHistNcluITSpureSA[iSpec]->Sumw2(); | |
333 | fOutput->Add(fHistNcluITSpureSA[iSpec]); | |
334 | ||
335 | //--- | |
336 | ||
337 | hisname.Form("hd0rphiITSpureSA%s",spname[iSpec].Data()); | |
a9130d15 | 338 | fHistd0rphiITSpureSA[iSpec] = new TH2F(hisname.Data(),"",nbins,xbins,4000,-2,2); |
045571a6 | 339 | fHistd0rphiITSpureSA[iSpec]->Sumw2(); |
340 | fOutput->Add(fHistd0rphiITSpureSA[iSpec]); | |
341 | ||
342 | hisname.Form("hd0zITSpureSA%s",spname[iSpec].Data()); | |
a9130d15 | 343 | fHistd0zITSpureSA[iSpec] = new TH2F(hisname.Data(),"",nbins,xbins,4000,-2,2); |
045571a6 | 344 | fHistd0zITSpureSA[iSpec]->Sumw2(); |
345 | fOutput->Add(fHistd0zITSpureSA[iSpec]); | |
346 | ||
347 | //--- | |
348 | ||
349 | hisname.Form("hCluInLayTPCITS%s",spname[iSpec].Data()); | |
350 | fHistCluInLayTPCITS[iSpec] = new TH2F(hisname.Data(),"",100,0.,2.,7,-1.5,5.5); | |
351 | fHistCluInLayTPCITS[iSpec]->Sumw2(); | |
352 | fOutput->Add(fHistCluInLayTPCITS[iSpec]); | |
353 | ||
354 | hisname.Form("hCluInLayITSsa%s",spname[iSpec].Data()); | |
355 | fHistCluInLayITSsa[iSpec] = new TH2F(hisname.Data(),"",100,0.,2.,7,-1.5,5.5); | |
356 | fHistCluInLayITSsa[iSpec]->Sumw2(); | |
357 | fOutput->Add(fHistCluInLayITSsa[iSpec]); | |
358 | ||
359 | hisname.Form("hCluInLayITSpureSA%s",spname[iSpec].Data()); | |
360 | fHistCluInLayITSpureSA[iSpec] = new TH2F(hisname.Data(),"",100,0.,2.,7,-1.5,5.5); | |
361 | fHistCluInLayITSpureSA[iSpec]->Sumw2(); | |
362 | fOutput->Add(fHistCluInLayITSpureSA[iSpec]); | |
363 | ||
364 | hisname.Form("hOuterLayITSpureSA%s",spname[iSpec].Data()); | |
365 | fHistOuterLayITSpureSA[iSpec] = new TH2F(hisname.Data(),"",100,0.,2.,7,-1.5,5.5); | |
366 | fHistOuterLayITSpureSA[iSpec]->Sumw2(); | |
367 | fOutput->Add(fHistOuterLayITSpureSA[iSpec]); | |
368 | ||
369 | //--- | |
370 | ||
371 | hisname.Form("hPtResid%s",spname[iSpec].Data()); | |
372 | fHistPtResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-1.,1.); | |
373 | fHistPtResid[iSpec]->Sumw2(); | |
374 | fOutput->Add(fHistPtResid[iSpec]); | |
375 | hisname.Form("hPtRelResid%s",spname[iSpec].Data()); | |
376 | fHistPtRelResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-0.5,0.5); | |
377 | fHistPtRelResid[iSpec]->Sumw2(); | |
378 | fOutput->Add(fHistPtRelResid[iSpec]); | |
379 | ||
380 | hisname.Form("hInvPtResid%s",spname[iSpec].Data()); | |
381 | fHistInvPtResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-1.,1.); | |
382 | fHistInvPtResid[iSpec]->Sumw2(); | |
383 | fOutput->Add(fHistInvPtResid[iSpec]); | |
384 | hisname.Form("hInvPtRelResid%s",spname[iSpec].Data()); | |
385 | fHistInvPtRelResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-0.5,0.5); | |
386 | fHistInvPtRelResid[iSpec]->Sumw2(); | |
387 | fOutput->Add(fHistInvPtRelResid[iSpec]); | |
388 | ||
389 | hisname.Form("hMCPtResid%s",spname[iSpec].Data()); | |
390 | fHistMCPtResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-1.,1.); | |
391 | fHistMCPtResid[iSpec]->Sumw2(); | |
392 | fOutput->Add(fHistMCPtResid[iSpec]); | |
393 | hisname.Form("hMCPtRelResid%s",spname[iSpec].Data()); | |
394 | fHistMCPtRelResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-0.5,0.5); | |
395 | fHistMCPtRelResid[iSpec]->Sumw2(); | |
396 | fOutput->Add(fHistMCPtRelResid[iSpec]); | |
397 | ||
398 | hisname.Form("hMCInvPtResid%s",spname[iSpec].Data()); | |
399 | fHistMCInvPtResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-1.,1.); | |
400 | fHistMCInvPtResid[iSpec]->Sumw2(); | |
401 | fOutput->Add(fHistMCInvPtResid[iSpec]); | |
402 | hisname.Form("hMCInvPtRelResid%s",spname[iSpec].Data()); | |
403 | fHistMCInvPtRelResid[iSpec]=new TH2F(hisname.Data(),hisname.Data(),nbins,xbins,100,-0.5,0.5); | |
404 | fHistMCInvPtRelResid[iSpec]->Sumw2(); | |
405 | fOutput->Add(fHistMCInvPtRelResid[iSpec]); | |
406 | ||
407 | } | |
408 | ||
2afdea69 | 409 | fHistMCPhiResid=new TH2F("hMCPhiResid","",nbins,xbins,100,-0.5,0.5); |
410 | fHistMCPhiResid->Sumw2(); | |
411 | fOutput->Add(fHistMCPhiResid); | |
412 | fHistPhiResid=new TH2F("hPhiResid","",nbins,xbins,100,-0.5,0.5); | |
413 | fHistPhiResid->Sumw2(); | |
414 | fOutput->Add(fHistPhiResid); | |
415 | ||
416 | PostData(1,fOutput); | |
417 | ||
045571a6 | 418 | } |
419 | //______________________________________________________________________________ | |
420 | void AliAnalysisTaskITSsaTracks::UserExec(Option_t *) | |
421 | { | |
422 | // | |
423 | ||
31a96e36 | 424 | static Bool_t initCalib = kFALSE; |
045571a6 | 425 | AliESDEvent *esd = (AliESDEvent*) (InputEvent()); |
426 | ||
427 | ||
428 | if(!esd) { | |
429 | printf("AliAnalysisTaskSDDRP::Exec(): bad ESD\n"); | |
430 | return; | |
431 | } | |
432 | ||
433 | ||
434 | if(!ESDfriend()) { | |
435 | printf("AliAnalysisTaskSDDRP::Exec(): bad ESDfriend\n"); | |
436 | return; | |
437 | } | |
31a96e36 | 438 | if(fRequireSPD || fRequireSDD || fRequireSSD){ |
439 | if (!initCalib) { | |
440 | AliCDBManager* man = AliCDBManager::Instance(); | |
441 | if (!man) { | |
442 | AliFatal("CDB not set but needed by AliAnalysisTaskSDDRP"); | |
443 | return; | |
444 | } | |
445 | AliCDBEntry* eT=(AliCDBEntry*)man->Get("GRP/CTP/Config"); | |
446 | if(eT){ | |
447 | eT->PrintId(); | |
448 | eT->PrintMetaData(); | |
449 | fTrigConfig=(AliTriggerConfiguration*)eT->GetObject(); | |
450 | } | |
451 | if(!eT || !fTrigConfig){ | |
452 | AliError("Cannot retrieve CDB entry for GRP/CTP/Config"); | |
453 | return; | |
454 | } | |
455 | initCalib=kTRUE; | |
456 | } | |
457 | } | |
458 | ||
045571a6 | 459 | AliStack* stack=0; |
460 | ||
461 | if(fReadMC){ | |
462 | AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
463 | if (!eventHandler) { | |
464 | Printf("ERROR: Could not retrieve MC event handler"); | |
465 | return; | |
466 | } | |
467 | AliMCEvent* mcEvent = eventHandler->MCEvent(); | |
468 | if (!mcEvent) { | |
469 | Printf("ERROR: Could not retrieve MC event"); | |
470 | return; | |
471 | } | |
472 | stack = mcEvent->Stack(); | |
473 | if (!stack) { | |
474 | Printf("ERROR: stack not available"); | |
475 | return; | |
476 | } | |
477 | } | |
478 | ||
045571a6 | 479 | |
480 | fHistNEvents->Fill(0); | |
481 | const AliESDVertex *spdv=esd->GetPrimaryVertexSPD(); | |
482 | if(spdv->GetNContributors()<=0) return; | |
483 | fHistNEvents->Fill(1); | |
2afdea69 | 484 | |
a9130d15 | 485 | const Int_t ntSize=39; |
2afdea69 | 486 | Float_t xnt[ntSize]; |
487 | ||
a9130d15 | 488 | Double_t centrality=esd->GetCentrality()->GetCentralityPercentile("V0M"); |
489 | if(fUseCentrality){ | |
490 | if(centrality<fMinCentrality) return; | |
491 | if(centrality>fMaxCentrality) return; | |
492 | } | |
493 | fHistNEvents->Fill(2); | |
494 | ||
31a96e36 | 495 | Bool_t spdOK=kTRUE; |
496 | Bool_t sddOK=kTRUE; | |
497 | Bool_t ssdOK=kTRUE; | |
498 | if(fTrigConfig){ | |
499 | spdOK=esd->IsDetectorInTriggerCluster("ITSSPD",fTrigConfig); | |
500 | if(!spdOK) fHistNEvents->Fill(3); | |
501 | sddOK=esd->IsDetectorInTriggerCluster("ITSSDD",fTrigConfig); | |
502 | if(!sddOK) fHistNEvents->Fill(4); | |
503 | ssdOK=esd->IsDetectorInTriggerCluster("ITSSSD",fTrigConfig); | |
504 | if(!ssdOK) fHistNEvents->Fill(5); | |
505 | } | |
506 | if(fRequireSPD && !spdOK) return; | |
507 | if(fRequireSDD && !sddOK) return; | |
508 | if(fRequireSSD && !ssdOK) return; | |
509 | fHistNEvents->Fill(6); | |
510 | ||
511 | ||
045571a6 | 512 | Int_t ntracks = esd->GetNumberOfTracks(); |
a9130d15 | 513 | const AliMultiplicity* mult=esd->GetMultiplicity(); |
514 | Int_t ntracklets = mult->GetNumberOfTracklets(); | |
515 | ||
045571a6 | 516 | for (Int_t iTrack=0; iTrack < ntracks; iTrack++) { |
517 | AliESDtrack * track = esd->GetTrack(iTrack); | |
518 | if (!track) continue; | |
2afdea69 | 519 | Float_t pttrack=track->Pt(); |
520 | Float_t ptrack=track->P(); | |
521 | Float_t pxtrack=track->Px(); | |
522 | Float_t pytrack=track->Py(); | |
523 | Float_t pztrack=track->Pz(); | |
524 | Float_t impactXY=-999, impactZ=-999; | |
525 | track->GetImpactParameters(impactXY, impactZ); | |
526 | Double_t dedxlay[4]; | |
527 | track->GetITSdEdxSamples(dedxlay); | |
528 | Float_t dedx=track->GetITSsignal(); | |
529 | Float_t chi2=track->GetITSchi2(); | |
045571a6 | 530 | Int_t status=track->GetStatus(); |
2afdea69 | 531 | Bool_t isITSrefit=kFALSE; |
532 | Bool_t isTPCin=kFALSE; | |
533 | Bool_t isTPCrefit=kFALSE; | |
534 | Bool_t isPureSA=kFALSE; | |
535 | if(status&AliESDtrack::kITSrefit) isITSrefit=kTRUE; | |
536 | if(status&AliESDtrack::kTPCin) isTPCin=kTRUE; | |
537 | if(status&AliESDtrack::kTPCrefit) isTPCrefit=kTRUE; | |
538 | if(status&AliESDtrack::kITSpureSA) isPureSA=kTRUE; | |
045571a6 | 539 | Bool_t isSA=kTRUE; |
540 | if(status&AliESDtrack::kTPCin) isSA=kFALSE; | |
541 | Int_t nTPCclus=track->GetNcls(1); | |
542 | Int_t nITSclus=track->GetNcls(0); | |
2afdea69 | 543 | UChar_t clumap=track->GetITSClusterMap(); |
544 | Int_t idet; | |
545 | Float_t xloc,zloc; | |
546 | Int_t statusLay[6]; | |
547 | for(Int_t iLay=0; iLay<6;iLay++) track->GetITSModuleIndexInfo(iLay,idet,statusLay[iLay],xloc,zloc); | |
548 | Int_t trlabel=track->GetLabel(); | |
549 | Float_t ptgen=-999.; | |
550 | Float_t pgen=-999.; | |
551 | Float_t pxgen=-999.; | |
552 | Float_t pygen=-999.; | |
553 | Float_t pzgen=-999.; | |
554 | Float_t etagen=-999.; | |
555 | Float_t phigen=-999.; | |
556 | if(fReadMC){ | |
557 | TParticle* part = stack->Particle(TMath::Abs(trlabel)); | |
558 | ptgen=part->Pt(); | |
559 | pgen=part->P(); | |
560 | pxgen=part->Px(); | |
561 | pygen=part->Py(); | |
562 | pzgen=part->Pz(); | |
563 | etagen=part->Eta(); | |
564 | phigen=part->Phi(); | |
565 | } | |
566 | ||
567 | Int_t indexn=0; | |
568 | xnt[indexn++]=pttrack; | |
569 | xnt[indexn++]=pxtrack; | |
570 | xnt[indexn++]=pytrack; | |
571 | xnt[indexn++]=pztrack; | |
572 | xnt[indexn++]=track->Eta(); | |
573 | xnt[indexn++]=track->Phi(); | |
574 | xnt[indexn++]=impactXY; | |
575 | xnt[indexn++]=impactZ; | |
576 | for(Int_t iLay=0; iLay<4; iLay++) xnt[indexn++]=dedxlay[iLay]; | |
577 | xnt[indexn++]=dedx; | |
578 | xnt[indexn++]=chi2; | |
579 | xnt[indexn++]=status; | |
580 | xnt[indexn++]=isITSrefit; | |
581 | xnt[indexn++]=isTPCin; | |
582 | xnt[indexn++]=isTPCrefit; | |
583 | xnt[indexn++]=isPureSA; | |
584 | xnt[indexn++]=nITSclus; | |
585 | xnt[indexn++]=nTPCclus; | |
586 | xnt[indexn++]=clumap; | |
587 | for(Int_t iLay=0; iLay<6; iLay++) xnt[indexn++]=(Float_t)statusLay[iLay]; | |
588 | xnt[indexn++]=trlabel; | |
589 | xnt[indexn++]=ptgen; | |
590 | xnt[indexn++]=pxgen; | |
591 | xnt[indexn++]=pygen; | |
592 | xnt[indexn++]=pzgen; | |
593 | xnt[indexn++]=etagen; | |
594 | xnt[indexn++]=phigen; | |
595 | xnt[indexn++]=ntracks; | |
a9130d15 | 596 | xnt[indexn++]=ntracklets; |
597 | xnt[indexn++]=centrality; | |
598 | xnt[indexn++]=esd->GetEventNumberInFile(); | |
2afdea69 | 599 | |
600 | if(indexn>ntSize) printf("AliAnalysisTaskITSsaTracks: ERROR ntuple insexout of range\n"); | |
601 | if(fFillNtuple) fNtupleTracks->Fill(xnt); | |
602 | ||
603 | if(!(status&AliESDtrack::kITSrefit)) continue; | |
519eed9b | 604 | |
605 | Int_t iTrackType=-1; | |
606 | if(status&AliESDtrack::kTPCin){ | |
607 | iTrackType=kTypeTPCITS; | |
608 | }else{ | |
609 | if(status&AliESDtrack::kITSpureSA) iTrackType=kTypeITSpureSA; | |
610 | else iTrackType=kTypeITSsa; | |
611 | } | |
612 | if(iTrackType<0 || iTrackType>=kNtrackTypes) continue; | |
045571a6 | 613 | |
045571a6 | 614 | Int_t nSPDPoints=0; |
615 | for(Int_t i=0; i<2; i++){ | |
616 | if(clumap&(1<<i)) ++nSPDPoints; | |
617 | } | |
045571a6 | 618 | Int_t nPointsForPid=0; |
619 | for(Int_t i=2; i<6; i++){ | |
620 | if(clumap&(1<<i)) ++nPointsForPid; | |
621 | } | |
2afdea69 | 622 | |
519eed9b | 623 | fHistEtaPhiAny[iTrackType]->Fill(track->Eta(),track->Phi()); |
624 | if(nSPDPoints>=1) fHistEtaPhi1SPD[iTrackType]->Fill(track->Eta(),track->Phi()); | |
625 | if(nSPDPoints>=1 && nPointsForPid>=3) fHistEtaPhi4Clu[iTrackType]->Fill(track->Eta(),track->Phi()); | |
626 | if(nITSclus==6) fHistEtaPhi6Clu[iTrackType]->Fill(track->Eta(),track->Phi()); | |
627 | ||
628 | ||
629 | if(nITSclus<fMinITSpts)continue; | |
630 | if((chi2/nITSclus) > fMaxITSChi2Clu) continue; | |
631 | if(nSPDPoints<fMinSPDpts) continue; | |
632 | ||
2afdea69 | 633 | fHistPt[iTrackType]->Fill(pttrack); |
634 | fHistEtaPhi[iTrackType]->Fill(track->Eta(),track->Phi()); | |
519eed9b | 635 | |
2afdea69 | 636 | fHistChi2[iTrackType]->Fill(chi2/nITSclus); |
637 | fHistNclu[iTrackType]->Fill(nITSclus); | |
519eed9b | 638 | if(nPointsForPid==2){ |
639 | fHistdedxvsP2cls[iTrackType]->Fill(ptrack,dedx); | |
640 | } | |
641 | else if(nPointsForPid==3){ | |
642 | fHistdedxvsP3cls[iTrackType]->Fill(ptrack,dedx); | |
2afdea69 | 643 | } |
519eed9b | 644 | else if(nPointsForPid==4){ |
645 | fHistdedxvsP4cls[iTrackType]->Fill(ptrack,dedx); | |
2afdea69 | 646 | } |
647 | if(fReadMC){ | |
648 | if(trlabel<0){ | |
649 | fHistPtFake[iTrackType]->Fill(pttrack); | |
650 | fHistEtaPhiFake[iTrackType]->Fill(track->Eta(),track->Phi()); | |
651 | fHistChi2Fake[iTrackType]->Fill(chi2/nITSclus); | |
652 | fHistNcluFake[iTrackType]->Fill(nITSclus); | |
045571a6 | 653 | }else{ |
2afdea69 | 654 | fHistPtGood[iTrackType]->Fill(pttrack); |
655 | fHistEtaPhiGood[iTrackType]->Fill(track->Eta(),track->Phi()); | |
656 | fHistChi2Good[iTrackType]->Fill(chi2/nITSclus); | |
657 | fHistNcluGood[iTrackType]->Fill(nITSclus); | |
045571a6 | 658 | } |
659 | } | |
660 | ||
2afdea69 | 661 | Int_t hadronSpecie=-1; |
045571a6 | 662 | if(fReadMC && fUseMCId){ |
045571a6 | 663 | if(trlabel>=0){ |
2afdea69 | 664 | TParticle* part = stack->Particle(trlabel); |
665 | Int_t pdg=TMath::Abs(part->GetPdgCode()); | |
666 | if(pdg==211) hadronSpecie=kPion; | |
667 | else if(pdg==321) hadronSpecie=kKaon; | |
668 | else if(pdg==2212) hadronSpecie=kProton; | |
045571a6 | 669 | } |
045571a6 | 670 | }else{ |
2afdea69 | 671 | if(nPointsForPid<fMinPtsforPid)continue; |
045571a6 | 672 | AliITSPIDResponse pidits(fReadMC); |
673 | Float_t nSigmaPion=pidits.GetNumberOfSigmas(ptrack,dedx,AliPID::kPion,nPointsForPid,isSA); | |
674 | if(nSigmaPion>-2. && nSigmaPion<2.){ | |
675 | hadronSpecie=kPion; | |
676 | }else{ | |
677 | Float_t nSigmaKaon=pidits.GetNumberOfSigmas(ptrack,dedx,AliPID::kKaon,nPointsForPid,isSA); | |
678 | if(nSigmaKaon>-2. && nSigmaKaon<2.){ | |
679 | hadronSpecie=kKaon; | |
680 | }else{ | |
681 | Float_t nSigmaProton=pidits.GetNumberOfSigmas(ptrack,dedx,AliPID::kProton,nPointsForPid,isSA); | |
682 | if(nSigmaProton>-2. && nSigmaProton<2.){ | |
683 | hadronSpecie=kProton; | |
684 | } | |
685 | } | |
686 | } | |
687 | } | |
688 | if(hadronSpecie<0) continue; | |
2afdea69 | 689 | if(iTrackType==kTypeTPCITS){ // TPC+ITS tracks |
045571a6 | 690 | fHistPtTPCITS[hadronSpecie]->Fill(pttrack); |
691 | fHistEtaPhiTPCITS[hadronSpecie]->Fill(track->Eta(),track->Phi()); | |
692 | fHistNcluTPCITS[hadronSpecie]->Fill(pttrack,nITSclus); | |
a9130d15 | 693 | fHistCluInLayTPCITS[hadronSpecie]->Fill(pttrack,-1.); |
045571a6 | 694 | for(Int_t iBit=0; iBit<6; iBit++){ |
695 | if(clumap&(1<<iBit)) fHistCluInLayTPCITS[hadronSpecie]->Fill(pttrack,iBit); | |
696 | } | |
2afdea69 | 697 | }else if(iTrackType==kTypeITSpureSA){ // TPC+ITS tracks |
698 | fHistPtITSpureSA[hadronSpecie]->Fill(pttrack); | |
699 | fHistEtaPhiITSpureSA[hadronSpecie]->Fill(track->Eta(),track->Phi()); | |
700 | fHistNcluITSpureSA[hadronSpecie]->Fill(pttrack,nITSclus); | |
701 | fHistd0rphiITSpureSA[hadronSpecie]->Fill(pttrack,impactXY); | |
702 | fHistd0zITSpureSA[hadronSpecie]->Fill(pttrack,impactZ); | |
a9130d15 | 703 | fHistCluInLayITSpureSA[hadronSpecie]->Fill(pttrack,-1.); |
2afdea69 | 704 | Int_t outerLay=-1; |
705 | for(Int_t iBit=0; iBit<6; iBit++){ | |
706 | if(clumap&(1<<iBit)){ | |
707 | fHistCluInLayITSpureSA[hadronSpecie]->Fill(pttrack,iBit); | |
708 | if(iBit>outerLay) outerLay=iBit; | |
045571a6 | 709 | } |
045571a6 | 710 | } |
2afdea69 | 711 | fHistOuterLayITSpureSA[hadronSpecie]->Fill(pttrack,outerLay); |
712 | ||
045571a6 | 713 | |
2afdea69 | 714 | if(fReadMC){ |
715 | if(trlabel>=0){ | |
045571a6 | 716 | TParticle* part = stack->Particle(trlabel); |
2afdea69 | 717 | ptgen=part->Pt(); |
045571a6 | 718 | Float_t invpttrack=track->OneOverPt(); |
719 | Float_t invptgen=0.; | |
720 | if(ptgen>0.) invptgen=1./ptgen; | |
721 | fHistMCPtResid[hadronSpecie]->Fill(pttrack,pttrack-ptgen); | |
722 | fHistMCPtRelResid[hadronSpecie]->Fill(pttrack,(pttrack-ptgen)/ptgen); | |
723 | fHistMCInvPtResid[hadronSpecie]->Fill(pttrack,invpttrack-invptgen); | |
724 | fHistMCInvPtRelResid[hadronSpecie]->Fill(pttrack,(invpttrack-invptgen)/invptgen); | |
2afdea69 | 725 | Float_t deltaphi=track->Phi()-part->Phi(); |
726 | if(deltaphi<-TMath::Pi()) deltaphi+=2*TMath::Pi(); | |
727 | if(deltaphi>TMath::Pi()) deltaphi-=2*TMath::Pi(); | |
728 | fHistMCPhiResid->Fill(pttrack,deltaphi); | |
045571a6 | 729 | } |
2afdea69 | 730 | } |
731 | }else if(iTrackType==kTypeITSsa){ // TPC+ITS tracks | |
732 | fHistPtITSsa[hadronSpecie]->Fill(pttrack); | |
733 | fHistEtaPhiITSsa[hadronSpecie]->Fill(track->Eta(),track->Phi()); | |
734 | fHistNcluITSsa[hadronSpecie]->Fill(pttrack,nITSclus); | |
a9130d15 | 735 | fHistCluInLayITSsa[hadronSpecie]->Fill(pttrack,-1.); |
2afdea69 | 736 | for(Int_t iBit=0; iBit<6; iBit++){ |
737 | if(clumap&(1<<iBit)) fHistCluInLayITSsa[hadronSpecie]->Fill(pttrack,iBit); | |
045571a6 | 738 | } |
739 | } | |
2afdea69 | 740 | |
741 | // match TPCITS with ITSpureSA | |
742 | if(nITSclus<fMinITSpts || nTPCclus<fMinTPCpts) continue; | |
045571a6 | 743 | Int_t idxMI[12],idxSA[12]; |
744 | for(Int_t icl=0; icl<12; icl++){ | |
745 | idxMI[icl]=-1; | |
746 | idxSA[icl]=-1; | |
747 | } | |
748 | Int_t ncls=track->GetClusters(0,idxMI); | |
749 | if(fMinITSpts<6){ | |
750 | Bool_t accept=kTRUE; | |
751 | for(Int_t ilay=0; ilay<6; ilay++){ | |
752 | if(fRequirePoint[ilay]){ | |
753 | Int_t mask = 1<<ilay; | |
754 | if(!(clumap & mask)){ | |
755 | accept=kFALSE; | |
756 | break; | |
757 | } | |
758 | } | |
759 | } | |
760 | if(!accept) continue; | |
761 | } | |
762 | // Sort | |
763 | for(Int_t i=0;i<12;i++){ | |
764 | for(Int_t j=i+1;j<12;j++){ | |
765 | if(idxMI[j]>idxMI[i]){ | |
766 | Int_t tmp=idxMI[j]; | |
767 | idxMI[j]=idxMI[i]; | |
768 | idxMI[i]=tmp; | |
769 | } | |
770 | } | |
771 | } | |
772 | // for(Int_t i=0; i<12; i++) printf("%d ",idxMI[i]); | |
773 | // printf("\n"); | |
774 | if(idxMI[0]<0 && idxMI[0]==idxMI[1]) continue; | |
775 | Bool_t matched=kFALSE; | |
776 | for (Int_t iTrack2 = 0; iTrack2 < ntracks; iTrack2++) { | |
777 | if(matched) break; | |
778 | if(iTrack2==iTrack) continue; | |
779 | AliESDtrack* track2 = esd->GetTrack(iTrack2); | |
780 | Int_t status2=track2->GetStatus(); | |
781 | if(!(status2&AliESDtrack::kITSrefit)) continue; | |
782 | if(!(status2&AliESDtrack::kITSpureSA)) continue; | |
783 | Int_t clumap2=track2->GetITSClusterMap(); | |
784 | Int_t nITSclus2=track2->GetNcls(0); | |
785 | Int_t nTPCclus2=track2->GetNcls(1); | |
786 | if(nITSclus2<fMinITSpts || nTPCclus2>0) continue; | |
787 | Int_t ncls2=track2->GetClusters(0,idxSA); | |
788 | if(ncls2!=ncls) continue; | |
789 | if(fMinITSpts<6){ | |
790 | Bool_t accept=kTRUE; | |
791 | for(Int_t ilay=0; ilay<6; ilay++){ | |
792 | if(fRequirePoint[ilay]){ | |
793 | Int_t mask = 1<<ilay; | |
794 | if(!(clumap2 & mask)){ | |
795 | accept=kFALSE; | |
796 | break; | |
797 | } | |
798 | } | |
799 | } | |
800 | if(!accept) continue; | |
801 | } | |
802 | // Sort | |
803 | for(Int_t i=0;i<12;i++){ | |
804 | for(Int_t j=i+1;j<12;j++){ | |
805 | if(idxSA[j]>idxSA[i]){ | |
806 | Int_t tmp=idxSA[j]; | |
807 | idxSA[j]=idxSA[i]; | |
808 | idxSA[i]=tmp; | |
809 | } | |
810 | } | |
811 | } | |
812 | Int_t match=0; | |
813 | for(Int_t icl=0; icl<ncls; icl++){ | |
814 | if(idxSA[icl]!=idxMI[icl]){ | |
815 | match=0; | |
816 | break; | |
817 | } | |
818 | else match++; | |
819 | } | |
820 | if(match==ncls && match>0){ | |
821 | matched=kTRUE; | |
822 | Float_t pt1=track->Pt(); | |
823 | Float_t pt2=track2->Pt(); | |
824 | Float_t ptm1=track->OneOverPt(); | |
825 | Float_t ptm2=track2->OneOverPt(); | |
826 | fHistPtResid[hadronSpecie]->Fill(pt1,pt2-pt1); | |
827 | fHistPtRelResid[hadronSpecie]->Fill(pt1,(pt2-pt1)/pt1); | |
828 | fHistInvPtResid[hadronSpecie]->Fill(pt1,ptm2-ptm1); | |
2afdea69 | 829 | fHistInvPtRelResid[hadronSpecie]->Fill(pt1,(ptm2-ptm1)/ptm1); |
830 | Float_t deltaphi=track->Phi()-track2->Phi(); | |
831 | if(deltaphi<-TMath::Pi()) deltaphi+=2*TMath::Pi(); | |
832 | if(deltaphi>TMath::Pi()) deltaphi-=2*TMath::Pi(); | |
833 | fHistPhiResid->Fill(pt1,deltaphi); | |
045571a6 | 834 | } |
835 | } | |
836 | } | |
837 | ||
838 | PostData(1,fOutput); | |
839 | ||
840 | } | |
841 | //______________________________________________________________________________ | |
842 | void AliAnalysisTaskITSsaTracks::Terminate(Option_t */*option*/) | |
843 | { | |
844 | // Terminate analysis | |
845 | fOutput = dynamic_cast<TList*> (GetOutputData(1)); | |
846 | if (!fOutput) { | |
847 | printf("ERROR: fOutput not available\n"); | |
848 | return; | |
849 | } | |
2afdea69 | 850 | fNtupleTracks = dynamic_cast<TNtuple*>(fOutput->FindObject("ntupleTracks")); |
045571a6 | 851 | fHistNEvents= dynamic_cast<TH1F*>(fOutput->FindObject("hNEvents")); |
045571a6 | 852 | |
2afdea69 | 853 | TString spname[3]={"Pion","Kaon","Proton"}; |
045571a6 | 854 | |
855 | for(Int_t iSpec=0; iSpec<kNspecies; iSpec++){ | |
856 | fHistPtTPCITS[iSpec]= dynamic_cast<TH1F*>(fOutput->FindObject(Form("hPtTPCITS%s",spname[iSpec].Data()))); | |
857 | fHistPtITSsa[iSpec]= dynamic_cast<TH1F*>(fOutput->FindObject(Form("hPtITSsa%s",spname[iSpec].Data()))); | |
858 | fHistPtITSpureSA[iSpec]= dynamic_cast<TH1F*>(fOutput->FindObject(Form("hPtITSpureSA%s",spname[iSpec].Data()))); | |
859 | ||
860 | fHistEtaPhiTPCITS[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hEtaPhiTPCITS%s",spname[iSpec].Data()))); | |
861 | fHistEtaPhiITSsa[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hEtaPhiITSsa%s",spname[iSpec].Data()))); | |
862 | fHistEtaPhiITSpureSA[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hEtaPhiITSpureSA%s",spname[iSpec].Data()))); | |
863 | ||
864 | fHistNcluTPCITS[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hNcluTPCITS%s",spname[iSpec].Data()))); | |
865 | fHistNcluITSsa[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hNcluITSsa%s",spname[iSpec].Data()))); | |
866 | fHistNcluITSpureSA[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hNcluITSpureSA%s",spname[iSpec].Data()))); | |
867 | ||
868 | fHistd0rphiITSpureSA[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hd0rphiITSpureSA%s",spname[iSpec].Data()))); | |
869 | fHistd0zITSpureSA[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hd0zITSpureSA%s",spname[iSpec].Data()))); | |
870 | ||
871 | fHistCluInLayTPCITS[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hCluInLayTPCITS%s",spname[iSpec].Data()))); | |
872 | fHistCluInLayITSsa[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hCluInLayITSsa%s",spname[iSpec].Data()))); | |
873 | fHistCluInLayITSpureSA[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hCluInLayITSpureSA%s",spname[iSpec].Data()))); | |
874 | ||
875 | fHistOuterLayITSpureSA[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hOuterLayITSpureSA%s",spname[iSpec].Data()))); | |
876 | ||
877 | fHistPtResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hPtResid%s",spname[iSpec].Data()))); | |
878 | fHistPtRelResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hPtRelResid%s",spname[iSpec].Data()))); | |
879 | fHistInvPtResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hInvPtResid%s",spname[iSpec].Data()))); | |
880 | fHistInvPtRelResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hInvPtRelResid%s",spname[iSpec].Data()))); | |
881 | fHistMCPtResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hMCPtResid%s",spname[iSpec].Data()))); | |
882 | fHistMCPtRelResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hMCPtRelResid%s",spname[iSpec].Data()))); | |
883 | fHistMCInvPtResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hMCInvPtResid%s",spname[iSpec].Data()))); | |
884 | fHistMCInvPtRelResid[iSpec]= dynamic_cast<TH2F*>(fOutput->FindObject(Form("hMCInvPtRelResid%s",spname[iSpec].Data()))); | |
885 | ||
886 | } | |
2afdea69 | 887 | fHistMCPhiResid= dynamic_cast<TH2F*>(fOutput->FindObject("hMCPhiResid")); |
888 | fHistPhiResid= dynamic_cast<TH2F*>(fOutput->FindObject("hPhiResid")); | |
045571a6 | 889 | return; |
890 | } | |
891 | ||
892 | ||
893 | ||
894 | ||
895 |