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