1ee39b3a |
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-commercialf 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 | /* $Id: AliTRDresolution.cxx 27496 2008-07-22 08:35:45Z cblume $ */ |
17 | |
18 | //////////////////////////////////////////////////////////////////////////// |
19 | // // |
20 | // TRD tracking resolution // |
21 | // |
22 | // The class performs resolution and residual studies |
23 | // of the TRD tracks for the following quantities : |
24 | // - spatial position (y, [z]) |
25 | // - angular (phi) tracklet |
26 | // - momentum at the track level |
27 | // |
28 | // The class has to be used for regular detector performance checks using the official macros: |
29 | // - $ALICE_ROOT/TRD/qaRec/run.C |
30 | // - $ALICE_ROOT/TRD/qaRec/makeResults.C |
31 | // |
32 | // For stand alone usage please refer to the following example: |
33 | // { |
34 | // gSystem->Load("libANALYSIS.so"); |
35 | // gSystem->Load("libTRDqaRec.so"); |
36 | // AliTRDresolution *res = new AliTRDresolution(); |
37 | // //res->SetMCdata(); |
38 | // //res->SetVerbose(); |
39 | // //res->SetVisual(); |
40 | // res->Load(); |
41 | // if(!res->PostProcess()) return; |
42 | // res->GetRefFigure(0); |
43 | // } |
44 | // |
45 | // Authors: // |
46 | // Alexandru Bercuci <A.Bercuci@gsi.de> // |
47 | // Markus Fasel <M.Fasel@gsi.de> // |
48 | // // |
49 | //////////////////////////////////////////////////////////////////////////// |
50 | |
33056e04 |
51 | #include <TFile.h> |
92c40e64 |
52 | #include <TSystem.h> |
3ceb45ae |
53 | #include <TStyle.h> |
1ee39b3a |
54 | #include <TROOT.h> |
55 | #include <TObjArray.h> |
56 | #include <TH3.h> |
57 | #include <TH2.h> |
58 | #include <TH1.h> |
3ceb45ae |
59 | #include <THnSparse.h> |
1ee39b3a |
60 | #include <TF1.h> |
61 | #include <TCanvas.h> |
62 | #include <TGaxis.h> |
63 | #include <TBox.h> |
92c40e64 |
64 | #include <TLegend.h> |
1ee39b3a |
65 | #include <TGraphErrors.h> |
66 | #include <TGraphAsymmErrors.h> |
08bdd9d1 |
67 | #include <TLinearFitter.h> |
1ee39b3a |
68 | #include <TMath.h> |
69 | #include <TMatrixT.h> |
70 | #include <TVectorT.h> |
71 | #include <TTreeStream.h> |
72 | #include <TGeoManager.h> |
92c40e64 |
73 | #include <TDatabasePDG.h> |
1ee39b3a |
74 | |
75 | #include "AliPID.h" |
92d6d80c |
76 | #include "AliLog.h" |
92c40e64 |
77 | #include "AliESDtrack.h" |
068e2c00 |
78 | #include "AliMathBase.h" |
08bdd9d1 |
79 | #include "AliTrackPointArray.h" |
1ee39b3a |
80 | |
81 | #include "AliTRDresolution.h" |
82 | #include "AliTRDgeometry.h" |
3ceb45ae |
83 | #include "AliTRDtransform.h" |
1ee39b3a |
84 | #include "AliTRDpadPlane.h" |
85 | #include "AliTRDcluster.h" |
86 | #include "AliTRDseedV1.h" |
87 | #include "AliTRDtrackV1.h" |
88 | #include "AliTRDReconstructor.h" |
89 | #include "AliTRDrecoParam.h" |
92c40e64 |
90 | #include "AliTRDpidUtil.h" |
fd7ffd88 |
91 | #include "AliTRDinfoGen.h" |
4860c9db |
92 | #include "AliAnalysisManager.h" |
1ee39b3a |
93 | #include "info/AliTRDclusterInfo.h" |
566c3d46 |
94 | #include "info/AliTRDeventInfo.h" |
1ee39b3a |
95 | |
96 | ClassImp(AliTRDresolution) |
eb05d549 |
97 | ClassImp(AliTRDresolution::AliTRDrecoProjection) |
1ee39b3a |
98 | |
3ceb45ae |
99 | Int_t const AliTRDresolution::fgkNbins[kNdim] = { |
100 | Int_t(kNbunchCross)/*bc*/, |
101 | 180/*phi*/, |
102 | 50/*eta*/, |
3ceb45ae |
103 | 50/*dy*/, |
3ed01fbe |
104 | 40/*dphi*/, |
3ceb45ae |
105 | 50/*dz*/, |
566c3d46 |
106 | 3/*chg*species*/, |
3ed01fbe |
107 | kNpt/*pt*/ |
3ceb45ae |
108 | }; //! no of bins/projection |
109 | Double_t const AliTRDresolution::fgkMin[kNdim] = { |
566c3d46 |
110 | -1.5, |
3ceb45ae |
111 | -TMath::Pi(), |
112 | -1., |
3ceb45ae |
113 | -1.5, |
f036f7ec |
114 | -5., |
3ceb45ae |
115 | -2.5, |
566c3d46 |
116 | -1.5, |
3ed01fbe |
117 | -0.5 |
3ceb45ae |
118 | }; //! low limits for projections |
119 | Double_t const AliTRDresolution::fgkMax[kNdim] = { |
566c3d46 |
120 | 1.5, |
3ceb45ae |
121 | TMath::Pi(), |
122 | 1., |
3ceb45ae |
123 | 1.5, |
f036f7ec |
124 | 5., |
3ceb45ae |
125 | 2.5, |
566c3d46 |
126 | 1.5, |
3ed01fbe |
127 | kNpt-0.5 |
3ceb45ae |
128 | }; //! high limits for projections |
129 | Char_t const *AliTRDresolution::fgkTitle[kNdim] = { |
130 | "bunch cross", |
131 | "#phi [rad]", |
132 | "#eta", |
3ceb45ae |
133 | "#Deltay [cm]", |
3ed01fbe |
134 | "#Delta#phi [deg]", |
3ceb45ae |
135 | "#Deltaz [cm]", |
3ed01fbe |
136 | "chg*spec*rc", |
137 | "bin_p_{t}" |
3ceb45ae |
138 | }; //! title of projection |
139 | |
3ceb45ae |
140 | Char_t const * AliTRDresolution::fgPerformanceName[kNclasses] = { |
f073d500 |
141 | "Det2Cluster" |
142 | ,"Cluster2Track" |
1ee39b3a |
143 | ,"Tracklet2Track" |
01ccc21a |
144 | ,"Tracklet2TRDin" |
1ee39b3a |
145 | ,"Cluster2MC" |
146 | ,"Tracklet2MC" |
92d6d80c |
147 | ,"TRDin2MC" |
1ee39b3a |
148 | ,"TRD2MC" |
f429b017 |
149 | // ,"Tracklet2TRDout" |
150 | // ,"TRDout2MC" |
1ee39b3a |
151 | }; |
56838f9d |
152 | Float_t AliTRDresolution::fgPtBin[25]; |
1ee39b3a |
153 | |
154 | //________________________________________________________ |
155 | AliTRDresolution::AliTRDresolution() |
f2e89a4c |
156 | :AliTRDrecoTask() |
b9058d72 |
157 | ,fSteer(0) |
566c3d46 |
158 | ,fPtThreshold(.3) |
566c3d46 |
159 | ,fBCbinTOF(0) |
160 | ,fBCbinFill(0) |
56838f9d |
161 | ,fBsign(kFALSE) |
3ceb45ae |
162 | ,fProj(NULL) |
92c40e64 |
163 | ,fDBPDG(NULL) |
b91fdd71 |
164 | ,fCl(NULL) |
b91fdd71 |
165 | ,fMCcl(NULL) |
1ee39b3a |
166 | { |
167 | // |
168 | // Default constructor |
169 | // |
f2e89a4c |
170 | SetNameTitle("TRDresolution", "TRD spatial and momentum resolution"); |
3ceb45ae |
171 | MakePtSegmentation(); |
b9058d72 |
172 | SetProcesses(kTRUE, kTRUE, kTRUE, kTRUE); |
f8f46e4d |
173 | } |
174 | |
705f8b0a |
175 | //________________________________________________________ |
3ed01fbe |
176 | AliTRDresolution::AliTRDresolution(char* name, Bool_t xchange) |
f2e89a4c |
177 | :AliTRDrecoTask(name, "TRD spatial and momentum resolution") |
b9058d72 |
178 | ,fSteer(0) |
566c3d46 |
179 | ,fPtThreshold(.3) |
566c3d46 |
180 | ,fBCbinTOF(0) |
181 | ,fBCbinFill(0) |
56838f9d |
182 | ,fBsign(kFALSE) |
3ceb45ae |
183 | ,fProj(NULL) |
f8f46e4d |
184 | ,fDBPDG(NULL) |
f8f46e4d |
185 | ,fCl(NULL) |
f8f46e4d |
186 | ,fMCcl(NULL) |
f8f46e4d |
187 | { |
188 | // |
189 | // Default constructor |
190 | // |
1ee39b3a |
191 | |
1ee39b3a |
192 | InitFunctorList(); |
3ceb45ae |
193 | MakePtSegmentation(); |
b9058d72 |
194 | SetProcesses(kTRUE, kTRUE, kTRUE, kTRUE); |
3ed01fbe |
195 | if(xchange){ |
196 | SetUseExchangeContainers(); |
197 | DefineOutput(kClToTrk, TObjArray::Class()); // cluster2track |
198 | DefineOutput(kClToMC, TObjArray::Class()); // cluster2mc |
199 | } |
1ee39b3a |
200 | } |
201 | |
202 | //________________________________________________________ |
203 | AliTRDresolution::~AliTRDresolution() |
204 | { |
205 | // |
206 | // Destructor |
207 | // |
f0857a6a |
208 | if (AliAnalysisManager::GetAnalysisManager() && AliAnalysisManager::GetAnalysisManager()->IsProofMode()) return; |
3ceb45ae |
209 | if(fProj){fProj->Delete(); delete fProj;} |
1ee39b3a |
210 | if(fCl){fCl->Delete(); delete fCl;} |
1ee39b3a |
211 | if(fMCcl){fMCcl->Delete(); delete fMCcl;} |
1ee39b3a |
212 | } |
213 | |
214 | |
215 | //________________________________________________________ |
f8f46e4d |
216 | void AliTRDresolution::UserCreateOutputObjects() |
1ee39b3a |
217 | { |
218 | // spatial resolution |
5935a6da |
219 | |
068e2c00 |
220 | AliTRDrecoTask::UserCreateOutputObjects(); |
3ed01fbe |
221 | if(UseExchangeContainers()) InitExchangeContainers(); |
83b44483 |
222 | } |
1ee39b3a |
223 | |
83b44483 |
224 | //________________________________________________________ |
225 | void AliTRDresolution::InitExchangeContainers() |
226 | { |
61f6b45e |
227 | // Init containers for subsequent tasks (AliTRDclusterResolution) |
228 | |
3ceb45ae |
229 | fCl = new TObjArray(200); fCl->SetOwner(kTRUE); |
230 | fMCcl = new TObjArray(); fMCcl->SetOwner(kTRUE); |
e3147647 |
231 | PostData(kClToTrk, fCl); |
232 | PostData(kClToMC, fMCcl); |
1ee39b3a |
233 | } |
234 | |
235 | //________________________________________________________ |
f8f46e4d |
236 | void AliTRDresolution::UserExec(Option_t *opt) |
1ee39b3a |
237 | { |
238 | // |
239 | // Execution part |
240 | // |
241 | |
3ed01fbe |
242 | if(fCl) fCl->Delete(); |
243 | if(fMCcl) fMCcl->Delete(); |
b4414720 |
244 | AliTRDrecoTask::UserExec(opt); |
1ee39b3a |
245 | } |
246 | |
247 | //________________________________________________________ |
6475ec36 |
248 | Bool_t AliTRDresolution::Pulls(Double_t* /*dyz[2]*/, Double_t* /*cov[3]*/, Double_t /*tilt*/) const |
553528eb |
249 | { |
01ccc21a |
250 | // Helper function to calculate pulls in the yz plane |
553528eb |
251 | // using proper tilt rotation |
252 | // Uses functionality defined by AliTRDseedV1. |
253 | |
6475ec36 |
254 | return kTRUE; |
255 | /* |
553528eb |
256 | Double_t t2(tilt*tilt); |
9dcc64cc |
257 | // exit door until a bug fix is found for AliTRDseedV1::GetCovSqrt |
553528eb |
258 | |
259 | // rotate along pad |
260 | Double_t cc[3]; |
01ccc21a |
261 | cc[0] = cov[0] - 2.*tilt*cov[1] + t2*cov[2]; |
553528eb |
262 | cc[1] = cov[1]*(1.-t2) + tilt*(cov[0] - cov[2]); |
263 | cc[2] = t2*cov[0] + 2.*tilt*cov[1] + cov[2]; |
264 | // do sqrt |
01ccc21a |
265 | Double_t sqr[3]={0., 0., 0.}; |
553528eb |
266 | if(AliTRDseedV1::GetCovSqrt(cc, sqr)) return kFALSE; |
01ccc21a |
267 | Double_t invsqr[3]={0., 0., 0.}; |
553528eb |
268 | if(AliTRDseedV1::GetCovInv(sqr, invsqr)<1.e-40) return kFALSE; |
269 | Double_t tmp(dyz[0]); |
270 | dyz[0] = invsqr[0]*tmp + invsqr[1]*dyz[1]; |
271 | dyz[1] = invsqr[1]*tmp + invsqr[2]*dyz[1]; |
272 | return kTRUE; |
6475ec36 |
273 | */ |
553528eb |
274 | } |
275 | |
276 | //________________________________________________________ |
f073d500 |
277 | TH1* AliTRDresolution::DetCluster(const TObjArray *cls) |
278 | { |
279 | // |
280 | // Plot the cluster distributions |
281 | // |
282 | |
283 | if(cls) fkClusters = cls; |
284 | if(!fkClusters){ |
285 | AliDebug(4, "No Clusters defined."); |
286 | return NULL; |
287 | } |
288 | Int_t ncl(0); |
289 | if(!(ncl = fkClusters->GetEntriesFast())){ |
290 | AliDebug(1, "No RecPoints defined."); |
291 | return NULL; |
292 | } |
293 | Int_t det(-1); |
294 | AliTRDcluster *cl(NULL); |
295 | for(Int_t icl(0); icl<ncl; icl++){ |
296 | if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])) continue; |
297 | det = cl->GetDetector(); break; |
298 | } |
299 | if(det<0){ |
300 | AliDebug(1, "No useful clusters defined."); |
301 | return NULL; |
302 | } |
303 | THnSparse *H(NULL); |
304 | if(!fContainer || !(H = ((THnSparse*)fContainer->At(kDetector)))){ |
305 | AliWarning("No output container defined."); |
306 | return NULL; |
307 | } |
b351a191 |
308 | Int_t ly(AliTRDgeometry::GetLayer(det)), |
309 | stk(AliTRDgeometry::GetStack(det)); |
f073d500 |
310 | Double_t val[kNdim], |
311 | alpha((0.5+AliTRDgeometry::GetSector(det))*AliTRDgeometry::GetAlpha()), |
312 | cs(TMath::Cos(alpha)), |
313 | sn(TMath::Sin(alpha)); |
314 | for(Int_t icl(0); icl<ncl; icl++){ |
315 | if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])) continue; |
316 | val[kBC] = ly; |
317 | val[kPhi] = TMath::ATan2(cl->GetX()*sn + cl->GetY()*cs, cl->GetX()*cs - cl->GetY()*sn); |
b351a191 |
318 | val[kEta] = (5-stk)*16-cl->GetPadRow()-1-(stk<3?4:0); |
3557a081 |
319 | val[kYrez]= fEvent->GetMultiplicity(); |
320 | val[4] = TMath::Abs(cl->GetQ()); |
5591f3d6 |
321 | val[5] = cl->IsFivePad()?1:cl->GetNPads(); |
f073d500 |
322 | H->Fill(val); |
323 | } |
324 | return NULL; |
325 | } |
326 | |
327 | //________________________________________________________ |
3ceb45ae |
328 | TH1* AliTRDresolution::PlotCluster(const AliTRDtrackV1 *track) |
1ee39b3a |
329 | { |
330 | // |
3ceb45ae |
331 | // Plot the cluster distributions |
1ee39b3a |
332 | // |
333 | |
334 | if(track) fkTrack = track; |
335 | if(!fkTrack){ |
3d2a3dff |
336 | AliDebug(4, "No Track defined."); |
b91fdd71 |
337 | return NULL; |
1ee39b3a |
338 | } |
b05a637a |
339 | if(fkESD && TMath::Abs(fkESD->GetTOFbc()) > 1){ |
3ceb45ae |
340 | AliDebug(4, Form("Track with BC_index[%d] not used.", fkESD->GetTOFbc())); |
b91fdd71 |
341 | return NULL; |
1ee39b3a |
342 | } |
b05a637a |
343 | if(fkESD && fPt<fPtThreshold){ |
3ceb45ae |
344 | AliDebug(4, Form("Track with pt[%6.4f] under threshold.", fPt)); |
b91fdd71 |
345 | return NULL; |
1ee39b3a |
346 | } |
3ceb45ae |
347 | THnSparse *H(NULL); |
348 | if(!fContainer || !(H = ((THnSparse*)fContainer->At(kCluster)))){ |
1ee39b3a |
349 | AliWarning("No output container defined."); |
b91fdd71 |
350 | return NULL; |
1ee39b3a |
351 | } |
3ceb45ae |
352 | |
353 | AliTRDgeometry *geo(AliTRDinfoGen::Geometry()); |
b9058d72 |
354 | Double_t val[kNdim+2], |
7c4c4bb4 |
355 | alpha(0.), cs(-2.), sn(0.); //Float_t exb, vd, t0, s2, dl, dt; |
3ceb45ae |
356 | TObjArray *clInfoArr(NULL); |
357 | AliTRDseedV1 *fTracklet(NULL); |
3ed01fbe |
358 | AliTRDcluster *c(NULL), *cc(NULL); |
1ee39b3a |
359 | for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){ |
360 | if(!(fTracklet = fkTrack->GetTracklet(ily))) continue; |
361 | if(!fTracklet->IsOK()) continue; |
3ed01fbe |
362 | //fTracklet->GetCalibParam(exb, vd, t0, s2, dl, dt); |
3ceb45ae |
363 | val[kBC] = ily; |
7c4c4bb4 |
364 | if(cs<-1.){ |
365 | alpha = (0.5+AliTRDgeometry::GetSector(fTracklet->GetDetector()))*AliTRDgeometry::GetAlpha(); |
366 | cs = TMath::Cos(alpha); |
367 | sn = TMath::Sin(alpha); |
368 | } |
369 | val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn); |
370 | Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX()); |
371 | val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl)))); |
3ed01fbe |
372 | val[kPt] = TMath::ATan(fTracklet->GetYref(1))*TMath::RadToDeg(); |
373 | Float_t corr = 1./TMath::Sqrt(1.+fTracklet->GetYref(1)*fTracklet->GetYref(1)+fTracklet->GetZref(1)*fTracklet->GetZref(1)); |
374 | Int_t row0(-1); |
375 | Float_t padCorr(fTracklet->GetTilt()*fTracklet->GetPadLength()); |
3ceb45ae |
376 | fTracklet->ResetClusterIter(kTRUE); |
377 | while((c = fTracklet->NextCluster())){ |
3ed01fbe |
378 | Float_t xc(c->GetX()), |
f429b017 |
379 | q(TMath::Abs(c->GetQ())); |
3ed01fbe |
380 | if(row0<0) row0 = c->GetPadRow(); |
381 | |
382 | val[kYrez] = c->GetY() + padCorr*(c->GetPadRow() - row0) -fTracklet->GetYat(xc); |
383 | val[kPrez] = fTracklet->GetX0()-xc; |
f429b017 |
384 | val[kZrez] = 0.; Int_t ic(0), tb(c->GetLocalTimeBin());; |
385 | if((cc = fTracklet->GetClusters(tb-1))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} |
386 | if((cc = fTracklet->GetClusters(tb-2))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} |
3ed01fbe |
387 | if(ic) val[kZrez] /= (ic*q); |
388 | val[kSpeciesChgRC]= fTracklet->IsRowCross()?0.:(TMath::Max(q*corr, Float_t(3.))); |
2cef552b |
389 | val[kNdim] = fEvent?fEvent->GetMultiplicity():0.; |
b9058d72 |
390 | val[kNdim+1] = c->IsFivePad()?1:c->GetNPads(); |
3ceb45ae |
391 | H->Fill(val); |
392 | /* // tilt rotation of covariance for clusters |
553528eb |
393 | Double_t sy2(c->GetSigmaY2()), sz2(c->GetSigmaZ2()); |
a47a87c5 |
394 | cov[0] = (sy2+t2*sz2)*corr; |
395 | cov[1] = tilt*(sz2 - sy2)*corr; |
396 | cov[2] = (t2*sy2+sz2)*corr; |
553528eb |
397 | // sum with track covariance |
a47a87c5 |
398 | cov[0]+=covR[0]; cov[1]+=covR[1]; cov[2]+=covR[2]; |
553528eb |
399 | Double_t dyz[2]= {dy[1], dz[1]}; |
3ceb45ae |
400 | Pulls(dyz, cov, tilt);*/ |
01ccc21a |
401 | |
dfd7d48b |
402 | // Get z-position with respect to anode wire |
3ceb45ae |
403 | Float_t yt(fTracklet->GetYref(0)-val[kZrez]*fTracklet->GetYref(1)), |
404 | zt(fTracklet->GetZref(0)-val[kZrez]*fTracklet->GetZref(1)); |
fd7ffd88 |
405 | Int_t istk = geo->GetStack(c->GetDetector()); |
406 | AliTRDpadPlane *pp = geo->GetPadPlane(ily, istk); |
3ed01fbe |
407 | Float_t rowZ = pp->GetRow0(); |
408 | Float_t d = rowZ - zt + pp->GetAnodeWireOffset(); |
dfd7d48b |
409 | d -= ((Int_t)(2 * d)) / 2.0; |
410 | if (d > 0.25) d = 0.5 - d; |
411 | |
8ee59659 |
412 | AliTRDclusterInfo *clInfo(NULL); |
413 | clInfo = new AliTRDclusterInfo; |
dfd7d48b |
414 | clInfo->SetCluster(c); |
3ceb45ae |
415 | //Float_t covF[] = {cov[0], cov[1], cov[2]}; |
416 | clInfo->SetGlobalPosition(yt, zt, fTracklet->GetYref(1), fTracklet->GetZref(1)/*, covF*/); |
417 | clInfo->SetResolution(val[kYrez]); |
dfd7d48b |
418 | clInfo->SetAnisochronity(d); |
3ceb45ae |
419 | clInfo->SetDriftLength(val[kZrez]); |
420 | clInfo->SetTilt(fTracklet->GetTilt()); |
83b44483 |
421 | if(fCl) fCl->Add(clInfo); |
3ed01fbe |
422 | //else AliDebug(1, "Cl exchange container missing. Activate by calling \"InitExchangeContainers()\""); |
83b44483 |
423 | |
3ed01fbe |
424 | if(DebugLevel()>=2){ |
01ccc21a |
425 | if(!clInfoArr){ |
d14a8ac2 |
426 | clInfoArr=new TObjArray(AliTRDseedV1::kNclusters); |
427 | clInfoArr->SetOwner(kFALSE); |
428 | } |
dfd7d48b |
429 | clInfoArr->Add(clInfo); |
df0514f6 |
430 | } |
1ee39b3a |
431 | } |
3ed01fbe |
432 | if(DebugLevel()>=2 && clInfoArr){ |
3ceb45ae |
433 | ULong_t status = fkESD->GetStatus(); |
dfd7d48b |
434 | (*DebugStream()) << "cluster" |
435 | <<"status=" << status |
436 | <<"clInfo.=" << clInfoArr |
437 | << "\n"; |
d14a8ac2 |
438 | clInfoArr->Clear(); |
dfd7d48b |
439 | } |
1ee39b3a |
440 | } |
d14a8ac2 |
441 | if(clInfoArr) delete clInfoArr; |
00a56108 |
442 | |
b05a637a |
443 | if(!track) return NULL; |
444 | // special care for EVE usage |
445 | TH1 *h(NULL); |
446 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
447 | return H->Projection(kYrez); |
1ee39b3a |
448 | } |
449 | |
450 | |
451 | //________________________________________________________ |
452 | TH1* AliTRDresolution::PlotTracklet(const AliTRDtrackV1 *track) |
453 | { |
01ccc21a |
454 | // Plot normalized residuals for tracklets to track. |
455 | // |
1ee39b3a |
456 | // We start from the result that if X=N(|m|, |Cov|) |
457 | // BEGIN_LATEX |
458 | // (Cov^{-1})^{1/2}X = N((Cov^{-1})^{1/2}*|m|, |1|) |
459 | // END_LATEX |
01ccc21a |
460 | // in our case X=(y_trklt - y_trk z_trklt - z_trk) and |Cov| = |Cov_trklt| + |Cov_trk| at the radial |
461 | // reference position. |
1ee39b3a |
462 | if(track) fkTrack = track; |
463 | if(!fkTrack){ |
3d2a3dff |
464 | AliDebug(4, "No Track defined."); |
b91fdd71 |
465 | return NULL; |
1ee39b3a |
466 | } |
b05a637a |
467 | if(fkESD && TMath::Abs(fkESD->GetTOFbc())>1){ |
3ceb45ae |
468 | AliDebug(4, Form("Track with BC_index[%d] not used.", fkESD->GetTOFbc())); |
01ccc21a |
469 | //return NULL; |
3ceb45ae |
470 | } |
471 | THnSparse *H(NULL); |
472 | if(!fContainer || !(H = (THnSparse*)fContainer->At(kTracklet))){ |
1ee39b3a |
473 | AliWarning("No output container defined."); |
b91fdd71 |
474 | return NULL; |
1ee39b3a |
475 | } |
01ccc21a |
476 | |
178d284a |
477 | const Int_t ndim(kNdim+8); |
808d178e |
478 | Double_t val[ndim], |
01ccc21a |
479 | alpha(0.), cs(-2.), sn(0.); |
808d178e |
480 | Float_t sz[AliTRDseedV1::kNtb], pos[AliTRDseedV1::kNtb]; |
481 | Int_t ntbGap[AliTRDseedV1::kNtb]; |
3ceb45ae |
482 | AliTRDseedV1 *fTracklet(NULL); |
3ba3e0a4 |
483 | for(Int_t il(0); il<AliTRDgeometry::kNlayer; il++){ |
1ee39b3a |
484 | if(!(fTracklet = fkTrack->GetTracklet(il))) continue; |
566c3d46 |
485 | if(!fTracklet->IsOK() || !fTracklet->IsChmbGood()) continue; |
01ccc21a |
486 | val [kBC] = il; |
487 | if(cs<-1.){ |
488 | alpha = (0.5+AliTRDgeometry::GetSector(fTracklet->GetDetector()))*AliTRDgeometry::GetAlpha(); |
489 | cs = TMath::Cos(alpha); |
490 | sn = TMath::Sin(alpha); |
01ccc21a |
491 | } |
492 | val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn); |
493 | Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX());//fTracklet->GetTgl(); |
494 | val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl)))); |
01ccc21a |
495 | |
566c3d46 |
496 | val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:fkTrack->Charge();// fSpecies; |
33056e04 |
497 | val[kPt] = GetPtBinSignificant(fPt); //fPt<0.8?0:(fPt<1.5?1:2);//GetPtBin(fTracklet->GetMomentum()); |
35983729 |
498 | Double_t dyt(fTracklet->GetYfit(0) - fTracklet->GetYref(0)), |
499 | dzt(fTracklet->GetZfit(0) - fTracklet->GetZref(0)), |
3ceb45ae |
500 | dydx(fTracklet->GetYfit(1)), |
501 | tilt(fTracklet->GetTilt()); |
502 | // correct for tilt rotation |
503 | val[kYrez] = dyt - dzt*tilt; |
b9058d72 |
504 | val[kZrez] = fTracklet->IsRowCross()?(dzt + dyt*tilt):(fTracklet->GetdQdl()*3.e-4-1.5); |
3ceb45ae |
505 | dydx+= tilt*fTracklet->GetZref(1); |
35983729 |
506 | val[kPrez] = TMath::ATan((dydx - fTracklet->GetYref(1))/(1.+ fTracklet->GetYref(1)*dydx)) * TMath::RadToDeg(); |
b9058d72 |
507 | val[kNdim] = fEvent?fEvent->GetMultiplicity():0; |
508 | val[kNdim+1] = 1.e2*fTracklet->GetTBoccupancy()/AliTRDseedV1::kNtb; |
808d178e |
509 | Int_t n = fTracklet->GetChargeGaps(sz, pos, ntbGap); |
b9058d72 |
510 | val[kNdim+2] = 0.; for(Int_t igap(0); igap<n; igap++) val[kNdim+2] += sz[igap]; |
511 | for(Int_t ifill(0); ifill<3; ifill++){ val[kNdim+3+ifill]=0.;val[kNdim+4+ifill]=0.;} |
82e6e5dc |
512 | for(Int_t igap(0), ifill(0); igap<n&&ifill<2; igap++){ |
808d178e |
513 | if(ntbGap[igap]<2) continue; |
b9058d72 |
514 | val[kNdim+3+ifill] = sz[igap]; |
515 | val[kNdim+4+ifill] = pos[igap]; |
808d178e |
516 | ifill++; |
517 | } |
566c3d46 |
518 | H->Fill(val); |
3ceb45ae |
519 | |
520 | // // compute covariance matrix |
521 | // fTracklet->GetCovAt(x, cov); |
522 | // fTracklet->GetCovRef(covR); |
01ccc21a |
523 | // cov[0] += covR[0]; cov[1] += covR[1]; cov[2] += covR[2]; |
3ceb45ae |
524 | // Double_t dyz[2]= {dy[1], dz[1]}; |
525 | // Pulls(dyz, cov, tilt); |
526 | // ((TH3S*)arr->At(1))->Fill(sgm[fSegmentLevel], dyz[0], dyz[1]); |
527 | // ((TH3S*)arr->At(3))->Fill(tht, dyz[1], rc); |
dfd7d48b |
528 | |
3ed01fbe |
529 | if(DebugLevel()>=3){ |
3ceb45ae |
530 | Bool_t rc(fTracklet->IsRowCross()); |
dfd7d48b |
531 | UChar_t err(fTracklet->GetErrorMsg()); |
3ceb45ae |
532 | Double_t x(fTracklet->GetX()), |
533 | pt(fTracklet->GetPt()), |
534 | yt(fTracklet->GetYref(0)), |
535 | zt(fTracklet->GetZref(0)), |
536 | phi(fTracklet->GetYref(1)), |
537 | tht(fTracklet->GetZref(1)); |
01ccc21a |
538 | Int_t ncl(fTracklet->GetN()), det(fTracklet->GetDetector()); |
dfd7d48b |
539 | (*DebugStream()) << "tracklet" |
3ba3e0a4 |
540 | <<"pt=" << pt |
3ceb45ae |
541 | <<"x=" << x |
6475ec36 |
542 | <<"yt=" << yt |
3ceb45ae |
543 | <<"zt=" << zt |
3ba3e0a4 |
544 | <<"phi=" << phi |
545 | <<"tht=" << tht |
3ceb45ae |
546 | <<"det=" << det |
6475ec36 |
547 | <<"n=" << ncl |
3ceb45ae |
548 | <<"dy0=" << dyt |
549 | <<"dz0=" << dzt |
550 | <<"dy=" << val[kYrez] |
551 | <<"dz=" << val[kZrez] |
552 | <<"dphi="<< val[kPrez] |
553 | <<"dQ ="<< val[kNdim] |
dfd7d48b |
554 | <<"rc=" << rc |
555 | <<"err=" << err |
556 | << "\n"; |
557 | } |
1ee39b3a |
558 | } |
b05a637a |
559 | if(!track) return NULL; |
560 | // special care for EVE usage |
561 | TH1 *h(NULL); |
562 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
563 | return H->Projection(kYrez); |
1ee39b3a |
564 | } |
565 | |
566 | |
567 | //________________________________________________________ |
a310e49b |
568 | TH1* AliTRDresolution::PlotTrackIn(const AliTRDtrackV1 *track) |
1ee39b3a |
569 | { |
01ccc21a |
570 | // Store resolution/pulls of Kalman before updating with the TRD information |
571 | // at the radial position of the first tracklet. The following points are used |
572 | // for comparison |
1ee39b3a |
573 | // - the (y,z,snp) of the first TRD tracklet |
574 | // - the (y, z, snp, tgl, pt) of the MC track reference |
01ccc21a |
575 | // |
576 | // Additionally the momentum resolution/pulls are calculated for usage in the |
577 | // PID calculation. |
dffc3357 |
578 | |
1ee39b3a |
579 | if(track) fkTrack = track; |
3ceb45ae |
580 | if(!fkTrack){ |
3d2a3dff |
581 | AliDebug(4, "No Track defined."); |
b91fdd71 |
582 | return NULL; |
1ee39b3a |
583 | } |
3ed01fbe |
584 | //fkTrack->Print(); |
b05a637a |
585 | TH1 *h(NULL); // EVE projection |
3ceb45ae |
586 | // check container |
587 | THnSparseI *H=(THnSparseI*)fContainer->At(kTrackIn); |
588 | if(!H){ |
589 | AliError(Form("Missing container @ %d", Int_t(kTrackIn))); |
83b44483 |
590 | return NULL; |
591 | } |
3ceb45ae |
592 | // check input track status |
593 | AliExternalTrackParam *tin(NULL); |
a310e49b |
594 | if(!(tin = fkTrack->GetTrackIn())){ |
3ceb45ae |
595 | AliError("Track did not entered TRD fiducial volume."); |
b91fdd71 |
596 | return NULL; |
1ee39b3a |
597 | } |
3ceb45ae |
598 | // check first tracklet |
599 | AliTRDseedV1 *fTracklet(fkTrack->GetTracklet(0)); |
600 | if(!fTracklet){ |
601 | AliDebug(3, "No Tracklet in ly[0]. Skip track."); |
b05a637a |
602 | if(!track) return NULL; |
603 | // special care for EVE usage |
604 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
605 | return H->Projection(kYrez); |
1ee39b3a |
606 | } |
566c3d46 |
607 | if(!fTracklet->IsOK() || !fTracklet->IsChmbGood()){ |
608 | AliDebug(3, "Tracklet or Chamber not OK. Skip track."); |
b05a637a |
609 | if(!track) return NULL; |
610 | // special care for EVE usage |
611 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
612 | return H->Projection(kYrez); |
566c3d46 |
613 | } |
3ceb45ae |
614 | // check radial position |
615 | Double_t x = tin->GetX(); |
616 | if(TMath::Abs(x-fTracklet->GetX())>1.e-3){ |
617 | AliDebug(1, Form("Tracklet did not match Track. dx[cm]=%+4.1f", x-fTracklet->GetX())); |
b05a637a |
618 | if(!track) return NULL; |
619 | // special care for EVE usage |
620 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
621 | return H->Projection(kYrez); |
1ee39b3a |
622 | } |
623 | |
f036f7ec |
624 | // down scale PID resolution |
625 | Int_t spc(fSpecies); if(spc==3) spc=2; if(spc==-3) spc=-2; if(spc>3) spc=3; if(spc<-3) spc=-3; |
626 | |
f036f7ec |
627 | if(DebugLevel()>=3){ |
628 | Float_t tpc(fkESD->GetTPCdedx()); |
629 | Float_t tof(fkESD->GetTOFbeta()); |
630 | (*DebugStream()) << "trackIn" |
f036f7ec |
631 | <<"spc=" << spc |
632 | <<"tpc=" << tpc |
633 | <<"tof=" << tof |
634 | <<"tracklet.=" << fTracklet |
635 | <<"trackIn.=" << tin |
636 | << "\n"; |
637 | } |
638 | |
639 | //Int_t bc(fkESD?fkESD->GetTOFbc()/2:0); |
3ceb45ae |
640 | const Double_t *parR(tin->GetParameter()); |
35983729 |
641 | Double_t dyt(fTracklet->GetYfit(0)-parR[0]), dzt(fTracklet->GetZfit(0)-parR[1]), |
3ceb45ae |
642 | phit(fTracklet->GetYfit(1)), |
35983729 |
643 | tilt(fTracklet->GetTilt()), |
644 | norm(1./TMath::Sqrt((1.-parR[2])*(1.+parR[2]))); |
3ceb45ae |
645 | |
646 | // correct for tilt rotation |
647 | Double_t dy = dyt - dzt*tilt, |
35983729 |
648 | dz = dzt + dyt*tilt, |
01ccc21a |
649 | dx = dy/(parR[2]*norm-parR[3]*norm*tilt); |
3ceb45ae |
650 | phit += tilt*parR[3]; |
35983729 |
651 | Double_t dphi = TMath::ATan(phit) - TMath::ASin(parR[2]); |
3ceb45ae |
652 | |
f036f7ec |
653 | Double_t val[kNdim+2]; |
dffc3357 |
654 | val[kBC] = fTriggerSlot;//bc==0?0:(bc<0?-1.:1.); |
7c4c4bb4 |
655 | Double_t alpha = (0.5+AliTRDgeometry::GetSector(fTracklet->GetDetector()))*AliTRDgeometry::GetAlpha(), |
656 | cs = TMath::Cos(alpha), |
657 | sn = TMath::Sin(alpha); |
f036f7ec |
658 | val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn); |
659 | Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX()); |
660 | val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl)))); |
3ceb45ae |
661 | val[kYrez] = dy; |
b351a191 |
662 | val[kZrez] = fTracklet->IsRowCross()?dz:(fTracklet->GetdQdl()*5.e-4 - 2.5); |
3ceb45ae |
663 | val[kPrez] = dphi*TMath::RadToDeg(); |
cc98ff07 |
664 | val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:spc; |
f036f7ec |
665 | val[kPt] = DebugLevel()>=1?GetPtBin(fPt):GetPtBinSignificant(fPt); |
666 | val[kNdim] = DebugLevel()>=1?GetPtBin(fTracklet->GetMomentum()):GetPtBinSignificant(fTracklet->GetMomentum()); |
35983729 |
667 | val[kNdim+1] = dx; |
f036f7ec |
668 | //val[kNdim+2] = fEvent?fEvent->GetBunchFill():0; |
3ceb45ae |
669 | H->Fill(val); |
670 | |
b05a637a |
671 | if(!track) return NULL; |
672 | // special care for EVE usage |
2cef552b |
673 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
674 | return H->Projection(kYrez); |
1ee39b3a |
675 | } |
676 | |
f429b017 |
677 | /* |
1ee39b3a |
678 | //________________________________________________________ |
a310e49b |
679 | TH1* AliTRDresolution::PlotTrackOut(const AliTRDtrackV1 *track) |
680 | { |
01ccc21a |
681 | // Store resolution/pulls of Kalman after last update with the TRD information |
682 | // at the radial position of the first tracklet. The following points are used |
683 | // for comparison |
a310e49b |
684 | // - the (y,z,snp) of the first TRD tracklet |
685 | // - the (y, z, snp, tgl, pt) of the MC track reference |
01ccc21a |
686 | // |
687 | // Additionally the momentum resolution/pulls are calculated for usage in the |
688 | // PID calculation. |
a310e49b |
689 | |
690 | if(track) fkTrack = track; |
596f82fb |
691 | return NULL; |
a310e49b |
692 | } |
f429b017 |
693 | */ |
a310e49b |
694 | //________________________________________________________ |
1ee39b3a |
695 | TH1* AliTRDresolution::PlotMC(const AliTRDtrackV1 *track) |
696 | { |
697 | // |
698 | // Plot MC distributions |
699 | // |
700 | |
b351a191 |
701 | if(!HasMCdata()) return NULL; |
1ee39b3a |
702 | if(track) fkTrack = track; |
703 | if(!fkTrack){ |
3d2a3dff |
704 | AliDebug(4, "No Track defined."); |
b91fdd71 |
705 | return NULL; |
1ee39b3a |
706 | } |
f429b017 |
707 | Int_t bc(TMath::Abs(fkESD->GetTOFbc())); |
708 | |
709 | THnSparse *H(NULL); |
83b44483 |
710 | if(!fContainer){ |
711 | AliWarning("No output container defined."); |
712 | return NULL; |
713 | } |
92c40e64 |
714 | // retriev track characteristics |
715 | Int_t pdg = fkMC->GetPDG(), |
716 | sIdx(AliTRDpidUtil::Pdg2Pid(TMath::Abs(pdg))+1), // species index |
717 | sign(0), |
f429b017 |
718 | // sgm[3], |
719 | label(fkMC->GetLabel()); |
720 | // fSegmentLevel(0); |
92c40e64 |
721 | if(!fDBPDG) fDBPDG=TDatabasePDG::Instance(); |
722 | TParticlePDG *ppdg(fDBPDG->GetParticle(pdg)); |
723 | if(ppdg) sign = ppdg->Charge() > 0. ? 1 : -1; |
92c40e64 |
724 | |
f429b017 |
725 | TH1 *h(NULL); |
3ceb45ae |
726 | AliTRDgeometry *geo(AliTRDinfoGen::Geometry()); |
727 | AliTRDseedV1 *fTracklet(NULL); TObjArray *clInfoArr(NULL); |
1ee39b3a |
728 | UChar_t s; |
f429b017 |
729 | Double_t x, y, z, pt, dydx, dzdx, dzdl; |
1ee39b3a |
730 | Float_t pt0, x0, y0, z0, dx, dy, dz, dydx0, dzdx0; |
731 | Double_t covR[7]/*, cov[3]*/; |
01ccc21a |
732 | |
f429b017 |
733 | /* if(DebugLevel()>=3){ |
3ceb45ae |
734 | // get first detector |
735 | Int_t det = -1; |
736 | for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){ |
737 | if(!(fTracklet = fkTrack->GetTracklet(ily))) continue; |
738 | det = fTracklet->GetDetector(); |
739 | break; |
740 | } |
741 | if(det>=0){ |
742 | TVectorD X(12), Y(12), Z(12), dX(12), dY(12), dZ(12), vPt(12), dPt(12), budget(12), cCOV(12*15); |
743 | Double_t m(-1.); |
744 | m = fkTrack->GetMass(); |
745 | if(fkMC->PropagateKalman(&X, &Y, &Z, &dX, &dY, &dZ, &vPt, &dPt, &budget, &cCOV, m)){ |
746 | (*DebugStream()) << "MCkalman" |
747 | << "pdg=" << pdg |
748 | << "det=" << det |
749 | << "x=" << &X |
750 | << "y=" << &Y |
751 | << "z=" << &Z |
752 | << "dx=" << &dX |
753 | << "dy=" << &dY |
754 | << "dz=" << &dZ |
755 | << "pt=" << &vPt |
756 | << "dpt=" << &dPt |
757 | << "bgt=" << &budget |
758 | << "cov=" << &cCOV |
759 | << "\n"; |
760 | } |
761 | } |
f429b017 |
762 | }*/ |
763 | AliTRDcluster *c(NULL); |
764 | Double_t val[kNdim+1]; |
1ee39b3a |
765 | for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){ |
766 | if(!(fTracklet = fkTrack->GetTracklet(ily)))/* || |
767 | !fTracklet->IsOK())*/ continue; |
768 | |
f429b017 |
769 | x= x0 = fTracklet->GetX(); |
770 | Bool_t rc(fTracklet->IsRowCross()); Float_t eta, phi; |
771 | if(!fkMC->GetDirections(x0, y0, z0, dydx0, dzdx0, pt0, eta, phi, s)) continue; |
1ee39b3a |
772 | |
773 | // MC track position at reference radial position |
774 | dx = x0 - x; |
1ee39b3a |
775 | Float_t ymc = y0 - dx*dydx0; |
776 | Float_t zmc = z0 - dx*dzdx0; |
01ccc21a |
777 | //phi -= TMath::Pi(); |
f429b017 |
778 | |
779 | val[kBC] = ily; |
780 | val[kPhi] = phi; |
781 | val[kEta] = eta; |
782 | val[kSpeciesChgRC]= rc?0.:sign*sIdx; |
01ccc21a |
783 | val[kPt] = pt0<0.8?0:(pt0<1.5?1:2);//GetPtBin(pt0); |
f429b017 |
784 | Double_t tilt(fTracklet->GetTilt()); |
785 | // ,t2(tilt*tilt) |
786 | // ,corr(1./(1. + t2)) |
787 | // ,cost(TMath::Sqrt(corr)); |
788 | |
789 | AliExternalTrackParam *tin(fkTrack->GetTrackIn()); |
790 | if(ily==0 && tin){ // trackIn residuals |
791 | // check radial position |
808d178e |
792 | if(TMath::Abs(tin->GetX()-x)>1.e-3) AliDebug(1, Form("TrackIn radial mismatch. dx[cm]=%+4.1f", tin->GetX()-x)); |
793 | else{ |
f429b017 |
794 | val[kBC] = (bc>=kNbunchCross)?(kNbunchCross-1):bc; |
795 | val[kYrez] = tin->GetY()-ymc; |
0e36aa24 |
796 | val[kZrez] = rc?(tin->GetZ()-zmc):(fTracklet->GetdQdl()*1.8e-4 - 0.9); |
f429b017 |
797 | val[kPrez] = (TMath::ASin(tin->GetSnp())-TMath::ATan(dydx0))*TMath::RadToDeg(); |
798 | if((H = (THnSparseI*)fContainer->At(kMCtrackIn))) H->Fill(val); |
808d178e |
799 | } |
f429b017 |
800 | } |
01ccc21a |
801 | //if(bc>1) break; // do nothing for the rest of TRD objects if satellite bunch |
1ee39b3a |
802 | |
f429b017 |
803 | // track residuals |
1ee39b3a |
804 | dydx = fTracklet->GetYref(1); |
805 | dzdx = fTracklet->GetZref(1); |
806 | dzdl = fTracklet->GetTgl(); |
f429b017 |
807 | y = fTracklet->GetYref(0); |
1ee39b3a |
808 | dy = y - ymc; |
f429b017 |
809 | z = fTracklet->GetZref(0); |
1ee39b3a |
810 | dz = z - zmc; |
811 | pt = TMath::Abs(fTracklet->GetPt()); |
812 | fTracklet->GetCovRef(covR); |
813 | |
f429b017 |
814 | val[kYrez] = dy; |
815 | val[kPrez] = TMath::ATan((dydx - dydx0)/(1.+ dydx*dydx0))*TMath::RadToDeg(); |
816 | val[kZrez] = dz; |
6465da91 |
817 | val[kNdim] = 1.e2*(pt/pt0-1.); |
f429b017 |
818 | if((H = (THnSparse*)fContainer->At(kMCtrack))) H->Fill(val); |
819 | /* // theta resolution/ tgl pulls |
820 | Double_t dzdl0 = dzdx0/TMath::Sqrt(1.+dydx0*dydx0), |
821 | dtgl = (dzdl - dzdl0)/(1.- dzdl*dzdl0); |
822 | ((TH2I*)arr->At(6))->Fill(dzdl0, TMath::ATan(dtgl)); |
823 | ((TH2I*)arr->At(7))->Fill(dzdl0, (dzdl - dzdl0)/TMath::Sqrt(covR[4])); |
824 | // pt resolution \\ 1/pt pulls \\ p resolution for PID |
825 | Double_t p0 = TMath::Sqrt(1.+ dzdl0*dzdl0)*pt0, |
826 | p = TMath::Sqrt(1.+ dzdl*dzdl)*pt; |
827 | ((TH3S*)((TObjArray*)arr->At(8)))->Fill(pt0, pt/pt0-1., sign*sIdx); |
828 | ((TH3S*)((TObjArray*)arr->At(9)))->Fill(1./pt0, (1./pt-1./pt0)/TMath::Sqrt(covR[6]), sign*sIdx); |
829 | ((TH3S*)((TObjArray*)arr->At(10)))->Fill(p0, p/p0-1., sign*sIdx);*/ |
830 | |
831 | // Fill Debug stream for MC track |
3ba3e0a4 |
832 | if(DebugLevel()>=4){ |
f429b017 |
833 | Int_t det(fTracklet->GetDetector()); |
834 | (*DebugStream()) << "MC" |
835 | << "det=" << det |
836 | << "pdg=" << pdg |
837 | << "sgn=" << sign |
838 | << "pt=" << pt0 |
839 | << "x=" << x0 |
840 | << "y=" << y0 |
841 | << "z=" << z0 |
842 | << "dydx=" << dydx0 |
843 | << "dzdx=" << dzdx0 |
844 | << "\n"; |
01ccc21a |
845 | |
f429b017 |
846 | // Fill Debug stream for Kalman track |
1ee39b3a |
847 | (*DebugStream()) << "MCtrack" |
848 | << "pt=" << pt |
849 | << "x=" << x |
850 | << "y=" << y |
851 | << "z=" << z |
852 | << "dydx=" << dydx |
853 | << "dzdx=" << dzdx |
854 | << "s2y=" << covR[0] |
855 | << "s2z=" << covR[2] |
856 | << "\n"; |
857 | } |
858 | |
f429b017 |
859 | // tracklet residuals |
860 | dydx = fTracklet->GetYfit(1) + tilt*dzdx0; |
861 | dzdx = fTracklet->GetZfit(1); |
862 | y = fTracklet->GetYfit(0); |
863 | dy = y - ymc; |
864 | z = fTracklet->GetZfit(0); |
865 | dz = z - zmc; |
866 | val[kYrez] = dy - dz*tilt; |
867 | val[kPrez] = TMath::ATan((dydx - dydx0)/(1.+ dydx*dydx0))*TMath::RadToDeg(); |
0e36aa24 |
868 | val[kZrez] = rc?(dz + dy*tilt):(fTracklet->GetdQdl()*3.e-4 - 1.5); |
f429b017 |
869 | // val[kNdim] = pt/pt0-1.; |
870 | if((H = (THnSparse*)fContainer->At(kMCtracklet))) H->Fill(val); |
01ccc21a |
871 | |
f429b017 |
872 | |
1ee39b3a |
873 | // Fill Debug stream for tracklet |
3ba3e0a4 |
874 | if(DebugLevel()>=4){ |
f429b017 |
875 | Float_t s2y = fTracklet->GetS2Y(); |
876 | Float_t s2z = fTracklet->GetS2Z(); |
1ee39b3a |
877 | (*DebugStream()) << "MCtracklet" |
878 | << "rc=" << rc |
879 | << "x=" << x |
880 | << "y=" << y |
881 | << "z=" << z |
882 | << "dydx=" << dydx |
883 | << "s2y=" << s2y |
884 | << "s2z=" << s2z |
885 | << "\n"; |
886 | } |
887 | |
f429b017 |
888 | AliTRDpadPlane *pp = geo->GetPadPlane(ily, AliTRDgeometry::GetStack(fTracklet->GetDetector())); |
1ee39b3a |
889 | Float_t zr0 = pp->GetRow0() + pp->GetAnodeWireOffset(); |
1ee39b3a |
890 | //Double_t exb = AliTRDCommonParam::Instance()->GetOmegaTau(1.5); |
891 | |
f429b017 |
892 | H = (THnSparse*)fContainer->At(kMCcluster); |
893 | val[kPt] = TMath::ATan(dydx0)*TMath::RadToDeg(); |
894 | //Float_t corr = 1./TMath::Sqrt(1.+dydx0*dydx0+dzdx0*dzdx0); |
895 | Int_t row0(-1); |
896 | Float_t padCorr(tilt*fTracklet->GetPadLength()); |
897 | fTracklet->ResetClusterIter(kTRUE); |
898 | while((c = fTracklet->NextCluster())){ |
899 | if(row0<0) row0 = c->GetPadRow(); |
900 | x = c->GetX();//+fXcorr[c->GetDetector()][c->GetLocalTimeBin()]; |
901 | y = c->GetY() + padCorr*(c->GetPadRow() - row0); |
902 | z = c->GetZ(); |
01ccc21a |
903 | dx = x0 - x; |
1ee39b3a |
904 | ymc= y0 - dx*dydx0; |
905 | zmc= z0 - dx*dzdx0; |
f429b017 |
906 | dy = y - ymc; |
907 | dz = z - zmc; |
908 | val[kYrez] = dy - dz*tilt; |
909 | val[kPrez] = dx; |
910 | val[kZrez] = 0.; AliTRDcluster *cc(NULL); Int_t ic(0), tb(c->GetLocalTimeBin()); Float_t q(TMath::Abs(c->GetQ())); |
911 | if((cc = fTracklet->GetClusters(tb-1))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} |
912 | if((cc = fTracklet->GetClusters(tb-2))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} |
913 | if(ic) val[kZrez] /= (ic*q); |
914 | if(H) H->Fill(val); |
915 | |
1ee39b3a |
916 | |
917 | // Fill calibration container |
918 | Float_t d = zr0 - zmc; |
919 | d -= ((Int_t)(2 * d)) / 2.0; |
920 | if (d > 0.25) d = 0.5 - d; |
921 | AliTRDclusterInfo *clInfo = new AliTRDclusterInfo; |
1ee39b3a |
922 | clInfo->SetCluster(c); |
923 | clInfo->SetMC(pdg, label); |
924 | clInfo->SetGlobalPosition(ymc, zmc, dydx0, dzdx0); |
925 | clInfo->SetResolution(dy); |
926 | clInfo->SetAnisochronity(d); |
2589cf64 |
927 | clInfo->SetDriftLength(dx); |
1ee39b3a |
928 | clInfo->SetTilt(tilt); |
83b44483 |
929 | if(fMCcl) fMCcl->Add(clInfo); |
930 | else AliDebug(1, "MCcl exchange container missing. Activate by calling \"InitExchangeContainers()\""); |
01ccc21a |
931 | if(DebugLevel()>=5){ |
932 | if(!clInfoArr){ |
d14a8ac2 |
933 | clInfoArr=new TObjArray(AliTRDseedV1::kNclusters); |
934 | clInfoArr->SetOwner(kFALSE); |
935 | } |
d43e2ad1 |
936 | clInfoArr->Add(clInfo); |
1ee39b3a |
937 | } |
938 | } |
d43e2ad1 |
939 | // Fill Debug Tree |
3ba3e0a4 |
940 | if(DebugLevel()>=5 && clInfoArr){ |
d43e2ad1 |
941 | (*DebugStream()) << "MCcluster" |
942 | <<"clInfo.=" << clInfoArr |
943 | << "\n"; |
92c40e64 |
944 | clInfoArr->Clear(); |
d43e2ad1 |
945 | } |
1ee39b3a |
946 | } |
92c40e64 |
947 | if(clInfoArr) delete clInfoArr; |
2cef552b |
948 | if(!track) return NULL; |
949 | // special care for EVE usage |
a304f63f |
950 | if(H && (h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
951 | return H?H->Projection(kYrez):NULL; |
1ee39b3a |
952 | } |
953 | |
954 | |
3ceb45ae |
955 | //__________________________________________________________________________ |
956 | Int_t AliTRDresolution::GetPtBin(Float_t pt) |
957 | { |
958 | // Find pt bin according to local pt segmentation |
3ed01fbe |
959 | Int_t ipt(-1); |
56838f9d |
960 | while(ipt<24){ |
3ed01fbe |
961 | if(pt<fgPtBin[ipt+1]) break; |
3ceb45ae |
962 | ipt++; |
963 | } |
3ed01fbe |
964 | return ipt; |
3ceb45ae |
965 | } |
966 | |
3ceb45ae |
967 | |
1ee39b3a |
968 | //________________________________________________________ |
b351a191 |
969 | void AliTRDresolution::GetRangeZ(TH2 *h2, Float_t &min, Float_t &max) |
970 | { |
971 | // Get range on Z axis such to avoid outliers |
972 | |
973 | Double_t cnt[20000], c, m, s; |
974 | Int_t nx(h2->GetXaxis()->GetNbins()), ny(h2->GetYaxis()->GetNbins()), nc(0); |
975 | for(Int_t ix(1); ix<=nx; ix++){ |
976 | for(Int_t iy(1); iy<=ny; iy++){ |
977 | if((c = h2->GetBinContent(ix, iy))<10) continue; |
978 | cnt[nc++] = c; |
979 | if(nc==20000) break; |
980 | } |
981 | if(nc==20000) break; |
982 | } |
983 | AliMathBase::EvaluateUni(nc, cnt, m, s, 0); |
984 | min = m-s; max = m+2.*s; |
985 | } |
986 | |
987 | //________________________________________________________ |
1ee39b3a |
988 | Bool_t AliTRDresolution::GetRefFigure(Int_t ifig) |
989 | { |
990 | // |
991 | // Get the reference figures |
992 | // |
993 | |
1ee39b3a |
994 | if(!gPad){ |
995 | AliWarning("Please provide a canvas to draw results."); |
996 | return kFALSE; |
997 | } |
01ccc21a |
998 | /* Int_t selection[100], n(0), selStart(0); // |
a310e49b |
999 | Int_t ly0(0), dly(5); |
3ceb45ae |
1000 | TList *l(NULL); TVirtualPad *pad(NULL); */ |
1ee39b3a |
1001 | switch(ifig){ |
3ceb45ae |
1002 | case 0: |
1ee39b3a |
1003 | break; |
1ee39b3a |
1004 | } |
1005 | AliWarning(Form("Reference plot [%d] missing result", ifig)); |
1006 | return kFALSE; |
1007 | } |
1008 | |
3ceb45ae |
1009 | |
1010 | //________________________________________________________ |
1011 | void AliTRDresolution::MakePtSegmentation(Float_t pt0, Float_t dpt) |
1012 | { |
1013 | // Build pt segments |
56838f9d |
1014 | for(Int_t j(0); j<=24; j++){ |
3ceb45ae |
1015 | pt0+=(TMath::Exp(j*j*dpt)-1.); |
1016 | fgPtBin[j]=pt0; |
1017 | } |
1018 | } |
1019 | |
00a3f7a4 |
1020 | //________________________________________________________ |
1021 | void AliTRDresolution::MakeSummary() |
1022 | { |
1023 | // Build summary plots |
1024 | |
3ceb45ae |
1025 | if(!fProj){ |
00a3f7a4 |
1026 | AliError("Missing results"); |
1027 | return; |
01ccc21a |
1028 | } |
3ceb45ae |
1029 | TVirtualPad *p(NULL); TCanvas *cOut(NULL); |
3ed01fbe |
1030 | TObjArray *arr(NULL); TH2 *h2(NULL); |
068e2c00 |
1031 | |
3ceb45ae |
1032 | // cluster resolution |
1033 | // define palette |
1034 | gStyle->SetPalette(1); |
808d178e |
1035 | const Int_t nClViews(9); |
1036 | const Char_t *vClName[nClViews] = {"ClY", "ClYn", "ClYp", "ClQn", "ClQp", "ClYXTCp", "ClYXTCn", "ClYXPh", "ClYXPh"}; |
1037 | const UChar_t vClOpt[nClViews] = {1, 1, 1, 0, 0, 0, 0, 0, 1}; |
56838f9d |
1038 | const Float_t vClSignMin[2] = {2.6e2, 4.4e2}, |
1039 | vClSignMax[2] = {4.4e2, 6.2e2}, |
1040 | vClMin[nClViews] = {3.2e2, vClSignMin[Int_t(fBsign)], vClSignMin[Int_t(!fBsign)], 0., 0., 0., 0., 0., 3.2e2}, |
1041 | vClMax[nClViews] = {5.e2, vClSignMax[Int_t(fBsign)], vClSignMax[Int_t(!fBsign)], 0., 0., 0., 0., 0., 5.e2}; |
b9058d72 |
1042 | const Int_t nTrkltViews(20); |
01ccc21a |
1043 | const Char_t *vTrkltName[nTrkltViews] = { |
808d178e |
1044 | "TrkltY", "TrkltYn", "TrkltYp", "TrkltY", "TrkltYn", "TrkltYp", |
b9058d72 |
1045 | "TrkltRCZ", |
01ccc21a |
1046 | "TrkltPh", "TrkltPhn", "TrkltPhp", |
1047 | "TrkltQ", "TrkltQn", "TrkltQp", |
82e6e5dc |
1048 | "TrkltQS", "TrkltQSn", "TrkltQSp", |
1049 | "TrkltTBn", "TrkltTBp", "TrkltTBn", "TrkltTBp" |
01ccc21a |
1050 | // "TrkltYnl0", "TrkltYpl0", "TrkltPhnl0", "TrkltPhpl0", "TrkltQnl0", "TrkltQpl0", // electrons low pt |
1051 | /* "TrkltYnl1", "TrkltYpl1", "TrkltPhnl1", "TrkltPhpl1", "TrkltQnl1", "TrkltQpl1", // muons low pt |
1052 | "TrkltYnl2", "TrkltYpl2", "TrkltPhnl2", "TrkltPhpl2", "TrkltQnl2", "TrkltQpl2" // pions low pt*/ |
566c3d46 |
1053 | }; |
808d178e |
1054 | const UChar_t vTrkltOpt[nTrkltViews] = { |
1055 | 0, 0, 0, 1, 1, 1, |
b9058d72 |
1056 | 0, |
808d178e |
1057 | 0, 0, 0, |
1058 | 0, 0, 0, |
82e6e5dc |
1059 | 0, 0, 0, |
56838f9d |
1060 | 0, 0, 2, 2 |
808d178e |
1061 | }; |
1062 | const Int_t nTrkInViews(5); |
35983729 |
1063 | const Char_t *vTrkInName[nTrkInViews][6] = { |
566c3d46 |
1064 | {"TrkInY", "TrkInYn", "TrkInYp", "TrkInRCZ", "TrkInPhn", "TrkInPhp"}, |
808d178e |
1065 | {"TrkInY", "TrkInYn", "TrkInYp", "TrkInRCZ", "TrkInPhn", "TrkInPhp"}, |
35983729 |
1066 | {"TrkInYnl", "TrkInYni", "TrkInYnh", "TrkInYpl", "TrkInYpi", "TrkInYph"}, |
01ccc21a |
1067 | {"TrkInXnl", "TrkInXpl", "TrkInXl", "TrkInYnh", "TrkInYph", "TrkInYh"}, |
1068 | {"TrkInPhnl", "TrkInPhni", "TrkInPhnh", "TrkInPhpl", "TrkInPhpi", "TrkInPhph"}, |
1069 | //{"TrkInRCX", "TrkInRCY", "TrkInRCPh", "TrkInRCZl", "TrkInRCZi", "TrkInRCZh"} |
1070 | }; |
808d178e |
1071 | const UChar_t vTrkInOpt[nTrkInViews] = {0, 1, 0, 0, 0}; |
1072 | const Float_t min[6] = {0.15, 0.15, 0.15, 0.15, 0.5, 0.5}; |
1073 | const Float_t max[6] = {0.6, 0.6, 0.6, 0.6, 2.3, 2.3}; |
1074 | const Char_t *ttt[6] = {"#sigma(#Deltay) [cm]", "#sigma(#Deltay) [cm]", "#sigma(#Deltay) [cm]", "#sigma(#Deltaz) [cm]", "#sigma(#Delta#phi) [deg]", "#sigma(#Delta#phi) [deg]"}; |
1075 | |
01ccc21a |
1076 | const Int_t nTrkViews(27); |
1077 | const Char_t *vTrkName[nTrkViews] = { |
1078 | "TrkY", "TrkYn", "TrkYp", |
1079 | "TrkPh", "TrkPhn", "TrkPhp", |
1080 | "TrkDPt", "TrkDPtn", "TrkDPtp", |
1081 | "TrkYnl0", "TrkYpl0", "TrkPhnl0", "TrkPhpl0", "TrkDPtnl0", "TrkDPtpl0", // electrons low pt |
1082 | "TrkYnl1", "TrkYpl1", "TrkPhnl1", "TrkPhpl1", "TrkDPtnl1", "TrkDPtpl1", // muons low pt |
1083 | "TrkYnl2", "TrkYpl2", "TrkPhnl2", "TrkPhpl2", "TrkDPtnl2", "TrkDPtpl2" // pions low pt |
1084 | }; |
f429b017 |
1085 | const Char_t *typName[] = {"", "MC"}; |
3d98647d |
1086 | const Int_t nx(2048), ny(1536); |
f429b017 |
1087 | |
b351a191 |
1088 | if((arr = (TObjArray*)fProj->At(kDetector))){ |
5591f3d6 |
1089 | cOut = new TCanvas(Form("%s_DetOccupancy", GetName()), "Detector performance", 2*nx, 2*ny); |
b351a191 |
1090 | cOut->Divide(AliTRDgeometry::kNlayer,AliTRDeventInfo::kCentralityClasses, 1.e-5, 1.e-5); |
3d98647d |
1091 | Int_t n=0; |
b351a191 |
1092 | for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){ |
b351a191 |
1093 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
1094 | p=cOut->cd(icen*AliTRDgeometry::kNlayer+ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712); |
b9058d72 |
1095 | if(!(h2 = (TH2*)arr->FindObject(Form("HDet%d%dEn", ily, icen)))) continue; |
cc98ff07 |
1096 | if(SetNormZ(h2, 1, -1, 1, -1, 10.) < 1.e3) continue; // cut all bins with < 10 entries |
ea90ffcd |
1097 | SetRangeZ(h2, -90., 90, -200.); |
f985021d |
1098 | //h2->GetXaxis()->SetNdivisions(1010); |
5591f3d6 |
1099 | h2->GetZaxis()->SetTitle("Rel. Det. Occup. [%]"); |
1100 | h2->GetZaxis()->CenterTitle(); |
cc98ff07 |
1101 | h2->SetContour(9); h2->Draw("colz"); n++; |
5591f3d6 |
1102 | MakeDetectorPlot(ily, "pad"); |
b351a191 |
1103 | } |
1104 | } |
cc98ff07 |
1105 | if(n>=AliTRDgeometry::kNlayer) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
1106 | |
5591f3d6 |
1107 | cOut = new TCanvas(Form("%s_DetCharge", GetName()), "Detector performance", nx, ny); |
1108 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
1109 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
1110 | p=cOut->cd(ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712); |
b9058d72 |
1111 | if(!(h2 = (TH2*)arr->FindObject(Form("HDet%d_2D", ily)))) continue; |
f985021d |
1112 | SetNormZ(h2, 1, -1, 1, -1, 10.); // cut all <q> < 10 |
1113 | SetRangeZ(h2, -30., 30., -200.); |
1114 | //h2->GetXaxis()->SetNdivisions(1010); |
5591f3d6 |
1115 | h2->GetZaxis()->SetTitle("Rel. Mean(q) [%]"); |
1116 | h2->GetZaxis()->CenterTitle(); |
1117 | h2->Draw("colz"); |
1118 | MakeDetectorPlot(ily, "pad"); |
1119 | } |
1120 | cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
b351a191 |
1121 | } |
f429b017 |
1122 | for(Int_t ityp(0); ityp<(HasMCdata()?2:1); ityp++){ |
1123 | if((arr = (TObjArray*)fProj->At(ityp?kMCcluster:kCluster))){ |
1124 | for(Int_t iview(0); iview<nClViews; iview++){ |
808d178e |
1125 | cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vClName[iview], vClOpt[iview]), "Cluster Resolution", nx, ny); |
f429b017 |
1126 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
1127 | Int_t nplot(0); |
b9058d72 |
1128 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
1129 | p=cOut->cd(ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712); |
1130 | if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s%d_2D", typName[ityp], vClName[iview], ily)))) continue; |
f429b017 |
1131 | nplot++; |
1132 | if(vClOpt[iview]==0) h2->Draw("colz"); |
56838f9d |
1133 | else if(vClOpt[iview]==1) DrawSigma(h2, "#sigma(#Deltay) [#mum]", vClMin[iview], vClMax[iview], 1.e4); |
b9058d72 |
1134 | if(iview<5) MakeDetectorPlot(ily); |
f429b017 |
1135 | } |
b9058d72 |
1136 | if(nplot==AliTRDgeometry::kNlayer) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
f429b017 |
1137 | else delete cOut; |
1138 | } |
1139 | } |
1140 | // tracklet systematic |
1141 | if((arr = (TObjArray*)fProj->At(ityp?kMCtracklet:kTracklet))){ |
1142 | for(Int_t iview(0); iview<nTrkltViews; iview++){ |
808d178e |
1143 | cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vTrkltName[iview], vTrkltOpt[iview]), "Tracklet Resolution", nx, ny); |
01ccc21a |
1144 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
1145 | Int_t nplot(0); |
1146 | for(Int_t iplot(0); iplot<6; iplot++){ |
1147 | p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); |
1148 | if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s%d_2D", typName[ityp], vTrkltName[iview], iplot)))) continue; |
808d178e |
1149 | nplot++; |
1150 | if(vTrkltOpt[iview]==0) h2->Draw("colz"); |
b9058d72 |
1151 | else if (vTrkltOpt[iview]==1) DrawSigma(h2, "#sigma(#Deltay) [cm]", .15, .4); |
56838f9d |
1152 | else if (vTrkltOpt[iview]==2) DrawSigma(h2, "#sigma(occupancy) [%]", 10.5, 15.); |
82e6e5dc |
1153 | MakeDetectorPlot(iplot); |
f429b017 |
1154 | } |
808d178e |
1155 | if(nplot==6){ |
1156 | cOut->Modified();cOut->Update(); |
1157 | cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
1158 | } |
1159 | delete cOut; |
f429b017 |
1160 | } |
1161 | } |
1162 | // trackIn systematic |
1163 | if((arr = (TObjArray*)fProj->At(ityp?kMCtrackIn:kTrackIn))){ |
35983729 |
1164 | for(Int_t iview(0); iview<nTrkInViews; iview++){ |
808d178e |
1165 | cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vTrkInName[iview][0], vTrkInOpt[iview]), "Track IN Resolution", nx, ny); |
35983729 |
1166 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
1167 | Int_t nplot(0); |
1168 | for(Int_t iplot(0); iplot<6; iplot++){ |
566c3d46 |
1169 | p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); |
1170 | if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s_2D", typName[ityp], vTrkInName[iview][iplot])))){ |
1171 | AliInfo(Form("Missing H%s%s_2D", typName[ityp], vTrkInName[iview][iplot])); |
1172 | continue; |
1173 | } |
808d178e |
1174 | nplot++; |
668a0654 |
1175 | if(vTrkInOpt[iview]==0) h2->Draw("colz"); |
1176 | else DrawSigma(h2, ttt[iplot], min[iplot], max[iplot]); |
82e6e5dc |
1177 | MakeDetectorPlot(0); |
35983729 |
1178 | } |
01ccc21a |
1179 | if(nplot==6) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
35983729 |
1180 | else delete cOut; |
3ed01fbe |
1181 | } |
f073d500 |
1182 | // species |
cc98ff07 |
1183 | const Float_t zmin[] = {1., 61., 15.}, |
1184 | zmax[] = {10., 79., 33.}; |
1185 | cOut = new TCanvas(Form("%s_%sTrkInSpc", GetName(), typName[ityp]), "Track IN PID", Int_t(1.5*ny), Int_t(1.5*ny)); |
1186 | cOut->Divide(3,3, 1.e-5, 1.e-5); |
b9058d72 |
1187 | Int_t nplot(0); const Char_t *chName[] = {"p", "n", ""}; |
1188 | for(Int_t ich(0), ipad(1); ich<3; ich++){ |
1189 | TH2 *h2s(NULL); |
1190 | if(!(h2s = (TH2*)arr->FindObject(Form("H%sTrkInY%sEn", typName[ityp], chName[ich])))) { |
1191 | AliInfo(Form("Missing H%sTrkIn%sEn", typName[ityp], chName[ich])); |
1192 | continue; |
1193 | } |
cc98ff07 |
1194 | for(Int_t ispec(0); ispec<kNspc; ispec++){ |
b9058d72 |
1195 | p=cOut->cd(ipad++); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); |
1196 | if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkInY%s%dEn", typName[ityp], chName[ich], ispec)))) { |
1197 | AliInfo(Form("Missing H%sTrkIn%s%dEn", typName[ityp], chName[ich], ispec)); |
1198 | continue; |
f073d500 |
1199 | } |
b9058d72 |
1200 | nplot++; |
1201 | h2->Divide(h2, h2s, 1.e2); |
1202 | h2->SetContour(9); |
1203 | h2->GetZaxis()->SetRangeUser(zmin[ispec], zmax[ispec]); |
1204 | h2->GetZaxis()->SetTitle("Rel. Abundancy [%]");h2->GetZaxis()->CenterTitle(); |
dffc3357 |
1205 | TString tit(h2->GetTitle()); TObjArray *atit = tit.Tokenize("::"); |
1206 | h2->SetTitle(Form("%s :: Relative Abundancy", ((*atit)[0])->GetName())); |
1207 | atit->Delete(); delete atit; |
b9058d72 |
1208 | h2->Draw("colz"); |
1209 | MakeDetectorPlot(0); |
f073d500 |
1210 | } |
1211 | } |
cc98ff07 |
1212 | if(nplot==9) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
b9058d72 |
1213 | else delete cOut; |
f985021d |
1214 | |
1215 | const char *chQ[] = {"Q", "QS"}; |
1216 | for(Int_t iq(0); iq<2; iq++){ |
cc98ff07 |
1217 | cOut = new TCanvas(Form("%s_%sTrkIn%s", GetName(), typName[ityp], chQ[iq]), "Track IN PID", Int_t(1.5*ny), Int_t(1.5*ny)); |
1218 | cOut->Divide(3,3, 1.e-5, 1.e-5); |
f985021d |
1219 | nplot=0; |
1220 | for(Int_t ich(0), ipad(1); ich<3; ich++){ |
cc98ff07 |
1221 | for(Int_t ispec(0); ispec<kNspc; ispec++){ |
f985021d |
1222 | p=cOut->cd(ipad++); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); |
1223 | if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkIn%s%s%d_2D", typName[ityp], chQ[iq], chName[ich], ispec)))) { |
1224 | AliInfo(Form("Missing H%sTrkIn%s%s%d_2D", typName[ityp], chQ[iq], chName[ich], ispec)); |
1225 | continue; |
1226 | } |
1227 | nplot++; |
1228 | h2->Draw("colz"); |
1229 | MakeDetectorPlot(0); |
1230 | } |
1231 | } |
cc98ff07 |
1232 | if(nplot==9) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
f985021d |
1233 | else delete cOut; |
1234 | } |
3ed01fbe |
1235 | } |
3ceb45ae |
1236 | } |
f429b017 |
1237 | // track MC systematic |
1238 | if((arr = (TObjArray*)fProj->At(kMCtrack))) { |
1239 | for(Int_t iview(0); iview<nTrkViews; iview++){ |
01ccc21a |
1240 | cOut = new TCanvas(Form("%s_MC%s", GetName(), vTrkName[iview]), "Track Resolution", nx, ny); |
0b30040d |
1241 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
09c85be5 |
1242 | Int_t nplot(0); |
3ed01fbe |
1243 | for(Int_t iplot(0); iplot<6; iplot++){ |
1244 | p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); |
01ccc21a |
1245 | if(!(h2 = (TH2*)arr->FindObject(Form("HMC%s%d_2D", vTrkName[iview], iplot)))) continue; |
09c85be5 |
1246 | h2->Draw("colz"); nplot++; |
3ed01fbe |
1247 | } |
01ccc21a |
1248 | if(nplot==6) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
09c85be5 |
1249 | else delete cOut; |
3ed01fbe |
1250 | } |
1251 | } |
f429b017 |
1252 | |
1253 | |
3ceb45ae |
1254 | gStyle->SetPalette(1); |
068e2c00 |
1255 | } |
1256 | |
1257 | //________________________________________________________ |
808d178e |
1258 | void AliTRDresolution::DrawSigma(TH2 *h2, const Char_t *title, Float_t m, Float_t M, Float_t scale) |
0b30040d |
1259 | { |
1260 | // Draw error bars scaled with "scale" instead of content values |
1261 | //use range [m,M] if limits are specified |
1262 | |
1263 | if(!h2) return; |
808d178e |
1264 | TAxis *ax(h2->GetXaxis()), *ay(h2->GetYaxis()); |
1265 | TH2F *h2e = new TH2F(Form("%s_E", h2->GetName()), |
1266 | Form("%s;%s;%s;%s", h2->GetTitle(), ax->GetTitle(), ay->GetTitle(), title), |
1267 | ax->GetNbins(), ax->GetXmin(), ax->GetXmax(), |
1268 | ay->GetNbins(), ay->GetXmin(), ay->GetXmax()); |
1269 | h2e->SetContour(9); |
1270 | TAxis *az(h2e->GetZaxis()); |
1271 | if(M>m) az->SetRangeUser(m, M); |
1272 | az->CenterTitle(); |
1273 | az->SetTitleOffset(1.5); |
0b30040d |
1274 | for(Int_t ix(1); ix<=h2->GetNbinsX(); ix++){ |
1275 | for(Int_t iy(1); iy<=h2->GetNbinsY(); iy++){ |
1276 | if(h2->GetBinContent(ix, iy)<-100.) continue; |
1277 | Float_t v(scale*h2->GetBinError(ix, iy)); |
1278 | if(M>m && v<m) v=m+TMath::Abs((M-m)*1.e-3); |
1279 | h2e->SetBinContent(ix, iy, v); |
1280 | } |
1281 | } |
1282 | h2e->Draw("colz"); |
1283 | } |
1284 | |
1285 | //________________________________________________________ |
068e2c00 |
1286 | void AliTRDresolution::GetRange(TH2 *h2, Char_t mod, Float_t *range) |
1287 | { |
01ccc21a |
1288 | // Returns the range of the bulk of data in histogram h2. Removes outliers. |
068e2c00 |
1289 | // The "range" vector should be initialized with 2 elements |
1290 | // Option "mod" can be any of |
01ccc21a |
1291 | // - 0 : gaussian like distribution |
1292 | // - 1 : tailed distribution |
068e2c00 |
1293 | |
1294 | Int_t nx(h2->GetNbinsX()) |
1295 | , ny(h2->GetNbinsY()) |
1296 | , n(nx*ny); |
1297 | Double_t *data=new Double_t[n]; |
1298 | for(Int_t ix(1), in(0); ix<=nx; ix++){ |
1299 | for(Int_t iy(1); iy<=ny; iy++) |
1300 | data[in++] = h2->GetBinContent(ix, iy); |
00a3f7a4 |
1301 | } |
068e2c00 |
1302 | Double_t mean, sigm; |
1303 | AliMathBase::EvaluateUni(n, data, mean, sigm, Int_t(n*.8)); |
1304 | |
1305 | range[0]=mean-3.*sigm; range[1]=mean+3.*sigm; |
01ccc21a |
1306 | if(mod==1) range[0]=TMath::Max(Float_t(1.e-3), range[0]); |
068e2c00 |
1307 | AliDebug(2, Form("h[%s] range0[%f %f]", h2->GetName(), range[0], range[1])); |
1308 | TH1S h1("h1SF0", "", 100, range[0], range[1]); |
1309 | h1.FillN(n,data,0); |
1310 | delete [] data; |
01ccc21a |
1311 | |
068e2c00 |
1312 | switch(mod){ |
01ccc21a |
1313 | case 0:// gaussian distribution |
068e2c00 |
1314 | { |
1315 | TF1 fg("fg", "gaus", mean-3.*sigm, mean+3.*sigm); |
1316 | h1.Fit(&fg, "QN"); |
1317 | mean=fg.GetParameter(1); sigm=fg.GetParameter(2); |
1318 | range[0] = mean-2.5*sigm;range[1] = mean+2.5*sigm; |
1319 | AliDebug(2, Form(" rangeG[%f %f]", range[0], range[1])); |
1320 | break; |
00a3f7a4 |
1321 | } |
01ccc21a |
1322 | case 1:// tailed distribution |
1323 | { |
068e2c00 |
1324 | Int_t bmax(h1.GetMaximumBin()); |
1325 | Int_t jBinMin(1), jBinMax(100); |
1326 | for(Int_t ibin(bmax); ibin--;){ |
61f6b45e |
1327 | if(h1.GetBinContent(ibin)<1.){ |
068e2c00 |
1328 | jBinMin=ibin; break; |
1329 | } |
1330 | } |
1331 | for(Int_t ibin(bmax); ibin++;){ |
61f6b45e |
1332 | if(h1.GetBinContent(ibin)<1.){ |
068e2c00 |
1333 | jBinMax=ibin; break; |
1334 | } |
00a3f7a4 |
1335 | } |
068e2c00 |
1336 | range[0]=h1.GetBinCenter(jBinMin); range[1]=h1.GetBinCenter(jBinMax); |
1337 | AliDebug(2, Form(" rangeT[%f %f]", range[0], range[1])); |
1338 | break; |
1339 | } |
00a3f7a4 |
1340 | } |
00a3f7a4 |
1341 | |
068e2c00 |
1342 | return; |
1343 | } |
1344 | |
f073d500 |
1345 | //________________________________________________________ |
1346 | Bool_t AliTRDresolution::MakeProjectionDetector() |
1347 | { |
1348 | // Analyse cluster |
1349 | const Int_t kNcontours(9); |
1350 | const Int_t kNstat(100); |
1351 | if(fProj && fProj->At(kDetector)) return kTRUE; |
1352 | if(!fContainer){ |
1353 | AliError("Missing data container."); |
1354 | return kFALSE; |
1355 | } |
1356 | THnSparse *H(NULL); |
1357 | if(!(H = (THnSparse*)fContainer->FindObject("hDet2Cluster"))){ |
1358 | AliInfo(Form("Missing/Wrong data @ hDet2Cluster.")); |
1359 | return kTRUE; |
1360 | } |
1361 | Int_t ndim(H->GetNdimensions()); |
1362 | Int_t coord[kNdim]; memset(coord, 0, sizeof(Int_t) * kNdim); Double_t v = 0.; |
b9058d72 |
1363 | TAxis *aa[kNdim], *an(NULL); memset(aa, 0, sizeof(TAxis*) * kNdim); |
f073d500 |
1364 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
b9058d72 |
1365 | if(ndim < 5) aa[4] = new TAxis(1, -0.5, 0.5); |
1366 | Int_t nPad(1); |
1367 | if(ndim > 5){ |
1368 | an = H->GetAxis(5); |
1369 | nPad = kNpads+1; |
f073d500 |
1370 | } |
1371 | // build list of projections |
b9058d72 |
1372 | const Int_t nsel(8*AliTRDgeometry::kNlayer*AliTRDeventInfo::kCentralityClasses); |
f073d500 |
1373 | // define rebinning strategy |
b351a191 |
1374 | const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 2, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5}; |
b9058d72 |
1375 | //const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"}; |
1376 | const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"}; |
eb05d549 |
1377 | AliTRDrecoProjection hp[kDetNproj]; TObjArray php(kDetNproj); |
f073d500 |
1378 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
b9058d72 |
1379 | for(Int_t ipad(0); ipad<nPad; ipad++){ |
1380 | for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){ |
1381 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
1382 | isel++; // new selection |
1383 | hp[ih].Build(Form("HDet%d%d%d", ily, icen, ipad), |
1384 | Form("Detectors :: Ly[%d] Cen[%s] Pads[%s]", ily, cenName[icen], ipad?(ipad<kNpads?Form("%d", ipad+1):Form(">%d", kNpads)):"deconv"), |
1385 | kEta, kPhi, 4, aa); |
1386 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1387 | hp[ih].SetShowRange(10., 55.); |
1388 | php.AddLast(&hp[ih++]); np[isel]++; |
1389 | } |
f073d500 |
1390 | } |
1391 | } |
1392 | AliInfo(Form("Build %3d 3D projections.", ih)); |
1393 | |
b9058d72 |
1394 | Int_t ly(0), cen(0), npad(0); |
f073d500 |
1395 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
1396 | v = H->GetBinContent(ib, coord); if(v<1.) continue; |
b9058d72 |
1397 | ly = coord[kBC]-1; // layer selection |
1398 | cen = coord[kYrez]-1; // centrality selection |
1399 | npad = 0; // no. of pads selection |
1400 | if(an) npad = TMath::Min(coord[5]-1, Int_t(kNpads)); |
1401 | isel = npad*AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer+cen*AliTRDgeometry::kNlayer+ly; |
eb05d549 |
1402 | ((AliTRDrecoProjection*)php.At(isel))->Increment(coord, v); |
1403 | //Int_t ioff=isel;for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); |
f073d500 |
1404 | } |
1405 | TObjArray *arr(NULL); |
1406 | fProj->AddAt(arr = new TObjArray(kDetNproj), kDetector); |
1407 | |
1408 | TH2 *h2(NULL); Int_t jh(0); |
1409 | for(; ih--; ){ |
eb05d549 |
1410 | if(!hp[ih].H()) continue; |
b351a191 |
1411 | if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) continue; |
1412 | arr->AddAt(h2, jh++); |
eb05d549 |
1413 | if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) continue; |
f073d500 |
1414 | arr->AddAt(h2, jh++); |
1415 | } |
eb05d549 |
1416 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
f073d500 |
1417 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
b9058d72 |
1418 | for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){ |
eb05d549 |
1419 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, 0)))){ |
b9058d72 |
1420 | for(Int_t ipad(1); ipad<nPad; ipad++){ |
eb05d549 |
1421 | if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, ipad)))){ |
b9058d72 |
1422 | (*pr0)+=(*pr1); |
1423 | } |
f073d500 |
1424 | } |
eb05d549 |
1425 | pr0->H()->SetNameTitle(Form("HDet%d%d", ily, icen), Form("Detectors :: Ly[%d] Cen[%s]", ily, cenName[icen])); |
b9058d72 |
1426 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 |
1427 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
1428 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))) (*pr1)+=(*pr0); |
f073d500 |
1429 | } |
b9058d72 |
1430 | } |
eb05d549 |
1431 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))){ |
1432 | pr0->H()->SetNameTitle(Form("HDet%d", ily), Form("Detectors :: Ly[%d]", ily)); |
f073d500 |
1433 | if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); |
1434 | } |
1435 | } |
1436 | AliInfo(Form("Done %3d 2D projections.", jh)); |
1437 | return kTRUE; |
1438 | } |
3ceb45ae |
1439 | |
068e2c00 |
1440 | //________________________________________________________ |
f429b017 |
1441 | Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc) |
068e2c00 |
1442 | { |
3ceb45ae |
1443 | // Analyse cluster |
3ed01fbe |
1444 | const Int_t kNcontours(9); |
808d178e |
1445 | const Int_t kNstat(100); |
f429b017 |
1446 | Int_t cidx=mc?kMCcluster:kCluster; |
3ceb45ae |
1447 | if(fProj && fProj->At(cidx)) return kTRUE; |
1448 | if(!fContainer){ |
1449 | AliError("Missing data container."); |
1450 | return kFALSE; |
1451 | } |
f073d500 |
1452 | const Char_t *projName[] = {"hCluster2Track", "hCluster2MC"}; |
3ceb45ae |
1453 | THnSparse *H(NULL); |
f073d500 |
1454 | if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){ |
1455 | AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)])); |
3ceb45ae |
1456 | return kFALSE; |
1457 | } |
178d284a |
1458 | Int_t ndim(H->GetNdimensions()); Bool_t debug(ndim>Int_t(kNdimCl)); |
c6100e2a |
1459 | Int_t coord[10]; memset(coord, 0, sizeof(Int_t) * 10); Double_t v = 0.; |
b9058d72 |
1460 | TAxis *aa[kNdim], *as(NULL), *apt(NULL), *acen(NULL), *anp(NULL); memset(aa, 0, sizeof(TAxis*) * kNdim); |
3ed01fbe |
1461 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
178d284a |
1462 | if(ndim > Int_t(kPt)) apt = H->GetAxis(kPt); |
1463 | if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC); |
b9058d72 |
1464 | if(ndim > Int_t(kNdim)) acen = H->GetAxis(kNdim); |
1465 | if(ndim > Int_t(kNdim)+1) anp = H->GetAxis(kNdim+1); |
1466 | // calculate size depending on debug level |
1467 | const Int_t nCh(apt?2:1); |
1468 | const Int_t nCen(acen?Int_t(AliTRDeventInfo::kCentralityClasses):1); |
1469 | const Int_t nNpad(anp?(Int_t(kNpads)+1):1); |
1470 | |
3ed01fbe |
1471 | // build list of projections |
b9058d72 |
1472 | const Int_t nsel(AliTRDgeometry::kNlayer*kNcharge*(kNpads+1)*AliTRDeventInfo::kCentralityClasses); |
3ed01fbe |
1473 | // define rebinning strategy |
1474 | const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5}; |
eb05d549 |
1475 | AliTRDrecoProjection hp[kClNproj]; TObjArray php(kClNproj); |
01ccc21a |
1476 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
b9058d72 |
1477 | const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"}; |
3ed01fbe |
1478 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
3ceb45ae |
1479 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
b9058d72 |
1480 | for(Int_t ich(0); ich<nCh; ich++){ |
1481 | for(Int_t icen(0); icen<nCen; icen++){ |
1482 | for(Int_t ipad(0); ipad<nNpad; ipad++){ |
1483 | isel++; // new selection |
1484 | hp[ih].Build(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), |
1485 | Form("Clusters[%c] :: #Deltay Ly[%d] Cen[%s] Pads[%s]", chSgn[ich], ily, cenName[icen], ipad?(ipad<kNpads?Form("%d", ipad+1):Form(">%d", kNpads)):"deconv"), |
1486 | kEta, kPhi, kYrez, aa); |
1487 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1488 | php.AddLast(&hp[ih++]); np[isel]++; |
1489 | if(!debug) break; |
1490 | hp[ih].Build(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), |
1491 | Form("Clusters[%c] :: Q Ly[%d] Cen[%s] Pads[%s]", chSgn[ich], ily, cenName[icen], ipad?(ipad<kNpads?Form("%d", ipad+1):Form(">%d", kNpads)):"deconv"), |
1492 | kEta, kPhi, kSpeciesChgRC, aa); |
1493 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1494 | hp[ih].SetShowRange(24., 33.); |
1495 | php.AddLast(&hp[ih++]); np[isel]++; |
1496 | hp[ih].Build(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), |
1497 | Form("Clusters[%c] :: #Deltay(x,TC) Ly[%d] Cen[%s] Pads[%s]", chSgn[ich], ily, cenName[icen], ipad?(ipad<kNpads?Form("%d", ipad+1):Form(">%d", kNpads)):"deconv"), |
1498 | kPrez, kZrez, kYrez, aa); |
1499 | php.AddLast(&hp[ih++]); np[isel]++; |
1500 | hp[ih].Build(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), |
1501 | Form("Clusters[%c] :: #Deltay(x,#Phi) Ly[%d] Cen[%s] Pads[%s]", chSgn[ich], ily, cenName[icen], ipad?(ipad<kNpads?Form("%d", ipad+1):Form(">%d", kNpads)):"deconv"), |
1502 | kPrez, kPt, kYrez, aa); |
1503 | php.AddLast(&hp[ih++]); np[isel]++; |
1504 | } |
1505 | } |
01ccc21a |
1506 | } |
3ceb45ae |
1507 | } |
8892a7f3 |
1508 | AliInfo(Form("Build %3d 3D projections.", ih)); |
3ed01fbe |
1509 | |
eb05d549 |
1510 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
b9058d72 |
1511 | Int_t ly(0), ch(0), rcBin(as?as->FindBin(0.):-1), chBin(apt?apt->FindBin(0.):-1), ioff(0), cen(0), npad(0); |
3ceb45ae |
1512 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
3ed01fbe |
1513 | v = H->GetBinContent(ib, coord); if(v<1.) continue; |
1514 | ly = coord[kBC]-1; |
1515 | // RC selection |
1516 | if(rcBin>0 && coord[kSpeciesChgRC] == rcBin) continue; |
1517 | |
1518 | // charge selection |
1519 | ch = 0; // [-] track |
1520 | if(chBin>0 && coord[kPt] > chBin) ch = 1; // [+] track |
b9058d72 |
1521 | cen = 0; // centrality selection |
1522 | if(acen) cen = coord[kNdim]-1; |
1523 | npad = 0; // no. of pads selection |
1524 | if(anp) npad = TMath::Min(coord[kNdim+1]-1, Int_t(kNpads)); |
3ed01fbe |
1525 | |
49ed65ad |
1526 | if(debug){ |
b9058d72 |
1527 | isel = ly*nCh*nCen*nNpad |
1528 | +ch*nCen*nNpad |
1529 | +cen*nNpad |
1530 | +npad; |
1531 | ioff=isel*4; |
49ed65ad |
1532 | } else { |
1533 | isel = ly; ioff = isel; |
1534 | } |
b9058d72 |
1535 | if(ioff>=ih){ |
1536 | AliError(Form("Wrong selection %d [%3d]", ioff, ih)); |
1537 | return kFALSE; |
1538 | } |
eb05d549 |
1539 | if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) { |
b9058d72 |
1540 | AliError(Form("Missing projection %d", ioff)); |
1541 | return kFALSE; |
1542 | } |
eb05d549 |
1543 | if(strcmp(pr0->H()->GetName(), Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ch], ly, cen, npad))!=0){ |
1544 | AliError(Form("Projection mismatch :: request[H%sClY%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ly, cen, npad, pr0->H()->GetName())); |
b9058d72 |
1545 | return kFALSE; |
1546 | } |
eb05d549 |
1547 | for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); |
3ceb45ae |
1548 | } |
33056e04 |
1549 | if(HasDump3DFor(kCluster)){ |
1550 | TDirectory *cwd = gDirectory; |
1551 | TFile::Open(Form("ResDump_%s.root", H->GetName()), "RECREATE"); |
1552 | for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){ |
1553 | if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue; |
1554 | if(!pr0->H()) continue; |
1555 | TH3 *h3=(TH3*)pr0->H()->Clone(); |
1556 | h3->Write(); |
1557 | } |
1558 | gFile->Close(); |
1559 | cwd->cd(); |
1560 | } |
1561 | |
3ceb45ae |
1562 | TObjArray *arr(NULL); |
0b366e97 |
1563 | fProj->AddAt(arr = new TObjArray(kClNproj), cidx); |
3ed01fbe |
1564 | |
01ccc21a |
1565 | TH2 *h2(NULL); Int_t jh(0); |
3ed01fbe |
1566 | for(; ih--; ){ |
eb05d549 |
1567 | if(!hp[ih].H()) continue; |
1568 | if(strchr(hp[ih].H()->GetName(), 'Q')){ |
b9058d72 |
1569 | if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) continue; |
1570 | arr->AddAt(h2, jh++); |
eb05d549 |
1571 | if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) continue; |
b9058d72 |
1572 | arr->AddAt(h2, jh++); |
1573 | } else { |
1574 | if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
1575 | } |
01ccc21a |
1576 | } |
01ccc21a |
1577 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
b9058d72 |
1578 | for(Int_t ich(0); ich<nCh; ich++){ |
1579 | for(Int_t icen(0); icen<nCen; icen++){ |
1580 | /*!dy*/ |
eb05d549 |
1581 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 |
1582 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 |
1583 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 |
1584 | (*pr0)+=(*pr1); |
1585 | } |
eb05d549 |
1586 | pr0->H()->SetNameTitle(Form("H%sClY%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
b9058d72 |
1587 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1588 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 |
1589 | } |
1590 | /*!Q*/ |
eb05d549 |
1591 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 |
1592 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 |
1593 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 |
1594 | (*pr0)+=(*pr1); |
1595 | } |
eb05d549 |
1596 | pr0->H()->SetNameTitle(Form("H%sClQ%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: Q Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
b9058d72 |
1597 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 |
1598 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
1599 | pr0->H()->SetName(Form("H%sClQS%c%d%d", mc?"MC":"", chName[ich], ily, icen)); |
b9058d72 |
1600 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
eb05d549 |
1601 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 |
1602 | } |
1603 | /*!YXTC*/ |
eb05d549 |
1604 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 |
1605 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 |
1606 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 |
1607 | (*pr0)+=(*pr1); |
1608 | } |
eb05d549 |
1609 | pr0->H()->SetNameTitle(Form("H%sClYXTC%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,TC) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
b9058d72 |
1610 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1611 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 |
1612 | } |
1613 | /*!YXPh*/ |
eb05d549 |
1614 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 |
1615 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 |
1616 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 |
1617 | (*pr0)+=(*pr1); |
1618 | } |
eb05d549 |
1619 | pr0->H()->SetNameTitle(Form("H%sClYXPh%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,#Phi) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
b9058d72 |
1620 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1621 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 |
1622 | } |
1623 | } // end centrality integration |
1624 | /*!dy*/ |
eb05d549 |
1625 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
1626 | pr0->H()->SetNameTitle(Form("H%sClY%c%d", mc?"MC":"", chName[ich], ily), |
b9058d72 |
1627 | Form("Clusters[%c]:: #Deltay Ly[%d]", chSgn[ich], ily)); |
808d178e |
1628 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1629 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
808d178e |
1630 | } |
b9058d72 |
1631 | /*!Q*/ |
eb05d549 |
1632 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
1633 | pr0->H()->SetNameTitle(Form("H%sClQ%c%d", mc?"MC":"", chName[ich], ily), |
b9058d72 |
1634 | Form("Clusters[%c]:: Q Ly[%d]", chSgn[ich], ily)); |
1635 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); |
eb05d549 |
1636 | pr0->H()->SetName(Form("H%sClQS%c%d", mc?"MC":"", chName[ich], ily)); |
b9058d72 |
1637 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
eb05d549 |
1638 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 |
1639 | } |
1640 | /*!YXTC*/ |
eb05d549 |
1641 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
1642 | pr0->H()->SetNameTitle(Form("H%sClYXTC%c%d", mc?"MC":"", chName[ich], ily), |
b9058d72 |
1643 | Form("Clusters[%c]:: #Deltay(x,TC) Ly[%d]", chSgn[ich], ily)); |
808d178e |
1644 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1645 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
808d178e |
1646 | } |
b9058d72 |
1647 | /*!YXPh*/ |
eb05d549 |
1648 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
1649 | pr0->H()->SetNameTitle(Form("H%sClYXPh%c%d", mc?"MC":"", chName[ich], ily), |
b9058d72 |
1650 | Form("Clusters[%c]:: #Deltay(x,#Phi) Ly[%d]", chSgn[ich], ily)); |
1651 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1652 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 |
1653 | } |
1654 | } // end charge integration |
1655 | /*!dy*/ |
eb05d549 |
1656 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){ |
1657 | pr0->H()->SetNameTitle(Form("H%sClY%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily)); |
b9058d72 |
1658 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
808d178e |
1659 | } |
b9058d72 |
1660 | /*!YXPh*/ |
eb05d549 |
1661 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){ |
1662 | pr0->H()->SetNameTitle(Form("H%sClYXPh%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily)); |
b9058d72 |
1663 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
1664 | } |
1665 | |
00a3f7a4 |
1666 | } |
8892a7f3 |
1667 | AliInfo(Form("Done %3d 2D projections.", jh)); |
3ceb45ae |
1668 | return kTRUE; |
00a3f7a4 |
1669 | } |
1670 | |
3ceb45ae |
1671 | //________________________________________________________ |
f429b017 |
1672 | Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc) |
3ceb45ae |
1673 | { |
1674 | // Analyse tracklet |
3ed01fbe |
1675 | const Int_t kNcontours(9); |
566c3d46 |
1676 | const Int_t kNstat(30); |
01ccc21a |
1677 | const Int_t kNstatQ(30); |
f429b017 |
1678 | Int_t cidx=mc?kMCtracklet:kTracklet; |
3ceb45ae |
1679 | if(fProj && fProj->At(cidx)) return kTRUE; |
1680 | if(!fContainer){ |
1681 | AliError("Missing data container."); |
1682 | return kFALSE; |
1683 | } |
f073d500 |
1684 | const Char_t *projName[] = {"hTracklet2Track", "hTracklet2MC"}; |
3ceb45ae |
1685 | THnSparse *H(NULL); |
f073d500 |
1686 | if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){ |
1687 | AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)])); |
3ceb45ae |
1688 | return kFALSE; |
1689 | } |
82e6e5dc |
1690 | const Int_t mdim(kNdim+8); |
178d284a |
1691 | Int_t ndim(H->GetNdimensions()); Bool_t debug(ndim>Int_t(kNdimTrklt)); |
82e6e5dc |
1692 | Int_t coord[mdim]; memset(coord, 0, sizeof(Int_t) * mdim); Double_t v = 0.; |
8892a7f3 |
1693 | TAxis *aa[mdim], *as(NULL), *ap(NULL), *ac(NULL); memset(aa, 0, sizeof(TAxis*) * mdim); |
3ed01fbe |
1694 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
178d284a |
1695 | if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC); // init species/charge selection |
1696 | if(ndim > Int_t(kPt)) ap = H->GetAxis(kPt); // init pt selection |
b9058d72 |
1697 | if(ndim > Int_t(kNdim)) ac = H->GetAxis(kNdim); // init centrality selection |
8892a7f3 |
1698 | // calculate size depending on debug level |
178d284a |
1699 | const Int_t nCen(debug?Int_t(AliTRDeventInfo::kCentralityClasses):1); |
ea90ffcd |
1700 | const Int_t nPt(debug?Int_t(kNpt+2):1); |
8892a7f3 |
1701 | const Int_t nSpc(1);//ndim>kNdimTrklt?fgkNbins[kSpeciesChgRC]:1); |
178d284a |
1702 | const Int_t nCh(debug?Int_t(kNcharge):1); |
8892a7f3 |
1703 | |
3ed01fbe |
1704 | // build list of projections |
ea90ffcd |
1705 | const Int_t nsel(AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer*(kNpt+2)*(AliPID::kSPECIES*kNcharge + 1)); |
3ed01fbe |
1706 | // define rebinning strategy |
1707 | const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5}; |
eb05d549 |
1708 | AliTRDrecoProjection hp[kTrkltNproj]; TObjArray php(kTrkltNproj); |
3ed01fbe |
1709 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
566c3d46 |
1710 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
ea90ffcd |
1711 | const Char_t ptName[kNpt+2] = {'L', 'l', 'i', 'h', 'H'}; |
1712 | const Char_t *ptCut[kNpt+2] = {"p_{t}[GeV/c]<0.5", "0.5<=p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "1.5<=p_{t}[GeV/c]<5.0", "p_{t}[GeV/c]>=5.0"}; |
b9058d72 |
1713 | // const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"}; |
1714 | const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"}; |
8892a7f3 |
1715 | for(Int_t icen(0); icen<nCen; icen++){ |
1716 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
1717 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
1718 | for(Int_t isp(0); isp<nSpc; isp++){ |
1719 | for(Int_t ich(0); ich<nCh; ich++){ |
1720 | isel++; // new selection |
1721 | hp[ih].Build(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen), |
f073d500 |
1722 | Form("Tracklets[%s%c]:: #Deltay{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]), |
8892a7f3 |
1723 | kEta, kPhi, kYrez, aa); |
1724 | //hp[ih].SetShowRange(-0.1,0.1); |
1725 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1726 | php.AddLast(&hp[ih++]); np[isel]++; |
1727 | hp[ih].Build(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen), |
f073d500 |
1728 | Form("Tracklets[%s%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]), |
8892a7f3 |
1729 | kEta, kPhi, kPrez, aa); |
1730 | //hp[ih].SetShowRange(-0.5,0.5); |
1731 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1732 | php.AddLast(&hp[ih++]); np[isel]++; |
1733 | hp[ih].Build(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen), |
f073d500 |
1734 | Form("Tracklets[%s%c]:: dQdl{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]), |
b9058d72 |
1735 | kEta, kPhi, kZrez, aa); |
f073d500 |
1736 | hp[ih].SetShowRange(1.,2.3); |
8892a7f3 |
1737 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1738 | php.AddLast(&hp[ih++]); np[isel]++; |
1739 | hp[ih].Build(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen), |
f073d500 |
1740 | Form("Tracklets[%s%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]), |
b9058d72 |
1741 | kEta, kPhi, kNdim+1, aa); |
8892a7f3 |
1742 | hp[ih].SetShowRange(30., 70.); |
1743 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1744 | php.AddLast(&hp[ih++]); np[isel]++; |
1745 | } |
01ccc21a |
1746 | } |
8892a7f3 |
1747 | if(ndim==kNdimTrklt) continue; |
1748 | |
1749 | isel++; // new selection |
1750 | hp[ih].Build(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen), |
1751 | Form("Tracklets[RC]:: #Deltaz{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]), |
1752 | kEta, kPhi, kZrez, aa); |
1753 | // hp[ih].SetShowRange(-0.1,0.1); |
1754 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1755 | php.AddLast(&hp[ih++]); np[isel]++; |
b9058d72 |
1756 | /* hp[ih].Build(Form("H%sTrkltRCY%c%d%d", mc?"MC":"", ptName[ipt], ily, icen), |
8892a7f3 |
1757 | Form("Tracklets[RC]:: #Deltay{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]), |
1758 | kEta, kPhi, kYrez, aa); |
1759 | //hp[ih].SetShowRange(-0.1,0.1); |
1760 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1761 | php.AddLast(&hp[ih++]); np[isel]++; |
1762 | hp[ih].Build(Form("H%sTrkltRCPh%c%d%d", mc?"MC":"", ptName[ipt], ily, icen), |
1763 | Form("Tracklets[RC]:: #Delta#phi{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]), |
1764 | kEta, kPhi, kPrez, aa); |
1765 | //hp[ih].SetShowRange(-0.1,0.1); |
1766 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1767 | php.AddLast(&hp[ih++]); np[isel]++; |
1768 | hp[ih].Build(Form("H%sTrkltRCQ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen), |
1769 | Form("Tracklets[RC]:: dQdl{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]), |
1770 | kEta, kPhi, kNdim, aa); |
1771 | //hp[ih].SetShowRange(-0.1,0.1); |
1772 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
b9058d72 |
1773 | php.AddLast(&hp[ih++]); np[isel]++;*/ |
566c3d46 |
1774 | } |
566c3d46 |
1775 | } |
3ed01fbe |
1776 | } |
8892a7f3 |
1777 | AliInfo(Form("Build %3d 3D projections.", ih)); |
3ed01fbe |
1778 | |
eb05d549 |
1779 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
b9058d72 |
1780 | Int_t ly(0), ch(0), sp(2), rcBin(as?as->FindBin(0.):-1), pt(0), cen(0), ioff(0), jspc(nSpc*nCh+1), kspc(nSpc*nCh*4+1); |
3ed01fbe |
1781 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
1782 | v = H->GetBinContent(ib, coord); |
1783 | if(v<1.) continue; |
1784 | ly = coord[kBC]-1; // layer selection |
1785 | // charge selection |
8892a7f3 |
1786 | ch = 0; sp=0;// [e-] track [dafault] |
b9058d72 |
1787 | if(rcBin>0){ // debug mode in which species/charge are also saved |
01ccc21a |
1788 | sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1; |
3ed01fbe |
1789 | if(coord[kSpeciesChgRC] > rcBin) ch = 1; // [+] track |
1790 | else if(coord[kSpeciesChgRC] == rcBin) ch = 2; // [RC] track |
1791 | } |
566c3d46 |
1792 | // pt selection |
1793 | pt = 0; // low pt |
ea90ffcd |
1794 | if(ap) pt = TMath::Min(coord[kPt], Int_t(kNpt)+1); |
8892a7f3 |
1795 | // centrality selection |
1796 | cen = 0; // default |
b9058d72 |
1797 | if(ac) cen = coord[kNdim]-1; |
566c3d46 |
1798 | // global selection |
8892a7f3 |
1799 | if(ndim==kNdimTrklt){ |
1800 | ioff = ly*4; |
1801 | isel = ly; |
1802 | } else { |
b9058d72 |
1803 | isel = cen*AliTRDgeometry::kNlayer*nPt*jspc+ly*nPt*jspc+pt*jspc; isel+=sp<0?(nSpc*nCh):ch; |
1804 | ioff = cen*AliTRDgeometry::kNlayer*nPt*kspc+ly*nPt*kspc+pt*kspc; ioff+=sp<0?((nSpc*nCh)*4):(ch*4); |
1805 | } |
1806 | if(ioff>=ih){ |
1807 | AliError(Form("Wrong selection %d [%3d]", ioff, ih)); |
1808 | return kFALSE; |
1809 | } |
eb05d549 |
1810 | if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) { |
b9058d72 |
1811 | AliError(Form("Missing projection %d", ioff)); |
1812 | return kFALSE; |
1813 | } |
1814 | if(sp>=0){ |
eb05d549 |
1815 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen))!=0){ |
1816 | AliError(Form("Projection mismatch :: request[H%sTrkltY%c%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen, pr0->H()->GetName())); |
b9058d72 |
1817 | return kFALSE; |
1818 | } |
1819 | } else { |
eb05d549 |
1820 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[pt], ly, cen))!=0){ |
1821 | AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c%d%d] found[%s]", mc?"MC":"", ptName[pt], ly, cen, pr0->H()->GetName())); |
b9058d72 |
1822 | return kFALSE; |
1823 | } |
8892a7f3 |
1824 | } |
eb05d549 |
1825 | for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); |
3ed01fbe |
1826 | } |
33056e04 |
1827 | if(HasDump3DFor(kTracklet)){ |
1828 | TDirectory *cwd = gDirectory; |
1829 | TFile::Open(Form("ResDump_%s.root", H->GetName()), "RECREATE"); |
1830 | for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){ |
1831 | if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue; |
1832 | if(!pr0->H()) continue; |
1833 | TH3 *h3=(TH3*)pr0->H()->Clone(); |
1834 | h3->Write(); |
1835 | } |
1836 | gFile->Close(); |
1837 | cwd->cd(); |
1838 | } |
1839 | |
3ed01fbe |
1840 | TObjArray *arr(NULL); |
0b366e97 |
1841 | fProj->AddAt(arr = new TObjArray(kTrkltNproj), cidx); |
3ed01fbe |
1842 | |
566c3d46 |
1843 | TH2 *h2(NULL); Int_t jh(0); |
3ed01fbe |
1844 | for(; ih--; ){ |
eb05d549 |
1845 | if(!hp[ih].H()) continue; |
3ed01fbe |
1846 | Int_t mid(0), nstat(kNstat); |
eb05d549 |
1847 | if(strchr(hp[ih].H()->GetName(), 'Q')){ mid=2; nstat=kNstatQ;} |
3ed01fbe |
1848 | if(!(h2 = hp[ih].Projection2D(nstat, kNcontours, mid))) continue; |
566c3d46 |
1849 | arr->AddAt(h2, jh++); |
3ed01fbe |
1850 | } |
566c3d46 |
1851 | // build combined performance plots |
566c3d46 |
1852 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
8892a7f3 |
1853 | for(Int_t ich(0); ich<nCh; ich++){ |
1854 | for(Int_t icen(0); icen<nCen; icen++){ |
1855 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
1856 | /*!dy*/ |
eb05d549 |
1857 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){ |
8892a7f3 |
1858 | for(Int_t isp(1); isp<nSpc; isp++){ |
eb05d549 |
1859 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue; |
8892a7f3 |
1860 | (*pr0)+=(*pr1); |
1861 | } |
eb05d549 |
1862 | pr0->H()->SetNameTitle(Form("H%sTrkltY%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen), |
8892a7f3 |
1863 | Form("Tracklets[%c]:: #Deltay{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen])); |
1864 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1865 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0); |
8892a7f3 |
1866 | } |
1867 | /*!dphi*/ |
eb05d549 |
1868 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){ |
8892a7f3 |
1869 | for(Int_t isp(1); isp<nSpc; isp++){ |
eb05d549 |
1870 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue; |
8892a7f3 |
1871 | (*pr0)+=(*pr1); |
1872 | } |
eb05d549 |
1873 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen), |
8892a7f3 |
1874 | Form("Tracklets[%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen])); |
1875 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1876 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0); |
8892a7f3 |
1877 | } |
1878 | /*!dQ/dl*/ |
eb05d549 |
1879 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){ |
8892a7f3 |
1880 | for(Int_t isp(1); isp<nSpc; isp++){ |
eb05d549 |
1881 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue; |
8892a7f3 |
1882 | (*pr0)+=(*pr1); |
1883 | } |
eb05d549 |
1884 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen), |
8892a7f3 |
1885 | Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen])); |
1886 | if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++); |
eb05d549 |
1887 | pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen), |
8892a7f3 |
1888 | Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen])); |
f073d500 |
1889 | pr0->SetShowRange(2.4, 5.1); |
8892a7f3 |
1890 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
eb05d549 |
1891 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0); |
8892a7f3 |
1892 | } |
1893 | /*!TB occupancy*/ |
eb05d549 |
1894 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){ |
8892a7f3 |
1895 | for(Int_t isp(1); isp<nSpc; isp++){ |
eb05d549 |
1896 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue; |
8892a7f3 |
1897 | (*pr0)+=(*pr1); |
1898 | } |
eb05d549 |
1899 | pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen), |
8892a7f3 |
1900 | Form("Tracklets[%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen])); |
1901 | if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); |
eb05d549 |
1902 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0); |
01ccc21a |
1903 | } |
8892a7f3 |
1904 | } // end pt integration |
1905 | /*!dy*/ |
eb05d549 |
1906 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){ |
1907 | pr0->H()->SetNameTitle(Form("H%sTrkltY%c%d%d", mc?"MC":"", chName[ich], ily, icen), |
8892a7f3 |
1908 | Form("Tracklets[%c]:: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
01ccc21a |
1909 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1910 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
01ccc21a |
1911 | } |
1912 | /*!dphi*/ |
eb05d549 |
1913 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){ |
1914 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%d%d", mc?"MC":"", chName[ich], ily, icen), |
8892a7f3 |
1915 | Form("Tracklets[%c]:: #Delta#phi Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
01ccc21a |
1916 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1917 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
01ccc21a |
1918 | } |
1919 | /*!dQ/dl*/ |
eb05d549 |
1920 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){ |
1921 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%d%d", mc?"MC":"", chName[ich], ily, icen), |
8892a7f3 |
1922 | Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
f073d500 |
1923 | pr0->SetShowRange(1.,2.3); |
01ccc21a |
1924 | if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++); |
eb05d549 |
1925 | pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%d%d", mc?"MC":"", chName[ich], ily, icen), |
8892a7f3 |
1926 | Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
f073d500 |
1927 | pr0->SetShowRange(2.4,5.1); |
01ccc21a |
1928 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
eb05d549 |
1929 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
01ccc21a |
1930 | } |
82e6e5dc |
1931 | /*!TB occupancy*/ |
eb05d549 |
1932 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){ |
1933 | pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%d%d", mc?"MC":"", chName[ich], ily, icen), |
8892a7f3 |
1934 | Form("Tracklets[%c]:: OccupancyTB Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen])); |
82e6e5dc |
1935 | if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); |
eb05d549 |
1936 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
82e6e5dc |
1937 | } |
8892a7f3 |
1938 | } // end centrality integration |
01ccc21a |
1939 | /*!dy*/ |
eb05d549 |
1940 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){ |
1941 | pr0->H()->SetNameTitle(Form("H%sTrkltY%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Deltay Ly[%d]", chSgn[ich], ily)); |
01ccc21a |
1942 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1943 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
01ccc21a |
1944 | } |
1945 | /*!dphi*/ |
eb05d549 |
1946 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){ |
1947 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Delta#phi Ly[%d]", chSgn[ich], ily)); |
56838f9d |
1948 | pr0->SetShowRange(-.9,.9); |
01ccc21a |
1949 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
1950 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
01ccc21a |
1951 | } |
1952 | /*!dQ/dl*/ |
eb05d549 |
1953 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){ |
1954 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily)); |
f073d500 |
1955 | pr0->SetShowRange(1.,2.3); |
01ccc21a |
1956 | if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++); |
eb05d549 |
1957 | pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily)); |
f073d500 |
1958 | pr0->SetShowRange(2.4,5.1); |
01ccc21a |
1959 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
eb05d549 |
1960 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
01ccc21a |
1961 | } |
82e6e5dc |
1962 | /*!TB occupancy*/ |
eb05d549 |
1963 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){ |
1964 | pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: OccupancyTB Ly[%d]", chSgn[ich], ily)); |
82e6e5dc |
1965 | if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); |
eb05d549 |
1966 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0); |
82e6e5dc |
1967 | } |
8892a7f3 |
1968 | } // end charge integration |
01ccc21a |
1969 | /*!dy*/ |
eb05d549 |
1970 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){ |
1971 | pr0->H()->SetNameTitle(Form("H%sTrkltY%d", mc?"MC":"", ily), Form("Tracklets :: #Deltay Ly[%d]", ily)); |
01ccc21a |
1972 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
566c3d46 |
1973 | } |
01ccc21a |
1974 | /*!dphi*/ |
eb05d549 |
1975 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){ |
1976 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%d", mc?"MC":"", ily), Form("Tracklets :: #Delta#phi Ly[%d]", ily)); |
56838f9d |
1977 | pr0->SetShowRange(-.45,.45); |
01ccc21a |
1978 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
566c3d46 |
1979 | } |
8892a7f3 |
1980 | /*!dQdl*/ |
eb05d549 |
1981 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){ |
1982 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%d", mc?"MC":"", ily), Form("Tracklets :: dQdl Ly[%d]", ily)); |
56838f9d |
1983 | pr0->SetShowRange(1.,2.3); |
1984 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); |
eb05d549 |
1985 | pr0->H()->SetName(Form("H%sTrkltQS%d", mc?"MC":"", ily)); |
56838f9d |
1986 | pr0->SetShowRange(2.4,5.1); |
01ccc21a |
1987 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
566c3d46 |
1988 | } |
82e6e5dc |
1989 | /*!TB occupancy*/ |
eb05d549 |
1990 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){ |
1991 | pr0->H()->SetNameTitle(Form("H%sTrkltTB%d", mc?"MC":"", ily), Form("Tracklets :: OccupancyTB Ly[%d]", ily)); |
82e6e5dc |
1992 | if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); |
1993 | } |
8892a7f3 |
1994 | |
1995 | /*! Row Cross processing*/ |
1996 | for(Int_t icen(0); icen<nCen; icen++){ |
1997 | /*!RC dz*/ |
eb05d549 |
1998 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, icen)))){ |
8892a7f3 |
1999 | for(Int_t ipt(0); ipt<kNpt; ipt++){ |
eb05d549 |
2000 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen)))) continue; |
8892a7f3 |
2001 | (*pr0)+=(*pr1); |
2002 | } |
eb05d549 |
2003 | pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d%d", mc?"MC":"", ily, icen), Form("Tracklets[RC]:: #Deltaz Ly[%d] Cen[%s]", ily, cenName[icen])); |
8892a7f3 |
2004 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
2005 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))) (*pr1)+=(*pr0); |
8892a7f3 |
2006 | } |
2007 | } // end centrality integration for row cross |
2008 | /*!RC dz*/ |
eb05d549 |
2009 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))){ |
2010 | pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d", mc?"MC":"", ily), Form("Tracklets[RC] :: #Deltaz Ly[%d]", ily)); |
8892a7f3 |
2011 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2012 | } |
2013 | } // end layer loop |
2014 | AliInfo(Form("Done %3d 2D projections.", jh)); |
3ceb45ae |
2015 | return kTRUE; |
2016 | } |
068e2c00 |
2017 | |
00a3f7a4 |
2018 | //________________________________________________________ |
f429b017 |
2019 | Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc) |
1ee39b3a |
2020 | { |
3ceb45ae |
2021 | // Analyse track in |
3ed01fbe |
2022 | const Int_t kNcontours(9); |
2023 | const Int_t kNstat(30); |
f429b017 |
2024 | Int_t cidx=mc?kMCtrackIn:kTrackIn; |
3ceb45ae |
2025 | if(fProj && fProj->At(cidx)) return kTRUE; |
2026 | if(!fContainer){ |
2027 | AliError("Missing data container."); |
2028 | return kFALSE; |
2029 | } |
f073d500 |
2030 | const Char_t *projName[] = {"hTracklet2TRDin", "hTRDin2MC"}; |
3ceb45ae |
2031 | THnSparse *H(NULL); |
f073d500 |
2032 | if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){ |
2033 | AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)])); |
1ee39b3a |
2034 | return kFALSE; |
2035 | } |
61f6b45e |
2036 | |
01ccc21a |
2037 | const Int_t mdim(kNdim+3); |
2038 | Int_t coord[mdim]; memset(coord, 0, sizeof(Int_t) * mdim); Double_t v = 0.; |
3ed01fbe |
2039 | Int_t ndim(H->GetNdimensions()); |
cc98ff07 |
2040 | TAxis *aa[mdim], *as(NULL), *ap(NULL), *apt(NULL), *ax(NULL), *abf(NULL); memset(aa, 0, sizeof(TAxis*) * (mdim)); |
3ed01fbe |
2041 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
178d284a |
2042 | if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC); |
cc98ff07 |
2043 | if(ndim > Int_t(kPt)) apt = H->GetAxis(kPt); |
2044 | if(ndim > Int_t(kNdim)) ap = H->GetAxis(kNdim); |
178d284a |
2045 | if(ndim > Int_t(kNdim)+1) ax = H->GetAxis(kNdim+1); |
2046 | if(ndim > Int_t(kNdim)+2) abf = H->GetAxis(kNdim+2); |
49ed65ad |
2047 | //AliInfo(Form("Using : Species[%c] Pt[%c] BunchFill[%c]", as?'y':'n', ap?'y':'n', abf?'y':'n')); |
33056e04 |
2048 | const Int_t nPt(ndim>Int_t(kNdimTrkIn)?Int_t(kNpt+2):1); |
01ccc21a |
2049 | |
3ed01fbe |
2050 | // build list of projections |
cc98ff07 |
2051 | const Int_t nsel((kNpt+2)*(kNspc*kNcharge + 1)); |
01ccc21a |
2052 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
cc98ff07 |
2053 | const Char_t *spcName[kNspc] = {"e", "#mu#pi", "Kp"}; |
33056e04 |
2054 | const Char_t ptName[kNpt+2] = {'L', 'l', 'i', 'h', 'H'}; |
2055 | const Char_t *ptCut[kNpt+2] = {"p_{t}[GeV/c]<0.5", "0.5<=p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "1.5<=p_{t}[GeV/c]<5.0", "p_{t}[GeV/c]>=5.0"}; |
cc98ff07 |
2056 | const Char_t *pCut[kNpt+2] = {"p[GeV/c]<0.5", "0.5<=p[GeV/c]<0.8", "0.8<=p[GeV/c]<1.5", "1.5<=p[GeV/c]<5.0", "p[GeV/c]>=5.0"}; |
3ed01fbe |
2057 | // define rebinning strategy |
2058 | const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5}; |
eb05d549 |
2059 | AliTRDrecoProjection hp[kMCTrkInNproj]; TObjArray php(kMCTrkInNproj+2); |
3ed01fbe |
2060 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
2061 | // define list of projections |
f073d500 |
2062 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
cc98ff07 |
2063 | for(Int_t isp(0); isp<kNspc; isp++){ |
01ccc21a |
2064 | for(Int_t ich(0); ich<kNcharge; ich++){ |
2065 | isel++; // new selection |
2066 | hp[ih].Build(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp), |
cc98ff07 |
2067 | Form("TrackIn[%s%c]:: #Deltay{%s}", spcName[isp], chSgn[ich], ptCut[ipt]), |
01ccc21a |
2068 | kEta, kPhi, kYrez, aa); |
2069 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2070 | php.AddLast(&hp[ih++]); np[isel]++; |
2071 | hp[ih].Build(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp), |
cc98ff07 |
2072 | Form("TrackIn[%s%c]:: #Delta#phi{%s}", spcName[isp], chSgn[ich], ptCut[ipt]), |
01ccc21a |
2073 | kEta, kPhi, kPrez, aa); |
2074 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2075 | php.AddLast(&hp[ih++]); np[isel]++; |
49ed65ad |
2076 | hp[ih].Build(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp), |
cc98ff07 |
2077 | Form("TrackIn[%s%c]:: dQdl {%s}", spcName[isp], chSgn[ich], pCut[ipt]), |
49ed65ad |
2078 | kEta, kPhi, kZrez, aa); |
2079 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2080 | php.AddLast(&hp[ih++]); np[isel]++; |
2081 | if(!ax) continue; |
01ccc21a |
2082 | hp[ih].Build(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp), |
cc98ff07 |
2083 | Form("TrackIn[%s%c]:: #Deltax{%s}", spcName[isp], chSgn[ich], ptCut[ipt]), |
01ccc21a |
2084 | kEta, kPhi, kNdim+1, aa); |
2085 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2086 | php.AddLast(&hp[ih++]); np[isel]++; |
2087 | } |
35983729 |
2088 | } |
01ccc21a |
2089 | isel++; // RC tracks |
2090 | hp[ih].Build(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[ipt]), |
2091 | Form("TrackIn[RC]:: #Deltaz{%s}", ptCut[ipt]), |
2092 | kEta, kPhi, kZrez, aa); |
2093 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2094 | php.AddLast(&hp[ih++]); np[isel]++; |
2095 | hp[ih].Build(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[ipt]), |
2096 | Form("TrackIn[RC]:: #Deltay{%s}", ptCut[ipt]), |
2097 | kEta, kPhi, kYrez, aa); |
2098 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2099 | php.AddLast(&hp[ih++]); np[isel]++; |
2100 | hp[ih].Build(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[ipt]), |
2101 | Form("TrackIn[RC]:: #Delta#phi{%s}", ptCut[ipt]), |
2102 | kEta, kPhi, kPrez, aa); |
2103 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2104 | php.AddLast(&hp[ih++]); np[isel]++; |
49ed65ad |
2105 | if(!ax) continue; |
01ccc21a |
2106 | hp[ih].Build(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[ipt]), |
2107 | Form("TrackIn[RC]:: #Deltax{%s}", ptCut[ipt]), |
2108 | kEta, kPhi, kNdim+1, aa); |
2109 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2110 | php.AddLast(&hp[ih++]); np[isel]++; |
35983729 |
2111 | } |
8892a7f3 |
2112 | AliInfo(Form("Build %3d 3D projections.", ih)); |
3ed01fbe |
2113 | |
2114 | // fill projections |
cc98ff07 |
2115 | Int_t ch(0), pt(0), p(0), sp(1), rcBin(as?as->FindBin(0.):-1), ioff(0), joff(0), jsel(0); |
eb05d549 |
2116 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
3ceb45ae |
2117 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
2118 | v = H->GetBinContent(ib, coord); |
2119 | if(v<1.) continue; |
566c3d46 |
2120 | if(fBCbinTOF>0 && coord[kBC]!=fBCbinTOF) continue; // TOF bunch cross cut |
2121 | if(fBCbinFill>0 && abf && coord[kNdim+2]!=fBCbinTOF) continue; // Fill bunch cut |
f036f7ec |
2122 | if(coord[kBC]==3) continue; |
3ed01fbe |
2123 | // charge selection |
cc98ff07 |
2124 | ch = 0; sp=1;// [pi-] track |
3ed01fbe |
2125 | if(rcBin>0){ // debug mode in which species are also saved |
01ccc21a |
2126 | sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1; |
cc98ff07 |
2127 | // take care of old data format (2*AliPID::kSPECIES+1) |
2128 | if(as->GetNbins() == kNcharge*AliPID::kSPECIES+1){ |
2129 | if(sp>2) sp=2; |
2130 | else if(sp==2) sp=1; |
b9058d72 |
2131 | } |
3ed01fbe |
2132 | if(coord[kSpeciesChgRC] > rcBin) ch = 1; // [+] track |
2133 | else if(coord[kSpeciesChgRC] == rcBin) ch = 2; // [RC] track |
3ceb45ae |
2134 | } |
35983729 |
2135 | // pt selection |
cc98ff07 |
2136 | pt = 0; p = 0; // low pt |
2137 | if(apt) pt = TMath::Min(coord[kPt], Int_t(kNpt)+1); |
2138 | if(ap ) p = TMath::Min(coord[kNdim], Int_t(kNpt)+1); |
35983729 |
2139 | // global selection |
cc98ff07 |
2140 | isel = pt*(kNspc*kNcharge+1); isel+=(ch==2?(kNspc*kNcharge):(sp*kNcharge+ch)); ioff = isel*(ax?4:3); |
2141 | jsel = p*(kNspc*kNcharge+1); jsel+=(ch==2?(kNspc*kNcharge):(sp*kNcharge+ch)); joff = jsel*(ax?4:3); |
b9058d72 |
2142 | if(ioff>=ih){ |
2143 | AliError(Form("Wrong selection %d [%3d]", ioff, ih)); |
2144 | return kFALSE; |
2145 | } |
eb05d549 |
2146 | if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) { |
b9058d72 |
2147 | AliError(Form("Missing projection %d", ioff)); |
2148 | return kFALSE; |
2149 | } |
cc98ff07 |
2150 | if(ch<2){ |
eb05d549 |
2151 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ch], ptName[pt], sp))!=0){ |
2152 | AliError(Form("Projection mismatch :: request[H%sTrkInY%c%c%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, pr0->H()->GetName())); |
b9058d72 |
2153 | return kFALSE; |
2154 | } |
2155 | } else { |
eb05d549 |
2156 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[pt]))!=0){ |
2157 | AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c] found[%s]", mc?"MC":"", ptName[pt], pr0->H()->GetName())); |
b9058d72 |
2158 | return kFALSE; |
2159 | } |
2160 | } |
cc98ff07 |
2161 | AliDebug(2, Form("Found %s for selection sp[%d] ch[%d] pt[%d]", pr0->H()->GetName(), sp, ch, pt)); |
2162 | for(Int_t jh(0); jh<np[isel]; jh++){ |
2163 | if(ch<2 && jh==2) ((AliTRDrecoProjection*)php.At(joff+jh))->Increment(coord, v); // special care for dQdl=f(p) |
2164 | else ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); // all = f(p_t) |
2165 | } |
3ceb45ae |
2166 | } |
33056e04 |
2167 | if(HasDump3DFor(kTrackIn)){ |
2168 | TDirectory *cwd = gDirectory; |
2169 | TFile::Open(Form("ResDump_%s.root", H->GetName()), "RECREATE"); |
2170 | for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){ |
2171 | if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue; |
2172 | if(!pr0->H()) continue; |
2173 | TH3 *h3=(TH3*)pr0->H()->Clone(); |
2174 | h3->Write(); |
2175 | } |
2176 | gFile->Close(); |
2177 | cwd->cd(); |
2178 | } |
2179 | |
3ceb45ae |
2180 | TObjArray *arr(NULL); |
35983729 |
2181 | fProj->AddAt(arr = new TObjArray(mc?kMCTrkInNproj:kTrkInNproj), cidx); |
3ceb45ae |
2182 | |
566c3d46 |
2183 | TH2 *h2(NULL); Int_t jh(0); |
3ed01fbe |
2184 | for(; ih--; ){ |
eb05d549 |
2185 | if(!hp[ih].H()) continue; |
0b366e97 |
2186 | if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours))) continue; |
566c3d46 |
2187 | arr->AddAt(h2, jh++); |
3ed01fbe |
2188 | } |
35983729 |
2189 | // build combined performance plots |
01ccc21a |
2190 | // combine up the tree of projections |
668a0654 |
2191 | Double_t m(0.), s(0.), trend(0.); |
cc98ff07 |
2192 | AliTRDrecoProjection xlow[2], specY[kNcharge*kNspc], specPh[kNcharge*kNspc], specQ[kNcharge*kNspc]; |
01ccc21a |
2193 | for(Int_t ich(0); ich<kNcharge; ich++){ |
f073d500 |
2194 | // PID dependency - summation over pt |
cc98ff07 |
2195 | for(Int_t isp(0); isp<kNspc; isp++){ |
f073d500 |
2196 | /*!dy*/ |
cc98ff07 |
2197 | Int_t idx(ich*kNspc+isp); |
eb05d549 |
2198 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){ |
f073d500 |
2199 | specY[idx] = (*pr0); |
2200 | specY[idx].SetNameTitle(Form("H%sTrkInY%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt"); |
eb05d549 |
2201 | specY[idx].H()->SetNameTitle(Form("H%sTrkInY%c%d", mc?"MC":"", chName[ich], isp), |
cc98ff07 |
2202 | Form("TrackIn[%s%c]:: #Deltay", spcName[isp], chSgn[ich])); |
f073d500 |
2203 | for(Int_t ipt(1); ipt<nPt; ipt++){ |
eb05d549 |
2204 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue; |
f073d500 |
2205 | specY[idx]+=(*pr1); |
2206 | } |
2207 | php.AddLast(&specY[idx]); |
b351a191 |
2208 | if((h2 = specY[idx].Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 |
2209 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specY[idx]; |
f073d500 |
2210 | } |
2211 | /*!dphi*/ |
eb05d549 |
2212 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){ |
f073d500 |
2213 | specPh[idx] = (*pr0); |
2214 | specPh[idx].SetNameTitle(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt"); |
eb05d549 |
2215 | specPh[idx].H()->SetNameTitle(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[ich], isp), |
cc98ff07 |
2216 | Form("TrackIn[%s%c]:: #Delta#phi", spcName[isp], chSgn[ich])); |
b351a191 |
2217 | specPh[idx].SetShowRange(-1.5, 1.5); |
f036f7ec |
2218 | PutTrendValue(Form("TrkInPh%c%c%d", chName[ich], ptName[0], isp), pr0->GetTrendValue(1)); |
f073d500 |
2219 | for(Int_t ipt(1); ipt<nPt; ipt++){ |
eb05d549 |
2220 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue; |
668a0654 |
2221 | PutTrendValue(Form("TrkInPh%c%c%d", chName[ich], ptName[ipt], isp), pr1->GetTrendValue(1)); |
f073d500 |
2222 | specPh[idx]+=(*pr1); |
2223 | } |
2224 | php.AddLast(&specPh[idx]); |
2225 | if((h2 = specPh[idx].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
668a0654 |
2226 | PutTrendValue(Form("TrkInPh%c%d", chName[ich], isp), specPh[idx].GetTrendValue(1)); |
eb05d549 |
2227 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specPh[idx]; |
f073d500 |
2228 | } |
49ed65ad |
2229 | /*!dQdl*/ |
eb05d549 |
2230 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){ |
49ed65ad |
2231 | specQ[idx] = (*pr0); |
cc98ff07 |
2232 | specQ[idx].SetNameTitle(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[ich], isp), "Sum over p"); |
eb05d549 |
2233 | specQ[idx].H()->SetNameTitle(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[ich], isp), |
cc98ff07 |
2234 | Form("TrackIn[%s%c]:: dQdl", spcName[isp], chSgn[ich])); |
49ed65ad |
2235 | specQ[idx].SetShowRange(-2.2, -1.75); |
eb05d549 |
2236 | specQ[idx].H()->GetZaxis()->SetTitle("dQdl [a.u.]"); |
f036f7ec |
2237 | if((trend = pr0->GetTrendValue(2, &m))>-100.){ |
668a0654 |
2238 | PutTrendValue(Form("TrkInQ%c%c%d", chName[ich], ptName[0], isp), trend); |
2239 | PutTrendValue(Form("TrkInQS%c%c%d", chName[ich], ptName[0], isp), m); |
2240 | } |
49ed65ad |
2241 | for(Int_t ipt(1); ipt<nPt; ipt++){ |
eb05d549 |
2242 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue; |
668a0654 |
2243 | if((trend=pr1->GetTrendValue(2, &m))>-100.){ |
2244 | PutTrendValue(Form("TrkInQ%c%c%d", chName[ich], ptName[ipt], isp), trend); |
2245 | PutTrendValue(Form("TrkInQS%c%c%d", chName[ich], ptName[ipt], isp), m); |
2246 | } |
49ed65ad |
2247 | specQ[idx]+=(*pr1); |
2248 | } |
2249 | php.AddLast(&specQ[idx]); |
2250 | if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); |
eb05d549 |
2251 | specQ[idx].H()->SetName(Form("H%sTrkInQS%c%d", mc?"MC":"", chName[ich], isp)); |
f985021d |
2252 | specQ[idx].SetShowRange(-1.85, -1.4); |
49ed65ad |
2253 | if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
668a0654 |
2254 | if((trend=specQ[idx].GetTrendValue(2, &m))>-100.){ |
2255 | PutTrendValue(Form("TrkInQ%c%d", chName[ich], isp), trend); |
2256 | PutTrendValue(Form("TrkInQS%c%d", chName[ich], isp), m); |
2257 | } |
eb05d549 |
2258 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specQ[idx]; |
49ed65ad |
2259 | } |
b9058d72 |
2260 | } // end PID loop for pt integration |
2261 | |
f073d500 |
2262 | // pt dependency - summation over PID |
2263 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
01ccc21a |
2264 | /*!dy*/ |
eb05d549 |
2265 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){ |
cc98ff07 |
2266 | for(Int_t isp(1); isp<kNspc; isp++){ |
eb05d549 |
2267 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue; |
01ccc21a |
2268 | (*pr0)+=(*pr1); |
2269 | } |
eb05d549 |
2270 | pr0->H()->SetNameTitle(Form("H%sTrkInY%c%c", mc?"MC":"", chName[ich], ptName[ipt]), |
01ccc21a |
2271 | Form("TrackIn[%c]:: #Deltay{%s}", chSgn[ich], ptCut[ipt])); |
b9058d72 |
2272 | pr0->SetShowRange(-0.3, 0.3); |
01ccc21a |
2273 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
668a0654 |
2274 | if((trend=pr0->GetTrendValue(1,&m,&s))>-100.){ |
2275 | PutTrendValue(Form("TrkInY%c%c", chName[ich], ptName[ipt]), trend); |
2276 | PutTrendValue(Form("TrkInYS%c%c", chName[ich], ptName[ipt]), s); |
2277 | } |
eb05d549 |
2278 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a |
2279 | } |
2280 | /*!dphi*/ |
eb05d549 |
2281 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){ |
cc98ff07 |
2282 | for(Int_t isp(1); isp<kNspc; isp++){ |
eb05d549 |
2283 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue; |
01ccc21a |
2284 | (*pr0)+=(*pr1); |
2285 | } |
eb05d549 |
2286 | pr0->H()->SetNameTitle(Form("H%sTrkInPh%c%c", mc?"MC":"", chName[ich], ptName[ipt]), |
01ccc21a |
2287 | Form("TrackIn[%c]:: #Delta#phi{%s}", chSgn[ich], ptCut[ipt])); |
2288 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
668a0654 |
2289 | PutTrendValue(Form("TrkInPh%c%c", chName[ich], ptName[ipt]), pr0->GetTrendValue(1)); |
eb05d549 |
2290 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a |
2291 | } |
2292 | /*!dx*/ |
eb05d549 |
2293 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){ |
cc98ff07 |
2294 | for(Int_t isp(1); isp<kNspc; isp++){ |
eb05d549 |
2295 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue; |
01ccc21a |
2296 | (*pr0)+=(*pr1); |
2297 | } |
eb05d549 |
2298 | pr0->H()->SetNameTitle(Form("H%sTrkInX%c%c", mc?"MC":"", chName[ich], ptName[ipt]), |
01ccc21a |
2299 | Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[ipt])); |
2300 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
668a0654 |
2301 | PutTrendValue(Form("TrkInX%c%c", chName[ich], ptName[ipt]), pr0->GetTrendValue(1)); |
01ccc21a |
2302 | if(!ipt){ |
2303 | xlow[ich] = (*pr0); |
2304 | xlow[ich].SetNameTitle(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 5), |
2305 | Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[0])); |
2306 | php.AddLast(&xlow[ich]); |
2307 | } |
eb05d549 |
2308 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a |
2309 | } |
b9058d72 |
2310 | } // end pt loop for PID integration |
2311 | |
01ccc21a |
2312 | /*!dy*/ |
eb05d549 |
2313 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){ |
2314 | pr0->H()->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", chName[ich]), |
01ccc21a |
2315 | Form("TrackIn[%c]:: #Deltay", chSgn[ich])); |
8892a7f3 |
2316 | pr0->SetShowRange(-0.3, 0.3); |
b9058d72 |
2317 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 |
2318 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
668a0654 |
2319 | if((trend=pr0->GetTrendValue(1, &m, &s))>-100.){ |
2320 | PutTrendValue(Form("TrkInY%c", chName[ich]), trend); |
2321 | PutTrendValue(Form("TrkInYS%c", chName[ich]), s); |
2322 | } |
eb05d549 |
2323 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a |
2324 | } |
2325 | /*!dy high pt*/ |
ea90ffcd |
2326 | if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[3], 0)))){ |
2327 | if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[3], 0)))){ |
01ccc21a |
2328 | (*pr0)+=(*pr1); |
ea90ffcd |
2329 | pr0->H()->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", ptName[3]), Form("TrackIn :: #Deltay{%s}", ptCut[3])); |
b9058d72 |
2330 | pr0->SetShowRange(-0.3, 0.3); |
01ccc21a |
2331 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2332 | } |
2333 | } |
2334 | /*!dphi*/ |
eb05d549 |
2335 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){ |
2336 | pr0->H()->SetNameTitle(Form("H%sTrkInPh%c", mc?"MC":"", chName[ich]), |
01ccc21a |
2337 | Form("TrackIn[%c]:: #Delta#phi", chSgn[ich])); |
f073d500 |
2338 | pr0->SetShowRange(-1., 1.); |
01ccc21a |
2339 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
668a0654 |
2340 | PutTrendValue(Form("TrkInPh%c", chName[ich]), pr0->GetTrendValue(1)); |
eb05d549 |
2341 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a |
2342 | } |
2343 | /*!dx*/ |
eb05d549 |
2344 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){ |
2345 | pr0->H()->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", chName[ich]), |
01ccc21a |
2346 | Form("TrackIn[%c]:: #Deltax", chSgn[ich])); |
2347 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
668a0654 |
2348 | PutTrendValue(Form("TrkInX%c", chName[ich]), pr0->GetTrendValue(1)); |
eb05d549 |
2349 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a |
2350 | } |
2351 | /*!dx low pt*/ |
ea90ffcd |
2352 | if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[1], 5)))){ |
2353 | if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[1], 5)))){ |
01ccc21a |
2354 | (*pr0)+=(*pr1); |
ea90ffcd |
2355 | pr0->H()->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", ptName[1]), Form("TrackIn :: #Deltax{%s}", ptCut[1])); |
01ccc21a |
2356 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2357 | } |
2358 | } |
b9058d72 |
2359 | } // end charge loop |
2360 | |
cc98ff07 |
2361 | for(Int_t isp(0); isp<kNspc; isp++){ |
f073d500 |
2362 | /*!dy*/ |
eb05d549 |
2363 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))){ |
cc98ff07 |
2364 | pr0->H()->SetNameTitle(Form("H%sTrkInY%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Deltay", spcName[isp])); |
f073d500 |
2365 | pr0->SetShowRange(-0.3, 0.3); |
b351a191 |
2366 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 |
2367 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
f073d500 |
2368 | } |
2369 | /*!dphi*/ |
eb05d549 |
2370 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))){ |
cc98ff07 |
2371 | pr0->H()->SetNameTitle(Form("H%sTrkInPh%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Delta#phi", spcName[isp])); |
b351a191 |
2372 | pr0->SetShowRange(-1., 1.); |
f073d500 |
2373 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
668a0654 |
2374 | PutTrendValue(Form("TrkInPh%d", isp), pr0->GetTrendValue(1)); |
f073d500 |
2375 | } |
49ed65ad |
2376 | /*!dQdl*/ |
eb05d549 |
2377 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))){ |
cc98ff07 |
2378 | pr0->H()->SetNameTitle(Form("H%sTrkInQ%d", mc?"MC":"", isp), Form("TrackIn[%s] :: dQdl", spcName[isp])); |
49ed65ad |
2379 | pr0->SetShowRange(-2.2, -1.75); |
2380 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); |
eb05d549 |
2381 | pr0->H()->SetName(Form("H%sTrkInQS%d", mc?"MC":"", isp)); |
f985021d |
2382 | pr0->SetShowRange(-1.85, -1.4); |
49ed65ad |
2383 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
668a0654 |
2384 | if((trend=pr0->GetTrendValue(2, &m))>-100.){ |
2385 | PutTrendValue(Form("TrkInQ%d", isp), trend); |
2386 | PutTrendValue(Form("TrkInQS%d", isp), m); |
2387 | } |
49ed65ad |
2388 | } |
b9058d72 |
2389 | } // end PID processing |
2390 | |
01ccc21a |
2391 | /*!dy*/ |
eb05d549 |
2392 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){ |
2393 | pr0->H()->SetNameTitle(Form("H%sTrkInY", mc?"MC":""), "TrackIn :: #Deltay"); |
f073d500 |
2394 | pr0->SetShowRange(-0.3, 0.3); |
b9058d72 |
2395 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 |
2396 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
01ccc21a |
2397 | } |
2398 | /*!dphi*/ |
eb05d549 |
2399 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){ |
2400 | pr0->H()->SetNameTitle(Form("H%sTrkInPh", mc?"MC":""), "TrackIn :: #Delta#phi"); |
01ccc21a |
2401 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2402 | } |
2403 | /*!dx*/ |
eb05d549 |
2404 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){ |
2405 | pr0->H()->SetNameTitle(Form("H%sTrkInX", mc?"MC":""), "TrackIn :: #Deltax"); |
01ccc21a |
2406 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2407 | } |
b9058d72 |
2408 | |
2409 | // Row Cross processing |
01ccc21a |
2410 | /*!RC dz*/ |
eb05d549 |
2411 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[0])))){ |
01ccc21a |
2412 | for(Int_t ipt(0); ipt<kNpt; ipt++){ |
eb05d549 |
2413 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[ipt])))) continue; |
01ccc21a |
2414 | (*pr0)+=(*pr1); |
2415 | } |
eb05d549 |
2416 | pr0->H()->SetNameTitle(Form("H%sTrkInRCZ", mc?"MC":""), "TrackIn[RC]:: #Deltaz"); |
01ccc21a |
2417 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
566c3d46 |
2418 | } |
01ccc21a |
2419 | /*!RC dy*/ |
eb05d549 |
2420 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[0])))){ |
01ccc21a |
2421 | for(Int_t ipt(0); ipt<kNpt; ipt++){ |
eb05d549 |
2422 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[ipt])))) continue; |
01ccc21a |
2423 | (*pr0)+=(*pr1); |
2424 | } |
eb05d549 |
2425 | pr0->H()->SetNameTitle(Form("H%sTrkInRCY", mc?"MC":""), "TrackIn[RC]:: #Deltay"); |
01ccc21a |
2426 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2427 | } |
2428 | /*!RC dphi*/ |
eb05d549 |
2429 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[0])))){ |
01ccc21a |
2430 | for(Int_t ipt(0); ipt<kNpt; ipt++){ |
eb05d549 |
2431 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[ipt])))) continue; |
01ccc21a |
2432 | (*pr0)+=(*pr1); |
2433 | } |
eb05d549 |
2434 | pr0->H()->SetNameTitle(Form("H%sTrkInRCPh", mc?"MC":""), "TrackIn[RC]:: #Delta#phi"); |
01ccc21a |
2435 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2436 | } |
2437 | /*!RC dx*/ |
eb05d549 |
2438 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[0])))){ |
01ccc21a |
2439 | for(Int_t ipt(0); ipt<kNpt; ipt++){ |
eb05d549 |
2440 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[ipt])))) continue; |
01ccc21a |
2441 | (*pr0)+=(*pr1); |
2442 | } |
eb05d549 |
2443 | pr0->H()->SetNameTitle(Form("H%sTrkInRCX", mc?"MC":""), "TrackIn[RC]:: #Deltax"); |
01ccc21a |
2444 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2445 | } |
8892a7f3 |
2446 | AliInfo(Form("Done %3d 2D projections.", jh)); |
3ceb45ae |
2447 | return kTRUE; |
2448 | } |
1ee39b3a |
2449 | |
3ceb45ae |
2450 | |
f429b017 |
2451 | //________________________________________________________ |
2452 | Bool_t AliTRDresolution::MakeProjectionTrack() |
2453 | { |
2454 | // Analyse tracklet |
2455 | const Int_t kNcontours(9); |
01ccc21a |
2456 | const Int_t kNstat(30); |
f429b017 |
2457 | Int_t cidx(kMCtrack); |
2458 | if(fProj && fProj->At(cidx)) return kTRUE; |
2459 | if(!fContainer){ |
2460 | AliError("Missing data container."); |
2461 | return kFALSE; |
2462 | } |
2463 | THnSparse *H(NULL); |
f073d500 |
2464 | if(!(H = (THnSparse*)fContainer->FindObject("hTRD2MC"))){ |
2465 | AliError("Missing/Wrong data @ hTRD2MC."); |
f429b017 |
2466 | return kFALSE; |
2467 | } |
2468 | Int_t ndim(H->GetNdimensions()); |
2469 | Int_t coord[kNdim+1]; memset(coord, 0, sizeof(Int_t) * (kNdim+1)); Double_t v = 0.; |
01ccc21a |
2470 | TAxis *aa[kNdim+1], *as(NULL), *ap(NULL); memset(aa, 0, sizeof(TAxis*) * (kNdim+1)); |
f429b017 |
2471 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
2472 | if(ndim > kSpeciesChgRC) as = H->GetAxis(kSpeciesChgRC); |
01ccc21a |
2473 | if(ndim > kPt) ap = H->GetAxis(kPt); |
2474 | |
f429b017 |
2475 | // build list of projections |
01ccc21a |
2476 | const Int_t nsel(AliTRDgeometry::kNlayer*kNpt*AliPID::kSPECIES*7);//, npsel(3); |
2477 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
2478 | const Char_t ptName[kNpt] = {'l', 'i', 'h'}; |
2479 | const Char_t *ptCut[kNpt] = {"p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "p_{t}[GeV/c]>=1.5"}; |
f429b017 |
2480 | // define rebinning strategy |
2481 | const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5}; |
eb05d549 |
2482 | AliTRDrecoProjection hp[kTrkNproj]; TObjArray php(kTrkNproj); |
f429b017 |
2483 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
2484 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
01ccc21a |
2485 | for(Int_t ipt(0); ipt<kNpt; ipt++){ |
2486 | for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){ |
2487 | for(Int_t ich(0); ich<kNcharge; ich++){ |
2488 | isel++; // new selection |
2489 | hp[ih].Build(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, ily), |
f073d500 |
2490 | Form("Tracks[%s%c]:: #Deltay{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily), |
01ccc21a |
2491 | kEta, kPhi, kYrez, aa); |
2492 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2493 | php.AddLast(&hp[ih++]); np[isel]++; |
2494 | hp[ih].Build(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, ily), |
f073d500 |
2495 | Form("Tracks[%s%c]:: #Delta#phi{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily), |
01ccc21a |
2496 | kEta, kPhi, kPrez, aa); |
2497 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2498 | php.AddLast(&hp[ih++]); np[isel]++; |
2499 | hp[ih].Build(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, ily), |
f073d500 |
2500 | Form("Tracks[%s%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily), |
01ccc21a |
2501 | kEta, kPhi, kNdim, aa); |
2502 | hp[ih].SetShowRange(0.,10.); |
2503 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2504 | php.AddLast(&hp[ih++]); np[isel]++; |
2505 | } |
2506 | } |
2507 | isel++; // new selection |
2508 | hp[ih].Build(Form("HMCTrkZ%c%d", ptName[ipt], ily), |
2509 | Form("Tracks[RC]:: #Deltaz{%s} Ly[%d]", ptCut[ipt], ily), |
2510 | kEta, kPhi, kZrez, aa); |
2511 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
2512 | php.AddLast(&hp[ih++]); np[isel]++; |
2513 | } |
f429b017 |
2514 | } |
2515 | |
01ccc21a |
2516 | Int_t ly(0), ch(0), pt(0), sp(2), rcBin(as?as->FindBin(0.):-1); |
f429b017 |
2517 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
2518 | v = H->GetBinContent(ib, coord); |
2519 | if(v<1.) continue; |
2520 | ly = coord[kBC]-1; // layer selection |
2521 | // charge selection |
01ccc21a |
2522 | ch=0; sp=2;// [pi-] track [dafault] |
f429b017 |
2523 | if(rcBin>0){ // debug mode in which species are also saved |
01ccc21a |
2524 | sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1; |
2525 | if(coord[kSpeciesChgRC] > rcBin) ch = 1; // [+] track |
f429b017 |
2526 | else if(coord[kSpeciesChgRC] == rcBin) ch = 2; // [RC] track |
2527 | } |
01ccc21a |
2528 | // pt selection |
2529 | pt = 0; // low pt [default] |
2530 | if(ap) pt = coord[kPt]-1; |
2531 | // global selection |
2532 | Int_t ioff = ly*kNpt*31+pt*31; ioff+=3*(sp<0?10:(sp*kNcharge+ch)); |
2533 | isel = ly*kNpt*11+pt*11; isel+=sp<0?10:(sp*kNcharge+ch); |
2534 | AliDebug(4, Form("SELECTION[%d] :: ch[%c] pt[%c] sp[%d] ly[%d]\n", np[isel], ch==2?'Z':chName[ch], ptName[pt], sp, ly)); |
eb05d549 |
2535 | for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); |
f429b017 |
2536 | } |
f429b017 |
2537 | TObjArray *arr(NULL); |
0b366e97 |
2538 | fProj->AddAt(arr = new TObjArray(kTrkNproj), cidx); |
f429b017 |
2539 | |
01ccc21a |
2540 | TH2 *h2(NULL); Int_t jh(0); |
f429b017 |
2541 | for(; ih--; ){ |
eb05d549 |
2542 | if(!hp[ih].H()) continue; |
0b366e97 |
2543 | if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours))) continue; |
01ccc21a |
2544 | arr->AddAt(h2, jh++); |
f429b017 |
2545 | } |
01ccc21a |
2546 | |
2547 | // combine up the tree of projections |
eb05d549 |
2548 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
01ccc21a |
2549 | //Int_t iproj(0), jproj(0); |
2550 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
2551 | for(Int_t ich(0); ich<kNcharge; ich++){ |
2552 | for(Int_t ipt(0); ipt<kNpt; ipt++){ |
2553 | /*!dy*/ |
eb05d549 |
2554 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){ |
01ccc21a |
2555 | for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){ |
eb05d549 |
2556 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue; |
01ccc21a |
2557 | (*pr0)+=(*pr1); |
2558 | } |
eb05d549 |
2559 | AliDebug(2, Form("Rename %s to HMCTrkY%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], ily)); |
2560 | pr0->H()->SetNameTitle(Form("HMCTrkY%c%c%d", chName[ich], ptName[ipt], ily), |
01ccc21a |
2561 | Form("Tracks[%c]:: #Deltay{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily)); |
2562 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
2563 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0); |
01ccc21a |
2564 | } |
2565 | /*!dphi*/ |
eb05d549 |
2566 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){ |
01ccc21a |
2567 | for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){ |
eb05d549 |
2568 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue; |
01ccc21a |
2569 | (*pr0)+=(*pr1); |
2570 | } |
eb05d549 |
2571 | AliDebug(2, Form("Rename %s to HMCTrkPh%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], ily)); |
2572 | pr0->H()->SetNameTitle(Form("HMCTrkPh%c%c%d", chName[ich], ptName[ipt], ily), |
01ccc21a |
2573 | Form("Tracks[%c]:: #Delta#phi{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily)); |
2574 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
2575 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0); |
01ccc21a |
2576 | } |
2577 | |
2578 | /*!dpt/pt*/ |
eb05d549 |
2579 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){ |
01ccc21a |
2580 | for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){ |
eb05d549 |
2581 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue; |
01ccc21a |
2582 | (*pr0)+=(*pr1); |
2583 | } |
eb05d549 |
2584 | AliDebug(2, Form("Rename %s to HMCTrkDPt%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], ily)); |
2585 | pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%c%d", chName[ich], ptName[ipt], ily), |
01ccc21a |
2586 | Form("Tracks[%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily)); |
2587 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
2588 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0); |
01ccc21a |
2589 | } |
2590 | } |
2591 | /*!dy*/ |
eb05d549 |
2592 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))){ |
2593 | pr0->H()->SetNameTitle(Form("HMCTrkY%c%d", chName[ich], ily), |
01ccc21a |
2594 | Form("Tracks[%c]:: #Deltay Ly[%d]", chSgn[ich], ily)); |
2595 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
2596 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0); |
01ccc21a |
2597 | } |
2598 | /*!dphi*/ |
eb05d549 |
2599 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))){ |
2600 | pr0->H()->SetNameTitle(Form("HMCTrkPh%c%d", chName[ich], ily), |
01ccc21a |
2601 | Form("Tracks[%c]:: #Delta#phi Ly[%d]", chSgn[ich], ily)); |
2602 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
2603 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0); |
01ccc21a |
2604 | } |
2605 | /*!dpt/pt*/ |
eb05d549 |
2606 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))){ |
2607 | pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%d", chName[ich], ily), |
01ccc21a |
2608 | Form("Tracks[%c]:: #Deltap_{t}/p_{t} Ly[%d]", chSgn[ich], ily)); |
2609 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 |
2610 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0); |
01ccc21a |
2611 | } |
2612 | } |
2613 | /*!dy*/ |
eb05d549 |
2614 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))){ |
2615 | pr0->H()->SetNameTitle(Form("HMCTrkY%d", ily), Form("Tracks :: #Deltay Ly[%d]", ily)); |
01ccc21a |
2616 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2617 | } |
2618 | /*!dphi*/ |
eb05d549 |
2619 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))){ |
2620 | pr0->H()->SetNameTitle(Form("HMCTrkPh%d", ily), Form("Tracks :: #Delta#phi Ly[%d]", ily)); |
01ccc21a |
2621 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2622 | } |
2623 | /*!dpt/pt*/ |
eb05d549 |
2624 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))){ |
2625 | pr0->H()->SetNameTitle(Form("HMCTrkDPt%d", ily), Form("Tracks :: #Deltap_{t}/p_{t} Ly[%d]", ily)); |
01ccc21a |
2626 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2627 | } |
2628 | } |
8892a7f3 |
2629 | AliInfo(Form("Done %3d 2D projections.", jh)); |
f429b017 |
2630 | return kTRUE; |
2631 | } |
3ceb45ae |
2632 | |
2633 | //________________________________________________________ |
2634 | Bool_t AliTRDresolution::PostProcess() |
2635 | { |
2636 | // Fit, Project, Combine, Extract values from the containers filled during execution |
2637 | |
2638 | if (!fContainer) { |
2639 | AliError("ERROR: list not available"); |
2640 | return kFALSE; |
2641 | } |
35983729 |
2642 | if(!fProj){ |
2643 | AliInfo("Building array of projections ..."); |
2644 | fProj = new TObjArray(kNclasses); fProj->SetOwner(kTRUE); |
2645 | } |
1ee39b3a |
2646 | |
1ee39b3a |
2647 | //PROCESS EXPERIMENTAL DISTRIBUTIONS |
f073d500 |
2648 | // Clusters detector |
33056e04 |
2649 | if(HasProcess(kDetector)) if(!MakeProjectionDetector()) return kFALSE; |
1ee39b3a |
2650 | // Clusters residuals |
33056e04 |
2651 | if(HasProcess(kCluster)) if(!MakeProjectionCluster()) return kFALSE; |
6558fd69 |
2652 | fNRefFigures = 3; |
|