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