]>
Commit | Line | Data |
---|---|---|
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 | // { | |
4070f709 | 34 | // gSystem->Load("libANALYSIS"); |
35 | // gSystem->Load("libTRDqaRec"); | |
1ee39b3a | 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" |
fb7cacec | 78 | #include "AliESDHeader.h" |
068e2c00 | 79 | #include "AliMathBase.h" |
08bdd9d1 | 80 | #include "AliTrackPointArray.h" |
1ee39b3a | 81 | |
82 | #include "AliTRDresolution.h" | |
83 | #include "AliTRDgeometry.h" | |
3ceb45ae | 84 | #include "AliTRDtransform.h" |
1ee39b3a | 85 | #include "AliTRDpadPlane.h" |
86 | #include "AliTRDcluster.h" | |
87 | #include "AliTRDseedV1.h" | |
88 | #include "AliTRDtrackV1.h" | |
89 | #include "AliTRDReconstructor.h" | |
90 | #include "AliTRDrecoParam.h" | |
92c40e64 | 91 | #include "AliTRDpidUtil.h" |
fd7ffd88 | 92 | #include "AliTRDinfoGen.h" |
4860c9db | 93 | #include "AliAnalysisManager.h" |
1ee39b3a | 94 | #include "info/AliTRDclusterInfo.h" |
566c3d46 | 95 | #include "info/AliTRDeventInfo.h" |
1ee39b3a | 96 | |
97 | ClassImp(AliTRDresolution) | |
eb05d549 | 98 | ClassImp(AliTRDresolution::AliTRDrecoProjection) |
1ee39b3a | 99 | |
3ceb45ae | 100 | Int_t const AliTRDresolution::fgkNbins[kNdim] = { |
101 | Int_t(kNbunchCross)/*bc*/, | |
0f2c4c4f | 102 | 144/*phi*/, |
103 | 45/*eta*/, | |
3ceb45ae | 104 | 50/*dy*/, |
3ed01fbe | 105 | 40/*dphi*/, |
3ceb45ae | 106 | 50/*dz*/, |
0f2c4c4f | 107 | 5/*chg*species*/, |
95d47440 | 108 | 3/*pt*/ |
3ceb45ae | 109 | }; //! no of bins/projection |
110 | Double_t const AliTRDresolution::fgkMin[kNdim] = { | |
95d47440 | 111 | -1.5, /*bc*/ |
112 | -TMath::Pi(),/*phi*/ | |
113 | -0.9, /*eta*/ | |
114 | -1.5, /*dy*/ | |
115 | -5., /*dphi*/ | |
116 | -2.5, /*dz*/ | |
117 | -2.5, /*chg*species*/ | |
118 | -0.5 /*pt*/ | |
3ceb45ae | 119 | }; //! low limits for projections |
120 | Double_t const AliTRDresolution::fgkMax[kNdim] = { | |
95d47440 | 121 | 1.5, /*bc*/ |
122 | TMath::Pi(),/*phi*/ | |
123 | 0.9, /*eta*/ | |
124 | 1.5, /*dy*/ | |
125 | 5., /*dphi*/ | |
126 | 2.5, /*dz*/ | |
127 | 2.5, /*chg*species*/ | |
128 | 2.5 /*pt*/ | |
3ceb45ae | 129 | }; //! high limits for projections |
130 | Char_t const *AliTRDresolution::fgkTitle[kNdim] = { | |
131 | "bunch cross", | |
132 | "#phi [rad]", | |
133 | "#eta", | |
3ceb45ae | 134 | "#Deltay [cm]", |
3ed01fbe | 135 | "#Delta#phi [deg]", |
3ceb45ae | 136 | "#Deltaz [cm]", |
3ed01fbe | 137 | "chg*spec*rc", |
95d47440 | 138 | "p_{t} [bin]" |
3ceb45ae | 139 | }; //! title of projection |
140 | ||
3ceb45ae | 141 | Char_t const * AliTRDresolution::fgPerformanceName[kNclasses] = { |
f073d500 | 142 | "Det2Cluster" |
143 | ,"Cluster2Track" | |
1ee39b3a | 144 | ,"Tracklet2Track" |
01ccc21a | 145 | ,"Tracklet2TRDin" |
1ee39b3a | 146 | ,"Cluster2MC" |
147 | ,"Tracklet2MC" | |
92d6d80c | 148 | ,"TRDin2MC" |
1ee39b3a | 149 | ,"TRD2MC" |
f429b017 | 150 | // ,"Tracklet2TRDout" |
151 | // ,"TRDout2MC" | |
1ee39b3a | 152 | }; |
1ee39b3a | 153 | |
154 | //________________________________________________________ | |
155 | AliTRDresolution::AliTRDresolution() | |
f2e89a4c | 156 | :AliTRDrecoTask() |
b9058d72 | 157 | ,fSteer(0) |
566c3d46 | 158 | ,fPtThreshold(.3) |
566c3d46 | 159 | ,fBCbinTOF(0) |
160 | ,fBCbinFill(0) | |
95d47440 | 161 | ,fLYselect(-1) |
56838f9d | 162 | ,fBsign(kFALSE) |
3ceb45ae | 163 | ,fProj(NULL) |
92c40e64 | 164 | ,fDBPDG(NULL) |
b91fdd71 | 165 | ,fCl(NULL) |
b91fdd71 | 166 | ,fMCcl(NULL) |
f8f46e4d | 167 | { |
168 | // | |
169 | // Default constructor | |
170 | // | |
f2e89a4c | 171 | SetNameTitle("TRDresolution", "TRD spatial and momentum resolution"); |
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) | |
95d47440 | 182 | ,fLYselect(-1) |
56838f9d | 183 | ,fBsign(kFALSE) |
3ceb45ae | 184 | ,fProj(NULL) |
f8f46e4d | 185 | ,fDBPDG(NULL) |
f8f46e4d | 186 | ,fCl(NULL) |
f8f46e4d | 187 | ,fMCcl(NULL) |
1ee39b3a | 188 | { |
189 | // | |
190 | // Default constructor | |
191 | // | |
192 | ||
1ee39b3a | 193 | InitFunctorList(); |
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; |
95d47440 | 209 | if(fProj){ |
210 | fProj->Delete(); | |
211 | delete fProj; | |
212 | } | |
1ee39b3a | 213 | if(fCl){fCl->Delete(); delete fCl;} |
1ee39b3a | 214 | if(fMCcl){fMCcl->Delete(); delete fMCcl;} |
1ee39b3a | 215 | } |
216 | ||
217 | ||
218 | //________________________________________________________ | |
f8f46e4d | 219 | void AliTRDresolution::UserCreateOutputObjects() |
1ee39b3a | 220 | { |
221 | // spatial resolution | |
5935a6da | 222 | |
068e2c00 | 223 | AliTRDrecoTask::UserCreateOutputObjects(); |
3ed01fbe | 224 | if(UseExchangeContainers()) InitExchangeContainers(); |
83b44483 | 225 | } |
1ee39b3a | 226 | |
83b44483 | 227 | //________________________________________________________ |
228 | void AliTRDresolution::InitExchangeContainers() | |
229 | { | |
61f6b45e | 230 | // Init containers for subsequent tasks (AliTRDclusterResolution) |
231 | ||
3ceb45ae | 232 | fCl = new TObjArray(200); fCl->SetOwner(kTRUE); |
233 | fMCcl = new TObjArray(); fMCcl->SetOwner(kTRUE); | |
e3147647 | 234 | PostData(kClToTrk, fCl); |
235 | PostData(kClToMC, fMCcl); | |
1ee39b3a | 236 | } |
237 | ||
238 | //________________________________________________________ | |
f8f46e4d | 239 | void AliTRDresolution::UserExec(Option_t *opt) |
1ee39b3a | 240 | { |
241 | // | |
242 | // Execution part | |
243 | // | |
244 | ||
3ed01fbe | 245 | if(fCl) fCl->Delete(); |
246 | if(fMCcl) fMCcl->Delete(); | |
b4414720 | 247 | AliTRDrecoTask::UserExec(opt); |
1ee39b3a | 248 | } |
249 | ||
553528eb | 250 | //________________________________________________________ |
6475ec36 | 251 | Bool_t AliTRDresolution::Pulls(Double_t* /*dyz[2]*/, Double_t* /*cov[3]*/, Double_t /*tilt*/) const |
553528eb | 252 | { |
01ccc21a | 253 | // Helper function to calculate pulls in the yz plane |
553528eb | 254 | // using proper tilt rotation |
255 | // Uses functionality defined by AliTRDseedV1. | |
256 | ||
6475ec36 | 257 | return kTRUE; |
258 | /* | |
553528eb | 259 | Double_t t2(tilt*tilt); |
9dcc64cc | 260 | // exit door until a bug fix is found for AliTRDseedV1::GetCovSqrt |
553528eb | 261 | |
262 | // rotate along pad | |
263 | Double_t cc[3]; | |
01ccc21a | 264 | cc[0] = cov[0] - 2.*tilt*cov[1] + t2*cov[2]; |
553528eb | 265 | cc[1] = cov[1]*(1.-t2) + tilt*(cov[0] - cov[2]); |
266 | cc[2] = t2*cov[0] + 2.*tilt*cov[1] + cov[2]; | |
267 | // do sqrt | |
01ccc21a | 268 | Double_t sqr[3]={0., 0., 0.}; |
553528eb | 269 | if(AliTRDseedV1::GetCovSqrt(cc, sqr)) return kFALSE; |
01ccc21a | 270 | Double_t invsqr[3]={0., 0., 0.}; |
553528eb | 271 | if(AliTRDseedV1::GetCovInv(sqr, invsqr)<1.e-40) return kFALSE; |
272 | Double_t tmp(dyz[0]); | |
273 | dyz[0] = invsqr[0]*tmp + invsqr[1]*dyz[1]; | |
274 | dyz[1] = invsqr[1]*tmp + invsqr[2]*dyz[1]; | |
275 | return kTRUE; | |
6475ec36 | 276 | */ |
553528eb | 277 | } |
278 | ||
f073d500 | 279 | //________________________________________________________ |
280 | TH1* AliTRDresolution::DetCluster(const TObjArray *cls) | |
281 | { | |
282 | // | |
283 | // Plot the cluster distributions | |
284 | // | |
285 | ||
286 | if(cls) fkClusters = cls; | |
287 | if(!fkClusters){ | |
288 | AliDebug(4, "No Clusters defined."); | |
289 | return NULL; | |
290 | } | |
291 | Int_t ncl(0); | |
292 | if(!(ncl = fkClusters->GetEntriesFast())){ | |
293 | AliDebug(1, "No RecPoints defined."); | |
294 | return NULL; | |
295 | } | |
296 | Int_t det(-1); | |
297 | AliTRDcluster *cl(NULL); | |
298 | for(Int_t icl(0); icl<ncl; icl++){ | |
299 | if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])) continue; | |
300 | det = cl->GetDetector(); break; | |
301 | } | |
302 | if(det<0){ | |
303 | AliDebug(1, "No useful clusters defined."); | |
304 | return NULL; | |
305 | } | |
306 | THnSparse *H(NULL); | |
307 | if(!fContainer || !(H = ((THnSparse*)fContainer->At(kDetector)))){ | |
308 | AliWarning("No output container defined."); | |
309 | return NULL; | |
310 | } | |
b351a191 | 311 | Int_t ly(AliTRDgeometry::GetLayer(det)), |
312 | stk(AliTRDgeometry::GetStack(det)); | |
f073d500 | 313 | Double_t val[kNdim], |
314 | alpha((0.5+AliTRDgeometry::GetSector(det))*AliTRDgeometry::GetAlpha()), | |
315 | cs(TMath::Cos(alpha)), | |
316 | sn(TMath::Sin(alpha)); | |
317 | for(Int_t icl(0); icl<ncl; icl++){ | |
0f2c4c4f | 318 | if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])){ |
319 | AliDebug(2, Form("Missing clusters @ %d", icl)); | |
320 | continue; | |
321 | } | |
322 | if(cl->IsMasked()) printf("Mask %03d[%02d_%d_%d] %d[%d]", det, AliTRDgeometry::GetSector(det), stk, ly, cl->GetPadMaskedPosition(), cl->GetPadMaskedStatus()); | |
f073d500 | 323 | val[kBC] = ly; |
324 | val[kPhi] = TMath::ATan2(cl->GetX()*sn + cl->GetY()*cs, cl->GetX()*cs - cl->GetY()*sn); | |
b351a191 | 325 | val[kEta] = (5-stk)*16-cl->GetPadRow()-1-(stk<3?4:0); |
3557a081 | 326 | val[kYrez]= fEvent->GetMultiplicity(); |
327 | val[4] = TMath::Abs(cl->GetQ()); | |
0f2c4c4f | 328 | val[5] = fTriggerList?fTriggerSlot:(cl->IsFivePad()?1:cl->GetNPads()); |
f073d500 | 329 | H->Fill(val); |
330 | } | |
331 | return NULL; | |
332 | } | |
333 | ||
1ee39b3a | 334 | //________________________________________________________ |
3ceb45ae | 335 | TH1* AliTRDresolution::PlotCluster(const AliTRDtrackV1 *track) |
1ee39b3a | 336 | { |
337 | // | |
3ceb45ae | 338 | // Plot the cluster distributions |
1ee39b3a | 339 | // |
340 | ||
341 | if(track) fkTrack = track; | |
342 | if(!fkTrack){ | |
3d2a3dff | 343 | AliDebug(4, "No Track defined."); |
b91fdd71 | 344 | return NULL; |
1ee39b3a | 345 | } |
b05a637a | 346 | if(fkESD && TMath::Abs(fkESD->GetTOFbc()) > 1){ |
3ceb45ae | 347 | AliDebug(4, Form("Track with BC_index[%d] not used.", fkESD->GetTOFbc())); |
b91fdd71 | 348 | return NULL; |
1ee39b3a | 349 | } |
b05a637a | 350 | if(fkESD && fPt<fPtThreshold){ |
3ceb45ae | 351 | AliDebug(4, Form("Track with pt[%6.4f] under threshold.", fPt)); |
b91fdd71 | 352 | return NULL; |
1ee39b3a | 353 | } |
3ceb45ae | 354 | THnSparse *H(NULL); |
355 | if(!fContainer || !(H = ((THnSparse*)fContainer->At(kCluster)))){ | |
1ee39b3a | 356 | AliWarning("No output container defined."); |
b91fdd71 | 357 | return NULL; |
1ee39b3a | 358 | } |
3ceb45ae | 359 | |
360 | AliTRDgeometry *geo(AliTRDinfoGen::Geometry()); | |
b9058d72 | 361 | Double_t val[kNdim+2], |
7c4c4bb4 | 362 | alpha(0.), cs(-2.), sn(0.); //Float_t exb, vd, t0, s2, dl, dt; |
3ceb45ae | 363 | TObjArray *clInfoArr(NULL); |
364 | AliTRDseedV1 *fTracklet(NULL); | |
3ed01fbe | 365 | AliTRDcluster *c(NULL), *cc(NULL); |
1ee39b3a | 366 | for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){ |
367 | if(!(fTracklet = fkTrack->GetTracklet(ily))) continue; | |
368 | if(!fTracklet->IsOK()) continue; | |
3ed01fbe | 369 | //fTracklet->GetCalibParam(exb, vd, t0, s2, dl, dt); |
3ceb45ae | 370 | val[kBC] = ily; |
7c4c4bb4 | 371 | if(cs<-1.){ |
372 | alpha = (0.5+AliTRDgeometry::GetSector(fTracklet->GetDetector()))*AliTRDgeometry::GetAlpha(); | |
373 | cs = TMath::Cos(alpha); | |
374 | sn = TMath::Sin(alpha); | |
375 | } | |
376 | val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn); | |
377 | Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX()); | |
378 | val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl)))); | |
3ed01fbe | 379 | val[kPt] = TMath::ATan(fTracklet->GetYref(1))*TMath::RadToDeg(); |
380 | Float_t corr = 1./TMath::Sqrt(1.+fTracklet->GetYref(1)*fTracklet->GetYref(1)+fTracklet->GetZref(1)*fTracklet->GetZref(1)); | |
381 | Int_t row0(-1); | |
382 | Float_t padCorr(fTracklet->GetTilt()*fTracklet->GetPadLength()); | |
3ceb45ae | 383 | fTracklet->ResetClusterIter(kTRUE); |
384 | while((c = fTracklet->NextCluster())){ | |
3ed01fbe | 385 | Float_t xc(c->GetX()), |
f429b017 | 386 | q(TMath::Abs(c->GetQ())); |
3ed01fbe | 387 | if(row0<0) row0 = c->GetPadRow(); |
388 | ||
389 | val[kYrez] = c->GetY() + padCorr*(c->GetPadRow() - row0) -fTracklet->GetYat(xc); | |
390 | val[kPrez] = fTracklet->GetX0()-xc; | |
f429b017 | 391 | val[kZrez] = 0.; Int_t ic(0), tb(c->GetLocalTimeBin());; |
392 | if((cc = fTracklet->GetClusters(tb-1))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} | |
393 | if((cc = fTracklet->GetClusters(tb-2))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} | |
3ed01fbe | 394 | if(ic) val[kZrez] /= (ic*q); |
395 | val[kSpeciesChgRC]= fTracklet->IsRowCross()?0.:(TMath::Max(q*corr, Float_t(3.))); | |
2cef552b | 396 | val[kNdim] = fEvent?fEvent->GetMultiplicity():0.; |
0f2c4c4f | 397 | val[kNdim+1] = fTriggerList?fTriggerSlot:(c->IsFivePad()?1:c->GetNPads()); |
3ceb45ae | 398 | H->Fill(val); |
399 | /* // tilt rotation of covariance for clusters | |
553528eb | 400 | Double_t sy2(c->GetSigmaY2()), sz2(c->GetSigmaZ2()); |
a47a87c5 | 401 | cov[0] = (sy2+t2*sz2)*corr; |
402 | cov[1] = tilt*(sz2 - sy2)*corr; | |
403 | cov[2] = (t2*sy2+sz2)*corr; | |
553528eb | 404 | // sum with track covariance |
a47a87c5 | 405 | cov[0]+=covR[0]; cov[1]+=covR[1]; cov[2]+=covR[2]; |
553528eb | 406 | Double_t dyz[2]= {dy[1], dz[1]}; |
3ceb45ae | 407 | Pulls(dyz, cov, tilt);*/ |
01ccc21a | 408 | |
dfd7d48b | 409 | // Get z-position with respect to anode wire |
3ceb45ae | 410 | Float_t yt(fTracklet->GetYref(0)-val[kZrez]*fTracklet->GetYref(1)), |
411 | zt(fTracklet->GetZref(0)-val[kZrez]*fTracklet->GetZref(1)); | |
fd7ffd88 | 412 | Int_t istk = geo->GetStack(c->GetDetector()); |
413 | AliTRDpadPlane *pp = geo->GetPadPlane(ily, istk); | |
3ed01fbe | 414 | Float_t rowZ = pp->GetRow0(); |
415 | Float_t d = rowZ - zt + pp->GetAnodeWireOffset(); | |
dfd7d48b | 416 | d -= ((Int_t)(2 * d)) / 2.0; |
417 | if (d > 0.25) d = 0.5 - d; | |
418 | ||
8ee59659 | 419 | AliTRDclusterInfo *clInfo(NULL); |
420 | clInfo = new AliTRDclusterInfo; | |
dfd7d48b | 421 | clInfo->SetCluster(c); |
3ceb45ae | 422 | //Float_t covF[] = {cov[0], cov[1], cov[2]}; |
423 | clInfo->SetGlobalPosition(yt, zt, fTracklet->GetYref(1), fTracklet->GetZref(1)/*, covF*/); | |
424 | clInfo->SetResolution(val[kYrez]); | |
dfd7d48b | 425 | clInfo->SetAnisochronity(d); |
3ceb45ae | 426 | clInfo->SetDriftLength(val[kZrez]); |
427 | clInfo->SetTilt(fTracklet->GetTilt()); | |
83b44483 | 428 | if(fCl) fCl->Add(clInfo); |
3ed01fbe | 429 | //else AliDebug(1, "Cl exchange container missing. Activate by calling \"InitExchangeContainers()\""); |
83b44483 | 430 | |
3ed01fbe | 431 | if(DebugLevel()>=2){ |
01ccc21a | 432 | if(!clInfoArr){ |
d14a8ac2 | 433 | clInfoArr=new TObjArray(AliTRDseedV1::kNclusters); |
434 | clInfoArr->SetOwner(kFALSE); | |
435 | } | |
dfd7d48b | 436 | clInfoArr->Add(clInfo); |
df0514f6 | 437 | } |
1ee39b3a | 438 | } |
3ed01fbe | 439 | if(DebugLevel()>=2 && clInfoArr){ |
3ceb45ae | 440 | ULong_t status = fkESD->GetStatus(); |
dfd7d48b | 441 | (*DebugStream()) << "cluster" |
442 | <<"status=" << status | |
443 | <<"clInfo.=" << clInfoArr | |
444 | << "\n"; | |
d14a8ac2 | 445 | clInfoArr->Clear(); |
dfd7d48b | 446 | } |
1ee39b3a | 447 | } |
d14a8ac2 | 448 | if(clInfoArr) delete clInfoArr; |
00a56108 | 449 | |
b05a637a | 450 | if(!track) return NULL; |
451 | // special care for EVE usage | |
452 | TH1 *h(NULL); | |
453 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; | |
454 | return H->Projection(kYrez); | |
1ee39b3a | 455 | } |
456 | ||
1ee39b3a | 457 | //________________________________________________________ |
458 | TH1* AliTRDresolution::PlotTracklet(const AliTRDtrackV1 *track) | |
459 | { | |
01ccc21a | 460 | // Plot normalized residuals for tracklets to track. |
461 | // | |
1ee39b3a | 462 | // We start from the result that if X=N(|m|, |Cov|) |
463 | // BEGIN_LATEX | |
464 | // (Cov^{-1})^{1/2}X = N((Cov^{-1})^{1/2}*|m|, |1|) | |
465 | // END_LATEX | |
01ccc21a | 466 | // in our case X=(y_trklt - y_trk z_trklt - z_trk) and |Cov| = |Cov_trklt| + |Cov_trk| at the radial |
467 | // reference position. | |
1ee39b3a | 468 | if(track) fkTrack = track; |
469 | if(!fkTrack){ | |
3d2a3dff | 470 | AliDebug(4, "No Track defined."); |
b91fdd71 | 471 | return NULL; |
1ee39b3a | 472 | } |
b05a637a | 473 | if(fkESD && TMath::Abs(fkESD->GetTOFbc())>1){ |
3ceb45ae | 474 | AliDebug(4, Form("Track with BC_index[%d] not used.", fkESD->GetTOFbc())); |
01ccc21a | 475 | //return NULL; |
3ceb45ae | 476 | } |
477 | THnSparse *H(NULL); | |
478 | if(!fContainer || !(H = (THnSparse*)fContainer->At(kTracklet))){ | |
1ee39b3a | 479 | AliWarning("No output container defined."); |
b91fdd71 | 480 | return NULL; |
1ee39b3a | 481 | } |
01ccc21a | 482 | |
0f2c4c4f | 483 | // down scale PID resolution |
484 | Int_t spc(fSpecies); if(spc==3) spc=2; if(spc==-3) spc=-2; if(spc>3) spc=3; if(spc<-3) spc=-3; | |
178d284a | 485 | const Int_t ndim(kNdim+8); |
808d178e | 486 | Double_t val[ndim], |
01ccc21a | 487 | alpha(0.), cs(-2.), sn(0.); |
0f2c4c4f | 488 | // Float_t sz[AliTRDseedV1::kNtb], pos[AliTRDseedV1::kNtb]; Int_t ntbGap[AliTRDseedV1::kNtb]; |
3ceb45ae | 489 | AliTRDseedV1 *fTracklet(NULL); |
3ba3e0a4 | 490 | for(Int_t il(0); il<AliTRDgeometry::kNlayer; il++){ |
1ee39b3a | 491 | if(!(fTracklet = fkTrack->GetTracklet(il))) continue; |
566c3d46 | 492 | if(!fTracklet->IsOK() || !fTracklet->IsChmbGood()) continue; |
01ccc21a | 493 | val [kBC] = il; |
494 | if(cs<-1.){ | |
495 | alpha = (0.5+AliTRDgeometry::GetSector(fTracklet->GetDetector()))*AliTRDgeometry::GetAlpha(); | |
496 | cs = TMath::Cos(alpha); | |
497 | sn = TMath::Sin(alpha); | |
01ccc21a | 498 | } |
499 | val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn); | |
500 | Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX());//fTracklet->GetTgl(); | |
501 | val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl)))); | |
01ccc21a | 502 | |
0f2c4c4f | 503 | val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:spc;// fSpecies; |
504 | val[kPt] = GetPtBin(fPt); //fPt<0.8?0:(fPt<1.5?1:2);//GetPtBin(fTracklet->GetMomentum()); | |
35983729 | 505 | Double_t dyt(fTracklet->GetYfit(0) - fTracklet->GetYref(0)), |
506 | dzt(fTracklet->GetZfit(0) - fTracklet->GetZref(0)), | |
3ceb45ae | 507 | dydx(fTracklet->GetYfit(1)), |
508 | tilt(fTracklet->GetTilt()); | |
509 | // correct for tilt rotation | |
510 | val[kYrez] = dyt - dzt*tilt; | |
b9058d72 | 511 | val[kZrez] = fTracklet->IsRowCross()?(dzt + dyt*tilt):(fTracklet->GetdQdl()*3.e-4-1.5); |
3ceb45ae | 512 | dydx+= tilt*fTracklet->GetZref(1); |
35983729 | 513 | val[kPrez] = TMath::ATan((dydx - fTracklet->GetYref(1))/(1.+ fTracklet->GetYref(1)*dydx)) * TMath::RadToDeg(); |
b9058d72 | 514 | val[kNdim] = fEvent?fEvent->GetMultiplicity():0; |
0f2c4c4f | 515 | val[kNdim+1] = fTriggerList?fTriggerSlot:(1.e2*fTracklet->GetTBoccupancy()/AliTRDseedV1::kNtb); |
516 | /* Int_t n = fTracklet->GetChargeGaps(sz, pos, ntbGap); | |
b9058d72 | 517 | val[kNdim+2] = 0.; for(Int_t igap(0); igap<n; igap++) val[kNdim+2] += sz[igap]; |
518 | for(Int_t ifill(0); ifill<3; ifill++){ val[kNdim+3+ifill]=0.;val[kNdim+4+ifill]=0.;} | |
82e6e5dc | 519 | for(Int_t igap(0), ifill(0); igap<n&&ifill<2; igap++){ |
808d178e | 520 | if(ntbGap[igap]<2) continue; |
b9058d72 | 521 | val[kNdim+3+ifill] = sz[igap]; |
522 | val[kNdim+4+ifill] = pos[igap]; | |
808d178e | 523 | ifill++; |
0f2c4c4f | 524 | }*/ |
566c3d46 | 525 | H->Fill(val); |
3ceb45ae | 526 | |
527 | // // compute covariance matrix | |
528 | // fTracklet->GetCovAt(x, cov); | |
529 | // fTracklet->GetCovRef(covR); | |
01ccc21a | 530 | // cov[0] += covR[0]; cov[1] += covR[1]; cov[2] += covR[2]; |
3ceb45ae | 531 | // Double_t dyz[2]= {dy[1], dz[1]}; |
532 | // Pulls(dyz, cov, tilt); | |
533 | // ((TH3S*)arr->At(1))->Fill(sgm[fSegmentLevel], dyz[0], dyz[1]); | |
534 | // ((TH3S*)arr->At(3))->Fill(tht, dyz[1], rc); | |
dfd7d48b | 535 | |
3ed01fbe | 536 | if(DebugLevel()>=3){ |
3ceb45ae | 537 | Bool_t rc(fTracklet->IsRowCross()); |
dfd7d48b | 538 | UChar_t err(fTracklet->GetErrorMsg()); |
3ceb45ae | 539 | Double_t x(fTracklet->GetX()), |
540 | pt(fTracklet->GetPt()), | |
541 | yt(fTracklet->GetYref(0)), | |
542 | zt(fTracklet->GetZref(0)), | |
543 | phi(fTracklet->GetYref(1)), | |
544 | tht(fTracklet->GetZref(1)); | |
01ccc21a | 545 | Int_t ncl(fTracklet->GetN()), det(fTracklet->GetDetector()); |
dfd7d48b | 546 | (*DebugStream()) << "tracklet" |
3ba3e0a4 | 547 | <<"pt=" << pt |
3ceb45ae | 548 | <<"x=" << x |
6475ec36 | 549 | <<"yt=" << yt |
3ceb45ae | 550 | <<"zt=" << zt |
3ba3e0a4 | 551 | <<"phi=" << phi |
552 | <<"tht=" << tht | |
3ceb45ae | 553 | <<"det=" << det |
6475ec36 | 554 | <<"n=" << ncl |
3ceb45ae | 555 | <<"dy0=" << dyt |
556 | <<"dz0=" << dzt | |
557 | <<"dy=" << val[kYrez] | |
558 | <<"dz=" << val[kZrez] | |
559 | <<"dphi="<< val[kPrez] | |
560 | <<"dQ ="<< val[kNdim] | |
dfd7d48b | 561 | <<"rc=" << rc |
562 | <<"err=" << err | |
563 | << "\n"; | |
564 | } | |
1ee39b3a | 565 | } |
b05a637a | 566 | if(!track) return NULL; |
567 | // special care for EVE usage | |
568 | TH1 *h(NULL); | |
569 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; | |
570 | return H->Projection(kYrez); | |
1ee39b3a | 571 | } |
572 | ||
573 | ||
574 | //________________________________________________________ | |
a310e49b | 575 | TH1* AliTRDresolution::PlotTrackIn(const AliTRDtrackV1 *track) |
1ee39b3a | 576 | { |
01ccc21a | 577 | // Store resolution/pulls of Kalman before updating with the TRD information |
578 | // at the radial position of the first tracklet. The following points are used | |
579 | // for comparison | |
1ee39b3a | 580 | // - the (y,z,snp) of the first TRD tracklet |
581 | // - the (y, z, snp, tgl, pt) of the MC track reference | |
01ccc21a | 582 | // |
583 | // Additionally the momentum resolution/pulls are calculated for usage in the | |
584 | // PID calculation. | |
dffc3357 | 585 | |
1ee39b3a | 586 | if(track) fkTrack = track; |
3ceb45ae | 587 | if(!fkTrack){ |
3d2a3dff | 588 | AliDebug(4, "No Track defined."); |
b91fdd71 | 589 | return NULL; |
1ee39b3a | 590 | } |
3ed01fbe | 591 | //fkTrack->Print(); |
b05a637a | 592 | TH1 *h(NULL); // EVE projection |
3ceb45ae | 593 | // check container |
594 | THnSparseI *H=(THnSparseI*)fContainer->At(kTrackIn); | |
595 | if(!H){ | |
596 | AliError(Form("Missing container @ %d", Int_t(kTrackIn))); | |
83b44483 | 597 | return NULL; |
598 | } | |
3ceb45ae | 599 | // check input track status |
600 | AliExternalTrackParam *tin(NULL); | |
a310e49b | 601 | if(!(tin = fkTrack->GetTrackIn())){ |
3ceb45ae | 602 | AliError("Track did not entered TRD fiducial volume."); |
b91fdd71 | 603 | return NULL; |
1ee39b3a | 604 | } |
3ceb45ae | 605 | // check first tracklet |
606 | AliTRDseedV1 *fTracklet(fkTrack->GetTracklet(0)); | |
607 | if(!fTracklet){ | |
608 | AliDebug(3, "No Tracklet in ly[0]. 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); | |
1ee39b3a | 613 | } |
566c3d46 | 614 | if(!fTracklet->IsOK() || !fTracklet->IsChmbGood()){ |
615 | AliDebug(3, "Tracklet or Chamber not OK. Skip track."); | |
b05a637a | 616 | if(!track) return NULL; |
617 | // special care for EVE usage | |
618 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; | |
619 | return H->Projection(kYrez); | |
566c3d46 | 620 | } |
3ceb45ae | 621 | // check radial position |
622 | Double_t x = tin->GetX(); | |
623 | if(TMath::Abs(x-fTracklet->GetX())>1.e-3){ | |
624 | AliDebug(1, Form("Tracklet did not match Track. dx[cm]=%+4.1f", x-fTracklet->GetX())); | |
b05a637a | 625 | if(!track) return NULL; |
626 | // special care for EVE usage | |
627 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; | |
628 | return H->Projection(kYrez); | |
1ee39b3a | 629 | } |
630 | ||
f036f7ec | 631 | // down scale PID resolution |
632 | Int_t spc(fSpecies); if(spc==3) spc=2; if(spc==-3) spc=-2; if(spc>3) spc=3; if(spc<-3) spc=-3; | |
95d47440 | 633 | // read V0 PID if available |
634 | Int_t v0pid(-2); | |
635 | if(fkESD->IsElectron()) v0pid = -1; | |
636 | else if(fkESD->IsPion()) v0pid = 0; | |
637 | else if(fkESD->IsProton()) v0pid = 1; | |
fb7cacec | 638 | if(DebugLevel()>=1/* && v0pid>-2*/){ |
f036f7ec | 639 | Float_t tpc(fkESD->GetTPCdedx()); |
640 | Float_t tof(fkESD->GetTOFbeta()); | |
fb7cacec | 641 | Int_t ev(fEvent->GetEventHeader()->GetEventNumberInFile()); |
aebcb1ff | 642 | AliTRDtrackV1 t(*fkTrack); t.SetOwner(); |
f036f7ec | 643 | (*DebugStream()) << "trackIn" |
fb7cacec | 644 | <<"ev=" << ev |
aebcb1ff | 645 | <<"pid=" << v0pid |
646 | <<"tpc=" << tpc | |
647 | <<"tof=" << tof | |
648 | <<"track.=" << &t | |
649 | <<"trackIn.=" << tin | |
f036f7ec | 650 | << "\n"; |
651 | } | |
652 | ||
653 | //Int_t bc(fkESD?fkESD->GetTOFbc()/2:0); | |
3ceb45ae | 654 | const Double_t *parR(tin->GetParameter()); |
35983729 | 655 | Double_t dyt(fTracklet->GetYfit(0)-parR[0]), dzt(fTracklet->GetZfit(0)-parR[1]), |
3ceb45ae | 656 | phit(fTracklet->GetYfit(1)), |
35983729 | 657 | tilt(fTracklet->GetTilt()), |
658 | norm(1./TMath::Sqrt((1.-parR[2])*(1.+parR[2]))); | |
3ceb45ae | 659 | |
660 | // correct for tilt rotation | |
661 | Double_t dy = dyt - dzt*tilt, | |
35983729 | 662 | dz = dzt + dyt*tilt, |
01ccc21a | 663 | dx = dy/(parR[2]*norm-parR[3]*norm*tilt); |
3ceb45ae | 664 | phit += tilt*parR[3]; |
35983729 | 665 | Double_t dphi = TMath::ATan(phit) - TMath::ASin(parR[2]); |
3ceb45ae | 666 | |
f036f7ec | 667 | Double_t val[kNdim+2]; |
5047978d | 668 | val[kBC] = fTriggerSlot?fTriggerSlot:v0pid;//bc==0?0:(bc<0?-1.:1.); |
7c4c4bb4 | 669 | Double_t alpha = (0.5+AliTRDgeometry::GetSector(fTracklet->GetDetector()))*AliTRDgeometry::GetAlpha(), |
670 | cs = TMath::Cos(alpha), | |
671 | sn = TMath::Sin(alpha); | |
f036f7ec | 672 | val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn); |
673 | Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX()); | |
674 | val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl)))); | |
3ceb45ae | 675 | val[kYrez] = dy; |
b351a191 | 676 | val[kZrez] = fTracklet->IsRowCross()?dz:(fTracklet->GetdQdl()*5.e-4 - 2.5); |
3ceb45ae | 677 | val[kPrez] = dphi*TMath::RadToDeg(); |
cc98ff07 | 678 | val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:spc; |
5047978d | 679 | Float_t pz(0.); if(fTracklet->GetMomentum()-fPt>1.e-5) pz = TMath::Sqrt((fTracklet->GetMomentum()-fPt)*(fTracklet->GetMomentum()+fPt)); |
680 | val[kPt] = fTracklet->IsRowCross()?GetPtBin(pz):GetPtBin(fPt); | |
0f2c4c4f | 681 | val[kNdim] = GetPtBin(fTracklet->GetMomentum()); |
35983729 | 682 | val[kNdim+1] = dx; |
f036f7ec | 683 | //val[kNdim+2] = fEvent?fEvent->GetBunchFill():0; |
3ceb45ae | 684 | H->Fill(val); |
685 | ||
b05a637a | 686 | if(!track) return NULL; |
687 | // special care for EVE usage | |
2cef552b | 688 | if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
689 | return H->Projection(kYrez); | |
1ee39b3a | 690 | } |
691 | ||
f429b017 | 692 | /* |
a310e49b | 693 | //________________________________________________________ |
694 | TH1* AliTRDresolution::PlotTrackOut(const AliTRDtrackV1 *track) | |
695 | { | |
01ccc21a | 696 | // Store resolution/pulls of Kalman after last update with the TRD information |
697 | // at the radial position of the first tracklet. The following points are used | |
698 | // for comparison | |
a310e49b | 699 | // - the (y,z,snp) of the first TRD tracklet |
700 | // - the (y, z, snp, tgl, pt) of the MC track reference | |
01ccc21a | 701 | // |
702 | // Additionally the momentum resolution/pulls are calculated for usage in the | |
703 | // PID calculation. | |
a310e49b | 704 | |
705 | if(track) fkTrack = track; | |
596f82fb | 706 | return NULL; |
a310e49b | 707 | } |
f429b017 | 708 | */ |
1ee39b3a | 709 | //________________________________________________________ |
710 | TH1* AliTRDresolution::PlotMC(const AliTRDtrackV1 *track) | |
711 | { | |
712 | // | |
713 | // Plot MC distributions | |
714 | // | |
715 | ||
b351a191 | 716 | if(!HasMCdata()) return NULL; |
1ee39b3a | 717 | if(track) fkTrack = track; |
718 | if(!fkTrack){ | |
3d2a3dff | 719 | AliDebug(4, "No Track defined."); |
b91fdd71 | 720 | return NULL; |
1ee39b3a | 721 | } |
95d47440 | 722 | // Int_t bc(TMath::Abs(fkESD->GetTOFbc())); |
f429b017 | 723 | |
724 | THnSparse *H(NULL); | |
83b44483 | 725 | if(!fContainer){ |
726 | AliWarning("No output container defined."); | |
727 | return NULL; | |
728 | } | |
92c40e64 | 729 | // retriev track characteristics |
730 | Int_t pdg = fkMC->GetPDG(), | |
731 | sIdx(AliTRDpidUtil::Pdg2Pid(TMath::Abs(pdg))+1), // species index | |
732 | sign(0), | |
f429b017 | 733 | // sgm[3], |
734 | label(fkMC->GetLabel()); | |
735 | // fSegmentLevel(0); | |
92c40e64 | 736 | if(!fDBPDG) fDBPDG=TDatabasePDG::Instance(); |
737 | TParticlePDG *ppdg(fDBPDG->GetParticle(pdg)); | |
738 | if(ppdg) sign = ppdg->Charge() > 0. ? 1 : -1; | |
0f2c4c4f | 739 | if(sIdx==3) sIdx=2; if(sIdx>3) sIdx=3; // downscale PID |
92c40e64 | 740 | |
f429b017 | 741 | TH1 *h(NULL); |
3ceb45ae | 742 | AliTRDgeometry *geo(AliTRDinfoGen::Geometry()); |
743 | AliTRDseedV1 *fTracklet(NULL); TObjArray *clInfoArr(NULL); | |
1ee39b3a | 744 | UChar_t s; |
5047978d | 745 | Double_t x, y, z, pt, dydx, dzdx/*, dzdl*/; |
0f2c4c4f | 746 | Float_t pt0, p0, x0, y0, z0, dx, dy, dz, dydx0, dzdx0; |
1ee39b3a | 747 | Double_t covR[7]/*, cov[3]*/; |
01ccc21a | 748 | |
f429b017 | 749 | /* if(DebugLevel()>=3){ |
3ceb45ae | 750 | // get first detector |
751 | Int_t det = -1; | |
752 | for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){ | |
753 | if(!(fTracklet = fkTrack->GetTracklet(ily))) continue; | |
754 | det = fTracklet->GetDetector(); | |
755 | break; | |
756 | } | |
757 | if(det>=0){ | |
758 | TVectorD X(12), Y(12), Z(12), dX(12), dY(12), dZ(12), vPt(12), dPt(12), budget(12), cCOV(12*15); | |
759 | Double_t m(-1.); | |
760 | m = fkTrack->GetMass(); | |
761 | if(fkMC->PropagateKalman(&X, &Y, &Z, &dX, &dY, &dZ, &vPt, &dPt, &budget, &cCOV, m)){ | |
762 | (*DebugStream()) << "MCkalman" | |
763 | << "pdg=" << pdg | |
764 | << "det=" << det | |
765 | << "x=" << &X | |
766 | << "y=" << &Y | |
767 | << "z=" << &Z | |
768 | << "dx=" << &dX | |
769 | << "dy=" << &dY | |
770 | << "dz=" << &dZ | |
771 | << "pt=" << &vPt | |
772 | << "dpt=" << &dPt | |
773 | << "bgt=" << &budget | |
774 | << "cov=" << &cCOV | |
775 | << "\n"; | |
776 | } | |
777 | } | |
f429b017 | 778 | }*/ |
779 | AliTRDcluster *c(NULL); | |
0f2c4c4f | 780 | Double_t val[kNdim+2]; |
1ee39b3a | 781 | for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){ |
782 | if(!(fTracklet = fkTrack->GetTracklet(ily)))/* || | |
783 | !fTracklet->IsOK())*/ continue; | |
784 | ||
f429b017 | 785 | x= x0 = fTracklet->GetX(); |
786 | Bool_t rc(fTracklet->IsRowCross()); Float_t eta, phi; | |
0f2c4c4f | 787 | if(!fkMC->GetDirections(x0, y0, z0, dydx0, dzdx0, pt0, p0, eta, phi, s)) continue; |
1ee39b3a | 788 | |
789 | // MC track position at reference radial position | |
790 | dx = x0 - x; | |
1ee39b3a | 791 | Float_t ymc = y0 - dx*dydx0; |
792 | Float_t zmc = z0 - dx*dzdx0; | |
01ccc21a | 793 | //phi -= TMath::Pi(); |
f429b017 | 794 | |
795 | val[kBC] = ily; | |
796 | val[kPhi] = phi; | |
797 | val[kEta] = eta; | |
798 | val[kSpeciesChgRC]= rc?0.:sign*sIdx; | |
0f2c4c4f | 799 | val[kPt] = GetPtBin(pt0); |
800 | val[kNdim]= GetPtBin(p0); | |
f429b017 | 801 | Double_t tilt(fTracklet->GetTilt()); |
802 | // ,t2(tilt*tilt) | |
803 | // ,corr(1./(1. + t2)) | |
804 | // ,cost(TMath::Sqrt(corr)); | |
805 | ||
806 | AliExternalTrackParam *tin(fkTrack->GetTrackIn()); | |
807 | if(ily==0 && tin){ // trackIn residuals | |
808 | // check radial position | |
808d178e | 809 | if(TMath::Abs(tin->GetX()-x)>1.e-3) AliDebug(1, Form("TrackIn radial mismatch. dx[cm]=%+4.1f", tin->GetX()-x)); |
810 | else{ | |
95d47440 | 811 | Int_t exactPID = -2; |
812 | switch(TMath::Abs(pdg)){ | |
813 | case 11: exactPID = -1;break; | |
814 | case 211: exactPID = 0;break; | |
815 | case 2212: exactPID = 1;break; | |
816 | } | |
817 | val[kBC] = exactPID; | |
f429b017 | 818 | val[kYrez] = tin->GetY()-ymc; |
0f2c4c4f | 819 | val[kZrez] = rc?(tin->GetZ()-zmc):(fTracklet->GetdQdl()*5e-4 - 2.5); |
f429b017 | 820 | val[kPrez] = (TMath::ASin(tin->GetSnp())-TMath::ATan(dydx0))*TMath::RadToDeg(); |
0f2c4c4f | 821 | val[kNdim+1] = 0.;//dx; |
f429b017 | 822 | if((H = (THnSparseI*)fContainer->At(kMCtrackIn))) H->Fill(val); |
fb7cacec | 823 | val[kBC] = ily; // reset for subsequent components |
efc109ad | 824 | |
825 | if(DebugLevel()>=1 && exactPID>-2){ | |
826 | Float_t tpc(fkESD->GetTPCdedx()); | |
827 | Float_t tof(fkESD->GetTOFbeta()); | |
828 | AliTRDtrackV1 t(*fkTrack); t.SetOwner(); | |
829 | (*DebugStream()) << "MCtrackIn" | |
830 | <<"pid=" << exactPID | |
831 | <<"tpc=" << tpc | |
832 | <<"tof=" << tof | |
833 | <<"track.=" << &t | |
834 | <<"trackIn.=" << tin | |
835 | << "\n"; | |
836 | } | |
808d178e | 837 | } |
f429b017 | 838 | } |
01ccc21a | 839 | //if(bc>1) break; // do nothing for the rest of TRD objects if satellite bunch |
1ee39b3a | 840 | |
f429b017 | 841 | // track residuals |
1ee39b3a | 842 | dydx = fTracklet->GetYref(1); |
843 | dzdx = fTracklet->GetZref(1); | |
5047978d | 844 | //dzdl = fTracklet->GetTgl(); |
f429b017 | 845 | y = fTracklet->GetYref(0); |
1ee39b3a | 846 | dy = y - ymc; |
f429b017 | 847 | z = fTracklet->GetZref(0); |
1ee39b3a | 848 | dz = z - zmc; |
849 | pt = TMath::Abs(fTracklet->GetPt()); | |
850 | fTracklet->GetCovRef(covR); | |
851 | ||
f429b017 | 852 | val[kYrez] = dy; |
853 | val[kPrez] = TMath::ATan((dydx - dydx0)/(1.+ dydx*dydx0))*TMath::RadToDeg(); | |
854 | val[kZrez] = dz; | |
6465da91 | 855 | val[kNdim] = 1.e2*(pt/pt0-1.); |
f429b017 | 856 | if((H = (THnSparse*)fContainer->At(kMCtrack))) H->Fill(val); |
857 | /* // theta resolution/ tgl pulls | |
858 | Double_t dzdl0 = dzdx0/TMath::Sqrt(1.+dydx0*dydx0), | |
859 | dtgl = (dzdl - dzdl0)/(1.- dzdl*dzdl0); | |
860 | ((TH2I*)arr->At(6))->Fill(dzdl0, TMath::ATan(dtgl)); | |
861 | ((TH2I*)arr->At(7))->Fill(dzdl0, (dzdl - dzdl0)/TMath::Sqrt(covR[4])); | |
862 | // pt resolution \\ 1/pt pulls \\ p resolution for PID | |
863 | Double_t p0 = TMath::Sqrt(1.+ dzdl0*dzdl0)*pt0, | |
864 | p = TMath::Sqrt(1.+ dzdl*dzdl)*pt; | |
865 | ((TH3S*)((TObjArray*)arr->At(8)))->Fill(pt0, pt/pt0-1., sign*sIdx); | |
866 | ((TH3S*)((TObjArray*)arr->At(9)))->Fill(1./pt0, (1./pt-1./pt0)/TMath::Sqrt(covR[6]), sign*sIdx); | |
867 | ((TH3S*)((TObjArray*)arr->At(10)))->Fill(p0, p/p0-1., sign*sIdx);*/ | |
868 | ||
869 | // Fill Debug stream for MC track | |
3ba3e0a4 | 870 | if(DebugLevel()>=4){ |
f429b017 | 871 | Int_t det(fTracklet->GetDetector()); |
872 | (*DebugStream()) << "MC" | |
873 | << "det=" << det | |
874 | << "pdg=" << pdg | |
875 | << "sgn=" << sign | |
876 | << "pt=" << pt0 | |
877 | << "x=" << x0 | |
878 | << "y=" << y0 | |
879 | << "z=" << z0 | |
880 | << "dydx=" << dydx0 | |
881 | << "dzdx=" << dzdx0 | |
882 | << "\n"; | |
01ccc21a | 883 | |
f429b017 | 884 | // Fill Debug stream for Kalman track |
1ee39b3a | 885 | (*DebugStream()) << "MCtrack" |
886 | << "pt=" << pt | |
887 | << "x=" << x | |
888 | << "y=" << y | |
889 | << "z=" << z | |
890 | << "dydx=" << dydx | |
891 | << "dzdx=" << dzdx | |
892 | << "s2y=" << covR[0] | |
893 | << "s2z=" << covR[2] | |
894 | << "\n"; | |
895 | } | |
896 | ||
f429b017 | 897 | // tracklet residuals |
898 | dydx = fTracklet->GetYfit(1) + tilt*dzdx0; | |
899 | dzdx = fTracklet->GetZfit(1); | |
900 | y = fTracklet->GetYfit(0); | |
901 | dy = y - ymc; | |
902 | z = fTracklet->GetZfit(0); | |
903 | dz = z - zmc; | |
904 | val[kYrez] = dy - dz*tilt; | |
905 | val[kPrez] = TMath::ATan((dydx - dydx0)/(1.+ dydx*dydx0))*TMath::RadToDeg(); | |
0e36aa24 | 906 | val[kZrez] = rc?(dz + dy*tilt):(fTracklet->GetdQdl()*3.e-4 - 1.5); |
0f2c4c4f | 907 | val[kNdim] = fEvent?fEvent->GetMultiplicity():0; |
908 | val[kNdim+1] = 1.e2*fTracklet->GetTBoccupancy()/AliTRDseedV1::kNtb; | |
f429b017 | 909 | // val[kNdim] = pt/pt0-1.; |
910 | if((H = (THnSparse*)fContainer->At(kMCtracklet))) H->Fill(val); | |
01ccc21a | 911 | |
f429b017 | 912 | |
1ee39b3a | 913 | // Fill Debug stream for tracklet |
3ba3e0a4 | 914 | if(DebugLevel()>=4){ |
f429b017 | 915 | Float_t s2y = fTracklet->GetS2Y(); |
916 | Float_t s2z = fTracklet->GetS2Z(); | |
1ee39b3a | 917 | (*DebugStream()) << "MCtracklet" |
918 | << "rc=" << rc | |
919 | << "x=" << x | |
920 | << "y=" << y | |
921 | << "z=" << z | |
922 | << "dydx=" << dydx | |
923 | << "s2y=" << s2y | |
924 | << "s2z=" << s2z | |
925 | << "\n"; | |
926 | } | |
927 | ||
f429b017 | 928 | AliTRDpadPlane *pp = geo->GetPadPlane(ily, AliTRDgeometry::GetStack(fTracklet->GetDetector())); |
1ee39b3a | 929 | Float_t zr0 = pp->GetRow0() + pp->GetAnodeWireOffset(); |
1ee39b3a | 930 | //Double_t exb = AliTRDCommonParam::Instance()->GetOmegaTau(1.5); |
931 | ||
f429b017 | 932 | H = (THnSparse*)fContainer->At(kMCcluster); |
933 | val[kPt] = TMath::ATan(dydx0)*TMath::RadToDeg(); | |
934 | //Float_t corr = 1./TMath::Sqrt(1.+dydx0*dydx0+dzdx0*dzdx0); | |
935 | Int_t row0(-1); | |
0f2c4c4f | 936 | Float_t padCorr(tilt*fTracklet->GetPadLength()), |
937 | corr(1./TMath::Sqrt(1.+dydx0*dydx0+dzdx0*dzdx0)); | |
f429b017 | 938 | fTracklet->ResetClusterIter(kTRUE); |
939 | while((c = fTracklet->NextCluster())){ | |
940 | if(row0<0) row0 = c->GetPadRow(); | |
941 | x = c->GetX();//+fXcorr[c->GetDetector()][c->GetLocalTimeBin()]; | |
942 | y = c->GetY() + padCorr*(c->GetPadRow() - row0); | |
943 | z = c->GetZ(); | |
01ccc21a | 944 | dx = x0 - x; |
1ee39b3a | 945 | ymc= y0 - dx*dydx0; |
946 | zmc= z0 - dx*dzdx0; | |
f429b017 | 947 | dy = y - ymc; |
948 | dz = z - zmc; | |
949 | val[kYrez] = dy - dz*tilt; | |
950 | val[kPrez] = dx; | |
951 | val[kZrez] = 0.; AliTRDcluster *cc(NULL); Int_t ic(0), tb(c->GetLocalTimeBin()); Float_t q(TMath::Abs(c->GetQ())); | |
952 | if((cc = fTracklet->GetClusters(tb-1))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} | |
953 | if((cc = fTracklet->GetClusters(tb-2))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;} | |
954 | if(ic) val[kZrez] /= (ic*q); | |
0f2c4c4f | 955 | val[kSpeciesChgRC]= rc?0.:(TMath::Max(q*corr, Float_t(3.))); |
956 | val[kNdim+1] = c->IsFivePad()?1:c->GetNPads(); | |
f429b017 | 957 | if(H) H->Fill(val); |
958 | ||
1ee39b3a | 959 | |
960 | // Fill calibration container | |
961 | Float_t d = zr0 - zmc; | |
962 | d -= ((Int_t)(2 * d)) / 2.0; | |
963 | if (d > 0.25) d = 0.5 - d; | |
964 | AliTRDclusterInfo *clInfo = new AliTRDclusterInfo; | |
1ee39b3a | 965 | clInfo->SetCluster(c); |
966 | clInfo->SetMC(pdg, label); | |
967 | clInfo->SetGlobalPosition(ymc, zmc, dydx0, dzdx0); | |
968 | clInfo->SetResolution(dy); | |
969 | clInfo->SetAnisochronity(d); | |
2589cf64 | 970 | clInfo->SetDriftLength(dx); |
1ee39b3a | 971 | clInfo->SetTilt(tilt); |
83b44483 | 972 | if(fMCcl) fMCcl->Add(clInfo); |
973 | else AliDebug(1, "MCcl exchange container missing. Activate by calling \"InitExchangeContainers()\""); | |
01ccc21a | 974 | if(DebugLevel()>=5){ |
975 | if(!clInfoArr){ | |
d14a8ac2 | 976 | clInfoArr=new TObjArray(AliTRDseedV1::kNclusters); |
977 | clInfoArr->SetOwner(kFALSE); | |
978 | } | |
d43e2ad1 | 979 | clInfoArr->Add(clInfo); |
1ee39b3a | 980 | } |
981 | } | |
d43e2ad1 | 982 | // Fill Debug Tree |
3ba3e0a4 | 983 | if(DebugLevel()>=5 && clInfoArr){ |
d43e2ad1 | 984 | (*DebugStream()) << "MCcluster" |
985 | <<"clInfo.=" << clInfoArr | |
986 | << "\n"; | |
92c40e64 | 987 | clInfoArr->Clear(); |
d43e2ad1 | 988 | } |
1ee39b3a | 989 | } |
92c40e64 | 990 | if(clInfoArr) delete clInfoArr; |
2cef552b | 991 | if(!track) return NULL; |
992 | // special care for EVE usage | |
a304f63f | 993 | if(H && (h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h; |
994 | return H?H->Projection(kYrez):NULL; | |
1ee39b3a | 995 | } |
996 | ||
b351a191 | 997 | //________________________________________________________ |
998 | void AliTRDresolution::GetRangeZ(TH2 *h2, Float_t &min, Float_t &max) | |
999 | { | |
1000 | // Get range on Z axis such to avoid outliers | |
1001 | ||
1002 | Double_t cnt[20000], c, m, s; | |
1003 | Int_t nx(h2->GetXaxis()->GetNbins()), ny(h2->GetYaxis()->GetNbins()), nc(0); | |
1004 | for(Int_t ix(1); ix<=nx; ix++){ | |
1005 | for(Int_t iy(1); iy<=ny; iy++){ | |
1006 | if((c = h2->GetBinContent(ix, iy))<10) continue; | |
1007 | cnt[nc++] = c; | |
1008 | if(nc==20000) break; | |
1009 | } | |
1010 | if(nc==20000) break; | |
1011 | } | |
1012 | AliMathBase::EvaluateUni(nc, cnt, m, s, 0); | |
1013 | min = m-s; max = m+2.*s; | |
1014 | } | |
1015 | ||
1ee39b3a | 1016 | //________________________________________________________ |
1017 | Bool_t AliTRDresolution::GetRefFigure(Int_t ifig) | |
1018 | { | |
1019 | // | |
1020 | // Get the reference figures | |
1021 | // | |
1022 | ||
1ee39b3a | 1023 | if(!gPad){ |
1024 | AliWarning("Please provide a canvas to draw results."); | |
1025 | return kFALSE; | |
1026 | } | |
01ccc21a | 1027 | /* Int_t selection[100], n(0), selStart(0); // |
a310e49b | 1028 | Int_t ly0(0), dly(5); |
3ceb45ae | 1029 | TList *l(NULL); TVirtualPad *pad(NULL); */ |
1ee39b3a | 1030 | switch(ifig){ |
3ceb45ae | 1031 | case 0: |
1ee39b3a | 1032 | break; |
1ee39b3a | 1033 | } |
1034 | AliWarning(Form("Reference plot [%d] missing result", ifig)); | |
1035 | return kFALSE; | |
1036 | } | |
1037 | ||
00a3f7a4 | 1038 | //________________________________________________________ |
1039 | void AliTRDresolution::MakeSummary() | |
1040 | { | |
1041 | // Build summary plots | |
1042 | ||
3ceb45ae | 1043 | if(!fProj){ |
00a3f7a4 | 1044 | AliError("Missing results"); |
1045 | return; | |
01ccc21a | 1046 | } |
3ceb45ae | 1047 | TVirtualPad *p(NULL); TCanvas *cOut(NULL); |
3ed01fbe | 1048 | TObjArray *arr(NULL); TH2 *h2(NULL); |
95d47440 | 1049 | TH2 *h2e[100] = {NULL}; Int_t ih2e(0); // save sigma histos for later deletion |
068e2c00 | 1050 | |
3ceb45ae | 1051 | // cluster resolution |
1052 | // define palette | |
1053 | gStyle->SetPalette(1); | |
808d178e | 1054 | const Int_t nClViews(9); |
1055 | const Char_t *vClName[nClViews] = {"ClY", "ClYn", "ClYp", "ClQn", "ClQp", "ClYXTCp", "ClYXTCn", "ClYXPh", "ClYXPh"}; | |
1056 | const UChar_t vClOpt[nClViews] = {1, 1, 1, 0, 0, 0, 0, 0, 1}; | |
56838f9d | 1057 | const Float_t vClSignMin[2] = {2.6e2, 4.4e2}, |
1058 | vClSignMax[2] = {4.4e2, 6.2e2}, | |
1059 | vClMin[nClViews] = {3.2e2, vClSignMin[Int_t(fBsign)], vClSignMin[Int_t(!fBsign)], 0., 0., 0., 0., 0., 3.2e2}, | |
1060 | vClMax[nClViews] = {5.e2, vClSignMax[Int_t(fBsign)], vClSignMax[Int_t(!fBsign)], 0., 0., 0., 0., 0., 5.e2}; | |
b9058d72 | 1061 | const Int_t nTrkltViews(20); |
01ccc21a | 1062 | const Char_t *vTrkltName[nTrkltViews] = { |
808d178e | 1063 | "TrkltY", "TrkltYn", "TrkltYp", "TrkltY", "TrkltYn", "TrkltYp", |
b9058d72 | 1064 | "TrkltRCZ", |
01ccc21a | 1065 | "TrkltPh", "TrkltPhn", "TrkltPhp", |
1066 | "TrkltQ", "TrkltQn", "TrkltQp", | |
82e6e5dc | 1067 | "TrkltQS", "TrkltQSn", "TrkltQSp", |
1068 | "TrkltTBn", "TrkltTBp", "TrkltTBn", "TrkltTBp" | |
01ccc21a | 1069 | // "TrkltYnl0", "TrkltYpl0", "TrkltPhnl0", "TrkltPhpl0", "TrkltQnl0", "TrkltQpl0", // electrons low pt |
1070 | /* "TrkltYnl1", "TrkltYpl1", "TrkltPhnl1", "TrkltPhpl1", "TrkltQnl1", "TrkltQpl1", // muons low pt | |
1071 | "TrkltYnl2", "TrkltYpl2", "TrkltPhnl2", "TrkltPhpl2", "TrkltQnl2", "TrkltQpl2" // pions low pt*/ | |
566c3d46 | 1072 | }; |
808d178e | 1073 | const UChar_t vTrkltOpt[nTrkltViews] = { |
1074 | 0, 0, 0, 1, 1, 1, | |
b9058d72 | 1075 | 0, |
808d178e | 1076 | 0, 0, 0, |
1077 | 0, 0, 0, | |
82e6e5dc | 1078 | 0, 0, 0, |
56838f9d | 1079 | 0, 0, 2, 2 |
808d178e | 1080 | }; |
1081 | const Int_t nTrkInViews(5); | |
35983729 | 1082 | const Char_t *vTrkInName[nTrkInViews][6] = { |
808d178e | 1083 | {"TrkInY", "TrkInYn", "TrkInYp", "TrkInRCZ", "TrkInPhn", "TrkInPhp"}, |
566c3d46 | 1084 | {"TrkInY", "TrkInYn", "TrkInYp", "TrkInRCZ", "TrkInPhn", "TrkInPhp"}, |
35983729 | 1085 | {"TrkInYnl", "TrkInYni", "TrkInYnh", "TrkInYpl", "TrkInYpi", "TrkInYph"}, |
01ccc21a | 1086 | {"TrkInXnl", "TrkInXpl", "TrkInXl", "TrkInYnh", "TrkInYph", "TrkInYh"}, |
1087 | {"TrkInPhnl", "TrkInPhni", "TrkInPhnh", "TrkInPhpl", "TrkInPhpi", "TrkInPhph"}, | |
1088 | //{"TrkInRCX", "TrkInRCY", "TrkInRCPh", "TrkInRCZl", "TrkInRCZi", "TrkInRCZh"} | |
1089 | }; | |
808d178e | 1090 | const UChar_t vTrkInOpt[nTrkInViews] = {0, 1, 0, 0, 0}; |
1091 | const Float_t min[6] = {0.15, 0.15, 0.15, 0.15, 0.5, 0.5}; | |
1092 | const Float_t max[6] = {0.6, 0.6, 0.6, 0.6, 2.3, 2.3}; | |
1093 | 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]"}; | |
1094 | ||
01ccc21a | 1095 | const Int_t nTrkViews(27); |
1096 | const Char_t *vTrkName[nTrkViews] = { | |
1097 | "TrkY", "TrkYn", "TrkYp", | |
1098 | "TrkPh", "TrkPhn", "TrkPhp", | |
1099 | "TrkDPt", "TrkDPtn", "TrkDPtp", | |
1100 | "TrkYnl0", "TrkYpl0", "TrkPhnl0", "TrkPhpl0", "TrkDPtnl0", "TrkDPtpl0", // electrons low pt | |
1101 | "TrkYnl1", "TrkYpl1", "TrkPhnl1", "TrkPhpl1", "TrkDPtnl1", "TrkDPtpl1", // muons low pt | |
1102 | "TrkYnl2", "TrkYpl2", "TrkPhnl2", "TrkPhpl2", "TrkDPtnl2", "TrkDPtpl2" // pions low pt | |
1103 | }; | |
f429b017 | 1104 | const Char_t *typName[] = {"", "MC"}; |
3d98647d | 1105 | const Int_t nx(2048), ny(1536); |
f429b017 | 1106 | |
ff511aa7 | 1107 | if((arr = (TObjArray*)fProj->FindObject("hDet2Cluster"))){ |
5591f3d6 | 1108 | cOut = new TCanvas(Form("%s_DetOccupancy", GetName()), "Detector performance", 2*nx, 2*ny); |
b351a191 | 1109 | cOut->Divide(AliTRDgeometry::kNlayer,AliTRDeventInfo::kCentralityClasses, 1.e-5, 1.e-5); |
3d98647d | 1110 | Int_t n=0; |
b351a191 | 1111 | for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){ |
b351a191 | 1112 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
1113 | p=cOut->cd(icen*AliTRDgeometry::kNlayer+ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712); | |
b9058d72 | 1114 | if(!(h2 = (TH2*)arr->FindObject(Form("HDet%d%dEn", ily, icen)))) continue; |
cc98ff07 | 1115 | if(SetNormZ(h2, 1, -1, 1, -1, 10.) < 1.e3) continue; // cut all bins with < 10 entries |
ea90ffcd | 1116 | SetRangeZ(h2, -90., 90, -200.); |
f985021d | 1117 | //h2->GetXaxis()->SetNdivisions(1010); |
5591f3d6 | 1118 | h2->GetZaxis()->SetTitle("Rel. Det. Occup. [%]"); |
1119 | h2->GetZaxis()->CenterTitle(); | |
cc98ff07 | 1120 | h2->SetContour(9); h2->Draw("colz"); n++; |
95d47440 | 1121 | MakeDetectorPlot(ily, "p"); |
b351a191 | 1122 | } |
1123 | } | |
cc98ff07 | 1124 | if(n>=AliTRDgeometry::kNlayer) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
1125 | ||
5591f3d6 | 1126 | cOut = new TCanvas(Form("%s_DetCharge", GetName()), "Detector performance", nx, ny); |
1127 | cOut->Divide(3,2, 1.e-5, 1.e-5); | |
1128 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ | |
1129 | p=cOut->cd(ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712); | |
95d47440 | 1130 | if(!(h2 = (TH2*)arr->FindObject(Form("HDet%d_2D", UseLYselectTrklt()?fLYselect:ily)))) continue; |
f985021d | 1131 | SetNormZ(h2, 1, -1, 1, -1, 10.); // cut all <q> < 10 |
1132 | SetRangeZ(h2, -30., 30., -200.); | |
1133 | //h2->GetXaxis()->SetNdivisions(1010); | |
5591f3d6 | 1134 | h2->GetZaxis()->SetTitle("Rel. Mean(q) [%]"); |
1135 | h2->GetZaxis()->CenterTitle(); | |
1136 | h2->Draw("colz"); | |
95d47440 | 1137 | MakeDetectorPlot(ily, "p"); |
5591f3d6 | 1138 | } |
1139 | cOut->SaveAs(Form("%s.gif", cOut->GetName())); | |
b351a191 | 1140 | } |
f429b017 | 1141 | for(Int_t ityp(0); ityp<(HasMCdata()?2:1); ityp++){ |
ff511aa7 | 1142 | if((arr = (TObjArray*)fProj->FindObject(ityp?"hCluster2MC":"hCluster2Track"))){ |
f429b017 | 1143 | for(Int_t iview(0); iview<nClViews; iview++){ |
808d178e | 1144 | cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vClName[iview], vClOpt[iview]), "Cluster Resolution", nx, ny); |
f429b017 | 1145 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
1146 | Int_t nplot(0); | |
b9058d72 | 1147 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
1148 | p=cOut->cd(ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712); | |
95d47440 | 1149 | if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s%d_2D", typName[ityp], vClName[iview], UseLYselectTrklt()?fLYselect:ily)))) continue; |
f429b017 | 1150 | nplot++; |
1151 | if(vClOpt[iview]==0) h2->Draw("colz"); | |
95d47440 | 1152 | else if(vClOpt[iview]==1) h2e[ih2e++] = DrawSigma(h2, "#sigma(#Deltay) [#mum]", vClMin[iview], vClMax[iview], 1.e4); |
b9058d72 | 1153 | if(iview<5) MakeDetectorPlot(ily); |
f429b017 | 1154 | } |
b9058d72 | 1155 | if(nplot==AliTRDgeometry::kNlayer) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
f429b017 | 1156 | else delete cOut; |
1157 | } | |
1158 | } | |
1159 | // tracklet systematic | |
ff511aa7 | 1160 | if((arr = (TObjArray*)fProj->FindObject(ityp?"hTracklet2MC":"hTracklet2Track"))){ |
f429b017 | 1161 | for(Int_t iview(0); iview<nTrkltViews; iview++){ |
808d178e | 1162 | cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vTrkltName[iview], vTrkltOpt[iview]), "Tracklet Resolution", nx, ny); |
01ccc21a | 1163 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
1164 | Int_t nplot(0); | |
1165 | for(Int_t iplot(0); iplot<6; iplot++){ | |
1166 | p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); | |
1167 | if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s%d_2D", typName[ityp], vTrkltName[iview], iplot)))) continue; | |
808d178e | 1168 | nplot++; |
1169 | if(vTrkltOpt[iview]==0) h2->Draw("colz"); | |
95d47440 | 1170 | else if (vTrkltOpt[iview]==1) h2e[ih2e++] = DrawSigma(h2, "#sigma(#Deltay) [cm]", .15, .4); |
1171 | else if (vTrkltOpt[iview]==2) h2e[ih2e++] = DrawSigma(h2, "#sigma(occupancy) [%]", 10.5, 15.); | |
82e6e5dc | 1172 | MakeDetectorPlot(iplot); |
f429b017 | 1173 | } |
808d178e | 1174 | if(nplot==6){ |
1175 | cOut->Modified();cOut->Update(); | |
1176 | cOut->SaveAs(Form("%s.gif", cOut->GetName())); | |
1177 | } | |
1178 | delete cOut; | |
f429b017 | 1179 | } |
1180 | } | |
1181 | // trackIn systematic | |
95d47440 | 1182 | for(Int_t iv0(0); iv0<2; iv0++){ |
1183 | const Char_t *prefix = ityp?"MC":(iv0?"V0":""); | |
1184 | if(ityp && !iv0) arr = (TObjArray*)fProj->FindObject("hTRDin2MC"); | |
1185 | else if(!ityp && !iv0) arr = (TObjArray*)fProj->FindObject("hTracklet2TRDin"); | |
1186 | else if(!ityp && iv0) arr = (TObjArray*)fProj->FindObject("hTracklet2TRDinV0"); | |
1187 | else continue; | |
1188 | if(arr){ | |
1189 | for(Int_t iview(0); iview<nTrkInViews; iview++){ | |
1190 | cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), prefix, vTrkInName[iview][0], vTrkInOpt[iview]), "Track IN Resolution", nx, ny); | |
1191 | cOut->Divide(3,2, 1.e-5, 1.e-5); | |
1192 | Int_t nplot(0); | |
1193 | for(Int_t iplot(0); iplot<6; iplot++){ | |
1194 | p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); | |
1195 | if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s_2D", prefix, vTrkInName[iview][iplot])))){ | |
1196 | AliInfo(Form("Missing H%s%s_2D", prefix, vTrkInName[iview][iplot])); | |
1197 | continue; | |
1198 | } | |
1199 | nplot++; | |
1200 | if(vTrkInOpt[iview]==0) h2->Draw("colz"); | |
1201 | else h2e[ih2e++] = DrawSigma(h2, ttt[iplot], min[iplot], max[iplot]); | |
1202 | MakeDetectorPlot(0); | |
f073d500 | 1203 | } |
95d47440 | 1204 | if(nplot==6) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
1205 | else delete cOut; | |
f073d500 | 1206 | } |
95d47440 | 1207 | // species |
1208 | const Float_t zmin[] = {1., 61., 15.}, | |
1209 | zmax[] = {10., 79., 33.}; | |
1210 | cOut = new TCanvas(Form("%s_%sTrkInSpc", GetName(), prefix), "Track IN PID", Int_t(1.5*ny), Int_t(1.5*ny)); | |
cc98ff07 | 1211 | cOut->Divide(3,3, 1.e-5, 1.e-5); |
95d47440 | 1212 | Int_t nplot(0); const Char_t *chName[] = {"p", "n", ""}; |
f985021d | 1213 | for(Int_t ich(0), ipad(1); ich<3; ich++){ |
95d47440 | 1214 | TH2 *h2s(NULL); |
1215 | if(!(h2s = (TH2*)arr->FindObject(Form("H%sTrkInY%sEn", prefix, chName[ich])))) { | |
1216 | AliInfo(Form("Missing H%sTrkIn%sEn", prefix, chName[ich])); | |
1217 | continue; | |
1218 | } | |
1219 | Int_t irebin(0), dxBin(1), dyBin(1); | |
1220 | const Int_t nrebin(5); Int_t rebinX[nrebin] = {1, 2, 1, 2, 1}, rebinY[nrebin] = {2, 1, 2, 1, 2}; | |
1221 | if(h2s->GetNbinsY()==180){ // old binning | |
1222 | rebinX[0] = 1; rebinY[0] = 2; | |
1223 | rebinX[1] = 2; rebinY[1] = 1; | |
1224 | rebinX[2] = 2; rebinY[2] = 1; | |
1225 | rebinX[3] = 1; rebinY[3] = 5; | |
1226 | rebinX[4] = 1; rebinY[4] = 1; // dummy | |
1227 | } | |
1228 | while(irebin<nrebin && (AliTRDrecoTask::GetMeanStat(h2s, .5, 1)<200)){ | |
1229 | h2s->Rebin2D(rebinX[irebin], rebinY[irebin]); | |
1230 | dxBin*=rebinX[irebin];dyBin*=rebinY[irebin];irebin++; | |
1231 | } | |
1232 | AliDebug(2, Form("Rebin level[%d] @ chg[%d]. Binning[%2dx%2d]", irebin, ich, h2s->GetNbinsX(), h2s->GetNbinsY())); | |
cc98ff07 | 1233 | for(Int_t ispec(0); ispec<kNspc; ispec++){ |
f985021d | 1234 | p=cOut->cd(ipad++); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); |
95d47440 | 1235 | if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkInY%s%dEn", prefix, chName[ich], ispec)))) { |
1236 | AliInfo(Form("Missing H%sTrkIn%s%dEn", prefix, chName[ich], ispec)); | |
f985021d | 1237 | continue; |
1238 | } | |
1239 | nplot++; | |
95d47440 | 1240 | h2->Rebin2D(dxBin,dyBin); |
1241 | h2->Divide(h2, h2s, 1.e2); | |
1242 | h2->SetContour(9); | |
1243 | h2->GetZaxis()->SetRangeUser(zmin[ispec], zmax[ispec]); | |
1244 | h2->GetZaxis()->SetTitle("Rel. Abundancy [%]");h2->GetZaxis()->CenterTitle(); | |
1245 | TString tit(h2->GetTitle()); TObjArray *atit = tit.Tokenize("::"); | |
1246 | h2->SetTitle(Form("%s :: Relative Abundancy", ((*atit)[0])->GetName())); | |
1247 | atit->Delete(); delete atit; | |
f985021d | 1248 | h2->Draw("colz"); |
1249 | MakeDetectorPlot(0); | |
1250 | } | |
1251 | } | |
cc98ff07 | 1252 | if(nplot==9) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
f985021d | 1253 | else delete cOut; |
95d47440 | 1254 | // pt resolution plot |
1255 | cOut = new TCanvas(Form("%s_%sTrkInPt", GetName(), prefix), "TrackIn Pt", Int_t(1.5*ny), Int_t(1.5*ny)); | |
1256 | cOut->Divide(3,2, 1.e-5, 1.e-5); | |
1257 | for(Int_t ich(0), ipad(1); ich<2; ich++){ | |
1258 | for(Int_t ispc(0); ispc<kNspc; ispc++){ | |
1259 | p=cOut->cd(ipad++); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712); | |
1260 | if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkInPt%s%d_2D", prefix, chName[ich], ispc)))) continue; | |
1261 | h2->GetZaxis()->SetRangeUser(0.5, 1.2); h2->SetContour(7); h2->Draw("colz"); | |
1262 | MakeDetectorPlot(0); | |
1263 | } | |
1264 | } | |
1265 | cOut->SaveAs(Form("%s.gif", cOut->GetName())); | |
1266 | // MPV(Q) & <Q plots> | |
1267 | const char *chQ[] = {"Q", "QS"}; | |
1268 | for(Int_t iq(0); iq<2; iq++){ | |
1269 | cOut = new TCanvas(Form("%s_%sTrkIn%s", GetName(), prefix, chQ[iq]), "Track IN PID", Int_t(1.5*ny), Int_t(1.5*ny)); | |
1270 | cOut->Divide(3,3, 1.e-5, 1.e-5); | |
1271 | nplot=0; | |
1272 | for(Int_t ich(0), ipad(1); ich<3; ich++){ | |
1273 | for(Int_t ispec(0); ispec<kNspc; ispec++){ | |
1274 | p=cOut->cd(ipad++); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); | |
1275 | if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkIn%s%s%d_2D", prefix, chQ[iq], chName[ich], ispec)))) { | |
1276 | AliInfo(Form("Missing H%sTrkIn%s%s%d_2D", prefix, chQ[iq], chName[ich], ispec)); | |
1277 | continue; | |
1278 | } | |
1279 | nplot++; | |
1280 | h2->Draw("colz"); | |
1281 | MakeDetectorPlot(0); | |
1282 | } | |
1283 | } | |
1284 | if(nplot==9) cOut->SaveAs(Form("%s.gif", cOut->GetName())); | |
1285 | else delete cOut; | |
1286 | } | |
f985021d | 1287 | } |
3ed01fbe | 1288 | } |
3ceb45ae | 1289 | } |
f429b017 | 1290 | // track MC systematic |
ff511aa7 | 1291 | if((arr = (TObjArray*)fProj->FindObject("hTRD2MC"))) { |
f429b017 | 1292 | for(Int_t iview(0); iview<nTrkViews; iview++){ |
01ccc21a | 1293 | cOut = new TCanvas(Form("%s_MC%s", GetName(), vTrkName[iview]), "Track Resolution", nx, ny); |
0b30040d | 1294 | cOut->Divide(3,2, 1.e-5, 1.e-5); |
09c85be5 | 1295 | Int_t nplot(0); |
3ed01fbe | 1296 | for(Int_t iplot(0); iplot<6; iplot++){ |
1297 | p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712); | |
01ccc21a | 1298 | if(!(h2 = (TH2*)arr->FindObject(Form("HMC%s%d_2D", vTrkName[iview], iplot)))) continue; |
09c85be5 | 1299 | h2->Draw("colz"); nplot++; |
3ed01fbe | 1300 | } |
01ccc21a | 1301 | if(nplot==6) cOut->SaveAs(Form("%s.gif", cOut->GetName())); |
09c85be5 | 1302 | else delete cOut; |
3ed01fbe | 1303 | } |
1304 | } | |
3ceb45ae | 1305 | gStyle->SetPalette(1); |
95d47440 | 1306 | |
1307 | // clean histos | |
1308 | for(Int_t ih(ih2e); ih--;) delete h2e[ih]; | |
068e2c00 | 1309 | } |
1310 | ||
0b30040d | 1311 | //________________________________________________________ |
95d47440 | 1312 | TH2* AliTRDresolution::DrawSigma(TH2 *h2, const Char_t *title, Float_t m, Float_t M, Float_t scale) |
0b30040d | 1313 | { |
1314 | // Draw error bars scaled with "scale" instead of content values | |
1315 | //use range [m,M] if limits are specified | |
1316 | ||
95d47440 | 1317 | if(!h2) return NULL; |
808d178e | 1318 | TAxis *ax(h2->GetXaxis()), *ay(h2->GetYaxis()); |
1319 | TH2F *h2e = new TH2F(Form("%s_E", h2->GetName()), | |
1320 | Form("%s;%s;%s;%s", h2->GetTitle(), ax->GetTitle(), ay->GetTitle(), title), | |
1321 | ax->GetNbins(), ax->GetXmin(), ax->GetXmax(), | |
1322 | ay->GetNbins(), ay->GetXmin(), ay->GetXmax()); | |
1323 | h2e->SetContour(9); | |
1324 | TAxis *az(h2e->GetZaxis()); | |
1325 | if(M>m) az->SetRangeUser(m, M); | |
1326 | az->CenterTitle(); | |
1327 | az->SetTitleOffset(1.5); | |
0b30040d | 1328 | for(Int_t ix(1); ix<=h2->GetNbinsX(); ix++){ |
1329 | for(Int_t iy(1); iy<=h2->GetNbinsY(); iy++){ | |
1330 | if(h2->GetBinContent(ix, iy)<-100.) continue; | |
1331 | Float_t v(scale*h2->GetBinError(ix, iy)); | |
1332 | if(M>m && v<m) v=m+TMath::Abs((M-m)*1.e-3); | |
1333 | h2e->SetBinContent(ix, iy, v); | |
1334 | } | |
1335 | } | |
1336 | h2e->Draw("colz"); | |
95d47440 | 1337 | return h2e; |
0b30040d | 1338 | } |
1339 | ||
068e2c00 | 1340 | //________________________________________________________ |
1341 | void AliTRDresolution::GetRange(TH2 *h2, Char_t mod, Float_t *range) | |
1342 | { | |
01ccc21a | 1343 | // Returns the range of the bulk of data in histogram h2. Removes outliers. |
068e2c00 | 1344 | // The "range" vector should be initialized with 2 elements |
1345 | // Option "mod" can be any of | |
01ccc21a | 1346 | // - 0 : gaussian like distribution |
1347 | // - 1 : tailed distribution | |
068e2c00 | 1348 | |
1349 | Int_t nx(h2->GetNbinsX()) | |
1350 | , ny(h2->GetNbinsY()) | |
1351 | , n(nx*ny); | |
1352 | Double_t *data=new Double_t[n]; | |
1353 | for(Int_t ix(1), in(0); ix<=nx; ix++){ | |
1354 | for(Int_t iy(1); iy<=ny; iy++) | |
1355 | data[in++] = h2->GetBinContent(ix, iy); | |
00a3f7a4 | 1356 | } |
068e2c00 | 1357 | Double_t mean, sigm; |
1358 | AliMathBase::EvaluateUni(n, data, mean, sigm, Int_t(n*.8)); | |
1359 | ||
1360 | range[0]=mean-3.*sigm; range[1]=mean+3.*sigm; | |
01ccc21a | 1361 | if(mod==1) range[0]=TMath::Max(Float_t(1.e-3), range[0]); |
068e2c00 | 1362 | AliDebug(2, Form("h[%s] range0[%f %f]", h2->GetName(), range[0], range[1])); |
1363 | TH1S h1("h1SF0", "", 100, range[0], range[1]); | |
1364 | h1.FillN(n,data,0); | |
1365 | delete [] data; | |
01ccc21a | 1366 | |
068e2c00 | 1367 | switch(mod){ |
01ccc21a | 1368 | case 0:// gaussian distribution |
068e2c00 | 1369 | { |
1370 | TF1 fg("fg", "gaus", mean-3.*sigm, mean+3.*sigm); | |
1371 | h1.Fit(&fg, "QN"); | |
1372 | mean=fg.GetParameter(1); sigm=fg.GetParameter(2); | |
1373 | range[0] = mean-2.5*sigm;range[1] = mean+2.5*sigm; | |
1374 | AliDebug(2, Form(" rangeG[%f %f]", range[0], range[1])); | |
1375 | break; | |
00a3f7a4 | 1376 | } |
01ccc21a | 1377 | case 1:// tailed distribution |
1378 | { | |
068e2c00 | 1379 | Int_t bmax(h1.GetMaximumBin()); |
1380 | Int_t jBinMin(1), jBinMax(100); | |
1381 | for(Int_t ibin(bmax); ibin--;){ | |
61f6b45e | 1382 | if(h1.GetBinContent(ibin)<1.){ |
068e2c00 | 1383 | jBinMin=ibin; break; |
1384 | } | |
1385 | } | |
1386 | for(Int_t ibin(bmax); ibin++;){ | |
61f6b45e | 1387 | if(h1.GetBinContent(ibin)<1.){ |
068e2c00 | 1388 | jBinMax=ibin; break; |
1389 | } | |
00a3f7a4 | 1390 | } |
068e2c00 | 1391 | range[0]=h1.GetBinCenter(jBinMin); range[1]=h1.GetBinCenter(jBinMax); |
1392 | AliDebug(2, Form(" rangeT[%f %f]", range[0], range[1])); | |
1393 | break; | |
1394 | } | |
00a3f7a4 | 1395 | } |
00a3f7a4 | 1396 | |
068e2c00 | 1397 | return; |
1398 | } | |
1399 | ||
f073d500 | 1400 | //________________________________________________________ |
1401 | Bool_t AliTRDresolution::MakeProjectionDetector() | |
1402 | { | |
1403 | // Analyse cluster | |
1404 | const Int_t kNcontours(9); | |
1405 | const Int_t kNstat(100); | |
1406 | if(fProj && fProj->At(kDetector)) return kTRUE; | |
1407 | if(!fContainer){ | |
1408 | AliError("Missing data container."); | |
1409 | return kFALSE; | |
1410 | } | |
1411 | THnSparse *H(NULL); | |
1412 | if(!(H = (THnSparse*)fContainer->FindObject("hDet2Cluster"))){ | |
95d47440 | 1413 | AliInfo("Missing/Wrong data @ hDet2Cluster."); |
f073d500 | 1414 | return kTRUE; |
1415 | } | |
1416 | Int_t ndim(H->GetNdimensions()); | |
1417 | Int_t coord[kNdim]; memset(coord, 0, sizeof(Int_t) * kNdim); Double_t v = 0.; | |
b9058d72 | 1418 | TAxis *aa[kNdim], *an(NULL); memset(aa, 0, sizeof(TAxis*) * kNdim); |
f073d500 | 1419 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
b9058d72 | 1420 | if(ndim < 5) aa[4] = new TAxis(1, -0.5, 0.5); |
1421 | Int_t nPad(1); | |
1422 | if(ndim > 5){ | |
1423 | an = H->GetAxis(5); | |
1424 | nPad = kNpads+1; | |
f073d500 | 1425 | } |
1426 | // build list of projections | |
b9058d72 | 1427 | const Int_t nsel(8*AliTRDgeometry::kNlayer*AliTRDeventInfo::kCentralityClasses); |
f073d500 | 1428 | // define rebinning strategy |
0f2c4c4f | 1429 | const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 1, 2, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2}; |
1430 | if(aa[1]->GetNbins()==180){ // old binning | |
1431 | rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2; | |
1432 | rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1; | |
1433 | rebinEtaPhiX[2] = 2; rebinEtaPhiY[2] = 1; | |
1434 | rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5; | |
1435 | rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy | |
1436 | } | |
b9058d72 | 1437 | //const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"}; |
1438 | const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"}; | |
eb05d549 | 1439 | AliTRDrecoProjection hp[kDetNproj]; TObjArray php(kDetNproj); |
95d47440 | 1440 | Int_t ih(0), isel(-1), np[nsel]={0}; |
b9058d72 | 1441 | for(Int_t ipad(0); ipad<nPad; ipad++){ |
1442 | for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){ | |
1443 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ | |
1444 | isel++; // new selection | |
1445 | hp[ih].Build(Form("HDet%d%d%d", ily, icen, ipad), | |
1446 | Form("Detectors :: Ly[%d] Cen[%s] Pads[%s]", ily, cenName[icen], ipad?(ipad<kNpads?Form("%d", ipad+1):Form(">%d", kNpads)):"deconv"), | |
1447 | kEta, kPhi, 4, aa); | |
1448 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1449 | hp[ih].SetShowRange(10., 55.); | |
1450 | php.AddLast(&hp[ih++]); np[isel]++; | |
1451 | } | |
f073d500 | 1452 | } |
1453 | } | |
1454 | AliInfo(Form("Build %3d 3D projections.", ih)); | |
1455 | ||
b9058d72 | 1456 | Int_t ly(0), cen(0), npad(0); |
f073d500 | 1457 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
1458 | v = H->GetBinContent(ib, coord); if(v<1.) continue; | |
b9058d72 | 1459 | ly = coord[kBC]-1; // layer selection |
1460 | cen = coord[kYrez]-1; // centrality selection | |
1461 | npad = 0; // no. of pads selection | |
1462 | if(an) npad = TMath::Min(coord[5]-1, Int_t(kNpads)); | |
1463 | isel = npad*AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer+cen*AliTRDgeometry::kNlayer+ly; | |
eb05d549 | 1464 | ((AliTRDrecoProjection*)php.At(isel))->Increment(coord, v); |
1465 | //Int_t ioff=isel;for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); | |
f073d500 | 1466 | } |
1467 | TObjArray *arr(NULL); | |
1468 | fProj->AddAt(arr = new TObjArray(kDetNproj), kDetector); | |
95d47440 | 1469 | arr->SetName("hDet2Cluster"); arr->SetOwner(); |
f073d500 | 1470 | |
1471 | TH2 *h2(NULL); Int_t jh(0); | |
1472 | for(; ih--; ){ | |
eb05d549 | 1473 | if(!hp[ih].H()) continue; |
95d47440 | 1474 | if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++); |
1475 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) arr->AddAt(h2, jh++); | |
f073d500 | 1476 | } |
eb05d549 | 1477 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
f073d500 | 1478 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
b9058d72 | 1479 | for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){ |
eb05d549 | 1480 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, 0)))){ |
b9058d72 | 1481 | for(Int_t ipad(1); ipad<nPad; ipad++){ |
eb05d549 | 1482 | if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, ipad)))){ |
b9058d72 | 1483 | (*pr0)+=(*pr1); |
1484 | } | |
f073d500 | 1485 | } |
eb05d549 | 1486 | pr0->H()->SetNameTitle(Form("HDet%d%d", ily, icen), Form("Detectors :: Ly[%d] Cen[%s]", ily, cenName[icen])); |
b9058d72 | 1487 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 | 1488 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
1489 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))) (*pr1)+=(*pr0); | |
f073d500 | 1490 | } |
b9058d72 | 1491 | } |
eb05d549 | 1492 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))){ |
95d47440 | 1493 | pr0->H()->SetNameTitle(Form("HDet%d", UseLYselectTrklt()?fLYselect:ily), Form("Detectors :: Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); |
f073d500 | 1494 | if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); |
1495 | } | |
1496 | } | |
1497 | AliInfo(Form("Done %3d 2D projections.", jh)); | |
1498 | return kTRUE; | |
1499 | } | |
3ceb45ae | 1500 | |
068e2c00 | 1501 | //________________________________________________________ |
f429b017 | 1502 | Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc) |
068e2c00 | 1503 | { |
3ceb45ae | 1504 | // Analyse cluster |
3ed01fbe | 1505 | const Int_t kNcontours(9); |
808d178e | 1506 | const Int_t kNstat(100); |
f429b017 | 1507 | Int_t cidx=mc?kMCcluster:kCluster; |
3ceb45ae | 1508 | if(fProj && fProj->At(cidx)) return kTRUE; |
1509 | if(!fContainer){ | |
1510 | AliError("Missing data container."); | |
1511 | return kFALSE; | |
1512 | } | |
f073d500 | 1513 | const Char_t *projName[] = {"hCluster2Track", "hCluster2MC"}; |
3ceb45ae | 1514 | THnSparse *H(NULL); |
f073d500 | 1515 | if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){ |
1516 | AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)])); | |
ff511aa7 | 1517 | return kTRUE; |
3ceb45ae | 1518 | } |
178d284a | 1519 | Int_t ndim(H->GetNdimensions()); Bool_t debug(ndim>Int_t(kNdimCl)); |
c6100e2a | 1520 | Int_t coord[10]; memset(coord, 0, sizeof(Int_t) * 10); Double_t v = 0.; |
b9058d72 | 1521 | TAxis *aa[kNdim], *as(NULL), *apt(NULL), *acen(NULL), *anp(NULL); memset(aa, 0, sizeof(TAxis*) * kNdim); |
3ed01fbe | 1522 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
178d284a | 1523 | if(ndim > Int_t(kPt)) apt = H->GetAxis(kPt); |
1524 | if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC); | |
b9058d72 | 1525 | if(ndim > Int_t(kNdim)) acen = H->GetAxis(kNdim); |
1526 | if(ndim > Int_t(kNdim)+1) anp = H->GetAxis(kNdim+1); | |
1527 | // calculate size depending on debug level | |
1528 | const Int_t nCh(apt?2:1); | |
1529 | const Int_t nCen(acen?Int_t(AliTRDeventInfo::kCentralityClasses):1); | |
1530 | const Int_t nNpad(anp?(Int_t(kNpads)+1):1); | |
1531 | ||
3ed01fbe | 1532 | // build list of projections |
b9058d72 | 1533 | const Int_t nsel(AliTRDgeometry::kNlayer*kNcharge*(kNpads+1)*AliTRDeventInfo::kCentralityClasses); |
3ed01fbe | 1534 | // define rebinning strategy |
0f2c4c4f | 1535 | const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2}; |
1536 | if(aa[1]->GetNbins()==180){ // old binning | |
1537 | rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2; | |
1538 | rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1; | |
1539 | rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1; | |
1540 | rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5; | |
1541 | rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy | |
1542 | } | |
eb05d549 | 1543 | AliTRDrecoProjection hp[kClNproj]; TObjArray php(kClNproj); |
01ccc21a | 1544 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
b9058d72 | 1545 | const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"}; |
3ed01fbe | 1546 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
3ceb45ae | 1547 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
b9058d72 | 1548 | for(Int_t ich(0); ich<nCh; ich++){ |
1549 | for(Int_t icen(0); icen<nCen; icen++){ | |
1550 | for(Int_t ipad(0); ipad<nNpad; ipad++){ | |
1551 | isel++; // new selection | |
1552 | hp[ih].Build(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), | |
1553 | 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"), | |
1554 | kEta, kPhi, kYrez, aa); | |
1555 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1556 | php.AddLast(&hp[ih++]); np[isel]++; | |
1557 | if(!debug) break; | |
1558 | hp[ih].Build(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), | |
1559 | 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"), | |
1560 | kEta, kPhi, kSpeciesChgRC, aa); | |
1561 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1562 | hp[ih].SetShowRange(24., 33.); | |
1563 | php.AddLast(&hp[ih++]); np[isel]++; | |
1564 | hp[ih].Build(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), | |
1565 | 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"), | |
1566 | kPrez, kZrez, kYrez, aa); | |
1567 | php.AddLast(&hp[ih++]); np[isel]++; | |
1568 | hp[ih].Build(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad), | |
1569 | 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"), | |
1570 | kPrez, kPt, kYrez, aa); | |
1571 | php.AddLast(&hp[ih++]); np[isel]++; | |
1572 | } | |
1573 | } | |
01ccc21a | 1574 | } |
3ceb45ae | 1575 | } |
0f2c4c4f | 1576 | AliInfo(Form("Build %3d 3D %s projections.", ih, mc?"MC":"")); |
3ed01fbe | 1577 | |
eb05d549 | 1578 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
b9058d72 | 1579 | 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 | 1580 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
3ed01fbe | 1581 | v = H->GetBinContent(ib, coord); if(v<1.) continue; |
1582 | ly = coord[kBC]-1; | |
1583 | // RC selection | |
1584 | if(rcBin>0 && coord[kSpeciesChgRC] == rcBin) continue; | |
1585 | ||
1586 | // charge selection | |
1587 | ch = 0; // [-] track | |
1588 | if(chBin>0 && coord[kPt] > chBin) ch = 1; // [+] track | |
b9058d72 | 1589 | cen = 0; // centrality selection |
1590 | if(acen) cen = coord[kNdim]-1; | |
1591 | npad = 0; // no. of pads selection | |
1592 | if(anp) npad = TMath::Min(coord[kNdim+1]-1, Int_t(kNpads)); | |
3ed01fbe | 1593 | |
49ed65ad | 1594 | if(debug){ |
b9058d72 | 1595 | isel = ly*nCh*nCen*nNpad |
1596 | +ch*nCen*nNpad | |
1597 | +cen*nNpad | |
1598 | +npad; | |
1599 | ioff=isel*4; | |
49ed65ad | 1600 | } else { |
fb7cacec | 1601 | if(mc && ly<0) ly=0; // fix for bug in PlotMC |
49ed65ad | 1602 | isel = ly; ioff = isel; |
1603 | } | |
b9058d72 | 1604 | if(ioff>=ih){ |
1605 | AliError(Form("Wrong selection %d [%3d]", ioff, ih)); | |
1606 | return kFALSE; | |
1607 | } | |
eb05d549 | 1608 | if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) { |
b9058d72 | 1609 | AliError(Form("Missing projection %d", ioff)); |
1610 | return kFALSE; | |
1611 | } | |
eb05d549 | 1612 | if(strcmp(pr0->H()->GetName(), Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ch], ly, cen, npad))!=0){ |
1613 | AliError(Form("Projection mismatch :: request[H%sClY%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ly, cen, npad, pr0->H()->GetName())); | |
b9058d72 | 1614 | return kFALSE; |
1615 | } | |
eb05d549 | 1616 | for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); |
3ceb45ae | 1617 | } |
33056e04 | 1618 | if(HasDump3DFor(kCluster)){ |
1619 | TDirectory *cwd = gDirectory; | |
95d47440 | 1620 | TFile::Open(Form("DumpRes_%s.root", H->GetName()), "RECREATE"); |
33056e04 | 1621 | for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){ |
1622 | if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue; | |
1623 | if(!pr0->H()) continue; | |
1624 | TH3 *h3=(TH3*)pr0->H()->Clone(); | |
1625 | h3->Write(); | |
1626 | } | |
1627 | gFile->Close(); | |
1628 | cwd->cd(); | |
1629 | } | |
1630 | ||
3ceb45ae | 1631 | TObjArray *arr(NULL); |
0b366e97 | 1632 | fProj->AddAt(arr = new TObjArray(kClNproj), cidx); |
95d47440 | 1633 | arr->SetName(projName[Int_t(mc)]); arr->SetOwner(); |
3ed01fbe | 1634 | |
01ccc21a | 1635 | TH2 *h2(NULL); Int_t jh(0); |
3ed01fbe | 1636 | for(; ih--; ){ |
eb05d549 | 1637 | if(!hp[ih].H()) continue; |
1638 | if(strchr(hp[ih].H()->GetName(), 'Q')){ | |
95d47440 | 1639 | if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++); |
1640 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) arr->AddAt(h2, jh++); | |
b9058d72 | 1641 | } else { |
1642 | if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); | |
1643 | } | |
01ccc21a | 1644 | } |
aebcb1ff | 1645 | Double_t m(0.), s(0.), se(0.), trend(0.); |
01ccc21a | 1646 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ |
b9058d72 | 1647 | for(Int_t ich(0); ich<nCh; ich++){ |
1648 | for(Int_t icen(0); icen<nCen; icen++){ | |
1649 | /*!dy*/ | |
eb05d549 | 1650 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 | 1651 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 | 1652 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 | 1653 | (*pr0)+=(*pr1); |
1654 | } | |
eb05d549 | 1655 | 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 | 1656 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 | 1657 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 | 1658 | } |
1659 | /*!Q*/ | |
eb05d549 | 1660 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 | 1661 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 | 1662 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 | 1663 | (*pr0)+=(*pr1); |
1664 | } | |
eb05d549 | 1665 | 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 | 1666 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 | 1667 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
1668 | pr0->H()->SetName(Form("H%sClQS%c%d%d", mc?"MC":"", chName[ich], ily, icen)); | |
b9058d72 | 1669 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
eb05d549 | 1670 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 | 1671 | } |
1672 | /*!YXTC*/ | |
eb05d549 | 1673 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 | 1674 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 | 1675 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 | 1676 | (*pr0)+=(*pr1); |
1677 | } | |
eb05d549 | 1678 | 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 | 1679 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 | 1680 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 | 1681 | } |
1682 | /*!YXPh*/ | |
eb05d549 | 1683 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){ |
b9058d72 | 1684 | for(Int_t ipad(1); ipad<nNpad; ipad++){ |
33056e04 | 1685 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue; |
b9058d72 | 1686 | (*pr0)+=(*pr1); |
1687 | } | |
eb05d549 | 1688 | 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 | 1689 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 | 1690 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 | 1691 | } |
1692 | } // end centrality integration | |
1693 | /*!dy*/ | |
eb05d549 | 1694 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
95d47440 | 1695 | pr0->H()->SetNameTitle(Form("H%sClY%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), |
1696 | Form("Clusters[%c]:: #Deltay Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
808d178e | 1697 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 | 1698 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
808d178e | 1699 | } |
b9058d72 | 1700 | /*!Q*/ |
eb05d549 | 1701 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
95d47440 | 1702 | pr0->H()->SetNameTitle(Form("H%sClQ%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), |
1703 | Form("Clusters[%c]:: Q Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
b9058d72 | 1704 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); |
95d47440 | 1705 | pr0->H()->SetName(Form("H%sClQS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily)); |
b9058d72 | 1706 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
eb05d549 | 1707 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 | 1708 | } |
1709 | /*!YXTC*/ | |
eb05d549 | 1710 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
95d47440 | 1711 | pr0->H()->SetNameTitle(Form("H%sClYXTC%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), |
1712 | Form("Clusters[%c]:: #Deltay(x,TC) Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
808d178e | 1713 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 | 1714 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
808d178e | 1715 | } |
b9058d72 | 1716 | /*!YXPh*/ |
eb05d549 | 1717 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){ |
95d47440 | 1718 | pr0->H()->SetNameTitle(Form("H%sClYXPh%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), |
1719 | Form("Clusters[%c]:: #Deltay(x,#Phi) Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
b9058d72 | 1720 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
eb05d549 | 1721 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0); |
b9058d72 | 1722 | } |
1723 | } // end charge integration | |
1724 | /*!dy*/ | |
eb05d549 | 1725 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){ |
95d47440 | 1726 | pr0->H()->SetNameTitle(Form("H%sClY%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Clusters :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); |
b9058d72 | 1727 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
aebcb1ff | 1728 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.) PutTrendValue(Form("%sClS%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), s, se); |
808d178e | 1729 | } |
b9058d72 | 1730 | /*!YXPh*/ |
eb05d549 | 1731 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){ |
95d47440 | 1732 | pr0->H()->SetNameTitle(Form("H%sClYXPh%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Clusters :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); |
b9058d72 | 1733 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
1734 | } | |
1735 | ||
00a3f7a4 | 1736 | } |
0f2c4c4f | 1737 | AliInfo(Form("Done %3d 2D %s projections.", jh, mc?"MC":"")); |
3ceb45ae | 1738 | return kTRUE; |
00a3f7a4 | 1739 | } |
1740 | ||
3ceb45ae | 1741 | //________________________________________________________ |
f429b017 | 1742 | Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc) |
3ceb45ae | 1743 | { |
1744 | // Analyse tracklet | |
3ed01fbe | 1745 | const Int_t kNcontours(9); |
566c3d46 | 1746 | const Int_t kNstat(30); |
01ccc21a | 1747 | const Int_t kNstatQ(30); |
f429b017 | 1748 | Int_t cidx=mc?kMCtracklet:kTracklet; |
95d47440 | 1749 | if(!fProj){ |
1750 | AliError("Missing results container."); | |
1751 | return kFALSE; | |
1752 | } | |
3ceb45ae | 1753 | if(!fContainer){ |
1754 | AliError("Missing data container."); | |
1755 | return kFALSE; | |
1756 | } | |
f073d500 | 1757 | const Char_t *projName[] = {"hTracklet2Track", "hTracklet2MC"}; |
3ceb45ae | 1758 | THnSparse *H(NULL); |
f073d500 | 1759 | if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){ |
1760 | AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)])); | |
ff511aa7 | 1761 | return kTRUE; |
3ceb45ae | 1762 | } |
82e6e5dc | 1763 | const Int_t mdim(kNdim+8); |
95d47440 | 1764 | Int_t ndim(H->GetNdimensions()); //Bool_t debug(ndim>Int_t(kNdimTrklt)); |
82e6e5dc | 1765 | Int_t coord[mdim]; memset(coord, 0, sizeof(Int_t) * mdim); Double_t v = 0.; |
8892a7f3 | 1766 | TAxis *aa[mdim], *as(NULL), *ap(NULL), *ac(NULL); memset(aa, 0, sizeof(TAxis*) * mdim); |
3ed01fbe | 1767 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
178d284a | 1768 | if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC); // init species/charge selection |
1769 | if(ndim > Int_t(kPt)) ap = H->GetAxis(kPt); // init pt selection | |
95d47440 | 1770 | // if(ndim > Int_t(kNdim)) ac = H->GetAxis(kNdim); // init centrality selection |
8892a7f3 | 1771 | // calculate size depending on debug level |
95d47440 | 1772 | const Int_t nCen(ac?Int_t(AliTRDeventInfo::kCentralityClasses):1); |
1773 | const Int_t nPt(ap?Int_t(fNpt+2):1); | |
1774 | const Int_t nSpc(as?Int_t(kNspc):1); | |
1775 | const Int_t nCh(as?Int_t(kNcharge):1); | |
1776 | const Int_t nLy(UseLYselectTrklt()?1:AliTRDgeometry::kNlayer); | |
8892a7f3 | 1777 | |
3ed01fbe | 1778 | // build list of projections |
95d47440 | 1779 | const Int_t nsel(AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer*(fgNPt+2)*(AliPID::kSPECIES*kNcharge + 1)); |
3ed01fbe | 1780 | // define rebinning strategy |
0f2c4c4f | 1781 | const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2}; |
1782 | if(aa[1]->GetNbins()==180){ // old binning | |
1783 | rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2; | |
1784 | rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1; | |
1785 | rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1; | |
1786 | rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5; | |
1787 | rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy | |
1788 | } | |
eb05d549 | 1789 | AliTRDrecoProjection hp[kTrkltNproj]; TObjArray php(kTrkltNproj); |
3ed01fbe | 1790 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
566c3d46 | 1791 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
95d47440 | 1792 | const Char_t ptShortName[5] = {'L', 'l', 'i', 'h', 'H'}; |
1793 | Char_t ptName[fgNPt+2] = {0}; | |
1794 | Char_t *ptCut[fgNPt+2] = {NULL}; | |
1795 | ||
b9058d72 | 1796 | // const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"}; |
1797 | const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"}; | |
8892a7f3 | 1798 | for(Int_t icen(0); icen<nCen; icen++){ |
95d47440 | 1799 | for(Int_t ily(0); ily<nLy; ily++){ |
8892a7f3 | 1800 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
95d47440 | 1801 | if(!ptName[ipt]){ |
1802 | ptName[ipt]= nPt>5?(64+ipt):ptShortName[ipt]; | |
1803 | ptCut[ipt] = StrDup(Form("#it{%4.2f<=p_{t}^{%s}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., mc?"MC":"", ipt>fgNPt?99.99:fgPt[ipt])); | |
1804 | } | |
8892a7f3 | 1805 | for(Int_t isp(0); isp<nSpc; isp++){ |
1806 | for(Int_t ich(0); ich<nCh; ich++){ | |
1807 | isel++; // new selection | |
95d47440 | 1808 | AliDebug(3, Form("Building sel[%3d|%4d]", isel, ih)); |
1809 | hp[ih].Build(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen), | |
1810 | Form("Tracklets[%s%c]:: #Deltay{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]), | |
8892a7f3 | 1811 | kEta, kPhi, kYrez, aa); |
1812 | //hp[ih].SetShowRange(-0.1,0.1); | |
1813 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1814 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 1815 | hp[ih].Build(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen), |
1816 | Form("Tracklets[%s%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]), | |
8892a7f3 | 1817 | kEta, kPhi, kPrez, aa); |
1818 | //hp[ih].SetShowRange(-0.5,0.5); | |
1819 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1820 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 1821 | hp[ih].Build(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen), |
1822 | Form("Tracklets[%s%c]:: dQdl{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]), | |
b9058d72 | 1823 | kEta, kPhi, kZrez, aa); |
f073d500 | 1824 | hp[ih].SetShowRange(1.,2.3); |
8892a7f3 | 1825 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); |
1826 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 1827 | // hp[ih].Build(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen), |
1828 | // Form("Tracklets[%s%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]), | |
1829 | // kEta, kPhi, kNdim+1, aa); | |
1830 | // hp[ih].SetShowRange(30., 70.); | |
1831 | // hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1832 | // php.AddLast(&hp[ih++]); np[isel]++; | |
8892a7f3 | 1833 | } |
01ccc21a | 1834 | } |
8892a7f3 | 1835 | if(ndim==kNdimTrklt) continue; |
1836 | ||
1837 | isel++; // new selection | |
95d47440 | 1838 | AliDebug(3, Form("Building selRC[%3d|%4d]", isel, ih)); |
1839 | hp[ih].Build(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen), | |
1840 | Form("Tracklets[RC]:: #Deltaz{%s} Ly[%d] Cen[%s]", ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]), | |
8892a7f3 | 1841 | kEta, kPhi, kZrez, aa); |
1842 | // hp[ih].SetShowRange(-0.1,0.1); | |
1843 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1844 | php.AddLast(&hp[ih++]); np[isel]++; | |
b9058d72 | 1845 | /* hp[ih].Build(Form("H%sTrkltRCY%c%d%d", mc?"MC":"", ptName[ipt], ily, icen), |
8892a7f3 | 1846 | Form("Tracklets[RC]:: #Deltay{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]), |
1847 | kEta, kPhi, kYrez, aa); | |
1848 | //hp[ih].SetShowRange(-0.1,0.1); | |
1849 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1850 | php.AddLast(&hp[ih++]); np[isel]++; | |
1851 | hp[ih].Build(Form("H%sTrkltRCPh%c%d%d", mc?"MC":"", ptName[ipt], ily, icen), | |
1852 | Form("Tracklets[RC]:: #Delta#phi{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]), | |
1853 | kEta, kPhi, kPrez, aa); | |
1854 | //hp[ih].SetShowRange(-0.1,0.1); | |
1855 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
1856 | php.AddLast(&hp[ih++]); np[isel]++; | |
1857 | hp[ih].Build(Form("H%sTrkltRCQ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen), | |
1858 | Form("Tracklets[RC]:: dQdl{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]), | |
1859 | kEta, kPhi, kNdim, aa); | |
1860 | //hp[ih].SetShowRange(-0.1,0.1); | |
1861 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
b9058d72 | 1862 | php.AddLast(&hp[ih++]); np[isel]++;*/ |
566c3d46 | 1863 | } |
566c3d46 | 1864 | } |
3ed01fbe | 1865 | } |
95d47440 | 1866 | AliInfo(Form("Build %3d 3D %s projections%s", ih, mc?"MC":"", UseLYselectTrklt()?Form(" for Ly[%d].", fLYselect):".")); |
3ed01fbe | 1867 | |
eb05d549 | 1868 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
95d47440 | 1869 | 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*3/*4*/+1); |
3ed01fbe | 1870 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
1871 | v = H->GetBinContent(ib, coord); | |
1872 | if(v<1.) continue; | |
1873 | ly = coord[kBC]-1; // layer selection | |
95d47440 | 1874 | if(UseLYselectTrklt()&& (ly!=fLYselect)) continue; |
3ed01fbe | 1875 | // charge selection |
8892a7f3 | 1876 | ch = 0; sp=0;// [e-] track [dafault] |
b9058d72 | 1877 | if(rcBin>0){ // debug mode in which species/charge are also saved |
01ccc21a | 1878 | sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1; |
3ed01fbe | 1879 | if(coord[kSpeciesChgRC] > rcBin) ch = 1; // [+] track |
1880 | else if(coord[kSpeciesChgRC] == rcBin) ch = 2; // [RC] track | |
1881 | } | |
566c3d46 | 1882 | // pt selection |
1883 | pt = 0; // low pt | |
95d47440 | 1884 | if(ap) pt = coord[kPt];//TMath::Min(coord[kPt], Int_t(kNpt)+1); |
8892a7f3 | 1885 | // centrality selection |
1886 | cen = 0; // default | |
b9058d72 | 1887 | if(ac) cen = coord[kNdim]-1; |
566c3d46 | 1888 | // global selection |
8892a7f3 | 1889 | if(ndim==kNdimTrklt){ |
fb7cacec | 1890 | if(mc && ly<0) ly=0; // fix for bug in PlotMC |
95d47440 | 1891 | ioff = ly*3/*4*/; |
8892a7f3 | 1892 | isel = ly; |
1893 | } else { | |
95d47440 | 1894 | isel = cen*nLy*nPt*jspc+(!UseLYselectTrklt())*ly*nPt*jspc+pt*jspc; isel+=sp<0?(nSpc*nCh):(sp*nCh+ch); |
1895 | ioff = cen*nLy*nPt*kspc+(!UseLYselectTrklt())*ly*nPt*kspc+pt*kspc; ioff+=sp<0?((nSpc*nCh)*3/*4*/):(sp*nCh*3+ch*3/*4*/); | |
b9058d72 | 1896 | } |
1897 | if(ioff>=ih){ | |
1898 | AliError(Form("Wrong selection %d [%3d]", ioff, ih)); | |
1899 | return kFALSE; | |
1900 | } | |
eb05d549 | 1901 | if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) { |
b9058d72 | 1902 | AliError(Form("Missing projection %d", ioff)); |
1903 | return kFALSE; | |
1904 | } | |
1905 | if(sp>=0){ | |
95d47440 | 1906 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ch], ptName[pt], sp, UseLYselectTrklt()?fLYselect:ly, cen))!=0){ |
1907 | AliError(Form("Projection mismatch :: request[H%sTrkltY%c%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, UseLYselectTrklt()?fLYselect:ly, cen, pr0->H()->GetName())); | |
b9058d72 | 1908 | return kFALSE; |
1909 | } | |
1910 | } else { | |
95d47440 | 1911 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[pt], UseLYselectTrklt()?fLYselect:ly, cen))!=0){ |
1912 | AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c%d%d] found[%s]", mc?"MC":"", ptName[pt], UseLYselectTrklt()?fLYselect:ly, cen, pr0->H()->GetName())); | |
b9058d72 | 1913 | return kFALSE; |
1914 | } | |
8892a7f3 | 1915 | } |
eb05d549 | 1916 | for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); |
3ed01fbe | 1917 | } |
33056e04 | 1918 | if(HasDump3DFor(kTracklet)){ |
1919 | TDirectory *cwd = gDirectory; | |
95d47440 | 1920 | TFile::Open(Form("DumpRes_%s.root", H->GetName()), "RECREATE"); |
33056e04 | 1921 | for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){ |
1922 | if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue; | |
1923 | if(!pr0->H()) continue; | |
1924 | TH3 *h3=(TH3*)pr0->H()->Clone(); | |
1925 | h3->Write(); | |
1926 | } | |
1927 | gFile->Close(); | |
1928 | cwd->cd(); | |
1929 | } | |
1930 | ||
95d47440 | 1931 | TH2 *h2(NULL); Int_t jh(0); |
3ed01fbe | 1932 | TObjArray *arr(NULL); |
95d47440 | 1933 | if(!(arr = (TObjArray*)fProj->At(cidx))){ |
1934 | fProj->AddAt(arr = new TObjArray(kTrkltNproj), cidx); | |
1935 | arr->SetName(projName[Int_t(mc)]); arr->SetOwner(); | |
1936 | } else jh = arr->GetEntriesFast(); | |
3ed01fbe | 1937 | |
3ed01fbe | 1938 | for(; ih--; ){ |
eb05d549 | 1939 | if(!hp[ih].H()) continue; |
3ed01fbe | 1940 | Int_t mid(0), nstat(kNstat); |
eb05d549 | 1941 | if(strchr(hp[ih].H()->GetName(), 'Q')){ mid=2; nstat=kNstatQ;} |
3ed01fbe | 1942 | if(!(h2 = hp[ih].Projection2D(nstat, kNcontours, mid))) continue; |
566c3d46 | 1943 | arr->AddAt(h2, jh++); |
3ed01fbe | 1944 | } |
566c3d46 | 1945 | // build combined performance plots |
95d47440 | 1946 | Double_t m(0.), s(0.), se(0.), trend(0.); |
1947 | for(Int_t ily(0); ily<nLy; ily++){ | |
8892a7f3 | 1948 | for(Int_t ich(0); ich<nCh; ich++){ |
95d47440 | 1949 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
1950 | for(Int_t icen(0); icen<nCen; icen++){ | |
8892a7f3 | 1951 | /*!dy*/ |
95d47440 | 1952 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){ |
8892a7f3 | 1953 | for(Int_t isp(1); isp<nSpc; isp++){ |
95d47440 | 1954 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue; |
8892a7f3 | 1955 | (*pr0)+=(*pr1); |
1956 | } | |
95d47440 | 1957 | pr0->H()->SetNameTitle(Form("H%sTrkltY%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen), |
1958 | Form("Tracklets[%c]:: #Deltay{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen])); | |
8892a7f3 | 1959 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 1960 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); |
8892a7f3 | 1961 | } |
1962 | /*!dphi*/ | |
95d47440 | 1963 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){ |
8892a7f3 | 1964 | for(Int_t isp(1); isp<nSpc; isp++){ |
95d47440 | 1965 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue; |
8892a7f3 | 1966 | (*pr0)+=(*pr1); |
1967 | } | |
95d47440 | 1968 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen), |
1969 | Form("Tracklets[%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen])); | |
8892a7f3 | 1970 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 1971 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); |
8892a7f3 | 1972 | } |
1973 | /*!dQ/dl*/ | |
95d47440 | 1974 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){ |
8892a7f3 | 1975 | for(Int_t isp(1); isp<nSpc; isp++){ |
95d47440 | 1976 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue; |
8892a7f3 | 1977 | (*pr0)+=(*pr1); |
1978 | } | |
95d47440 | 1979 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen), |
1980 | Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen])); | |
8892a7f3 | 1981 | if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++); |
95d47440 | 1982 | pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen), |
1983 | Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen])); | |
f073d500 | 1984 | pr0->SetShowRange(2.4, 5.1); |
8892a7f3 | 1985 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
95d47440 | 1986 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); |
8892a7f3 | 1987 | } |
1988 | /*!TB occupancy*/ | |
95d47440 | 1989 | // if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){ |
1990 | // for(Int_t isp(1); isp<nSpc; isp++){ | |
1991 | // if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue; | |
1992 | // (*pr0)+=(*pr1); | |
1993 | // } | |
1994 | // pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen), | |
1995 | // Form("Tracklets[%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen])); | |
1996 | // if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); | |
1997 | // if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
1998 | // } | |
1999 | } // end centrality integration | |
8892a7f3 | 2000 | /*!dy*/ |
95d47440 | 2001 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2002 | pr0->H()->SetNameTitle(Form("H%sTrkltY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), | |
2003 | Form("Tracklets[%c]:: #Deltay Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt])); | |
01ccc21a | 2004 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2005 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
2006 | PutTrendValue(Form("%sTrkltY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), trend, m); | |
2007 | PutTrendValue(Form("%sTrkltYS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), s, se); | |
2008 | } | |
2009 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
01ccc21a | 2010 | } |
2011 | /*!dphi*/ | |
95d47440 | 2012 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2013 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), | |
2014 | Form("Tracklets[%c]:: #Delta#phi Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt])); | |
01ccc21a | 2015 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2016 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
2017 | PutTrendValue(Form("%sTrkltPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), trend, m); | |
2018 | PutTrendValue(Form("%sTrkltPhS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), s, se); | |
2019 | } | |
2020 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
01ccc21a | 2021 | } |
2022 | /*!dQ/dl*/ | |
95d47440 | 2023 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2024 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), | |
2025 | Form("Tracklets[%c]:: dQdl Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt])); | |
f073d500 | 2026 | pr0->SetShowRange(1.,2.3); |
01ccc21a | 2027 | if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++); |
95d47440 | 2028 | pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), |
2029 | Form("Tracklets[%c]:: dQdl Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt])); | |
f073d500 | 2030 | pr0->SetShowRange(2.4,5.1); |
01ccc21a | 2031 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
95d47440 | 2032 | if((trend=pr0->GetTrendValue(2,&m,&s,&se))>-100.){ |
2033 | PutTrendValue(Form("%sTrkltQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), trend, m); | |
2034 | PutTrendValue(Form("%sTrkltQS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), s, se); | |
2035 | } | |
2036 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
01ccc21a | 2037 | } |
82e6e5dc | 2038 | /*!TB occupancy*/ |
95d47440 | 2039 | // if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2040 | // pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), | |
2041 | // Form("Tracklets[%c]:: OccupancyTB Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt])); | |
2042 | // if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); | |
2043 | // if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
2044 | // } | |
2045 | } // end pt integration | |
01ccc21a | 2046 | /*!dy*/ |
95d47440 | 2047 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2048 | pr0->H()->SetNameTitle(Form("H%sTrkltY%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: #Deltay Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2049 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2050 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
2051 | PutTrendValue(Form("%sTrkltY%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), trend, m); | |
2052 | PutTrendValue(Form("%sTrkltYS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), s, se); | |
2053 | } | |
2054 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
01ccc21a | 2055 | } |
2056 | /*!dphi*/ | |
95d47440 | 2057 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2058 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: #Delta#phi Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
56838f9d | 2059 | pr0->SetShowRange(-.9,.9); |
01ccc21a | 2060 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2061 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
2062 | PutTrendValue(Form("%sTrkltPh%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), trend, m); | |
2063 | PutTrendValue(Form("%sTrkltPhS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), s, se); | |
2064 | } | |
2065 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
01ccc21a | 2066 | } |
2067 | /*!dQ/dl*/ | |
95d47440 | 2068 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2069 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
f073d500 | 2070 | pr0->SetShowRange(1.,2.3); |
01ccc21a | 2071 | if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++); |
95d47440 | 2072 | pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); |
f073d500 | 2073 | pr0->SetShowRange(2.4,5.1); |
01ccc21a | 2074 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
95d47440 | 2075 | if((trend=pr0->GetTrendValue(2,&m,&s,&se))>-100.){ |
2076 | PutTrendValue(Form("%sTrkltQ%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), trend, m); | |
2077 | PutTrendValue(Form("%sTrkltQS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), s, se); | |
2078 | } | |
2079 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
01ccc21a | 2080 | } |
82e6e5dc | 2081 | /*!TB occupancy*/ |
95d47440 | 2082 | // if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2083 | // pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: OccupancyTB Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
2084 | // if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); | |
2085 | // if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); | |
2086 | // } | |
8892a7f3 | 2087 | } // end charge integration |
01ccc21a | 2088 | /*!dy*/ |
95d47440 | 2089 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2090 | pr0->H()->SetNameTitle(Form("H%sTrkltY%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2091 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
aebcb1ff | 2092 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
2093 | PutTrendValue(Form("%sTrkltY%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), trend, m); | |
2094 | PutTrendValue(Form("%sTrkltYS%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), s, se); | |
0f2c4c4f | 2095 | } |
566c3d46 | 2096 | } |
01ccc21a | 2097 | /*!dphi*/ |
95d47440 | 2098 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2099 | pr0->H()->SetNameTitle(Form("H%sTrkltPh%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: #Delta#phi Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
56838f9d | 2100 | pr0->SetShowRange(-.45,.45); |
01ccc21a | 2101 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
566c3d46 | 2102 | } |
8892a7f3 | 2103 | /*!dQdl*/ |
95d47440 | 2104 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2105 | pr0->H()->SetNameTitle(Form("H%sTrkltQ%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: dQdl Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
56838f9d | 2106 | pr0->SetShowRange(1.,2.3); |
2107 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); | |
95d47440 | 2108 | pr0->H()->SetName(Form("H%sTrkltQS%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily)); |
56838f9d | 2109 | pr0->SetShowRange(2.4,5.1); |
01ccc21a | 2110 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
566c3d46 | 2111 | } |
82e6e5dc | 2112 | /*!TB occupancy*/ |
95d47440 | 2113 | // if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2114 | // pr0->H()->SetNameTitle(Form("H%sTrkltTB%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: OccupancyTB Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
2115 | // if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); | |
2116 | // } | |
8892a7f3 | 2117 | |
2118 | /*! Row Cross processing*/ | |
2119 | for(Int_t icen(0); icen<nCen; icen++){ | |
2120 | /*!RC dz*/ | |
95d47440 | 2121 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], UseLYselectTrklt()?fLYselect:ily, icen)))){ |
2122 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
2123 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen)))) continue; | |
8892a7f3 | 2124 | (*pr0)+=(*pr1); |
2125 | } | |
95d47440 | 2126 | pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily, icen), Form("Tracklets[RC]:: #Deltaz Ly[%d] Cen[%s]", UseLYselectTrklt()?fLYselect:ily, cenName[icen])); |
8892a7f3 | 2127 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2128 | if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0); |
8892a7f3 | 2129 | } |
2130 | } // end centrality integration for row cross | |
2131 | /*!RC dz*/ | |
95d47440 | 2132 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], UseLYselectTrklt()?fLYselect:ily, 0)))){ |
2133 | pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[RC] :: #Deltaz Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
8892a7f3 | 2134 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2135 | } | |
2136 | } // end layer loop | |
0f2c4c4f | 2137 | AliInfo(Form("Done %3d 2D %s projections.", jh, mc?"MC":"")); |
95d47440 | 2138 | |
2139 | // clean local memory allocation | |
2140 | for(Int_t i(fgNPt+2);i--;) if(ptCut[i]) delete [] ptCut[i]; | |
3ceb45ae | 2141 | return kTRUE; |
2142 | } | |
068e2c00 | 2143 | |
00a3f7a4 | 2144 | //________________________________________________________ |
95d47440 | 2145 | Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc, Bool_t v0) |
1ee39b3a | 2146 | { |
3ceb45ae | 2147 | // Analyse track in |
3ed01fbe | 2148 | const Int_t kNcontours(9); |
2149 | const Int_t kNstat(30); | |
95d47440 | 2150 | Int_t cidx=mc?kMCtrackIn:(v0?(kV0TrackIn-1):kTrackIn); |
2151 | if(fProj && fProj->At(cidx)){ | |
2152 | AliInfo(Form("Nothing to do for container %s.", ((TObjArray*)fProj->At(cidx))->GetName() )); | |
2153 | return kTRUE; | |
2154 | } | |
3ceb45ae | 2155 | if(!fContainer){ |
2156 | AliError("Missing data container."); | |
2157 | return kFALSE; | |
2158 | } | |
95d47440 | 2159 | const Char_t *projName[] = {"hTracklet2TRDin", "hTRDin2MC", "hTracklet2TRDinV0"}; |
3ceb45ae | 2160 | THnSparse *H(NULL); |
f073d500 | 2161 | if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){ |
2162 | AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)])); | |
ff511aa7 | 2163 | return kTRUE; |
1ee39b3a | 2164 | } |
95d47440 | 2165 | const Char_t *prefix = mc?"MC":(v0?"V0":""); |
61f6b45e | 2166 | |
01ccc21a | 2167 | const Int_t mdim(kNdim+3); |
2168 | Int_t coord[mdim]; memset(coord, 0, sizeof(Int_t) * mdim); Double_t v = 0.; | |
3ed01fbe | 2169 | Int_t ndim(H->GetNdimensions()); |
cc98ff07 | 2170 | TAxis *aa[mdim], *as(NULL), *ap(NULL), *apt(NULL), *ax(NULL), *abf(NULL); memset(aa, 0, sizeof(TAxis*) * (mdim)); |
3ed01fbe | 2171 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
178d284a | 2172 | if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC); |
cc98ff07 | 2173 | if(ndim > Int_t(kPt)) apt = H->GetAxis(kPt); |
2174 | if(ndim > Int_t(kNdim)) ap = H->GetAxis(kNdim); | |
178d284a | 2175 | if(ndim > Int_t(kNdim)+1) ax = H->GetAxis(kNdim+1); |
2176 | if(ndim > Int_t(kNdim)+2) abf = H->GetAxis(kNdim+2); | |
49ed65ad | 2177 | //AliInfo(Form("Using : Species[%c] Pt[%c] BunchFill[%c]", as?'y':'n', ap?'y':'n', abf?'y':'n')); |
aebcb1ff | 2178 | const Int_t nPt(apt?(apt->GetNbins()+2):1); |
01ccc21a | 2179 | |
3ed01fbe | 2180 | // build list of projections |
95d47440 | 2181 | const Int_t nsel((fgNPt+2)*(kNspc*kNcharge + 1) + kNspc*kNcharge); |
2182 | const Int_t nprj((fgNPt+2)*(kNspc*kNcharge + 1)*4 + kNspc*kNcharge); | |
01ccc21a | 2183 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
95d47440 | 2184 | const Char_t *spcName[2][kNspc] = {{"e", "#mu#pi", "Kp"}, |
2185 | {"e", "#pi", "p"}}; | |
2186 | const Char_t ptShortName[5] = {'L', 'l', 'i', 'h', 'H'}; | |
2187 | Char_t ptName[fgNPt+2] = {0}; | |
2188 | Char_t *ptCut[fgNPt+2] = {NULL}; | |
2189 | Char_t *pCut[fgNPt+2] = {NULL}; | |
3ed01fbe | 2190 | // define rebinning strategy |
0f2c4c4f | 2191 | const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2}; |
2192 | if(aa[1]->GetNbins()==180){ // old binning | |
2193 | rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2; | |
2194 | rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1; | |
2195 | rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1; | |
2196 | rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5; | |
2197 | rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy | |
2198 | } | |
95d47440 | 2199 | AliTRDrecoProjection hp[nprj]; TObjArray php(nprj+2); |
3ed01fbe | 2200 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
2201 | // define list of projections | |
f073d500 | 2202 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
95d47440 | 2203 | ptName[ipt]= nPt>5?(64+ipt):ptShortName[ipt]; |
2204 | ptCut[ipt] = StrDup(Form("#it{%4.2f<=p_{t}^{%s}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., mc?"MC":"", ipt>fgNPt?99.99:fgPt[ipt])); | |
2205 | pCut[ipt] = StrDup(Form("#it{%4.2f<=p^{%s}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., mc?"MC":"", ipt>fgNPt?99.99:fgPt[ipt])); | |
cc98ff07 | 2206 | for(Int_t isp(0); isp<kNspc; isp++){ |
01ccc21a | 2207 | for(Int_t ich(0); ich<kNcharge; ich++){ |
2208 | isel++; // new selection | |
95d47440 | 2209 | AliDebug(3, Form("Building sel[%3d|%4d] spc[%s%c] pt[%s]", isel, ih, spcName[v0][isp], chSgn[ich], ptCut[ipt])); |
2210 | hp[ih].Build(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp), | |
2211 | Form("TrackIn[%s%c]:: #Deltay{%s}", spcName[v0][isp], chSgn[ich], ptCut[ipt]), | |
01ccc21a | 2212 | kEta, kPhi, kYrez, aa); |
2213 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2214 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 2215 | hp[ih].Build(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp), |
2216 | Form("TrackIn[%s%c]:: #Delta#phi{%s}", spcName[v0][isp], chSgn[ich], ptCut[ipt]), | |
01ccc21a | 2217 | kEta, kPhi, kPrez, aa); |
2218 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2219 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 2220 | hp[ih].Build(Form("H%sTrkInQ%c%c%d", prefix, chName[ich], ptName[ipt], isp), |
2221 | Form("TrackIn[%s%c]:: dQdl {%s}", spcName[v0][isp], chSgn[ich], pCut[ipt]), | |
49ed65ad | 2222 | kEta, kPhi, kZrez, aa); |
2223 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2224 | php.AddLast(&hp[ih++]); np[isel]++; | |
2225 | if(!ax) continue; | |
95d47440 | 2226 | hp[ih].Build(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[ipt], isp), |
2227 | Form("TrackIn[%s%c]:: #Deltax{%s}", spcName[v0][isp], chSgn[ich], ptCut[ipt]), | |
01ccc21a | 2228 | kEta, kPhi, kNdim+1, aa); |
2229 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2230 | php.AddLast(&hp[ih++]); np[isel]++; | |
2231 | } | |
35983729 | 2232 | } |
5047978d | 2233 | isel++; // RC projections |
95d47440 | 2234 | AliDebug(3, Form("Building RCsel[%3d] pt[%s]", isel, ptCut[ipt])); |
2235 | hp[ih].Build(Form("H%sTrkInRCZ%c", prefix, ptName[ipt]), | |
01ccc21a | 2236 | Form("TrackIn[RC]:: #Deltaz{%s}", ptCut[ipt]), |
2237 | kEta, kPhi, kZrez, aa); | |
2238 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2239 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 2240 | hp[ih].Build(Form("H%sTrkInRCY%c", prefix, ptName[ipt]), |
01ccc21a | 2241 | Form("TrackIn[RC]:: #Deltay{%s}", ptCut[ipt]), |
2242 | kEta, kPhi, kYrez, aa); | |
2243 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2244 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 2245 | hp[ih].Build(Form("H%sTrkInRCPh%c", prefix, ptName[ipt]), |
01ccc21a | 2246 | Form("TrackIn[RC]:: #Delta#phi{%s}", ptCut[ipt]), |
2247 | kEta, kPhi, kPrez, aa); | |
2248 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2249 | php.AddLast(&hp[ih++]); np[isel]++; | |
49ed65ad | 2250 | if(!ax) continue; |
95d47440 | 2251 | hp[ih].Build(Form("H%sTrkInRCX%c", prefix, ptName[ipt]), |
01ccc21a | 2252 | Form("TrackIn[RC]:: #Deltax{%s}", ptCut[ipt]), |
2253 | kEta, kPhi, kNdim+1, aa); | |
2254 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2255 | php.AddLast(&hp[ih++]); np[isel]++; | |
35983729 | 2256 | } |
5047978d | 2257 | // pt projections |
2258 | for(Int_t isp(0); isp<kNspc; isp++){ | |
2259 | for(Int_t ich(0); ich<kNcharge; ich++){ | |
2260 | isel++; // new selection | |
95d47440 | 2261 | AliDebug(3, Form("Building PTsel[%3d] spc[%s%c]", isel, spcName[v0][isp], chSgn[ich])); |
2262 | hp[ih].Build(Form("H%sTrkInPt%c%d", prefix, chName[ich], isp), | |
2263 | Form("TrackIn[%s%c]:: P_{t}[GeV/c]", spcName[v0][isp], chSgn[ich]), | |
5047978d | 2264 | kEta, kPhi, kPt, aa); |
2265 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2266 | php.AddLast(&hp[ih++]); //np[isel]++; | |
2267 | } | |
2268 | } | |
95d47440 | 2269 | AliInfo(Form("Build %3d 3D %s projections.", ih, prefix)); |
3ed01fbe | 2270 | |
2271 | // fill projections | |
5047978d | 2272 | Int_t ch(0), pt(0), p(0), sp(1), rcBin(as?as->FindBin(0.):-1), ioff(0), joff(0), jsel(0), ksel(0); |
eb05d549 | 2273 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
3ceb45ae | 2274 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
2275 | v = H->GetBinContent(ib, coord); | |
2276 | if(v<1.) continue; | |
566c3d46 | 2277 | if(fBCbinTOF>0 && coord[kBC]!=fBCbinTOF) continue; // TOF bunch cross cut |
2278 | if(fBCbinFill>0 && abf && coord[kNdim+2]!=fBCbinTOF) continue; // Fill bunch cut | |
f036f7ec | 2279 | if(coord[kBC]==3) continue; |
3ed01fbe | 2280 | // charge selection |
cc98ff07 | 2281 | ch = 0; sp=1;// [pi-] track |
95d47440 | 2282 | if(rcBin>0){ |
2283 | if(v0){ // V0 PID for dQdl | |
2284 | if(!coord[kBC]) continue; | |
2285 | sp = coord[kBC]-1; | |
2286 | } else {// TPC PID for statistics | |
2287 | sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1; | |
2288 | } | |
2289 | ||
cc98ff07 | 2290 | // take care of old data format (2*AliPID::kSPECIES+1) |
2291 | if(as->GetNbins() == kNcharge*AliPID::kSPECIES+1){ | |
2292 | if(sp>2) sp=2; | |
2293 | else if(sp==2) sp=1; | |
b9058d72 | 2294 | } |
3ed01fbe | 2295 | if(coord[kSpeciesChgRC] > rcBin) ch = 1; // [+] track |
2296 | else if(coord[kSpeciesChgRC] == rcBin) ch = 2; // [RC] track | |
3ceb45ae | 2297 | } |
35983729 | 2298 | // pt selection |
cc98ff07 | 2299 | pt = 0; p = 0; // low pt |
95d47440 | 2300 | if(apt) pt = coord[kPt];//TMath::Min(coord[kPt], Int_t(kNpt)+1); |
2301 | if(ap ) p = coord[kNdim];//TMath::Min(coord[kNdim], Int_t(kNpt)+1); | |
35983729 | 2302 | // global selection |
cc98ff07 | 2303 | isel = pt*(kNspc*kNcharge+1); isel+=(ch==2?(kNspc*kNcharge):(sp*kNcharge+ch)); ioff = isel*(ax?4:3); |
0f2c4c4f | 2304 | jsel = p *(kNspc*kNcharge+1); jsel+=(ch==2?(kNspc*kNcharge):(sp*kNcharge+ch)); joff = jsel*(ax?4:3); |
5047978d | 2305 | ksel = ch==2?0:nPt*(kNspc*kNcharge+1); ksel *= (ax?4:3); ksel+=sp*kNcharge+ch; |
b9058d72 | 2306 | if(ioff>=ih){ |
2307 | AliError(Form("Wrong selection %d [%3d]", ioff, ih)); | |
2308 | return kFALSE; | |
2309 | } | |
eb05d549 | 2310 | if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) { |
5047978d | 2311 | AliError(Form("Missing projection @ %d", ioff)); |
b9058d72 | 2312 | return kFALSE; |
2313 | } | |
cc98ff07 | 2314 | if(ch<2){ |
95d47440 | 2315 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkInY%c%c%d", prefix, chName[ch], ptName[pt], sp))!=0){ |
2316 | AliError(Form("Projection mismatch :: request[H%sTrkInY%c%c%d] found[%s]", prefix, chName[ch], ptName[pt], sp, pr0->H()->GetName())); | |
b9058d72 | 2317 | return kFALSE; |
2318 | } | |
2319 | } else { | |
95d47440 | 2320 | if(strcmp(pr0->H()->GetName(), Form("H%sTrkInRCZ%c", prefix, ptName[pt]))!=0){ |
2321 | AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c] found[%s]", prefix, ptName[pt], pr0->H()->GetName())); | |
b9058d72 | 2322 | return kFALSE; |
2323 | } | |
2324 | } | |
cc98ff07 | 2325 | AliDebug(2, Form("Found %s for selection sp[%d] ch[%d] pt[%d]", pr0->H()->GetName(), sp, ch, pt)); |
2326 | for(Int_t jh(0); jh<np[isel]; jh++){ | |
2327 | if(ch<2 && jh==2) ((AliTRDrecoProjection*)php.At(joff+jh))->Increment(coord, v); // special care for dQdl=f(p) | |
2328 | else ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); // all = f(p_t) | |
2329 | } | |
5047978d | 2330 | if(ksel){ |
2331 | if(!(pr0 = (AliTRDrecoProjection*)php.At(ksel))){ | |
2332 | AliError(Form("Missing P_t projection @ %d", ksel)); | |
2333 | return kFALSE; | |
2334 | } | |
2335 | AliDebug(2, Form("Found %s for selection[%d] sp[%d] ch[%d]", pr0->H()->GetName(), ksel, sp, ch)); | |
2336 | pr0->Increment(coord, v); // p_t spectra | |
2337 | } | |
3ceb45ae | 2338 | } |
33056e04 | 2339 | if(HasDump3DFor(kTrackIn)){ |
2340 | TDirectory *cwd = gDirectory; | |
95d47440 | 2341 | TFile::Open(Form("Dump%s_%s.root", GetName(), H->GetName()), "UPDATE"); |
33056e04 | 2342 | for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){ |
2343 | if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue; | |
2344 | if(!pr0->H()) continue; | |
2345 | TH3 *h3=(TH3*)pr0->H()->Clone(); | |
2346 | h3->Write(); | |
2347 | } | |
2348 | gFile->Close(); | |
2349 | cwd->cd(); | |
2350 | } | |
2351 | ||
3ceb45ae | 2352 | TObjArray *arr(NULL); |
35983729 | 2353 | fProj->AddAt(arr = new TObjArray(mc?kMCTrkInNproj:kTrkInNproj), cidx); |
95d47440 | 2354 | arr->SetName(mc?projName[1]:(v0?projName[2]:projName[0])); arr->SetOwner(); |
3ceb45ae | 2355 | |
566c3d46 | 2356 | TH2 *h2(NULL); Int_t jh(0); |
3ed01fbe | 2357 | for(; ih--; ){ |
eb05d549 | 2358 | if(!hp[ih].H()) continue; |
5047978d | 2359 | if(strstr(hp[ih].H()->GetName(), "TrkInPt")){ |
2360 | for(Int_t ipt(0); ipt<nPt; ipt++) arr->AddAt(hp[ih].Projection2Dbin(ipt), jh++); | |
2361 | } else { | |
2362 | if((h2 = hp[ih].Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++); | |
2363 | } | |
3ed01fbe | 2364 | } |
35983729 | 2365 | // build combined performance plots |
01ccc21a | 2366 | // combine up the tree of projections |
aebcb1ff | 2367 | Double_t m(0.), s(0.), se(0.), trend(0.); |
cc98ff07 | 2368 | AliTRDrecoProjection xlow[2], specY[kNcharge*kNspc], specPh[kNcharge*kNspc], specQ[kNcharge*kNspc]; |
01ccc21a | 2369 | for(Int_t ich(0); ich<kNcharge; ich++){ |
f073d500 | 2370 | // PID dependency - summation over pt |
cc98ff07 | 2371 | for(Int_t isp(0); isp<kNspc; isp++){ |
f073d500 | 2372 | /*!dy*/ |
cc98ff07 | 2373 | Int_t idx(ich*kNspc+isp); |
95d47440 | 2374 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], isp)))){ |
f073d500 | 2375 | specY[idx] = (*pr0); |
95d47440 | 2376 | specY[idx].SetNameTitle(Form("H%sTrkInY%c%d", prefix, chName[ich], isp), "Sum over pt"); |
2377 | specY[idx].H()->SetNameTitle(Form("H%sTrkInY%c%d", prefix, chName[ich], isp), | |
2378 | Form("TrackIn[%s%c]:: #Deltay", spcName[v0][isp], chSgn[ich])); | |
aebcb1ff | 2379 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2380 | PutTrendValue(Form("%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m); |
aebcb1ff | 2381 | PutTrendValue(Form("%sTrkInYS%c%c%d", prefix, chName[ich], ptName[0], isp), s, se); |
0f2c4c4f | 2382 | } |
f073d500 | 2383 | for(Int_t ipt(1); ipt<nPt; ipt++){ |
95d47440 | 2384 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue; |
aebcb1ff | 2385 | if((trend=pr1->GetTrendValue(1,&m,&s, &se))>-100.){ |
95d47440 | 2386 | PutTrendValue(Form("%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m); |
aebcb1ff | 2387 | PutTrendValue(Form("%sTrkInYS%c%c%d", prefix, chName[ich], ptName[ipt], isp), s, se); |
0f2c4c4f | 2388 | } |
f073d500 | 2389 | specY[idx]+=(*pr1); |
2390 | } | |
2391 | php.AddLast(&specY[idx]); | |
b351a191 | 2392 | if((h2 = specY[idx].Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
aebcb1ff | 2393 | if((trend=specY[idx].GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2394 | PutTrendValue(Form("%sTrkInY%c%d", prefix, chName[ich], isp), trend, m); |
aebcb1ff | 2395 | PutTrendValue(Form("%sTrkInYS%c%d", prefix, chName[ich], isp), s,se); |
0f2c4c4f | 2396 | } |
ff511aa7 | 2397 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", specY[idx].H()->GetName())))) arr->AddAt(h2, jh++); |
95d47440 | 2398 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", prefix, chName[0], isp)))) (*pr1)+=specY[idx]; |
f073d500 | 2399 | } |
2400 | /*!dphi*/ | |
95d47440 | 2401 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], isp)))){ |
f073d500 | 2402 | specPh[idx] = (*pr0); |
95d47440 | 2403 | specPh[idx].SetNameTitle(Form("H%sTrkInPh%c%d", prefix, chName[ich], isp), "Sum over pt"); |
2404 | specPh[idx].H()->SetNameTitle(Form("H%sTrkInPh%c%d", prefix, chName[ich], isp), | |
2405 | Form("TrackIn[%s%c]:: #Delta#phi", spcName[v0][isp], chSgn[ich])); | |
b351a191 | 2406 | specPh[idx].SetShowRange(-1.5, 1.5); |
aebcb1ff | 2407 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2408 | PutTrendValue(Form("%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m); |
aebcb1ff | 2409 | PutTrendValue(Form("%sTrkInPhS%c%c%d", prefix, chName[ich], ptName[0], isp), s, se); |
0f2c4c4f | 2410 | } |
f073d500 | 2411 | for(Int_t ipt(1); ipt<nPt; ipt++){ |
95d47440 | 2412 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue; |
aebcb1ff | 2413 | if((trend=pr1->GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2414 | PutTrendValue(Form("%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m); |
aebcb1ff | 2415 | PutTrendValue(Form("%sTrkInPhS%c%c%d", prefix, chName[ich], ptName[ipt], isp), s, se); |
0f2c4c4f | 2416 | } |
f073d500 | 2417 | specPh[idx]+=(*pr1); |
2418 | } | |
2419 | php.AddLast(&specPh[idx]); | |
2420 | if((h2 = specPh[idx].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); | |
aebcb1ff | 2421 | if((trend=specPh[idx].GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2422 | PutTrendValue(Form("%sTrkInPh%c%d", prefix, chName[ich], isp), trend, m); |
aebcb1ff | 2423 | PutTrendValue(Form("%sTrkInPhS%c%d", prefix, chName[ich], isp), s,se); |
0f2c4c4f | 2424 | } |
95d47440 | 2425 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", prefix, chName[0], isp)))) (*pr1)+=specPh[idx]; |
f073d500 | 2426 | } |
49ed65ad | 2427 | /*!dQdl*/ |
95d47440 | 2428 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", prefix, chName[ich], ptName[0], isp)))){ |
49ed65ad | 2429 | specQ[idx] = (*pr0); |
95d47440 | 2430 | specQ[idx].SetNameTitle(Form("H%sTrkInQ%c%d", prefix, chName[ich], isp), "Sum over p"); |
2431 | specQ[idx].H()->SetNameTitle(Form("H%sTrkInQ%c%d", prefix, chName[ich], isp), | |
2432 | Form("TrackIn[%s%c]:: dQdl", spcName[v0][isp], chSgn[ich])); | |
49ed65ad | 2433 | specQ[idx].SetShowRange(-2.2, -1.75); |
eb05d549 | 2434 | specQ[idx].H()->GetZaxis()->SetTitle("dQdl [a.u.]"); |
aebcb1ff | 2435 | if((trend = pr0->GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m); |
2436 | if((trend = pr0->GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m); | |
49ed65ad | 2437 | for(Int_t ipt(1); ipt<nPt; ipt++){ |
95d47440 | 2438 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue; |
aebcb1ff | 2439 | if((trend=pr1->GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m); |
2440 | if((trend=pr1->GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m); | |
49ed65ad | 2441 | specQ[idx]+=(*pr1); |
2442 | } | |
2443 | php.AddLast(&specQ[idx]); | |
2444 | if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); | |
95d47440 | 2445 | specQ[idx].H()->SetName(Form("H%sTrkInQS%c%d", prefix, chName[ich], isp)); |
f985021d | 2446 | specQ[idx].SetShowRange(-1.85, -1.4); |
49ed65ad | 2447 | if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
aebcb1ff | 2448 | if((trend=specQ[idx].GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%c%d", prefix, chName[ich], isp), trend, m); |
2449 | if((trend=specQ[idx].GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%c%d", prefix, chName[ich], isp), trend, m); | |
95d47440 | 2450 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", prefix, chName[0], isp)))) (*pr1)+=specQ[idx]; |
49ed65ad | 2451 | } |
b9058d72 | 2452 | } // end PID loop for pt integration |
2453 | ||
f073d500 | 2454 | // pt dependency - summation over PID |
2455 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
01ccc21a | 2456 | /*!dy*/ |
95d47440 | 2457 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], 0)))){ |
cc98ff07 | 2458 | for(Int_t isp(1); isp<kNspc; isp++){ |
95d47440 | 2459 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue; |
01ccc21a | 2460 | (*pr0)+=(*pr1); |
2461 | } | |
95d47440 | 2462 | pr0->H()->SetNameTitle(Form("H%sTrkInY%c%c", prefix, chName[ich], ptName[ipt]), |
01ccc21a | 2463 | Form("TrackIn[%c]:: #Deltay{%s}", chSgn[ich], ptCut[ipt])); |
b9058d72 | 2464 | pr0->SetShowRange(-0.3, 0.3); |
01ccc21a | 2465 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
aebcb1ff | 2466 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2467 | PutTrendValue(Form("%sTrkInY%c%c", prefix, chName[ich], ptName[ipt]), trend, m); |
aebcb1ff | 2468 | PutTrendValue(Form("%sTrkInYS%c%c", prefix, chName[ich], ptName[ipt]), s, se); |
668a0654 | 2469 | } |
95d47440 | 2470 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a | 2471 | } |
2472 | /*!dphi*/ | |
95d47440 | 2473 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], 0)))){ |
cc98ff07 | 2474 | for(Int_t isp(1); isp<kNspc; isp++){ |
95d47440 | 2475 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue; |
01ccc21a | 2476 | (*pr0)+=(*pr1); |
2477 | } | |
95d47440 | 2478 | pr0->H()->SetNameTitle(Form("H%sTrkInPh%c%c", prefix, chName[ich], ptName[ipt]), |
01ccc21a | 2479 | Form("TrackIn[%c]:: #Delta#phi{%s}", chSgn[ich], ptCut[ipt])); |
2480 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); | |
aebcb1ff | 2481 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2482 | PutTrendValue(Form("%sTrkInPh%c%c", prefix, chName[ich], ptName[ipt]), trend, m); |
aebcb1ff | 2483 | PutTrendValue(Form("%sTrkInPhS%c%c", prefix, chName[ich], ptName[ipt]), s, se); |
0f2c4c4f | 2484 | } |
95d47440 | 2485 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a | 2486 | } |
2487 | /*!dx*/ | |
95d47440 | 2488 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[ipt], 0)))){ |
cc98ff07 | 2489 | for(Int_t isp(1); isp<kNspc; isp++){ |
95d47440 | 2490 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue; |
01ccc21a | 2491 | (*pr0)+=(*pr1); |
2492 | } | |
95d47440 | 2493 | pr0->H()->SetNameTitle(Form("H%sTrkInX%c%c", prefix, chName[ich], ptName[ipt]), |
01ccc21a | 2494 | Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[ipt])); |
2495 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); | |
95d47440 | 2496 | PutTrendValue(Form("%sTrkInX%c%c", prefix, chName[ich], ptName[ipt]), pr0->GetTrendValue(1)); |
01ccc21a | 2497 | if(!ipt){ |
2498 | xlow[ich] = (*pr0); | |
95d47440 | 2499 | xlow[ich].SetNameTitle(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[0], 5), |
01ccc21a | 2500 | Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[0])); |
2501 | php.AddLast(&xlow[ich]); | |
2502 | } | |
95d47440 | 2503 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a | 2504 | } |
b9058d72 | 2505 | } // end pt loop for PID integration |
2506 | ||
01ccc21a | 2507 | /*!dy*/ |
95d47440 | 2508 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], 0)))){ |
2509 | pr0->H()->SetNameTitle(Form("H%sTrkInY%c", prefix, chName[ich]), | |
01ccc21a | 2510 | Form("TrackIn[%c]:: #Deltay", chSgn[ich])); |
8892a7f3 | 2511 | pr0->SetShowRange(-0.3, 0.3); |
b9058d72 | 2512 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 | 2513 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
aebcb1ff | 2514 | if((trend=pr0->GetTrendValue(1, &m, &s, &se))>-100.){ |
95d47440 | 2515 | PutTrendValue(Form("%sTrkInY%c", prefix, chName[ich]), trend, m); |
aebcb1ff | 2516 | PutTrendValue(Form("%sTrkInYS%c", prefix, chName[ich]), s, se); |
668a0654 | 2517 | } |
95d47440 | 2518 | if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[0], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a | 2519 | } |
2520 | /*!dy high pt*/ | |
95d47440 | 2521 | if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[0], ptName[3], 0)))){ |
2522 | if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[3], 0)))){ | |
01ccc21a | 2523 | (*pr0)+=(*pr1); |
95d47440 | 2524 | pr0->H()->SetNameTitle(Form("H%sTrkInY%c", prefix, ptName[3]), Form("TrackIn :: #Deltay{%s}", ptCut[3])); |
b9058d72 | 2525 | pr0->SetShowRange(-0.3, 0.3); |
01ccc21a | 2526 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2527 | } | |
2528 | } | |
2529 | /*!dphi*/ | |
95d47440 | 2530 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], 0)))){ |
2531 | pr0->H()->SetNameTitle(Form("H%sTrkInPh%c", prefix, chName[ich]), | |
01ccc21a | 2532 | Form("TrackIn[%c]:: #Delta#phi", chSgn[ich])); |
f073d500 | 2533 | pr0->SetShowRange(-1., 1.); |
01ccc21a | 2534 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
aebcb1ff | 2535 | if((trend=pr0->GetTrendValue(1, &m, &s, &se))>-100.){ |
95d47440 | 2536 | PutTrendValue(Form("%sTrkInPh%c", prefix, chName[ich]), trend, m); |
aebcb1ff | 2537 | PutTrendValue(Form("%sTrkInPhS%c", prefix, chName[ich]), s, se); |
0f2c4c4f | 2538 | } |
95d47440 | 2539 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[0], ptName[0], 0)))) (*pr1)+=(*pr0); |
01ccc21a | 2540 | } |
2541 | /*!dx*/ | |
95d47440 | 2542 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[0], 0)))){ |
2543 | pr0->H()->SetNameTitle(Form("H%sTrkInX%c", prefix, chName[ich]), | |
01ccc21a | 2544 | Form("TrackIn[%c]:: #Deltax", chSgn[ich])); |
2545 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); | |
95d47440 | 2546 | PutTrendValue(Form("%sTrkInX%c", prefix, chName[ich]), pr0->GetTrendValue(1)); |
2547 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[0], ptName[0], 0)))) (*pr1)+=(*pr0); | |
01ccc21a | 2548 | } |
2549 | /*!dx low pt*/ | |
95d47440 | 2550 | if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[0], ptName[1], 5)))){ |
2551 | if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[1], 5)))){ | |
01ccc21a | 2552 | (*pr0)+=(*pr1); |
95d47440 | 2553 | pr0->H()->SetNameTitle(Form("H%sTrkInX%c", prefix, ptName[1]), Form("TrackIn :: #Deltax{%s}", ptCut[1])); |
01ccc21a | 2554 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2555 | } | |
2556 | } | |
b9058d72 | 2557 | } // end charge loop |
2558 | ||
cc98ff07 | 2559 | for(Int_t isp(0); isp<kNspc; isp++){ |
f073d500 | 2560 | /*!dy*/ |
95d47440 | 2561 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", prefix, chName[0], isp)))){ |
2562 | pr0->H()->SetNameTitle(Form("H%sTrkInY%d", prefix, isp), Form("TrackIn[%s] :: #Deltay", spcName[v0][isp])); | |
f073d500 | 2563 | pr0->SetShowRange(-0.3, 0.3); |
b351a191 | 2564 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
95d47440 | 2565 | PutTrendValue(Form("%sTrkInY%d", prefix, isp), pr0->GetTrendValue(1)); |
eb05d549 | 2566 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
f073d500 | 2567 | } |
2568 | /*!dphi*/ | |
95d47440 | 2569 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", prefix, chName[0], isp)))){ |
2570 | pr0->H()->SetNameTitle(Form("H%sTrkInPh%d", prefix, isp), Form("TrackIn[%s] :: #Delta#phi", spcName[v0][isp])); | |
b351a191 | 2571 | pr0->SetShowRange(-1., 1.); |
f073d500 | 2572 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2573 | PutTrendValue(Form("%sTrkInPh%d", prefix, isp), pr0->GetTrendValue(1)); |
f073d500 | 2574 | } |
49ed65ad | 2575 | /*!dQdl*/ |
95d47440 | 2576 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", prefix, chName[0], isp)))){ |
2577 | pr0->H()->SetNameTitle(Form("H%sTrkInQ%d", prefix, isp), Form("TrackIn[%s] :: dQdl", spcName[v0][isp])); | |
49ed65ad | 2578 | pr0->SetShowRange(-2.2, -1.75); |
2579 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++); | |
95d47440 | 2580 | pr0->H()->SetName(Form("H%sTrkInQS%d", prefix, isp)); |
f985021d | 2581 | pr0->SetShowRange(-1.85, -1.4); |
49ed65ad | 2582 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++); |
aebcb1ff | 2583 | if((trend=pr0->GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%d", prefix, isp), trend, m); |
2584 | if((trend=pr0->GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%d", prefix, isp), trend, m); | |
49ed65ad | 2585 | } |
b9058d72 | 2586 | } // end PID processing |
2587 | ||
01ccc21a | 2588 | /*!dy*/ |
95d47440 | 2589 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[0], ptName[0], 0)))){ |
2590 | pr0->H()->SetNameTitle(Form("H%sTrkInY", prefix), "TrackIn :: #Deltay"); | |
f073d500 | 2591 | pr0->SetShowRange(-0.3, 0.3); |
b9058d72 | 2592 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++); |
eb05d549 | 2593 | if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++); |
01ccc21a | 2594 | } |
2595 | /*!dphi*/ | |
95d47440 | 2596 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[0], ptName[0], 0)))){ |
2597 | pr0->H()->SetNameTitle(Form("H%sTrkInPh", prefix), "TrackIn :: #Delta#phi"); | |
01ccc21a | 2598 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2599 | } | |
2600 | /*!dx*/ | |
95d47440 | 2601 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[0], ptName[0], 0)))){ |
2602 | pr0->H()->SetNameTitle(Form("H%sTrkInX", prefix), "TrackIn :: #Deltax"); | |
01ccc21a | 2603 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2604 | } | |
b9058d72 | 2605 | |
2606 | // Row Cross processing | |
01ccc21a | 2607 | /*!RC dz*/ |
95d47440 | 2608 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", prefix, ptName[0])))){ |
2609 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
2610 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", prefix, ptName[ipt])))) continue; | |
01ccc21a | 2611 | (*pr0)+=(*pr1); |
2612 | } | |
95d47440 | 2613 | pr0->H()->SetNameTitle(Form("H%sTrkInRCZ", prefix), "TrackIn[RC]:: #Deltaz"); |
01ccc21a | 2614 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
aebcb1ff | 2615 | if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){ |
95d47440 | 2616 | PutTrendValue(Form("%sTrkInRCZ", prefix), trend, m); |
aebcb1ff | 2617 | PutTrendValue(Form("%sTrkInRCZS", prefix), s, se); |
0f2c4c4f | 2618 | } |
566c3d46 | 2619 | } |
01ccc21a | 2620 | /*!RC dy*/ |
95d47440 | 2621 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", prefix, ptName[0])))){ |
2622 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
2623 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", prefix, ptName[ipt])))) continue; | |
01ccc21a | 2624 | (*pr0)+=(*pr1); |
2625 | } | |
95d47440 | 2626 | pr0->H()->SetNameTitle(Form("H%sTrkInRCY", prefix), "TrackIn[RC]:: #Deltay"); |
01ccc21a | 2627 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2628 | } | |
2629 | /*!RC dphi*/ | |
95d47440 | 2630 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", prefix, ptName[0])))){ |
2631 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
2632 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", prefix, ptName[ipt])))) continue; | |
01ccc21a | 2633 | (*pr0)+=(*pr1); |
2634 | } | |
95d47440 | 2635 | pr0->H()->SetNameTitle(Form("H%sTrkInRCPh", prefix), "TrackIn[RC]:: #Delta#phi"); |
01ccc21a | 2636 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2637 | } | |
2638 | /*!RC dx*/ | |
95d47440 | 2639 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", prefix, ptName[0])))){ |
2640 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
2641 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", prefix, ptName[ipt])))) continue; | |
01ccc21a | 2642 | (*pr0)+=(*pr1); |
2643 | } | |
95d47440 | 2644 | pr0->H()->SetNameTitle(Form("H%sTrkInRCX", prefix), "TrackIn[RC]:: #Deltax"); |
01ccc21a | 2645 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2646 | } | |
5047978d | 2647 | |
2648 | // P_t processing | |
2649 | for(Int_t isp(0); isp<kNspc; isp++){ | |
2650 | for(Int_t ich(0); ich<kNcharge; ich++){ | |
5047978d | 2651 | TH2 *h2pt[26]={NULL}, *h2s(NULL); |
2652 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
95d47440 | 2653 | if(!(h2pt[ipt] = (TH2*)arr->FindObject(Form("H%sTrkInPt%c%d%d_2D", prefix, chName[ich], isp, ipt)))){ |
2654 | AliWarning(Form("Missing \"H%sTrkInPt%c%d%d_2D\"", prefix, chName[ich], isp, ipt)); | |
5047978d | 2655 | continue; |
2656 | } | |
2657 | if(!h2s) h2s = (TH2F*)h2pt[ipt]->Clone("h2s"); | |
2658 | else h2s->Add(h2pt[ipt]); | |
2659 | } | |
2660 | if(!h2s) continue; | |
2661 | Int_t irebin(0), dxBin(1), dyBin(1); | |
95d47440 | 2662 | while(irebin<nEtaPhi && (AliTRDrecoTask::GetMeanStat(h2s, .5, 1)<200)){ |
5047978d | 2663 | h2s->Rebin2D(rebinEtaPhiX[irebin], rebinEtaPhiY[irebin]); |
2664 | dxBin*=rebinEtaPhiX[irebin];dyBin*=rebinEtaPhiY[irebin];irebin++; | |
2665 | } | |
2666 | AliDebug(2, Form("Rebin level[%d] @ chg[%d] spc[%d]. Binning[%2dx%2d]", irebin, ich, isp, h2s->GetNbinsX(), h2s->GetNbinsY())); | |
95d47440 | 2667 | Int_t nx(h2s->GetNbinsX()), ny(h2s->GetNbinsY()); |
2668 | for(Int_t ipt(0); ipt<nPt; ipt++) h2pt[ipt]->Rebin2D(dxBin, dyBin); | |
2669 | delete h2s; | |
2670 | ||
2671 | h2 = new TH2F(Form("H%sTrkInPt%c%d_2D", prefix, chName[ich], isp), | |
2672 | Form("TrackIn[%s%c]:: <P_{t}>[GeV/c];%s;%s", spcName[v0][isp], chSgn[ich], aa[2]->GetTitle(), aa[1]->GetTitle()), | |
2673 | nx, aa[2]->GetXmin(), aa[2]->GetXmax(), | |
2674 | ny, aa[1]->GetXmin(), aa[1]->GetXmax()); | |
2675 | arr->AddAt(h2, jh++); | |
2676 | for(Int_t ix(1); ix<=nx; ix++){ // eta | |
2677 | for(Int_t iy(1); iy<=ny; iy++){ // phi | |
5047978d | 2678 | Float_t w[26]={0.}, sw(0.); |
2679 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
2680 | if(!h2pt[ipt]) continue; | |
2681 | w[ipt] = h2pt[ipt]->GetBinContent(ix, iy); | |
2682 | sw += w[ipt]; | |
2683 | } | |
2684 | if(sw<=0.) h2->SetBinContent(ix, iy, 0.); | |
2685 | else{ | |
2686 | Float_t ptm(0.); | |
2687 | for(Int_t ipt(0); ipt<nPt; ipt++){ | |
2688 | w[ipt]/=sw; | |
2689 | ptm += w[ipt]*fgPt[ipt?ipt-1:0]; | |
2690 | } | |
2691 | h2->SetBinContent(ix, iy, ptm); | |
2692 | } | |
2693 | } | |
2694 | } | |
95d47440 | 2695 | PutTrendValue(Form("%sTrkInPt%c%d", prefix, chName[ich], isp), GetMeanStat(h2, 0.01, 1)); |
5047978d | 2696 | } |
2697 | } | |
95d47440 | 2698 | AliInfo(Form("Done %3d 2D %s projections.", jh, prefix)); |
2699 | ||
2700 | // clean local memory allocation | |
2701 | for(Int_t i(fgNPt+2);i--;){ | |
2702 | if(ptCut[i]) delete [] ptCut[i]; | |
2703 | if(pCut[i]) delete [] pCut[i]; | |
2704 | } | |
3ceb45ae | 2705 | return kTRUE; |
2706 | } | |
1ee39b3a | 2707 | |
3ceb45ae | 2708 | |
f429b017 | 2709 | //________________________________________________________ |
2710 | Bool_t AliTRDresolution::MakeProjectionTrack() | |
2711 | { | |
2712 | // Analyse tracklet | |
2713 | const Int_t kNcontours(9); | |
01ccc21a | 2714 | const Int_t kNstat(30); |
f429b017 | 2715 | Int_t cidx(kMCtrack); |
2716 | if(fProj && fProj->At(cidx)) return kTRUE; | |
2717 | if(!fContainer){ | |
2718 | AliError("Missing data container."); | |
2719 | return kFALSE; | |
2720 | } | |
2721 | THnSparse *H(NULL); | |
f073d500 | 2722 | if(!(H = (THnSparse*)fContainer->FindObject("hTRD2MC"))){ |
2723 | AliError("Missing/Wrong data @ hTRD2MC."); | |
ff511aa7 | 2724 | return kTRUE; |
f429b017 | 2725 | } |
2726 | Int_t ndim(H->GetNdimensions()); | |
2727 | Int_t coord[kNdim+1]; memset(coord, 0, sizeof(Int_t) * (kNdim+1)); Double_t v = 0.; | |
01ccc21a | 2728 | TAxis *aa[kNdim+1], *as(NULL), *ap(NULL); memset(aa, 0, sizeof(TAxis*) * (kNdim+1)); |
f429b017 | 2729 | for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id); |
2730 | if(ndim > kSpeciesChgRC) as = H->GetAxis(kSpeciesChgRC); | |
01ccc21a | 2731 | if(ndim > kPt) ap = H->GetAxis(kPt); |
95d47440 | 2732 | const Int_t nPt(ap?(ap->GetNbins()+2):1); |
01ccc21a | 2733 | |
f429b017 | 2734 | // build list of projections |
95d47440 | 2735 | const Int_t nsel(AliTRDgeometry::kNlayer*fgNPt*AliPID::kSPECIES*7);//, npsel(3); |
01ccc21a | 2736 | const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'}; |
95d47440 | 2737 | const Char_t ptShortName[5] = {'L', 'l', 'i', 'h', 'H'}; |
2738 | Char_t ptName[fgNPt+2] = {0}; | |
2739 | Char_t *ptCut[fgNPt+2] = {NULL}; | |
f429b017 | 2740 | // define rebinning strategy |
0f2c4c4f | 2741 | const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2}; |
2742 | if(aa[1]->GetNbins()==180){ // old binning | |
2743 | rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2; | |
2744 | rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1; | |
2745 | rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1; | |
2746 | rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5; | |
2747 | rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy | |
2748 | } | |
eb05d549 | 2749 | AliTRDrecoProjection hp[kTrkNproj]; TObjArray php(kTrkNproj); |
f429b017 | 2750 | Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t)); |
2751 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ | |
95d47440 | 2752 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
2753 | if(!ptName[ipt]){ | |
2754 | ptName[ipt]= nPt>5?(64+ipt):ptShortName[ipt]; | |
2755 | ptCut[ipt] = StrDup(Form("#it{%4.2f<=p_{t}^{MC}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., ipt>fgNPt?99.99:fgPt[ipt])); | |
2756 | } | |
01ccc21a | 2757 | for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){ |
2758 | for(Int_t ich(0); ich<kNcharge; ich++){ | |
2759 | isel++; // new selection | |
95d47440 | 2760 | hp[ih].Build(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily), |
2761 | Form("Tracks[%s%c]:: #Deltay{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily), | |
01ccc21a | 2762 | kEta, kPhi, kYrez, aa); |
2763 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2764 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 2765 | hp[ih].Build(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily), |
2766 | Form("Tracks[%s%c]:: #Delta#phi{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily), | |
01ccc21a | 2767 | kEta, kPhi, kPrez, aa); |
2768 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2769 | php.AddLast(&hp[ih++]); np[isel]++; | |
95d47440 | 2770 | hp[ih].Build(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily), |
2771 | Form("Tracks[%s%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily), | |
01ccc21a | 2772 | kEta, kPhi, kNdim, aa); |
2773 | hp[ih].SetShowRange(0.,10.); | |
2774 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2775 | php.AddLast(&hp[ih++]); np[isel]++; | |
2776 | } | |
2777 | } | |
2778 | isel++; // new selection | |
95d47440 | 2779 | hp[ih].Build(Form("HMCTrkZ%c%d", ptName[ipt], UseLYselectTrklt()?fLYselect:ily), |
2780 | Form("Tracks[RC]:: #Deltaz{%s} Ly[%d]", ptCut[ipt], UseLYselectTrklt()?fLYselect:ily), | |
01ccc21a | 2781 | kEta, kPhi, kZrez, aa); |
2782 | hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY); | |
2783 | php.AddLast(&hp[ih++]); np[isel]++; | |
2784 | } | |
f429b017 | 2785 | } |
0f2c4c4f | 2786 | AliInfo(Form("Build %3d 3D projections.", ih)); |
f429b017 | 2787 | |
01ccc21a | 2788 | Int_t ly(0), ch(0), pt(0), sp(2), rcBin(as?as->FindBin(0.):-1); |
f429b017 | 2789 | for (Long64_t ib(0); ib < H->GetNbins(); ib++) { |
2790 | v = H->GetBinContent(ib, coord); | |
2791 | if(v<1.) continue; | |
2792 | ly = coord[kBC]-1; // layer selection | |
fb7cacec | 2793 | if(ly<0) ly=0; // fix for bug in PlotMC |
f429b017 | 2794 | // charge selection |
01ccc21a | 2795 | ch=0; sp=2;// [pi-] track [dafault] |
f429b017 | 2796 | if(rcBin>0){ // debug mode in which species are also saved |
01ccc21a | 2797 | sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1; |
2798 | if(coord[kSpeciesChgRC] > rcBin) ch = 1; // [+] track | |
f429b017 | 2799 | else if(coord[kSpeciesChgRC] == rcBin) ch = 2; // [RC] track |
2800 | } | |
01ccc21a | 2801 | // pt selection |
2802 | pt = 0; // low pt [default] | |
2803 | if(ap) pt = coord[kPt]-1; | |
2804 | // global selection | |
95d47440 | 2805 | Int_t ioff = ly*nPt*31+pt*31; ioff+=3*(sp<0?10:(sp*kNcharge+ch)); |
2806 | isel = ly*nPt*11+pt*11; isel+=sp<0?10:(sp*kNcharge+ch); | |
01ccc21a | 2807 | 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 | 2808 | for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); |
f429b017 | 2809 | } |
f429b017 | 2810 | TObjArray *arr(NULL); |
0b366e97 | 2811 | fProj->AddAt(arr = new TObjArray(kTrkNproj), cidx); |
95d47440 | 2812 | arr->SetName("hTRD2MC"); arr->SetOwner(); |
f429b017 | 2813 | |
01ccc21a | 2814 | TH2 *h2(NULL); Int_t jh(0); |
f429b017 | 2815 | for(; ih--; ){ |
eb05d549 | 2816 | if(!hp[ih].H()) continue; |
0b366e97 | 2817 | if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours))) continue; |
01ccc21a | 2818 | arr->AddAt(h2, jh++); |
f429b017 | 2819 | } |
01ccc21a | 2820 | |
2821 | // combine up the tree of projections | |
eb05d549 | 2822 | AliTRDrecoProjection *pr0(NULL), *pr1(NULL); |
01ccc21a | 2823 | //Int_t iproj(0), jproj(0); |
2824 | for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){ | |
2825 | for(Int_t ich(0); ich<kNcharge; ich++){ | |
95d47440 | 2826 | for(Int_t ipt(0); ipt<nPt; ipt++){ |
01ccc21a | 2827 | /*!dy*/ |
95d47440 | 2828 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
01ccc21a | 2829 | for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){ |
95d47440 | 2830 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily)))) continue; |
01ccc21a | 2831 | (*pr0)+=(*pr1); |
2832 | } | |
95d47440 | 2833 | AliDebug(2, Form("Rename %s to HMCTrkY%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily)); |
2834 | pr0->H()->SetNameTitle(Form("HMCTrkY%c%c%d", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), | |
2835 | Form("Tracks[%c]:: #Deltay{%s} Ly[%d]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2836 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2837 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0); |
01ccc21a | 2838 | } |
2839 | /*!dphi*/ | |
95d47440 | 2840 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
01ccc21a | 2841 | for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){ |
95d47440 | 2842 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily)))) continue; |
01ccc21a | 2843 | (*pr0)+=(*pr1); |
2844 | } | |
95d47440 | 2845 | AliDebug(2, Form("Rename %s to HMCTrkPh%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily)); |
2846 | pr0->H()->SetNameTitle(Form("HMCTrkPh%c%c%d", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), | |
2847 | Form("Tracks[%c]:: #Delta#phi{%s} Ly[%d]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2848 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2849 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0); |
01ccc21a | 2850 | } |
2851 | ||
2852 | /*!dpt/pt*/ | |
95d47440 | 2853 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
01ccc21a | 2854 | for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){ |
95d47440 | 2855 | if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily)))) continue; |
01ccc21a | 2856 | (*pr0)+=(*pr1); |
2857 | } | |
95d47440 | 2858 | AliDebug(2, Form("Rename %s to HMCTrkDPt%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily)); |
2859 | pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%c%d", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), | |
2860 | Form("Tracks[%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2861 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2862 | if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0); |
01ccc21a | 2863 | } |
2864 | } | |
2865 | /*!dy*/ | |
95d47440 | 2866 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
2867 | pr0->H()->SetNameTitle(Form("HMCTrkY%c%d", chName[ich], UseLYselectTrklt()?fLYselect:ily), | |
2868 | Form("Tracks[%c]:: #Deltay Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2869 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2870 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0); |
01ccc21a | 2871 | } |
2872 | /*!dphi*/ | |
95d47440 | 2873 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
2874 | pr0->H()->SetNameTitle(Form("HMCTrkPh%c%d", chName[ich], UseLYselectTrklt()?fLYselect:ily), | |
2875 | Form("Tracks[%c]:: #Delta#phi Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2876 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2877 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0); |
01ccc21a | 2878 | } |
2879 | /*!dpt/pt*/ | |
95d47440 | 2880 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
2881 | pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%d", chName[ich], UseLYselectTrklt()?fLYselect:ily), | |
2882 | Form("Tracks[%c]:: #Deltap_{t}/p_{t} Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2883 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
95d47440 | 2884 | if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0); |
01ccc21a | 2885 | } |
2886 | } | |
2887 | /*!dy*/ | |
95d47440 | 2888 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
2889 | pr0->H()->SetNameTitle(Form("HMCTrkY%d", UseLYselectTrklt()?fLYselect:ily), Form("Tracks :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2890 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2891 | } | |
2892 | /*!dphi*/ | |
95d47440 | 2893 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
2894 | pr0->H()->SetNameTitle(Form("HMCTrkPh%d", UseLYselectTrklt()?fLYselect:ily), Form("Tracks :: #Delta#phi Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2895 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2896 | } | |
2897 | /*!dpt/pt*/ | |
95d47440 | 2898 | if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){ |
2899 | pr0->H()->SetNameTitle(Form("HMCTrkDPt%d", UseLYselectTrklt()?fLYselect:ily), Form("Tracks :: #Deltap_{t}/p_{t} Ly[%d]", UseLYselectTrklt()?fLYselect:ily)); | |
01ccc21a | 2900 | if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++); |
2901 | } | |
2902 | } | |
8892a7f3 | 2903 | AliInfo(Form("Done %3d 2D projections.", jh)); |
f429b017 | 2904 | return kTRUE; |
2905 | } | |
3ceb45ae | 2906 | |
2907 | //________________________________________________________ | |
2908 | Bool_t AliTRDresolution::PostProcess() | |
2909 | { | |
2910 | // Fit, Project, Combine, Extract values from the containers filled during execution | |
2911 | ||
2912 | if (!fContainer) { | |
2913 | AliError("ERROR: list not available"); | |
2914 | return kFALSE; | |
2915 | } | |
35983729 | 2916 | if(!fProj){ |
2917 | AliInfo("Building array of projections ..."); | |
95d47440 | 2918 | fProj = new TObjArray(kNclasses+1); fProj->SetOwner(kTRUE); |
35983729 | 2919 | } |
0f2c4c4f | 2920 | // set pt/p segmentation. guess from data |
2921 | THnSparse *H(NULL); | |
2922 | if(!(H = (THnSparse*)fContainer->FindObject("hTracklet2TRDin"))){ | |
95d47440 | 2923 | AliWarning("Missing/Wrong data @ hTracklet2TRDin needed for infering pt/p segmentation."); |
0f2c4c4f | 2924 | return kFALSE; |
2925 | } | |
efc109ad | 2926 | // protect for backward compatibility |
2927 | fNpt=H->GetAxis(kPt)?(H->GetAxis(kPt)->GetNbins()+1):1; | |
0f2c4c4f | 2928 | if(!MakeMomSegmentation()) return kFALSE; |
1ee39b3a | 2929 | |
1ee39b3a | 2930 | //PROCESS EXPERIMENTAL DISTRIBUTIONS |
f073d500 | 2931 | // Clusters detector |
95d47440 | 2932 | if(HasProcess(kDetector)) MakeProjectionDetector(); |
1ee39b3a | 2933 | // Clusters residuals |
95d47440 | 2934 | if(HasProcess(kCluster)) MakeProjectionCluster(); |
6558fd69 | 2935 | fNRefFigures = 3; |
1ee39b3a | 2936 | // Tracklet residual/pulls |
95d47440 | 2937 | if(HasProcess(kTracklet)) MakeProjectionTracklet(); |
6558fd69 | 2938 | fNRefFigures = 7; |
a310e49b | 2939 | // TRDin residual/pulls |
95d47440 | 2940 | if(HasProcess(kTrackIn)){ |
2941 | MakeProjectionTrackIn(); | |
2942 | MakeProjectionTrackIn(kFALSE, kTRUE); | |
2943 | } | |
6558fd69 | 2944 | fNRefFigures = 11; |
1ee39b3a | 2945 | |
2946 | if(!HasMCdata()) return kTRUE; | |
1ee39b3a | 2947 | //PROCESS MC RESIDUAL DISTRIBUTIONS |
2948 | ||
2949 | // CLUSTER Y RESOLUTION/PULLS | |
95d47440 | 2950 | if(HasProcess(kCluster)) MakeProjectionCluster(kTRUE); |
6558fd69 | 2951 | fNRefFigures = 17; |
1ee39b3a | 2952 | |
2953 | // TRACKLET RESOLUTION/PULLS | |
33056e04 | 2954 | if(HasProcess(kTracklet)) if(!MakeProjectionTracklet(kTRUE)) return kFALSE; |
d25116b6 | 2955 | fNRefFigures = 21; |
1ee39b3a | 2956 | |
2957 | // TRACK RESOLUTION/PULLS | |
5047978d | 2958 | // if(HasProcess(kTracklet)) if(!MakeProjectionTrack()) return kFALSE; |
2959 | // fNRefFigures+=16; | |
92d6d80c | 2960 | |
2961 | // TRACK TRDin RESOLUTION/PULLS | |
33056e04 | 2962 | if(HasProcess(kTrackIn)) if(!MakeProjectionTrackIn(kTRUE)) return kFALSE; |
d25116b6 | 2963 | fNRefFigures+=8; |
1ee39b3a | 2964 | |
2965 | return kTRUE; | |
2966 | } | |
2967 | ||
2968 | ||
2969 | //________________________________________________________ | |
2970 | void AliTRDresolution::Terminate(Option_t *opt) | |
2971 | { | |
2972 | AliTRDrecoTask::Terminate(opt); | |
2973 | if(HasPostProcess()) PostProcess(); | |
2974 | } | |
2975 | ||
2976 | //________________________________________________________ | |
2977 | void AliTRDresolution::AdjustF1(TH1 *h, TF1 *f) | |
2978 | { | |
2979 | // Helper function to avoid duplication of code | |
2980 | // Make first guesses on the fit parameters | |
2981 | ||
2982 | // find the intial parameters of the fit !! (thanks George) | |
2983 | Int_t nbinsy = Int_t(.5*h->GetNbinsX()); | |
2984 | Double_t sum = 0.; | |
2985 | for(Int_t jbin=nbinsy-4; jbin<=nbinsy+4; jbin++) sum+=h->GetBinContent(jbin); sum/=9.; | |
2986 | f->SetParLimits(0, 0., 3.*sum); | |
2987 | f->SetParameter(0, .9*sum); | |
2988 | Double_t rms = h->GetRMS(); | |
2989 | f->SetParLimits(1, -rms, rms); | |
2990 | f->SetParameter(1, h->GetMean()); | |
2991 | ||
2992 | f->SetParLimits(2, 0., 2.*rms); | |
2993 | f->SetParameter(2, rms); | |
2994 | if(f->GetNpar() <= 4) return; | |
2995 | ||
2996 | f->SetParLimits(3, 0., sum); | |
2997 | f->SetParameter(3, .1*sum); | |
2998 | ||
2999 | f->SetParLimits(4, -.3, .3); | |
3000 | f->SetParameter(4, 0.); | |
3001 | ||
3002 | f->SetParLimits(5, 0., 1.e2); | |
3003 | f->SetParameter(5, 2.e-1); | |
3004 | } | |
3005 | ||
3006 | //________________________________________________________ | |
3007 | TObjArray* AliTRDresolution::Histos() | |
3008 | { | |
3009 | // | |
3010 | // Define histograms | |
3011 | // | |
3012 | ||
3013 | if(fContainer) return fContainer; | |
3014 | ||
3ceb45ae | 3015 | fContainer = new TObjArray(kNclasses); fContainer->SetOwner(kTRUE); |
3016 | THnSparse *H(NULL); | |
3017 | const Int_t nhn(100); Char_t hn[nhn]; TString st; | |
0f2c4c4f | 3018 | Int_t triggerBins(fTriggerList?(TMath::Power(2.,fTriggerList->GetEntriesFast())-1):0); |
1ee39b3a | 3019 | |
f073d500 | 3020 | //++++++++++++++++++++++ |
3021 | // cluster to detector | |
3022 | snprintf(hn, nhn, "h%s", fgPerformanceName[kDetector]); | |
3023 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
5591f3d6 | 3024 | const Int_t mdim(6); |
0f2c4c4f | 3025 | const Char_t *cldTitle[mdim] = {"layer", fgkTitle[kPhi], "pad row", "centrality", "q [a.u.]", triggerBins?"trigger":"no. of pads"/*, "tb [10 Hz]"*/}; |
3026 | const Int_t cldNbins[mdim] = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], 76, AliTRDeventInfo::kCentralityClasses, 50, triggerBins?triggerBins:kNpads}; | |
3557a081 | 3027 | const Double_t cldMin[mdim] = {-0.5, fgkMin[kPhi], -0.5, -0.5, 0., 0.5}, |
0f2c4c4f | 3028 | cldMax[mdim] = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], 75.5, AliTRDeventInfo::kCentralityClasses - 0.5, 1200., triggerBins?(triggerBins+.5):(kNpads+.5)}; |
f073d500 | 3029 | st = "cluster proprieties;"; |
3030 | // define minimum info to be saved in non debug mode | |
3031 | Int_t ndim=DebugLevel()>=1?mdim:Int_t(kNdimDet); | |
3032 | for(Int_t idim(0); idim<ndim; idim++){ st += cldTitle[idim]; st+=";";} | |
3033 | H = new THnSparseI(hn, st.Data(), ndim, cldNbins, cldMin, cldMax); | |
3034 | } else H->Reset(); | |
3035 | fContainer->AddAt(H, kDetector); | |
3ceb45ae | 3036 | //++++++++++++++++++++++ |
3ed01fbe | 3037 | // cluster to tracklet residuals/pulls |
3ceb45ae | 3038 | snprintf(hn, nhn, "h%s", fgPerformanceName[kCluster]); |
3039 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
b9058d72 | 3040 | const Int_t mdim(10); |
0f2c4c4f | 3041 | const Char_t *clTitle[mdim] = {"layer", fgkTitle[kPhi], fgkTitle[kEta], fgkTitle[kYrez], "#Deltax [cm]", "Q</Q", "Q/angle", "#Phi [deg]", "centrality", triggerBins?"trigger":"no. of pads"}; |
3042 | const Int_t clNbins[mdim] = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], fgkNbins[kEta], fgkNbins[kYrez], 45, 30, 30, 15, AliTRDeventInfo::kCentralityClasses, triggerBins?triggerBins:kNpads}; | |
b9058d72 | 3043 | const Double_t clMin[mdim] = {-0.5, fgkMin[kPhi], fgkMin[kEta], fgkMin[kYrez]/10., -.5, 0.1, -2., -45, -0.5, 0.5}, |
0f2c4c4f | 3044 | clMax[mdim] = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], fgkMax[kEta], fgkMax[kYrez]/10., 4., 2.1, 118., 45, AliTRDeventInfo::kCentralityClasses - 0.5, triggerBins?(triggerBins+.5):(kNpads+.5)}; |
3ceb45ae | 3045 | st = "cluster spatial&charge resolution;"; |
3ed01fbe | 3046 | // define minimum info to be saved in non debug mode |
b9058d72 | 3047 | Int_t ndim=DebugLevel()>=1?mdim:Int_t(kNdimCl); |
3ed01fbe | 3048 | for(Int_t idim(0); idim<ndim; idim++){ st += clTitle[idim]; st+=";";} |
3049 | H = new THnSparseI(hn, st.Data(), ndim, clNbins, clMin, clMax); | |
3ceb45ae | 3050 | } else H->Reset(); |
3051 | fContainer->AddAt(H, kCluster); | |
3052 | //++++++++++++++++++++++ | |
afca20ef | 3053 | // tracklet to TRD track |
3ceb45ae | 3054 | snprintf(hn, nhn, "h%s", fgPerformanceName[kTracklet]); |
3055 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
8892a7f3 | 3056 | const Int_t mdim(kNdim+8); |
808d178e | 3057 | Char_t *trTitle[mdim]; memcpy(trTitle, fgkTitle, kNdim*sizeof(Char_t*)); |
3058 | Int_t trNbins[mdim]; memcpy(trNbins, fgkNbins, kNdim*sizeof(Int_t)); | |
3059 | Double_t trMin[mdim]; memcpy(trMin, fgkMin, kNdim*sizeof(Double_t)); | |
3060 | Double_t trMax[mdim]; memcpy(trMax, fgkMax, kNdim*sizeof(Double_t)); | |
3ed01fbe | 3061 | // set specific fields |
f429b017 | 3062 | trMin[kYrez] = -0.45; trMax[kYrez] = 0.45; |
3063 | trMin[kPrez] = -4.5; trMax[kPrez] = 4.5; | |
3064 | trMin[kZrez] = -1.5; trMax[kZrez] = 1.5; | |
3ed01fbe | 3065 | trTitle[kBC]=StrDup("layer"); trNbins[kBC] = AliTRDgeometry::kNlayer; trMin[kBC] = -0.5; trMax[kBC] = AliTRDgeometry::kNlayer-0.5; |
95d47440 | 3066 | trNbins[kPt]=fNpt-1; trMax[kPt] = trNbins[kPt]-.5; |
b9058d72 | 3067 | Int_t jdim(kNdim); |
3068 | trTitle[jdim]=StrDup("centrality"); trNbins[jdim] = AliTRDeventInfo::kCentralityClasses; trMin[jdim] = -.5; trMax[jdim] = AliTRDeventInfo::kCentralityClasses - 0.5; | |
0f2c4c4f | 3069 | jdim++; |
3070 | if(triggerBins){ | |
3071 | trTitle[jdim]=StrDup("trigger"); trNbins[jdim] = triggerBins; | |
3072 | trMin[jdim] = 0.5; trMax[jdim] = triggerBins+.5; | |
3073 | } else { | |
3074 | trTitle[jdim]=StrDup("occupancy [%]"); trNbins[jdim] = 12; | |
3075 | trMin[jdim] = 25.; trMax[jdim] = 85.; | |
3076 | } | |
808d178e | 3077 | |
3ceb45ae | 3078 | st = "tracklet spatial&charge resolution;"; |
3ed01fbe | 3079 | // define minimum info to be saved in non debug mode |
b9058d72 | 3080 | Int_t ndim=DebugLevel()>=1?(jdim+1):kNdimTrklt; |
3ed01fbe | 3081 | for(Int_t idim(0); idim<ndim; idim++){ st += trTitle[idim]; st+=";";} |
3082 | H = new THnSparseI(hn, st.Data(), ndim, trNbins, trMin, trMax); | |
3ceb45ae | 3083 | } else H->Reset(); |
3084 | fContainer->AddAt(H, kTracklet); | |
3085 | //++++++++++++++++++++++ | |
afca20ef | 3086 | // tracklet to TRDin |
3ceb45ae | 3087 | snprintf(hn, nhn, "h%s", fgPerformanceName[kTrackIn]); |
3088 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
35983729 | 3089 | // set specific fields |
f036f7ec | 3090 | const Int_t mdim(kNdim+2); |
35983729 | 3091 | Char_t *trinTitle[mdim]; memcpy(trinTitle, fgkTitle, kNdim*sizeof(Char_t*)); |
3092 | Int_t trinNbins[mdim]; memcpy(trinNbins, fgkNbins, kNdim*sizeof(Int_t)); | |
3093 | Double_t trinMin[mdim]; memcpy(trinMin, fgkMin, kNdim*sizeof(Double_t)); | |
3094 | Double_t trinMax[mdim]; memcpy(trinMax, fgkMax, kNdim*sizeof(Double_t)); | |
0f2c4c4f | 3095 | if(triggerBins){ |
3096 | trinTitle[kBC]=StrDup("trigger"); trinNbins[kBC] = triggerBins; | |
3097 | trinMin[kBC] = 0.5; trinMax[kBC] = triggerBins+.5; | |
3098 | } | |
3099 | // trinNbins[kSpeciesChgRC] = Int_t(kNcharge)*(kNspc-1)+1; trinMin[kSpeciesChgRC] = -kNspc+0.5; trinMax[kSpeciesChgRC] = kNspc-0.5; | |
3100 | trinNbins[kPt]=fNpt-1; trinMax[kPt] = trinNbins[kPt]-.5; | |
95d47440 | 3101 | trinTitle[kNdim]=StrDup("p [bin]"); trinNbins[kNdim] = fNpt-1; trinMin[kNdim] = -0.5; trinMax[kNdim] = trinNbins[kNdim]-.5; |
35983729 | 3102 | trinTitle[kNdim+1]=StrDup("dx [cm]"); trinNbins[kNdim+1]=48; trinMin[kNdim+1]=-2.4; trinMax[kNdim+1]=2.4; |
f036f7ec | 3103 | //trinTitle[kNdim+2]=StrDup("Fill Bunch"); trinNbins[kNdim+2]=3500; trinMin[kNdim+2]=-0.5; trinMax[kNdim+2]=3499.5; |
3ceb45ae | 3104 | st = "r-#phi/z/angular residuals @ TRD entry;"; |
3ed01fbe | 3105 | // define minimum info to be saved in non debug mode |
cc98ff07 | 3106 | Int_t ndim=(DebugLevel()>=1?mdim:(kNdim+1));//kNdimTrkIn; |
35983729 | 3107 | for(Int_t idim(0); idim<ndim; idim++){st+=trinTitle[idim]; st+=";";} |
3108 | H = new THnSparseI(hn, st.Data(), ndim, trinNbins, trinMin, trinMax); | |
3ceb45ae | 3109 | } else H->Reset(); |
3110 | fContainer->AddAt(H, kTrackIn); | |
a310e49b | 3111 | // tracklet to TRDout |
3ed01fbe | 3112 | // fContainer->AddAt(BuildMonitorContainerTracklet("TrkOUT"), kTrackOut); |
1ee39b3a | 3113 | |
3114 | ||
3115 | // Resolution histos | |
3116 | if(!HasMCdata()) return fContainer; | |
3117 | ||
f429b017 | 3118 | //++++++++++++++++++++++ |
3119 | // cluster to TrackRef residuals/pulls | |
3120 | snprintf(hn, nhn, "h%s", fgPerformanceName[kMCcluster]); | |
3121 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
0f2c4c4f | 3122 | H = (THnSparseI*)((THnSparseI*)fContainer->At(kCluster))->Clone(hn); |
3123 | H->SetTitle("MC cluster spatial resolution"); | |
f429b017 | 3124 | } else H->Reset(); |
3125 | fContainer->AddAt(H, kMCcluster); | |
3126 | //++++++++++++++++++++++ | |
3127 | // tracklet to TrackRef | |
3128 | snprintf(hn, nhn, "h%s", fgPerformanceName[kMCtracklet]); | |
3129 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
0f2c4c4f | 3130 | H = (THnSparseI*)((THnSparseI*)fContainer->At(kTracklet))->Clone(hn); |
3131 | H->SetTitle("MC tracklet spatial resolution"); | |
f429b017 | 3132 | } else H->Reset(); |
3133 | fContainer->AddAt(H, kMCtracklet); | |
3134 | //++++++++++++++++++++++ | |
3135 | // TRDin to TrackRef | |
3136 | snprintf(hn, nhn, "h%s", fgPerformanceName[kMCtrackIn]); | |
3137 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
0f2c4c4f | 3138 | H = (THnSparseI*)((THnSparseI*)fContainer->At(kTrackIn))->Clone(hn); |
3139 | H->SetTitle("MC r-#phi/z/angular residuals @ TRD entry"); | |
f429b017 | 3140 | } else H->Reset(); |
3ceb45ae | 3141 | fContainer->AddAt(H, kMCtrackIn); |
f429b017 | 3142 | //++++++++++++++++++++++ |
3143 | // track to TrackRef | |
3144 | snprintf(hn, nhn, "h%s", fgPerformanceName[kMCtrack]); | |
3145 | if(!(H = (THnSparseI*)gROOT->FindObject(hn))){ | |
3146 | Char_t *trTitle[kNdim+1]; memcpy(trTitle, fgkTitle, kNdim*sizeof(Char_t*)); | |
3147 | Int_t trNbins[kNdim+1]; memcpy(trNbins, fgkNbins, kNdim*sizeof(Int_t)); | |
3148 | Double_t trMin[kNdim+1]; memcpy(trMin, fgkMin, kNdim*sizeof(Double_t)); | |
3149 | Double_t trMax[kNdim+1]; memcpy(trMax, fgkMax, kNdim*sizeof(Double_t)); | |
3150 | // set specific fields | |
3151 | trTitle[kBC]=StrDup("layer"); trNbins[kBC] = AliTRDgeometry::kNlayer; trMin[kBC] = -0.5; trMax[kBC] = AliTRDgeometry::kNlayer-0.5; | |
f429b017 | 3152 | trMin[kYrez] = -0.9; trMax[kYrez] = -trMin[kYrez]; |
3153 | trMin[kPrez] = -1.5; trMax[kPrez] = -trMin[kPrez]; | |
3154 | trMin[kZrez] = -0.9; trMax[kZrez] = -trMin[kZrez]; | |
0f2c4c4f | 3155 | trNbins[kPt] =fNpt-1;trMax[kPt] = trNbins[kPt]-.5; |
3156 | //trNbins[kSpeciesChgRC] = Int_t(kNcharge)*AliPID::kSPECIES+1;trMin[kSpeciesChgRC] = -AliPID::kSPECIES-0.5; trMax[kSpeciesChgRC] = AliPID::kSPECIES+0.5; | |
566c3d46 | 3157 | trTitle[kNdim]=StrDup("#Deltap_{t}/p_{t} [%]"); trNbins[kNdim] = 25; trMin[kNdim] = -4.5; trMax[kNdim] = 20.5; |
1ee39b3a | 3158 | |
f429b017 | 3159 | st = "MC track spatial&p_{t} resolution;"; |
3160 | // define minimum info to be saved in non debug mode | |
3161 | Int_t ndim=DebugLevel()>=1?(kNdim+1):4; | |
3162 | for(Int_t idim(0); idim<ndim; idim++){ st += trTitle[idim]; st+=";";} | |
3163 | H = new THnSparseI(hn, st.Data(), ndim, trNbins, trMin, trMax); | |
3164 | } else H->Reset(); | |
3165 | fContainer->AddAt(H, kMCtrack); | |
3166 | ||
1ee39b3a | 3167 | return fContainer; |
3168 | } | |
3169 | ||
08bdd9d1 | 3170 | //____________________________________________________________________ |
3171 | Bool_t AliTRDresolution::FitTrack(const Int_t np, AliTrackPoint *points, Float_t param[10]) | |
3172 | { | |
3173 | // | |
3174 | // Fit track with a staight line using the "np" clusters stored in the array "points". | |
3175 | // The following particularities are stored in the clusters from points: | |
3176 | // 1. pad tilt as cluster charge | |
3177 | // 2. pad row cross or vertex constrain as fake cluster with cluster type 1 | |
3178 | // The parameters of the straight line fit are stored in the array "param" in the following order : | |
3179 | // param[0] - x0 reference radial position | |
3180 | // param[1] - y0 reference r-phi position @ x0 | |
3181 | // param[2] - z0 reference z position @ x0 | |
3182 | // param[3] - slope dy/dx | |
3183 | // param[4] - slope dz/dx | |
3184 | // | |
3185 | // Attention : | |
3186 | // Function should be used to refit tracks for B=0T | |
3187 | // | |
3188 | ||
3189 | if(np<40){ | |
2bfe5463 | 3190 | if(AliLog::GetDebugLevel("PWGPP", "AliTRDresolution")>1) printf("D-AliTRDresolution::FitTrack: Not enough clusters to fit a track [%d].\n", np); |
08bdd9d1 | 3191 | return kFALSE; |
3192 | } | |
3193 | TLinearFitter yfitter(2, "pol1"), zfitter(2, "pol1"); | |
3194 | ||
3195 | Double_t x0(0.); | |
3196 | for(Int_t ip(0); ip<np; ip++) x0+=points[ip].GetX(); | |
3197 | x0/=Float_t(np); | |
3198 | ||
00a56108 | 3199 | Double_t x, y, z, dx, tilt(0.); |
08bdd9d1 | 3200 | for(Int_t ip(0); ip<np; ip++){ |
3201 | x = points[ip].GetX(); z = points[ip].GetZ(); | |
3202 | dx = x - x0; | |
3203 | zfitter.AddPoint(&dx, z, points[ip].GetClusterType()?1.e-3:1.); | |
3204 | } | |
3205 | if(zfitter.Eval() != 0) return kFALSE; | |
3206 | ||
3207 | Double_t z0 = zfitter.GetParameter(0); | |
3208 | Double_t dzdx = zfitter.GetParameter(1); | |
3209 | for(Int_t ip(0); ip<np; ip++){ | |
3210 | if(points[ip].GetClusterType()) continue; | |
3211 | x = points[ip].GetX(); | |
3212 | dx = x - x0; | |
3213 | y = points[ip].GetY(); | |
3214 | z = points[ip].GetZ(); | |
3215 | tilt = points[ip].GetCharge(); | |
3216 | y -= tilt*(-dzdx*dx + z - z0); | |
5047978d | 3217 | Float_t xyz[3] = {(Float_t)x, (Float_t)y, (Float_t)z}; points[ip].SetXYZ(xyz); |
08bdd9d1 | 3218 | yfitter.AddPoint(&dx, y, 1.); |
3219 | } | |
3220 | if(yfitter.Eval() != 0) return kFALSE; | |
3221 | Double_t y0 = yfitter.GetParameter(0); | |
3222 | Double_t dydx = yfitter.GetParameter(1); | |
3223 | ||
3224 | param[0] = x0; param[1] = y0; param[2] = z0; param[3] = dydx; param[4] = dzdx; | |
2bfe5463 | 3225 | if(AliLog::GetDebugLevel("PWGPP", "AliTRDresolution")>3) printf("D-AliTRDresolution::FitTrack: x0[%f] y0[%f] z0[%f] dydx[%f] dzdx[%f].\n", x0, y0, z0, dydx, dzdx); |
08bdd9d1 | 3226 | return kTRUE; |
3227 | } | |
3228 | ||
5f7f1c07 | 3229 | //____________________________________________________________________ |
b37d601d | 3230 | Bool_t AliTRDresolution::FitTracklet(const Int_t ly, const Int_t np, const AliTrackPoint *points, const Float_t param[10], Float_t par[3]) |
5f7f1c07 | 3231 | { |
3232 | // | |
3233 | // Fit tracklet with a staight line using the coresponding subset of clusters out of the total "np" clusters stored in the array "points". | |
3234 | // See function FitTrack for the data stored in the "clusters" array | |
3235 | ||
3236 | // The parameters of the straight line fit are stored in the array "param" in the following order : | |
3237 | // par[0] - x0 reference radial position | |
3238 | // par[1] - y0 reference r-phi position @ x0 | |
3239 | // par[2] - slope dy/dx | |
3240 | // | |
3241 | // Attention : | |
3242 | // Function should be used to refit tracks for B=0T | |
3243 | // | |
3244 | ||
3245 | TLinearFitter yfitter(2, "pol1"); | |
3246 | ||
3247 | // grep data for tracklet | |
3248 | Double_t x0(0.), x[60], y[60], dy[60]; | |
3249 | Int_t nly(0); | |
3250 | for(Int_t ip(0); ip<np; ip++){ | |
3251 | if(points[ip].GetClusterType()) continue; | |
3252 | if(points[ip].GetVolumeID() != ly) continue; | |
3253 | Float_t xt(points[ip].GetX()) | |
3254 | ,yt(param[1] + param[3] * (xt - param[0])); | |
3255 | x[nly] = xt; | |
3256 | y[nly] = points[ip].GetY(); | |
3257 | dy[nly]= y[nly]-yt; | |
3258 | x0 += xt; | |
3259 | nly++; | |
3260 | } | |
3261 | if(nly<10){ | |
2bfe5463 | 3262 | if(AliLog::GetDebugLevel("PWGPP", "AliTRDresolution")>1) printf("D-AliTRDresolution::FitTracklet: Not enough clusters to fit a tracklet [%d].\n", nly); |
5f7f1c07 | 3263 | return kFALSE; |
3264 | } | |
3265 | // set radial reference for fit | |
3266 | x0 /= Float_t(nly); | |
3267 | ||
3268 | // find tracklet core | |
3269 | Double_t mean(0.), sig(1.e3); | |
3270 | AliMathBase::EvaluateUni(nly, dy, mean, sig, 0); | |
3271 | ||
3272 | // simple cluster error parameterization | |
3273 | Float_t kSigCut = TMath::Sqrt(5.e-4 + param[3]*param[3]*0.018); | |
3274 | ||
3275 | // fit tracklet core | |
3276 | for(Int_t jly(0); jly<nly; jly++){ | |
3277 | if(TMath::Abs(dy[jly]-mean)>kSigCut) continue; | |
3278 | Double_t dx(x[jly]-x0); | |
3279 | yfitter.AddPoint(&dx, y[jly], 1.); | |
3280 | } | |
3281 | if(yfitter.Eval() != 0) return kFALSE; | |
3282 | par[0] = x0; | |
3283 | par[1] = yfitter.GetParameter(0); | |
3284 | par[2] = yfitter.GetParameter(1); | |
3285 | return kTRUE; | |
3286 | } | |
3287 | ||
00a56108 | 3288 | //____________________________________________________________________ |
b37d601d | 3289 | Bool_t AliTRDresolution::UseTrack(const Int_t np, const AliTrackPoint *points, Float_t param[10]) |
00a56108 | 3290 | { |
3291 | // | |
3292 | // Global selection mechanism of tracksbased on cluster to fit residuals | |
3293 | // The parameters are the same as used ni function FitTrack(). | |
3294 | ||
3295 | const Float_t kS(0.6), kM(0.2); | |
3296 | TH1S h("h1", "", 100, -5.*kS, 5.*kS); | |
5047978d | 3297 | Float_t dy/*, dz*/, s, m; |
00a56108 | 3298 | for(Int_t ip(0); ip<np; ip++){ |
3299 | if(points[ip].GetClusterType()) continue; | |
3300 | Float_t x0(points[ip].GetX()) | |
3301 | ,y0(param[1] + param[3] * (x0 - param[0])) | |
5047978d | 3302 | /*,z0(param[2] + param[4] * (x0 - param[0]))*/; |
00a56108 | 3303 | dy=points[ip].GetY() - y0; h.Fill(dy); |
5047978d | 3304 | //dz=points[ip].GetZ() - z0; |
00a56108 | 3305 | } |
3306 | TF1 fg("fg", "gaus", -5.*kS, 5.*kS); | |
3307 | fg.SetParameter(1, 0.); | |
3308 | fg.SetParameter(2, 2.e-2); | |
3309 | h.Fit(&fg, "QN"); | |
3310 | m=fg.GetParameter(1); s=fg.GetParameter(2); | |
3311 | if(s>kS || TMath::Abs(m)>kM) return kFALSE; | |
3312 | return kTRUE; | |
3313 | } | |
3314 | ||
1ee39b3a | 3315 | //________________________________________________________ |
3316 | void AliTRDresolution::GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm, Float_t &xM) | |
3317 | { | |
3318 | // | |
01ccc21a | 3319 | // Get the most probable value and the full width half mean |
1ee39b3a | 3320 | // of a Landau distribution |
3321 | // | |
3322 | ||
3323 | const Float_t dx = 1.; | |
3324 | mpv = f->GetParameter(1); | |
3325 | Float_t fx, max = f->Eval(mpv); | |
3326 | ||
3327 | xm = mpv - dx; | |
3328 | while((fx = f->Eval(xm))>.5*max){ | |
01ccc21a | 3329 | if(fx>max){ |
1ee39b3a | 3330 | max = fx; |
3331 | mpv = xm; | |
3332 | } | |
3333 | xm -= dx; | |
3334 | } | |
3335 | ||
3336 | xM += 2*(mpv - xm); | |
3337 | while((fx = f->Eval(xM))>.5*max) xM += dx; | |
3338 | } | |
3339 | ||
3340 | ||
3ceb45ae | 3341 | // #include "TFile.h" |
3342 | // //________________________________________________________ | |
3343 | // Bool_t AliTRDresolution::LoadCorrection(const Char_t *file) | |
3344 | // { | |
3345 | // if(!file){ | |
3346 | // AliWarning("Use cluster position as in reconstruction."); | |
3347 | // SetLoadCorrection(); | |
3348 | // return kTRUE; | |
3349 | // } | |
3350 | // TDirectory *cwd(gDirectory); | |
3351 | // TString fileList; | |
3352 | // FILE *filePtr = fopen(file, "rt"); | |
3353 | // if(!filePtr){ | |
3354 | // AliWarning(Form("Couldn't open correction list \"%s\". Use cluster position as in reconstruction.", file)); | |
3355 | // SetLoadCorrection(); | |
3356 | // return kFALSE; | |
3357 | // } | |
3358 | // TH2 *h2 = new TH2F("h2", ";time [time bins];detector;dx [#mum]", 30, -0.5, 29.5, AliTRDgeometry::kNdet, -0.5, AliTRDgeometry::kNdet-0.5); | |
3359 | // while(fileList.Gets(filePtr)){ | |
3360 | // if(!TFile::Open(fileList.Data())) { | |
3361 | // AliWarning(Form("Couldn't open \"%s\"", fileList.Data())); | |
3362 | // continue; | |
3363 | // } else AliInfo(Form("\"%s\"", fileList.Data())); | |
01ccc21a | 3364 | // |
3ceb45ae | 3365 | // TTree *tSys = (TTree*)gFile->Get("tSys"); |
3366 | // h2->SetDirectory(gDirectory); h2->Reset("ICE"); | |
3367 | // tSys->Draw("det:t>>h2", "dx", "goff"); | |
3368 | // for(Int_t idet(0); idet<AliTRDgeometry::kNdet; idet++){ | |
3369 | // for(Int_t it(0); it<30; it++) fXcorr[idet][it]+=(1.e-4*h2->GetBinContent(it+1, idet+1)); | |
3370 | // } | |
3371 | // h2->SetDirectory(cwd); | |
3372 | // gFile->Close(); | |
3373 | // } | |
3374 | // cwd->cd(); | |
01ccc21a | 3375 | // |
2bfe5463 | 3376 | // if(AliLog::GetDebugLevel("PWGPP", "AliTRDresolution")>=2){ |
3ceb45ae | 3377 | // for(Int_t il(0); il<184; il++) printf("-"); printf("\n"); |
3378 | // printf("DET|");for(Int_t it(0); it<30; it++) printf(" tb%02d|", it); printf("\n"); | |
3379 | // for(Int_t il(0); il<184; il++) printf("-"); printf("\n"); | |
3380 | // FILE *fout = fopen("TRD.ClusterCorrection.txt", "at"); | |
3381 | // fprintf(fout, " static const Double_t dx[AliTRDgeometry::kNdet][30]={\n"); | |
3382 | // for(Int_t idet(0); idet<AliTRDgeometry::kNdet; idet++){ | |
3383 | // printf("%03d|", idet); | |
3384 | // fprintf(fout, " {"); | |
3385 | // for(Int_t it(0); it<30; it++){ | |
3386 | // printf("%+5.0f|", 1.e4*fXcorr[idet][it]); | |
3387 | // fprintf(fout, "%+6.4f%c", fXcorr[idet][it], it==29?' ':','); | |
3388 | // } | |
3389 | // printf("\n"); | |
3390 | // fprintf(fout, "}%c\n", idet==AliTRDgeometry::kNdet-1?' ':','); | |
3391 | // } | |
3392 | // fprintf(fout, " };\n"); | |
3393 | // } | |
3394 | // SetLoadCorrection(); | |
3395 | // return kTRUE; | |
3396 | // } | |
3ed01fbe | 3397 | |
b9058d72 | 3398 | //________________________________________________________ |
3399 | void AliTRDresolution::SetProcesses(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin) | |
3400 | { | |
3401 | // steer processes | |
3402 | if(det) SETBIT(fSteer, kDetector); else CLRBIT(fSteer, kDetector); | |
3403 | if(cl) SETBIT(fSteer, kCluster); else CLRBIT(fSteer, kCluster); | |
3404 | if(trklt) SETBIT(fSteer, kTracklet); else CLRBIT(fSteer, kTracklet); | |
3405 | if(trkin) SETBIT(fSteer, kTrackIn); else CLRBIT(fSteer, kTrackIn); | |
3406 | } | |
3407 | ||
33056e04 | 3408 | |
3409 | //________________________________________________________ | |
3410 | void AliTRDresolution::SetDump3D(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin) | |
3411 | { | |
3412 | // steer processes | |
3413 | if(det) SETBIT(fSteer, 4+kDetector); else CLRBIT(fSteer, 4+kDetector); | |
3414 | if(cl) SETBIT(fSteer, 4+kCluster); else CLRBIT(fSteer, 4+kCluster); | |
3415 | if(trklt) SETBIT(fSteer, 4+kTracklet); else CLRBIT(fSteer, 4+kTracklet); | |
3416 | if(trkin) SETBIT(fSteer, 4+kTrackIn); else CLRBIT(fSteer, 4+kTrackIn); | |
3417 | } | |
3418 |