CbmRoot
CbmTrdQa.cxx
Go to the documentation of this file.
1 #include "CbmTrdQa.h"
2 #include "CbmDigiManager.h"
3 #include "CbmMCTrack.h"
4 #include "CbmTrdCluster.h"
5 #include "CbmTrdDigi.h"
6 #include "CbmTrdGeoHandler.h"
7 #include "CbmTrdHit.h"
8 #include "CbmTrdParModDigi.h"
9 #include "CbmTrdParModGeo.h"
10 #include "CbmTrdParSetDigi.h"
11 #include "CbmTrdParSetGeo.h"
12 #include "CbmTrdPoint.h"
13 #include "FairRootManager.h"
14 #include "FairRunAna.h"
15 #include "FairRuntimeDb.h"
16 #include "TBox.h"
17 #include "TCanvas.h"
18 #include "TClonesArray.h"
19 #include "TColor.h"
20 #include "TF1.h"
21 #include "TFile.h"
22 #include "TGeoManager.h"
23 #include "TH1.h"
24 #include "TH2.h"
25 #include "TLegend.h"
26 #include "TMath.h"
27 #include "TPaveText.h"
28 #include "TPolyLine.h"
29 #include "TProfile.h"
30 #include "TProfile2D.h"
31 #include "TStopwatch.h"
32 #include <cmath>
33 #include <iostream>
34 
35 //#include "CbmTrdDigitizer.h"
36 // #include "CbmTrdDigitizerPRF.h"
37 // #include "CbmTrdClusterFinderFast.h"
38 // #include "CbmTrdHitProducerCluster.h"
39 #include "CbmTrdRadiator.h"
40 #include "CbmTrdUtils.h"
41 
42 using std::cin;
43 using std::cout;
44 using std::endl;
45 using std::fabs;
46 using std::pair;
47 
49  : CbmTrdQa("TrdQa", "", "", 1e-6, radiator) {}
50 
51 CbmTrdQa::CbmTrdQa(const char* /*name*/,
52  const char* /*title*/,
53  const char* geo,
54  Double_t triggerThreshold,
55  CbmTrdRadiator* radiator)
56  : FairTask("TrdQa")
57  , fMCTracks(NULL)
58  , fPoints(NULL)
59  , fClusters(NULL)
60  , fHits(NULL)
61  , fDigiPar(NULL)
62  , fGeoPar(NULL)
63  , fGeoHandler(new CbmTrdGeoHandler())
64  , fLayerMap()
65  , fLayerMapIt()
66  , fLayerPointMap()
67  , fLayerPointMapIt()
68  , fLayerHitMap()
69  , fLayerHitMapIt()
70  , fModulePointMap()
71  , fModulePointMapIt()
72  , fModuleDigiMap()
73  , fModuleDigiMapIt()
74  , fModuleClusterMap()
75  , fModuleClusterMapIt()
76  , fModuleHitMap()
77  , fModuleHitMapIt()
78  , fModuleAveragePointsMap()
79  , fModuleAveragePointsMapIt()
80  , fModuleTrackableMap2()
81  , fModuleTrackableMap2It()
82  , fModuleTrackableMap()
83  , fModuleTrackableMapIt()
84  , fModuleClusterSizeMap()
85  , fModuleClusterSizeMapIt()
86  , fModuledEdxMap()
87  , fModuledEdxMapIt()
88  , fModuleTracklengthMap()
89  , fModuleTracklengthMapIt()
90  , fModuleMultiPointMap()
91  , fModuleMultiPointMapIt()
92  , fModuleDeltaEMap()
93  , fModuleDeltaEMapIt()
94  , fModuleGhostMap()
95  , fModuleGhostMapIt()
96  , fModuleLostMap()
97  , fModuleLostMapIt()
98  , fModuleEfficiencyMap()
99  , fModuleEfficiencyMapIt()
100  , fTriggerThreshold(triggerThreshold)
101  , fGeo(geo)
102  , fD(true)
103  , fT(true)
104  , fP(true)
105  , fC(true)
106  , fH(true)
107  , fTrianglePads(false)
108  , fLayerDummy(NULL)
109  , fStsTrdPoints(NULL)
110  , fStsMuchPoints(NULL)
111  , fStsTofPoints(NULL)
112  , fStsTrdPointsTrackable(NULL)
113  , fTrdPointsPerMcTrack_PID(NULL)
114  , fTrdPointsPerMcTrack_PT(NULL)
115  , fTrdPointsPerMcTrack_P(NULL)
116  , fTrdTrackCrossedRadiator(NULL)
117  , fMultiHitSamePadPerMcTrack(NULL)
118  , fMultiHitSamePadPerMcTrack_angle(NULL)
119  , fMultiHitSamePadPerMcTrack_zBirth(NULL)
120  , fMultiHitSamePadPerMcTrack_PID(NULL)
121  , fMultiHitSamePadPerMcTrack_motherPID(NULL)
122  , fMultiHitSamePadPerMcTrack_motherzBirth(NULL)
123  , fMultiHitAdjacentPadPerMcTrack(NULL)
124  , fMultiHitAdjacentPadPerMcTrack_angle(NULL)
125  , fMultiHitAdjacentPadPerMcTrack_zBirth(NULL)
126  , fMultiHitAdjacentPadPerMcTrack_PID(NULL)
127  , fMultiHitAdjacentPadPerMcTrack_motherzBirth(NULL)
128  , fMultiHitAdjacentPadPerMcTrack_motherPID(NULL)
129  , fDistanceMcToHit(NULL)
130  , fDistanceMcToHitAll(NULL)
131  , fPositionResolutionShort(NULL)
132  , fPositionResolutionLong(NULL)
133  , fdEdxPoint(NULL)
134  , fdEdxDigi(NULL)
135  , fdEdxCluster(NULL)
136  , fdEdxHit(NULL)
137  , fdEdxPionMc(NULL)
138  , fdEdxPionHit(NULL)
139  , fdEdxPionGhost(NULL)
140  , fdEdxElectronMc(NULL)
141  , fdEdxElectronHit(NULL)
142  , fdEdxElectronGhost(NULL)
143  , fClusterSize(NULL)
144  , fPointsPerDigi(NULL)
145  , fDigiPerCluster(NULL)
146  , fClusterPerHit(NULL)
147  , fMultiPointssVsR(NULL)
148  , fGhostPointsVsR(NULL)
149  , fMultiHitsVsR(NULL)
150  , fGhostHitVsR(NULL)
151  , fLostPointVsR(NULL)
152  , fHitToPointEfficiencyVsR(NULL)
153  , fMultiHitsVsAlpha(NULL)
154  , fGhostHitVsAlpha(NULL)
155  , fLostPointVsAlpha(NULL)
156  , fHitToPointEfficiencyVsAlpha(NULL)
157  , fPRF_1D(NULL)
158  , fPRF_2D(NULL)
159  , fRadiator(radiator) {}
160 
162  FairRootManager* ioman = FairRootManager::Instance();
163  ioman->Write();
164  if (fMCTracks) {
165  fMCTracks->Clear("C");
166  fMCTracks->Delete();
167  delete fMCTracks;
168  }
169  if (fPoints) {
170  fPoints->Delete();
171  delete fPoints;
172  }
173  if (fHits) {
174  fHits->Delete();
175  delete fHits;
176  }
177  if (fDigiPar) delete fDigiPar;
178 
179  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
180  fLayerMapIt++) {
181  delete fLayerMapIt->second;
182  }
183  fLayerMap.clear();
184  for (fLayerPointMapIt = fLayerPointMap.begin();
186  fLayerPointMapIt++) {
187  delete fLayerPointMapIt->second;
188  }
189  fLayerPointMap.clear();
190  for (fLayerHitMapIt = fLayerHitMap.begin();
191  fLayerHitMapIt != fLayerHitMap.end();
192  fLayerHitMapIt++) {
193  delete fLayerHitMapIt->second;
194  }
195  fLayerHitMap.clear();
196  for (fModulePointMapIt = fModulePointMap.begin();
198  fModulePointMapIt++) {
199  fModulePointMapIt->second.clear();
200  }
201  fModulePointMap.clear();
202 
203  for (fModuleDigiMapIt = fModuleDigiMap.begin();
205  fModuleDigiMapIt++) {
206  fModuleDigiMapIt->second.clear();
207  }
208  fModuleDigiMap.clear();
209 
210  for (fModuleClusterMapIt = fModuleClusterMap.begin();
213  fModuleClusterMapIt->second.clear();
214  }
215  fModuleClusterMap.clear();
216 
217  for (fModuleHitMapIt = fModuleHitMap.begin();
219  fModuleHitMapIt++) {
220  fModuleHitMapIt->second.clear();
221  }
222  fModuleHitMap.clear();
223 
224  for (fModuleGhostMapIt = fModuleGhostMap.begin();
226  fModuleGhostMapIt++) {
227  delete fModuleGhostMapIt->second;
228  }
229  fModuleGhostMap.clear();
230 
231  for (fModuleLostMapIt = fModuleLostMap.begin();
233  fModuleLostMapIt++) {
234  delete fModuleLostMapIt->second;
235  }
236  fModuleLostMap.clear();
237 
241  delete fModuleEfficiencyMapIt->second;
242  }
243  fModuleEfficiencyMap.clear();
244 
248  delete fModuleMultiPointMapIt->second;
249  }
250  fModuleMultiPointMap.clear();
251 
252 
253  for (fModuleDeltaEMapIt = fModuleDeltaEMap.begin();
255  fModuleDeltaEMapIt++) {
256  delete fModuleDeltaEMapIt->second;
257  }
258  fModuleDeltaEMap.clear();
259 
263  delete fModuleTracklengthMapIt->second;
264  }
265  fModuleTracklengthMap.clear();
266 
267  for (fModuledEdxMapIt = fModuledEdxMap.begin();
269  fModuledEdxMapIt++) {
270  delete fModuledEdxMapIt->second;
271  }
272  fModuledEdxMap.clear();
273 
277  delete fModuleClusterSizeMapIt->second;
278  }
279  fModuleClusterSizeMap.clear();
280 
281 
284  delete fTrdPointsPerMcTrack_P;
286 
299 
300  delete fDistanceMcToHit;
301  delete fDistanceMcToHitAll;
302  delete fdEdxPionMc;
303  delete fdEdxPionHit;
304  delete fdEdxPionGhost;
305  delete fdEdxElectronMc;
306  delete fdEdxElectronHit;
307  delete fdEdxElectronGhost;
308  delete fdEdxPoint;
309  delete fdEdxDigi;
310  delete fdEdxCluster;
311  delete fdEdxHit;
312  delete fMultiHitsVsR;
313  delete fGhostHitVsR;
314  delete fLostPointVsR;
318  delete fMultiHitsVsAlpha;
319  delete fGhostHitVsAlpha;
320  delete fLostPointVsAlpha;
322  delete fClusterSize;
323  delete fPointsPerDigi;
324  delete fDigiPerCluster;
325  delete fClusterPerHit;
326  delete fPRF_1D;
327  delete fPRF_2D;
328  //delete fLayerDummy;
329 }
331  cout << " * CbmTrdQa * :: SetParContainers() " << endl;
332  // Get Base Container
333  FairRunAna* ana = FairRunAna::Instance();
334  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
335  fDigiPar = (CbmTrdParSetDigi*) (rtdb->getContainer("CbmTrdParSetDigi"));
336  fGeoPar = (CbmTrdParSetGeo*) (rtdb->getContainer("CbmTrdParSetGeo"));
337 }
338 InitStatus CbmTrdQa::ReInit() {
339  FairRunAna* ana = FairRunAna::Instance();
340  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
341  fDigiPar = (CbmTrdParSetDigi*) (rtdb->getContainer("CbmTrdParSetDigi"));
342  fGeoPar = (CbmTrdParSetGeo*) (rtdb->getContainer("CbmTrdParSetGeo"));
343 
344  return kSUCCESS;
345 }
346 InitStatus CbmTrdQa::Init() {
347  FairRootManager* ioman = FairRootManager::Instance();
348  fMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
349  if (!fMCTracks) {
350  cout << "-W CbmTrdQa::Init: No MCTrack array!" << endl;
351  cout << " Task will be inactive" << endl;
352  //return kERROR;
353  fT = false;
354  }
355  fPoints = (TClonesArray*) ioman->GetObject("TrdPoint");
356  if (!fPoints) {
357  cout << "-W CbmTrdQa::Init: No TrdPoint array!" << endl;
358  cout << " Task will be inactive" << endl;
359  //return kERROR;
360  fP = false;
361  }
363  if (!CbmDigiManager::Instance()->IsPresent(ECbmModuleId::kTrd)) LOG(fatal);
364 
365  fClusters = (TClonesArray*) ioman->GetObject("TrdCluster");
366  if (!fClusters) {
367  cout << "-W CbmTrdQa::Init: No TrdCluster array!" << endl;
368  cout << " Task will be inactive" << endl;
369  //return kERROR;
370  fC = false;
371  }
372  fHits = (TClonesArray*) ioman->GetObject("TrdHit");
373  if (!fHits) {
374  cout << "-W CbmTrdQa::Init: No TrdHits array!" << endl;
375  cout << " Task will be inactive" << endl;
376  //return kERROR;
377  fH = false;
378  }
379  fGeoHandler->Init();
380 
381  fLayerDummy = new TH2I("LayerDummy", "", 1, -600, 600, 1, -500, 500);
382  fLayerDummy->SetXTitle("x-coordinate [cm]");
383  fLayerDummy->SetYTitle("y-coordinate [cm]");
384  fLayerDummy->GetXaxis()->SetLabelSize(0.02);
385  fLayerDummy->GetYaxis()->SetLabelSize(0.02);
386  fLayerDummy->GetZaxis()->SetLabelSize(0.02);
387  fLayerDummy->GetXaxis()->SetTitleSize(0.02);
388  fLayerDummy->GetXaxis()->SetTitleOffset(1.5);
389  fLayerDummy->GetYaxis()->SetTitleSize(0.02);
390  fLayerDummy->GetYaxis()->SetTitleOffset(2);
391  fLayerDummy->GetZaxis()->SetTitleSize(0.02);
392  fLayerDummy->GetZaxis()->SetTitleOffset(-2);
393  fLayerDummy->SetStats(kFALSE);
394  fLayerDummy->SetContour(99);
395  fLayerDummy->Fill(0., 0., 0.);
396 
397  fStsTrdPoints =
398  new TH2F("fStsTrdPoints", "fStsTrdPoints", 12, -0.5, 11.5, 21, -0.5, 20.5);
399  fStsTrdPoints->SetStats(kFALSE);
400  fStsTrdPoints->SetXTitle("TRD points / track");
401  fStsTrdPoints->SetYTitle("STS points / track");
402  fStsTrdPoints->SetContour(99);
403 
404  fStsMuchPoints = new TH2F(
405  "fStsMuchPoints", "fStsMuchPoints", 12, -0.5, 11.5, 21, -0.5, 20.5);
406  fStsMuchPoints->SetStats(kFALSE);
407  fStsMuchPoints->SetXTitle("MUCH points / track");
408  fStsMuchPoints->SetYTitle("STS points / track");
409  fStsMuchPoints->SetContour(99);
410 
411  fStsTofPoints =
412  new TH2F("fStsTofPoints", "fStsTofPoints", 12, -0.5, 11.5, 21, -0.5, 20.5);
413  fStsTofPoints->SetStats(kFALSE);
414  fStsTofPoints->SetXTitle("TOF points / track");
415  fStsTofPoints->SetYTitle("STS points / track");
416  fStsTofPoints->SetContour(99);
417 
418  TString name;
419  for (Int_t iStsPoints = 0; iStsPoints < 11; iStsPoints++) {
420  name.Form("_%02iStsPoints", iStsPoints);
421 
422  fMuchTrdPoints[iStsPoints] = new TH2F("fMuchTrdPoints" + name,
423  "fMuchTrdPoints" + name,
424  12,
425  -0.5,
426  11.5,
427  21,
428  -0.5,
429  20.5);
430  fMuchTrdPoints[iStsPoints]->SetStats(kFALSE);
431  fMuchTrdPoints[iStsPoints]->SetXTitle("TRD points / track");
432  fMuchTrdPoints[iStsPoints]->SetYTitle("MUCH points / track");
433  fMuchTrdPoints[iStsPoints]->SetContour(99);
434 
435  fMuchTofPoints[iStsPoints] = new TH2F("fMuchTofPoints" + name,
436  "fMuchTofPoints" + name,
437  12,
438  -0.5,
439  11.5,
440  21,
441  -0.5,
442  20.5);
443  fMuchTofPoints[iStsPoints]->SetStats(kFALSE);
444  fMuchTofPoints[iStsPoints]->SetXTitle("TOF points / track");
445  fMuchTofPoints[iStsPoints]->SetYTitle("MUCH points / track");
446  fMuchTofPoints[iStsPoints]->SetContour(99);
447 
448  fTrdTofPoints[iStsPoints] = new TH2F("fTrdTofPoints" + name,
449  "fTrdTofPoints" + name,
450  12,
451  -0.5,
452  11.5,
453  21,
454  -0.5,
455  20.5);
456  fTrdTofPoints[iStsPoints]->SetStats(kFALSE);
457  fTrdTofPoints[iStsPoints]->SetXTitle("TOF points / track");
458  fTrdTofPoints[iStsPoints]->SetYTitle("TRD points / track");
459  fTrdTofPoints[iStsPoints]->SetContour(99);
460  }
461 
462  fStsTrdPointsTrackable = new TH2F("fStsTrdPointsTrackable",
463  "fStsTrdPointsTrackable",
464  12,
465  -0.5,
466  11.5,
467  21,
468  -0.5,
469  20.5);
470  fStsTrdPointsTrackable->SetStats(kFALSE);
471  fStsTrdPointsTrackable->SetXTitle("TRD points / track");
472  fStsTrdPointsTrackable->SetYTitle("STS points / track");
473  fStsTrdPointsTrackable->SetContour(99);
474 
475 
476  fTrdPointsPerMcTrack_PID = new TH2F("fTrdPointsPerMcTrack_PID",
477  "fTrdPointsPerMcTrack_PID",
478  12,
479  -0.5,
480  11.5,
481  49,
482  0.5,
483  49.5);
484  fTrdPointsPerMcTrack_PID->SetContour(99);
485  fTrdPointsPerMcTrack_PID->SetXTitle("n TRD Points");
486  fTrdPointsPerMcTrack_PID->SetYTitle("");
487  for (Int_t bin = 1; bin <= 49; bin++) {
488  fTrdPointsPerMcTrack_PID->GetYaxis()->SetBinLabel(
489  bin, CbmTrdUtils::GetGeantName(bin));
490  }
491  fTrdPointsPerMcTrack_PT = new TH2F("fTrdPointsPerMcTrack_PT",
492  "fTrdPointsPerMcTrack_PT",
493  12,
494  -0.5,
495  11.5,
496  30,
497  0,
498  3);
499  fTrdPointsPerMcTrack_PT->SetContour(99);
500  fTrdPointsPerMcTrack_PT->SetXTitle("n TRD Points");
501  fTrdPointsPerMcTrack_PT->SetYTitle("p_{T} (GeV/c)");
502 
503  fTrdPointsPerMcTrack_P = new TH2F("fTrdPointsPerMcTrack_P",
504  "fTrdPointsPerMcTrack_P",
505  12,
506  -0.5,
507  11.5,
508  100,
509  0,
510  10);
511  fTrdPointsPerMcTrack_P->SetContour(99);
512  fTrdPointsPerMcTrack_P->SetXTitle("n TRD Points");
513  fTrdPointsPerMcTrack_P->SetYTitle("p (GeV/c)");
514 
515  fTrdTrackCrossedRadiator = new TH2F("fTrdTrackCrossedRadiator",
516  "fTrdTrackCrossedRadiator",
517  12,
518  -0.5,
519  11.5,
520  15,
521  -3.5,
522  11.5);
523  fTrdTrackCrossedRadiator->SetStats(kFALSE);
524  fTrdTrackCrossedRadiator->SetContour(99);
525  fTrdTrackCrossedRadiator->SetXTitle("n TRD Points");
526  fTrdTrackCrossedRadiator->SetYTitle("n Radiator crossings");
527 
529  new TH1I("DistanceMcToHit", "DistanceMcToHit", 1500, 0, 150);
530  fDistanceMcToHit->SetStats(kFALSE);
531  fDistanceMcToHit->SetXTitle("#Delta r (MC-Hit) pairs [cm]");
532  fDistanceMcToHit->SetYTitle("#");
533  fDistanceMcToHit->SetMarkerStyle(24);
535  new TH1I("DistanceMcToHitAll", "DistanceMcToHitAll", 1500, 0, 150);
536  fDistanceMcToHitAll->SetStats(kFALSE);
537  fDistanceMcToHitAll->SetXTitle("#Delta r (MC-Hit) all [cm]");
538  fDistanceMcToHitAll->SetYTitle("#");
539  fDistanceMcToHitAll->SetMarkerStyle(24);
540  fdEdxPionMc = new TH1F("dEdxPionMc", "dEdxPionMc", 250, 0, 30.0e-6);
541  fdEdxPionMc->SetStats(kFALSE);
542  fdEdxPionMc->SetXTitle("dE/dx MC [GeV]");
543  fdEdxPionMc->SetYTitle("#");
544  fdEdxPionMc->SetLineColor(1);
545  fdEdxPionMc->SetLineStyle(1);
546  fdEdxPionHit = new TH1F("dEdxPionHit", "dEdxPionHit", 250, 0, 30.0e-6);
547  fdEdxPionHit->SetStats(kFALSE);
548  fdEdxPionHit->SetXTitle("dE/dx Hit [GeV]");
549  fdEdxPionHit->SetYTitle("#");
550  fdEdxPionHit->SetLineColor(1);
551  fdEdxPionHit->SetLineStyle(2);
552  fdEdxPionGhost = new TH1F("dEdxPionGhost", "dEdxPionGhost", 250, 0, 30.0e-6);
553  fdEdxPionGhost->SetStats(kFALSE);
554  fdEdxPionGhost->SetXTitle("dE/dx Ghost [GeV]");
555  fdEdxPionGhost->SetYTitle("#");
556  fdEdxPionGhost->SetLineColor(1);
557  fdEdxPionGhost->SetLineStyle(3);
559  new TH1F("dEdxElectronMc", "dEdxElectronMc", 250, 0, 30.0e-6);
560  fdEdxElectronMc->SetStats(kFALSE);
561  fdEdxElectronMc->SetXTitle("dE/dx MC [GeV]");
562  fdEdxElectronMc->SetYTitle("#");
563  fdEdxElectronMc->SetLineColor(2);
564  fdEdxElectronMc->SetLineStyle(1);
566  new TH1F("dEdxElectronHit", "dEdxElectronHit", 250, 0, 30.0e-6);
567  fdEdxElectronHit->SetStats(kFALSE);
568  fdEdxElectronHit->SetXTitle("dE/dx Hit [GeV]");
569  fdEdxElectronHit->SetYTitle("#");
570  fdEdxElectronHit->SetLineColor(2);
571  fdEdxElectronHit->SetLineStyle(2);
573  new TH1F("dEdxElectronGhost", "dEdxElectronGhost", 250, 0, 30.0e-6);
574  fdEdxElectronGhost->SetStats(kFALSE);
575  fdEdxElectronGhost->SetXTitle("dE/dx Ghost [GeV]");
576  fdEdxElectronGhost->SetYTitle("#");
577  fdEdxElectronGhost->SetLineColor(2);
578  fdEdxElectronGhost->SetLineStyle(3);
579  fdEdxPoint = new TH1F("dEdxPoint", "dEdxPoint", 1.0e3, 0, 30.0e-6);
580  fdEdxPoint->SetStats(kFALSE);
581  fdEdxPoint->SetXTitle("dE/dx Hit [GeV]");
582  fdEdxPoint->SetYTitle("#");
583  fdEdxDigi = new TH1F("dEdxDigi", "dEdxDigi", 1.0e3, 0, 30.0e-6);
584  fdEdxDigi->SetStats(kFALSE);
585  fdEdxDigi->SetXTitle("dE/dx Hit [GeV]");
586  fdEdxDigi->SetYTitle("#");
587  fdEdxCluster = new TH1F("dEdxCluster", "dEdxCluster", 1.0e3, 0, 30.0e-6);
588  fdEdxCluster->SetStats(kFALSE);
589  fdEdxCluster->SetXTitle("dE/dx Hit [GeV]");
590  fdEdxCluster->SetYTitle("#");
591  fdEdxHit = new TH1F("dEdxHit", "dEdxHit", 1.0e3, 0, 30.0e-6);
592  fdEdxHit->SetStats(kFALSE);
593  fdEdxHit->SetXTitle("dE/dx Hit [GeV]");
594  fdEdxHit->SetYTitle("#");
595  fMultiHitsVsR = new TProfile("MultiHitVsR", "MultiHitVsR", 785, 0, 785);
596  fMultiHitsVsR->SetStats(kFALSE);
597  fMultiHitsVsR->SetXTitle("r [cm]");
598  fMultiHitsVsR->SetYTitle(
599  "hits per point on same pad/ all points per module [%]");
600  fMultiHitsVsR->SetMarkerStyle(24);
601  fMultiHitsVsR->SetMarkerColor(4);
602  fMultiHitsVsR->SetLineColor(4);
603  fGhostHitVsR = new TProfile("GhostHitVsR", "GhostHitVsR", 785, 0, 785);
604  fGhostHitVsR->SetStats(kFALSE);
605  fGhostHitVsR->SetXTitle("r [cm]");
606  fGhostHitVsR->SetYTitle("left over hits / all points per module [%]");
607  fGhostHitVsR->SetMarkerStyle(24);
608  fGhostHitVsR->SetMarkerColor(2);
609  fGhostHitVsR->SetLineColor(2);
610  fLostPointVsR = new TProfile("LostPointVsR", "LostPointVsR", 785, 0, 785);
611  fLostPointVsR->SetStats(kFALSE);
612  fLostPointVsR->SetXTitle("r [cm]");
613  fLostPointVsR->SetYTitle("left over points / all points per module [%]");
614  fLostPointVsR->SetMarkerStyle(24);
615  fLostPointVsR->SetMarkerColor(3);
616  fLostPointVsR->SetLineColor(3);
617  fHitToPointEfficiencyVsR = new TProfile(
618  "fHitToPointEfficiencyVsR", "fHitToPointEfficiencyVsR", 785, 0, 785);
619  fHitToPointEfficiencyVsR->SetStats(kFALSE);
620  fHitToPointEfficiencyVsR->SetXTitle("r [cm]");
621  fHitToPointEfficiencyVsR->SetYTitle(
622  "point hit pairs / all points per module [%]");
623  fHitToPointEfficiencyVsR->SetMarkerStyle(24);
624  fHitToPointEfficiencyVsR->SetMarkerColor(1);
625  fHitToPointEfficiencyVsR->SetLineColor(1);
626  fMultiHitsVsAlpha = new TProfile("MultiHitsVsAlpha",
627  "MultiHitsVsAlpha",
628  TMath::Pi() / 3. * 100,
629  0,
630  TMath::Pi() / 3. * 1000);
631  fMultiHitsVsAlpha->SetStats(kFALSE);
632  fMultiHitsVsAlpha->SetXTitle("#alpha [mrad]");
633  fMultiHitsVsAlpha->SetYTitle(
634  "hits per point on same pad/ all points per module [%]");
635  fMultiHitsVsAlpha->SetMarkerStyle(24);
636  fMultiHitsVsAlpha->SetMarkerColor(4);
637  fMultiHitsVsAlpha->SetLineColor(4);
638  fGhostHitVsAlpha = new TProfile("GhostHitVsAlpha",
639  "GhostHitVsAlpha",
640  TMath::Pi() / 3. * 100,
641  0,
642  TMath::Pi() / 3. * 1000);
643  fGhostHitVsAlpha->SetStats(kFALSE);
644  fGhostHitVsAlpha->SetXTitle("#alpha [mrad]");
645  fGhostHitVsAlpha->SetYTitle("left over hits / all points per module [%]");
646  fGhostHitVsAlpha->SetMarkerStyle(24);
647  fGhostHitVsAlpha->SetMarkerColor(2);
648  fGhostHitVsAlpha->SetLineColor(2);
649  fLostPointVsAlpha = new TProfile("LostPointVsAlpha",
650  "LostPointVsAlpha",
651  TMath::Pi() / 3. * 100,
652  0,
653  TMath::Pi() / 3. * 1000);
654  fLostPointVsAlpha->SetStats(kFALSE);
655  fLostPointVsAlpha->SetXTitle("#alpha [mrad]");
656  fLostPointVsAlpha->SetYTitle("left over points / all points per module [%]");
657  fLostPointVsAlpha->SetMarkerStyle(24);
658  fLostPointVsAlpha->SetMarkerColor(3);
659  fLostPointVsAlpha->SetLineColor(3);
660  fHitToPointEfficiencyVsAlpha = new TProfile("fHitToPointEfficiencyVsAlpha",
661  "fHitToPointEfficiencyVsAlpha",
662  TMath::Pi() / 3. * 100,
663  0,
664  TMath::Pi() / 3. * 1000);
665  fHitToPointEfficiencyVsAlpha->SetStats(kFALSE);
666  fHitToPointEfficiencyVsAlpha->SetXTitle("#alpha [mrad]");
667  fHitToPointEfficiencyVsAlpha->SetYTitle(
668  "point hit pairs / all points per module [%]");
669  fHitToPointEfficiencyVsAlpha->SetMarkerStyle(24);
670  fHitToPointEfficiencyVsAlpha->SetMarkerColor(1);
671  fHitToPointEfficiencyVsAlpha->SetLineColor(1);
672  fPositionResolutionShort = new TH1I(
673  "fPositionResolutionShort", "fPositionResolutionShort", 20000, -10, 10);
674  fPositionResolutionShort->SetStats(kFALSE);
675  fPositionResolutionShort->SetXTitle(
676  "position deviation along short pad side [cm]");
677  fPositionResolutionShort->SetYTitle("#");
678  fPositionResolutionLong = new TH1I(
679  "fPositionResolutionLong", "fPositionResolutionLong", 20000, -10, 10);
680  fPositionResolutionLong->SetStats(kFALSE);
681  fPositionResolutionLong->SetXTitle(
682  "position deviation along long pad side [cm]");
683  fPositionResolutionLong->SetYTitle("#");
684  fClusterSize = new TH1I("fClusterSize", "fClusterSize", 21, -0.5, 20.5);
685  fClusterSize->SetStats(kFALSE);
686  fClusterSize->SetXTitle("cluster size [pads]");
687  fClusterSize->SetYTitle("#");
689  new TH1I("fPointsPerDigi", "fPointsPerDigi", 101, -0.5, 100.5);
690  fPointsPerDigi->SetStats(kFALSE);
691  fPointsPerDigi->SetXTitle("point per digi");
692  fPointsPerDigi->SetYTitle("#");
694  new TH1I("fDigiPerCluster", "fDigiPerCluster", 101, -0.5, 100.5);
695  fDigiPerCluster->SetStats(kFALSE);
696  fDigiPerCluster->SetXTitle("digi per cluster");
697  fDigiPerCluster->SetYTitle("#");
699  new TH1I("fClusterPerHit", "fClusterPerHit", 101, -0.5, 100.5);
700  fClusterPerHit->SetStats(kFALSE);
701  fClusterPerHit->SetXTitle("cluster per hit");
702  fClusterPerHit->SetYTitle("#");
703  fPRF_1D = new TProfile("fPRF_1D", "fPRF_1D", 30, -1.5, 1.5);
704  fPRF_2D = new TH2I("fPRF_2D", "fPRF_2D", 30, -1.5, 1.5, 10, 0, 1);
705  fMultiHitSamePadPerMcTrack = new TH1I(
706  "fMultiHitSamePadPerMcTrack", "fMultiHitSamePadPerMcTrack", 21, -0.5, 20.5);
707  fMultiHitSamePadPerMcTrack->SetStats(kFALSE);
708  fMultiHitSamePadPerMcTrack->SetXTitle("Multihits per MC-track");
709  fMultiHitSamePadPerMcTrack->SetYTitle("#");
711  new TH1I("fMultiHitSamePadPerMcTrack_angle",
712  "fMultiHitSamePadPerMcTrack_angle",
713  3600,
714  0,
715  360);
716  fMultiHitSamePadPerMcTrack_angle->SetStats(kFALSE);
717  fMultiHitSamePadPerMcTrack_angle->SetXTitle("angle [deg]");
718  fMultiHitSamePadPerMcTrack_angle->SetYTitle("#");
720  new TH2I("fMultiHitSamePadPerMcTrack_zBirth",
721  "fMultiHitSamePadPerMcTrack_zBirth",
722  10000,
723  -50,
724  1000,
725  10000,
726  -50,
727  1000);
728  fMultiHitSamePadPerMcTrack_zBirth->SetStats(kFALSE);
729  fMultiHitSamePadPerMcTrack_zBirth->SetContour(99);
731  "z_{Birth} multihits track a [cm]");
733  "z_{Birth} multihits track b [cm]");
734  fMultiHitSamePadPerMcTrack_PID = new TH2I("fMultiHitSamePadPerMcTrack_PID",
735  "fMultiHitSamePadPerMcTrack_PID",
736  49,
737  0.5,
738  49.5,
739  49,
740  0.5,
741  49.5);
742  fMultiHitSamePadPerMcTrack_PID->SetStats(kFALSE);
743  for (Int_t bin = 1; bin <= 49; bin++) {
744  fMultiHitSamePadPerMcTrack_PID->GetYaxis()->SetBinLabel(
745  bin, CbmTrdUtils::GetGeantName(bin));
746  fMultiHitSamePadPerMcTrack_PID->GetXaxis()->SetBinLabel(
747  bin, CbmTrdUtils::GetGeantName(bin));
748  }
749  fMultiHitSamePadPerMcTrack_PID->GetXaxis()->SetRangeUser(0, 15);
750  fMultiHitSamePadPerMcTrack_PID->GetYaxis()->SetRangeUser(0, 15);
751  fMultiHitSamePadPerMcTrack_PID->SetContour(99);
752  fMultiHitSamePadPerMcTrack_PID->SetXTitle("MC PID track a");
753  fMultiHitSamePadPerMcTrack_PID->SetYTitle("MC PID track b");
755  new TH2I("fMultiHitSamePadPerMcTrack_motherzBirth",
756  "fMultiHitSamePadPerMcTrack_motherzBirth",
757  10000,
758  -50,
759  1000,
760  10000,
761  -50,
762  1000);
763  fMultiHitSamePadPerMcTrack_motherzBirth->SetStats(kFALSE);
766  "z_{Birth} multihits track a [cm]");
768  "z_{Birth} multihits track b [cm]");
770  new TH2I("fMultiHitSamePadPerMcTrack_motherPID",
771  "fMultiHitSamePadPerMcTrack_motherPID",
772  49,
773  0.5,
774  49.5,
775  49,
776  0.5,
777  49.5);
778  fMultiHitSamePadPerMcTrack_motherPID->SetStats(kFALSE);
779  for (Int_t bin = 1; bin <= 49; bin++) {
780  fMultiHitSamePadPerMcTrack_motherPID->GetYaxis()->SetBinLabel(
781  bin, CbmTrdUtils::GetGeantName(bin));
782  fMultiHitSamePadPerMcTrack_motherPID->GetXaxis()->SetBinLabel(
783  bin, CbmTrdUtils::GetGeantName(bin));
784  }
785  fMultiHitSamePadPerMcTrack_motherPID->GetXaxis()->SetRangeUser(0, 15);
786  fMultiHitSamePadPerMcTrack_motherPID->GetYaxis()->SetRangeUser(0, 15);
787  fMultiHitSamePadPerMcTrack_motherPID->SetContour(99);
788  fMultiHitSamePadPerMcTrack_motherPID->SetXTitle("MC PID track a");
789  fMultiHitSamePadPerMcTrack_motherPID->SetYTitle("MC PID track b");
790 
791  fMultiHitAdjacentPadPerMcTrack = new TH1I("fMultiHitAdjacentPadPerMcTrack",
792  "fMultiHitAdjacentPadPerMcTrack",
793  21,
794  -0.5,
795  20.5);
796  fMultiHitAdjacentPadPerMcTrack->SetStats(kFALSE);
797  fMultiHitAdjacentPadPerMcTrack->SetXTitle("Multihits per MC-track");
798  fMultiHitAdjacentPadPerMcTrack->SetYTitle("#");
800  new TH1I("fMultiHitAdjacentPadPerMcTrack_angle",
801  "fMultiHitAdjacentPadPerMcTrack_angle",
802  3600,
803  0,
804  360);
805  fMultiHitAdjacentPadPerMcTrack_angle->SetStats(kFALSE);
806  fMultiHitAdjacentPadPerMcTrack_angle->SetXTitle("angle [deg]");
807  fMultiHitAdjacentPadPerMcTrack_angle->SetYTitle("#");
809  new TH2I("fMultiHitAdjacentPadPerMcTrack_zBirth",
810  "fMultiHitAdjacentPadPerMcTrack_zBirth",
811  10000,
812  -50,
813  1000,
814  10000,
815  -50,
816  1000);
817  fMultiHitAdjacentPadPerMcTrack_zBirth->SetStats(kFALSE);
820  "z_{Birth} multihits track a [cm]");
822  "z_{Birth} multihits track b [cm]");
824  new TH2I("fMultiHitAdjacentPadPerMcTrack_PID",
825  "fMultiHitAdjacentPadPerMcTrack_PID",
826  49,
827  0.5,
828  49.5,
829  49,
830  0.5,
831  49.5);
832  fMultiHitAdjacentPadPerMcTrack_PID->SetStats(kFALSE);
833  for (Int_t bin = 1; bin <= 49; bin++) {
834  fMultiHitAdjacentPadPerMcTrack_PID->GetYaxis()->SetBinLabel(
835  bin, CbmTrdUtils::GetGeantName(bin));
836  fMultiHitAdjacentPadPerMcTrack_PID->GetXaxis()->SetBinLabel(
837  bin, CbmTrdUtils::GetGeantName(bin));
838  }
839  fMultiHitAdjacentPadPerMcTrack_PID->GetXaxis()->SetRangeUser(0, 15);
840  fMultiHitAdjacentPadPerMcTrack_PID->GetYaxis()->SetRangeUser(0, 15);
841  fMultiHitAdjacentPadPerMcTrack_PID->SetContour(99);
842  fMultiHitAdjacentPadPerMcTrack_PID->SetXTitle("MC PID track a");
843  fMultiHitAdjacentPadPerMcTrack_PID->SetYTitle("MC PID track b");
845  new TH2I("fMultiHitAdjacentPadPerMcTrack_motherzBirth",
846  "fMultiHitAdjacentPadPerMcTrack_motherzBirth",
847  10000,
848  -50,
849  1000,
850  10000,
851  -50,
852  1000);
856  "z_{Birth} multihits track a [cm]");
858  "z_{Birth} multihits track b [cm]");
860  new TH2I("fMultiHitAdjacentPadPerMcTrack_motherPID",
861  "fMultiHitAdjacentPadPerMcTrack_motherPID",
862  49,
863  0.5,
864  49.5,
865  49,
866  0.5,
867  49.5);
869  for (Int_t bin = 1; bin <= 49; bin++) {
870  fMultiHitAdjacentPadPerMcTrack_motherPID->GetYaxis()->SetBinLabel(
871  bin, CbmTrdUtils::GetGeantName(bin));
872  fMultiHitAdjacentPadPerMcTrack_motherPID->GetXaxis()->SetBinLabel(
873  bin, CbmTrdUtils::GetGeantName(bin));
874  }
875  fMultiHitAdjacentPadPerMcTrack_motherPID->GetXaxis()->SetRangeUser(0, 15);
876  fMultiHitAdjacentPadPerMcTrack_motherPID->GetYaxis()->SetRangeUser(0, 15);
878  fMultiHitAdjacentPadPerMcTrack_motherPID->SetXTitle("MC PID track a");
879  fMultiHitAdjacentPadPerMcTrack_motherPID->SetYTitle("MC PID track b");
880 
881 
882  return kSUCCESS;
883 }
885  return TMath::Sqrt((point->GetXOut() - point->GetXIn())
886  * (point->GetXOut() - point->GetXIn())
887  + (point->GetYOut() - point->GetYIn())
888  * (point->GetYOut() - point->GetYIn())
889  + (point->GetZOut() - point->GetZIn())
890  * (point->GetZOut() - point->GetZIn()));
891 }
892 
893 void CbmTrdQa::SetTriggerThreshold(Double_t triggerthreshold) {
894  fTriggerThreshold = triggerthreshold;
895 }
896 
897 TPolyLine*
898 CbmTrdQa::CreateTriangularPad(Int_t column, Int_t row, Double_t content) {
899  const Int_t nCoordinates = 4;
900  Double_t x[nCoordinates] = {
901  column - 0.5, column + 0.5, column + 0.5, column - 0.5};
902  Double_t y[nCoordinates] = {row - 0.5, row - 0.5, row + 0.5, row - 0.5};
903  if (row % 2 != 0) {
904  y[1] = row + 0.5;
905  y[2] = row + 0.5;
906  }
907  TPolyLine* pad = new TPolyLine(nCoordinates, x, y);
908  pad->SetFillColor(content);
909  return pad;
910 }
911 
912 void CbmTrdQa::Exec(Option_t*) {
913  Bool_t samePadMerge = false; //true;
914  //fTriggerThreshold = CbmTrdClusterFinderFast::GetTriggerThreshold();
915  TStopwatch timer;
916  timer.Start();
917  cout << endl << "==================CbmTrdQa===================" << endl;
918  Int_t nEntries(0), iTrack(-1), mother_iTrack(-1), moduleAddress(-1),
919  Station(-1), Layer(-1), combiId(-1),
920  /*dEdx(0), rPos(0), PDG(-1), ghostCount(0), lostCount(0),*/ nStsPoints(0);
921  TString title;
922  // Bool_t debug = false;
923  CbmMCTrack* track = NULL;
924  CbmMCTrack* track2 = NULL;
925  CbmMCTrack* track_mother = NULL;
926  CbmMCTrack* track2_mother = NULL;
927  CbmTrdPoint* point = NULL;
928  CbmTrdPoint* point2 = NULL;
929  const CbmTrdDigi* digi = NULL;
930  CbmTrdCluster* cluster = NULL;
931  CbmTrdHit* hit = NULL;
932  // CbmTrdPoint *point_temp = NULL;
933  std::map<Int_t, Int_t> deltaEMap;
934  std::map<Int_t, Int_t> TrackableMap;
935  std::map<Int_t, std::map<Int_t, Int_t>>
936  doubleHitSinglePadMap; // digiAddress, std::map[MC_track_ID]
937  std::map<Int_t, Int_t> channelAddressMap;
938  std::map<Int_t, Int_t> McTrackDoubleHitMap;
939  std::map<Int_t, Int_t> neighbourChannelAddressMap;
940  std::map<Int_t, Int_t> McTrackNeighbourHitMap;
941  // MC-points
942  if (fP && fT) {
943  nEntries = fPoints->GetEntries();
944  printf("%02i Points\n", nEntries);
945 
946  std::map<Int_t, Int_t> hasBeenUsedTrack;
947  for (Int_t iPoint = 0; iPoint < nEntries; iPoint++) {
948  point = (CbmTrdPoint*) fPoints->At(iPoint);
949  fdEdxPoint->Fill(point->GetEnergyLoss());
950  moduleAddress = point->GetDetectorID();
951  Station = CbmTrdAddress::GetLayerId(moduleAddress) / 4
952  + 1; //fGeoHandler->GetStation(moduleId);
953  Layer = CbmTrdAddress::GetLayerId(moduleAddress) % 4
954  + 1; //fGeoHandler->GetLayer(moduleId);
955  //Station = 0;//fGeoHandler->GetStation(moduleId);
956  //Layer = CbmTrdAddress::GetLayerId(moduleAddress);//fGeoHandler->GetLayer(moduleId);
957  //printf ("P det: %i S%i L%i \n",moduleId,Station,Layer);//GetDetId());
958  combiId = 10 * Station + Layer;
959  iTrack = point->GetTrackID();
960  track = (CbmMCTrack*) fMCTracks->At(iTrack);
961  //PDG = track->GetPdgCode();
962  nStsPoints = track->GetNPoints(ECbmModuleId::kSts);
963  //fStsTrdPoints->Fill(track->GetNPoints(ECbmModuleId::kTrd),track->GetNPoints(ECbmModuleId::kSts));
964  CbmTrdParModDigi* fModuleInfo =
965  (CbmTrdParModDigi*) fDigiPar->GetModulePar(moduleAddress);
966  CbmTrdParModGeo* fModuleGeo =
967  (CbmTrdParModGeo*) fGeoPar->GetModulePar(moduleAddress);
968  if (fModuleGhostMap.find(moduleAddress) == fModuleGhostMap.end()) {
969  title.Form("G%i_S%i_L%i_(%.2f, %.2f, %.2f)",
970  moduleAddress,
971  Station,
972  Layer,
973  fModuleGeo->GetX(),
974  fModuleGeo->GetY(),
975  fModuleGeo->GetZ());
976  fModuleGhostMap[moduleAddress] = new TH1I(title, title, 200, 0, 200);
977  fModuleGhostMap[moduleAddress]->SetXTitle(
978  "left over points / all points [%]");
979  fModuleGhostMap[moduleAddress]->SetYTitle("#");
980  title.Form("L%i_S%i_L%i_(%.2f, %.2f, %.2f)",
981  moduleAddress,
982  Station,
983  Layer,
984  fModuleGeo->GetX(),
985  fModuleGeo->GetY(),
986  fModuleGeo->GetZ());
987  fModuleLostMap[moduleAddress] = new TH1I(title, title, 200, 0, 200);
988  fModuleLostMap[moduleAddress]->SetXTitle(
989  "left over hits / all points [%]");
990  fModuleLostMap[moduleAddress]->SetYTitle("#");
991  title.Form("E%i_S%i_L%i_(%.2f, %.2f, %.2f)",
992  moduleAddress,
993  Station,
994  Layer,
995  fModuleGeo->GetX(),
996  fModuleGeo->GetY(),
997  fModuleGeo->GetZ());
998  fModuleEfficiencyMap[moduleAddress] =
999  new TH1I(title, title, 200, 0, 200);
1000  fModuleEfficiencyMap[moduleAddress]->SetXTitle(
1001  "found point hit pairs / all points [%]");
1002  fModuleEfficiencyMap[moduleAddress]->SetYTitle("#");
1003  title.Form("M%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1004  moduleAddress,
1005  Station,
1006  Layer,
1007  fModuleGeo->GetX(),
1008  fModuleGeo->GetY(),
1009  fModuleGeo->GetZ());
1010  fModuleMultiPointMap[moduleAddress] =
1011  new TH1I(title, title, 200, 0, 200);
1012  fModuleMultiPointMap[moduleAddress]->SetXTitle(
1013  "multi point per channel / all points [%]");
1014  fModuleMultiPointMap[moduleAddress]->SetYTitle("#");
1015  title.Form("D%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1016  moduleAddress,
1017  Station,
1018  Layer,
1019  fModuleGeo->GetX(),
1020  fModuleGeo->GetY(),
1021  fModuleGeo->GetZ());
1022  fModuleDeltaEMap[moduleAddress] = new TH1I(title, title, 200, 0, 200);
1023  fModuleDeltaEMap[moduleAddress]->SetXTitle("#delta-electrons [%]");
1024  fModuleDeltaEMap[moduleAddress]->SetYTitle("#");
1025  title.Form("TL%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1026  moduleAddress,
1027  Station,
1028  Layer,
1029  fModuleGeo->GetX(),
1030  fModuleGeo->GetY(),
1031  fModuleGeo->GetZ());
1032  fModuleTracklengthMap[moduleAddress] =
1033  new TH1I(title, title, 200, 0, 10);
1034  fModuleTracklengthMap[moduleAddress]->SetXTitle("track length [cm]");
1035  fModuleTracklengthMap[moduleAddress]->SetYTitle("#");
1036  title.Form("dE%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1037  moduleAddress,
1038  Station,
1039  Layer,
1040  fModuleGeo->GetX(),
1041  fModuleGeo->GetY(),
1042  fModuleGeo->GetZ());
1043  fModuledEdxMap[moduleAddress] = new TH1I(title, title, 200, 0, 50);
1044  fModuledEdxMap[moduleAddress]->SetXTitle("#LTdEdx#GT [keV]");
1045  fModuledEdxMap[moduleAddress]->SetYTitle("#");
1046  title.Form("CS%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1047  moduleAddress,
1048  Station,
1049  Layer,
1050  fModuleGeo->GetX(),
1051  fModuleGeo->GetY(),
1052  fModuleGeo->GetZ());
1053  fModuleClusterSizeMap[moduleAddress] =
1054  new TH1I(title, title, 200, 0, 200);
1055  fModuleClusterSizeMap[moduleAddress]->SetXTitle(
1056  "cluster size [channel]");
1057  fModuleClusterSizeMap[moduleAddress]->SetYTitle("#");
1058  title.Form("TA%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1059  moduleAddress,
1060  Station,
1061  Layer,
1062  fModuleGeo->GetX(),
1063  fModuleGeo->GetY(),
1064  fModuleGeo->GetZ());
1065  fModuleTrackableMap[moduleAddress] =
1066  new TH1I(title, title, 200, 0, 200);
1067  fModuleTrackableMap[moduleAddress]->SetXTitle("min. 5 STS points [%]");
1068  fModuleTrackableMap[moduleAddress]->SetYTitle("#");
1069  title.Form("TA2%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1070  moduleAddress,
1071  Station,
1072  Layer,
1073  fModuleGeo->GetX(),
1074  fModuleGeo->GetY(),
1075  fModuleGeo->GetZ());
1076  fModuleTrackableMap2[moduleAddress] =
1077  new TH1I(title, title, 200, 0, 200);
1078  fModuleTrackableMap2[moduleAddress]->SetXTitle("min. 5 STS points [#]");
1079  fModuleTrackableMap2[moduleAddress]->SetYTitle("#");
1080  title.Form("AP%i_S%i_L%i_(%.2f, %.2f, %.2f)",
1081  moduleAddress,
1082  Station,
1083  Layer,
1084  fModuleGeo->GetX(),
1085  fModuleGeo->GetY(),
1086  fModuleGeo->GetZ());
1087  fModuleAveragePointsMap[moduleAddress] =
1088  new TH1I(title, title, 500, 0, 500);
1089  fModuleAveragePointsMap[moduleAddress]->SetXTitle(
1090  "average points per event");
1091  fModuleAveragePointsMap[moduleAddress]->SetYTitle("#");
1092 
1093  deltaEMap[moduleAddress] = 0;
1094  TrackableMap[moduleAddress] = 0;
1095  }
1096 
1097  Double_t p_global[3] = {0.5 * (point->GetXOut() + point->GetXIn()),
1098  0.5 * (point->GetYOut() + point->GetYIn()),
1099  0.5 * (point->GetZOut() + point->GetZIn())};
1100 
1101  gGeoManager->FindNode(p_global[0], p_global[1], p_global[2]);
1102  if (!TString(gGeoManager->GetPath()).Contains("gas")) {
1103  cout << gGeoManager->GetPath() << endl;
1104  continue;
1105  }
1106  iTrack = point->GetTrackID();
1107  track = (CbmMCTrack*) fMCTracks->At(iTrack);
1108 
1109  Int_t Pdg_code = track->GetPdgCode();
1110  if (hasBeenUsedTrack.find(iTrack) != hasBeenUsedTrack.end()) {
1111  //hasBeenUsedTrack[iTrack] += 1;//continue;
1112  if (NULL != fRadiator)
1113  if (fRadiator->LatticeHit(point)) hasBeenUsedTrack[iTrack] -= 1;
1114  } else {
1115  hasBeenUsedTrack[iTrack] = track->GetNPoints(ECbmModuleId::kTrd);
1117  CbmTrdUtils::PdgToGeant(Pdg_code));
1119  track->GetPt());
1121  track->GetP());
1122  }
1123 
1124 
1125  Double_t trackLength = GetTrackLength(point);
1126  /*
1127  TMath::Sqrt(
1128  (point->GetXOut() - point->GetXIn()) * (point->GetXOut() - point->GetXIn()) +
1129  (point->GetYOut() - point->GetYIn()) * (point->GetYOut() - point->GetYIn()) +
1130  (point->GetZOut() - point->GetZIn()) * (point->GetZOut() - point->GetZIn())
1131  );
1132  */
1133  if (
1134  Int_t(trackLength / 1.0 + 0.9)
1135  < 1) { // Track length threshold of minimum 0.1cm track length in gas volume
1136  deltaEMap[moduleAddress] += 1;
1137  continue;
1138  }
1139  if (nStsPoints >= 5) TrackableMap[moduleAddress] += 1;
1140 
1141  //track = (CbmMCTrack*) fMCTracks->At(point->GetTrackID());
1142  Int_t sectorId(0), columnId(0), rowId(0);
1143  fModuleInfo->GetPadInfo(point, sectorId, columnId, rowId);
1144  //printf("L:%i, MA:%i, S:%i R:%i, C:%i\n",CbmTrdAddress::GetLayerId(moduleAddress),CbmTrdAddress::GetModuleId(moduleAddress),sectorId,rowId,columnId);
1145  Int_t channelAddress =
1147  CbmTrdAddress::GetModuleId(moduleAddress),
1148  sectorId,
1149  rowId,
1150  columnId);
1151 
1152  if (channelAddressMap.find(channelAddress) == channelAddressMap.end()) {
1153  channelAddressMap[channelAddress] = 0;
1154  neighbourChannelAddressMap[channelAddress] = 0;
1155  }
1156  channelAddressMap[channelAddress] += 1;
1157  //neighbourChannelAddressMap[channelAddress] += 1;
1158 
1159  if (McTrackDoubleHitMap.find(point->GetTrackID())
1160  == McTrackDoubleHitMap.end()) {
1161  McTrackDoubleHitMap[point->GetTrackID()] = 0;
1162  McTrackNeighbourHitMap[point->GetTrackID()] = 0;
1163  }
1164  if (channelAddressMap[channelAddress] > 1) {
1165  McTrackDoubleHitMap[point->GetTrackID()] += 1;
1166  }
1167 
1168  Int_t neighbourRow(-1), neighbourColumn(-1), neighbourSector(-1),
1169  neighbourChannelAddress(0);
1170  //printf("\nS:%3i C:%3i R:%3i\n",sectorId,columnId,rowId);
1171  for (Int_t r = -1; r <= 1; r++) {
1172  for (Int_t c = -1; c <= 1; c++) {
1173  if (r == 0 && c == 0) continue;
1174  if (r != 0 && c != 0) continue;
1175  if (rowId < fModuleInfo->GetNofRowsInSector(sectorId) - 1
1176  && rowId > 0) {
1177  neighbourSector = sectorId;
1178  neighbourRow = rowId + r;
1179  } else if (rowId + r < 0 && sectorId > 0) {
1180  neighbourSector = sectorId - 1;
1181  neighbourRow = fModuleInfo->GetNofRowsInSector(neighbourSector) - 1;
1182  } else if (rowId == fModuleInfo->GetNofRowsInSector(sectorId) - 1
1183  && sectorId < fModuleInfo->GetNofSectors() - 1) {
1184  neighbourSector = sectorId + 1;
1185  neighbourRow = 0;
1186  }
1187  if (columnId + c >= 0
1188  && columnId + c
1189  <= fModuleInfo->GetNofColumnsInSector(sectorId) - 1)
1190  neighbourColumn = columnId + c;
1191  //printf (" S:%3i C:%3i R:%3i\n",neighbourSector,neighbourColumn,neighbourRow);
1192  if (neighbourSector > -1 && neighbourRow > -1
1193  && neighbourColumn > -1) {
1194  neighbourChannelAddress = CbmTrdAddress::GetAddress(
1195  CbmTrdAddress::GetLayerId(moduleAddress),
1196  CbmTrdAddress::GetModuleId(moduleAddress),
1197  neighbourSector,
1198  neighbourRow,
1199  neighbourColumn);
1200  if (channelAddressMap.find(neighbourChannelAddress)
1201  != channelAddressMap.end()) {
1202  //if (neighbourChannelAddressMap.find(neighbourChannelAddress) != neighbourChannelAddressMap.end()){
1203  neighbourChannelAddressMap[channelAddress] += 1;
1204  neighbourChannelAddressMap[neighbourChannelAddress] += 1;
1205  //if (neighbourChannelAddressMap[neighbourChannelAddress] > 1){
1206  //if (McTrackNeighbourHitMap.find(neighbourChannelAddress) == McTrackNeighbourHitMap.end())
1207  //McTrackNeighbourHitMap[point->GetTrackID()] = 0;
1208  McTrackNeighbourHitMap[point->GetTrackID()] += 1;
1209  //}
1210  }
1211  }
1212  }
1213  }
1214  Double_t ELoss = point->GetEnergyLoss();
1215  //if (ELoss < 1E-9){
1216  //continue;
1217  //}
1218  fModulePointMap[moduleAddress].push_back(iPoint);
1219  fModuledEdxMap[moduleAddress]->Fill(ELoss * 1E6);
1220  fModuleTracklengthMap[moduleAddress]->Fill(trackLength);
1221 
1222  if (fLayerMap.find(combiId) == fLayerMap.end()) {
1223  title.Form("Station%i_Layer%i", Station, Layer);
1224  fLayerMap[combiId] = new TCanvas(title, title, 1200, 1000);
1225  fLayerDummy->Draw("colz");
1226  }
1227  }
1228  for (std::map<Int_t, Int_t>::iterator it = hasBeenUsedTrack.begin();
1229  it != hasBeenUsedTrack.end();
1230  it++) {
1231  track = (CbmMCTrack*) fMCTracks->At(it->first);
1233  it->second);
1234  }
1235  }
1236 
1237 
1238  // Digis
1239  if (fD) {
1241  // nEntries = fDigis->GetEntries();
1242  printf("%i Digis \n", nEntries);
1243  for (Int_t iDigi = 0; iDigi < nEntries; iDigi++) {
1244  digi = CbmDigiManager::Instance()->Get<CbmTrdDigi>(iDigi);
1245  //fPointsPerDigi->Fill((Int_t)digi->GetMCIndex().size());
1246  fdEdxDigi->Fill(digi->GetCharge());
1247  moduleAddress = CbmTrdAddress::GetModuleAddress(
1248  digi->GetAddress()); //digi->GetDetId();
1249  Station = CbmTrdAddress::GetLayerId(moduleAddress) / 4
1250  + 1; //fGeoHandler->GetStation(moduleId);
1251  Layer = CbmTrdAddress::GetLayerId(moduleAddress) % 4
1252  + 1; //fGeoHandler->GetLayer(moduleId);
1253  //printf ("D det: %i S%i L%i \n",moduleAddress,Station,Layer);//GetDetId());
1254  combiId = 10 * Station + Layer;
1255  // CbmTrdParModDigi* fModuleInfo = (CbmTrdParModDigi*)fDigiPar->GetModulePar(moduleAddress);
1256  if (fModuleDigiMap.find(moduleAddress) == fModuleDigiMap.end()) {}
1257  fModuleDigiMap[moduleAddress].push_back(iDigi);
1258  if (fLayerMap.find(combiId) == fLayerMap.end()) {
1259  title.Form("Station%i_Layer%i", Station, Layer);
1260  fLayerMap[combiId] = new TCanvas(title, title, 1200, 1000);
1261  fLayerDummy->Draw("colz");
1262  }
1263  }
1264  }
1265 
1266  //Clusters
1267  if (fC) {
1268  nEntries = fClusters->GetEntries();
1269  printf("%i\n", nEntries);
1270  for (Int_t iCluster = 0; iCluster < nEntries; iCluster++) {
1271  cluster = (CbmTrdCluster*) fClusters->At(iCluster);
1272  Double_t charge = 0;
1275  ->Get<CbmTrdDigi>(cluster->GetDigi(0))
1276  ->GetAddress())]
1277  ->Fill(Int_t(cluster->GetNofDigis()));
1278  //fModuleClusterSizeMap[CbmTrdAddress::GetModuleAddress(((CbmTrdDigi*)fDigis->At(cluster->GetDigi(0)))->GetAddress())]->Fill(Int_t(cluster->GetNofDigis()));
1279  for (Int_t iDigi = 0; iDigi < cluster->GetNofDigis(); iDigi++) {
1280  digi =
1281  CbmDigiManager::Instance()->Get<CbmTrdDigi>(cluster->GetDigi(iDigi));
1282  // digi = (CbmTrdDigi*)fDigis->At(cluster->GetDigi(iDigi));
1283  charge += digi->GetCharge();
1284  }
1285  fdEdxCluster->Fill(charge);
1286  fClusterSize->Fill(cluster->GetNofDigis());
1287  fDigiPerCluster->Fill(cluster->GetNofDigis());
1288  if (cluster->GetNofDigis() >= 3) {
1289  // Double_t qLeft(0.0), qCenter(.0), qRight(0.0);
1290  for (Int_t i = 0; i < cluster->GetNofDigis(); i++) {
1291  digi =
1293  // digi = (CbmTrdDigi*) fDigis->At(cluster->GetDigi(i));
1294  }
1295  //fPRF_2D->Fill();
1296  //fPRF_1D->Fill();
1297  }
1298  //moduleAddress = cluster->GetDetId();
1299  //Station = fGeoHandler->GetStation(moduleAddress);
1300  //Layer = fGeoHandler->GetLayer(moduleAddress);
1301  //printf ("det: %i S%i L%i \n",moduleAddress,Station,Layer);//GetDetId());
1302  //combiId = 10 * Station + Layer;
1303  //CbmTrdParModDigi* fModuleInfo = (CbmTrdParModDigi*)fDigiPar->GetModulePar(moduleAddress);
1304  //if (fModuleClusterMap.find(moduleAddress) == fModuleClusterMap.end()){
1305  //fModuleClusterMap[moduleAddress].push_back(iCluster);
1306  //}
1307  }
1308  }
1309 
1310  //Hits
1311  if (fH) {
1312  nEntries = fHits->GetEntries();
1313  printf("%i Hits\n", nEntries);
1314  for (Int_t iHit = 0; iHit < nEntries; iHit++) {
1315  hit = (CbmTrdHit*) fHits->At(iHit);
1316  fdEdxHit->Fill(hit->GetELoss());
1317  moduleAddress = hit->GetAddress(); //hit->GetDetId();
1318  Station = CbmTrdAddress::GetLayerId(moduleAddress) / 4
1319  + 1; //fGeoHandler->GetStation(moduleId);
1320  Layer = CbmTrdAddress::GetLayerId(moduleAddress) % 4
1321  + 1; //fGeoHandler->GetLayer(moduleId);
1322  combiId = 10 * Station + Layer;
1323  // CbmTrdParModDigi* fModuleInfo = (CbmTrdParModDigi*)fDigiPar->GetModulePar(moduleAddress);
1324  if (fModuleHitMap.find(moduleAddress) == fModuleHitMap.end()) {}
1325  fModuleHitMap[moduleAddress].push_back(iHit);
1326  if (fLayerMap.find(combiId) == fLayerMap.end()) {
1327  title.Form("Station%i_Layer%i", Station, Layer);
1328  fLayerMap[combiId] = new TCanvas(title, title, 1200, 1000);
1329  fLayerMap[combiId]->cd();
1330  fLayerDummy->Draw("colz");
1331  }
1332  }
1333  }
1334  for (std::map<Int_t, Int_t>::iterator McTrackDoubleHitMapIt =
1335  McTrackDoubleHitMap
1336  .begin(); // Loop for all module ids which have mc points
1337  McTrackDoubleHitMapIt != McTrackDoubleHitMap.end();
1338  McTrackDoubleHitMapIt++) {
1339  fMultiHitSamePadPerMcTrack->Fill(McTrackDoubleHitMapIt->second);
1340  }
1341 
1342  for (std::map<Int_t, Int_t>::iterator McTrackNeighbourHitMapIt =
1343  McTrackNeighbourHitMap.begin();
1344  McTrackNeighbourHitMapIt != McTrackNeighbourHitMap.end();
1345  McTrackNeighbourHitMapIt++) {
1346  fMultiHitAdjacentPadPerMcTrack->Fill(McTrackNeighbourHitMapIt->second);
1347  }
1348  //printf(Int_t(fModulePointMapIt->second.size()),Int_t(->second.size()),Int_t(->second.size()));
1349  std::map<Int_t, Int_t> notMultiPointTRDPoints;
1350  Int_t allPoints(0); //, allHits(0);//, notMultiPointTRDPoints(0);
1351  for (fModulePointMapIt =
1353  .begin(); // Loop for all module ids which have mc points
1355  fModulePointMapIt++) {
1356  if (fModuleHitMap.find(fModulePointMapIt->first) == fModuleHitMap.end()) {
1357  printf("module %i not found in hit map\n", fModulePointMapIt->first);
1358  } else {
1359  std::map<Int_t, Int_t> hasBeenUsed;
1360  moduleAddress = fModulePointMapIt->first;
1361  CbmTrdParModDigi* fModuleInfo =
1362  (CbmTrdParModDigi*) fDigiPar->GetModulePar(moduleAddress);
1363  CbmTrdParModGeo* fModuleGeo =
1364  (CbmTrdParModGeo*) fGeoPar->GetModulePar(moduleAddress);
1365  allPoints = Int_t(fModulePointMapIt->second.size());
1366  fModuleAveragePointsMap[moduleAddress]->Fill(allPoints);
1367  // allHits = Int_t(fModuleHitMap[moduleAddress].size());
1368  fModuleDeltaEMap[moduleAddress]->Fill(100. * deltaEMap[moduleAddress]
1369  / allPoints);
1370  fModuleTrackableMap[moduleAddress]->Fill(
1371  100. * TrackableMap[moduleAddress] / allPoints);
1372  fModuleTrackableMap2[moduleAddress]->Fill(TrackableMap[moduleAddress]);
1373  //fModuleHitMapIt = fModuleHitMap[fModulePointMapIt->first];
1374  //cout << "Module: " << moduleAddress << " Points: "<< fModulePointMapIt->second.size() << endl;
1375 
1376  Double_t multiHitCounterModule = 0;
1377  Double_t r =
1378  sqrt(fModuleGeo->GetX() * fModuleGeo->GetX()
1379  + fModuleGeo->GetY()
1380  * fModuleGeo->GetY()); // radial position of the module center
1381  Double_t alpha = atan(r / fModuleGeo->GetZ()) * 1000.; //[mrad]
1382  //printf("%.2f %.2f %.2f %.2f %.2f\n",fModuleGeo->GetX(), fModuleGeo->GetY(), fModuleGeo->GetZ(), r, alpha);
1383  //for (Int_t iPoint = 0; iPoint < Int_t(fModulePointMapIt->second.size()); iPoint++) {
1384  for (
1385  Int_t iPoint = Int_t(fModulePointMapIt->second.size()) - 1; iPoint >= 0;
1386  iPoint--) { // its better to go backwards since found point and hit pairs are erased -> vector sice is dynamic
1387  //hasBeenUsed[fModulePointMapIt->second[iPoint]] = 0;
1388  point = (CbmTrdPoint*) fPoints->At(fModulePointMapIt->second[iPoint]);
1389  iTrack = point->GetTrackID();
1390 
1391 
1392  track = (CbmMCTrack*) fMCTracks->At(iTrack);
1393  mother_iTrack = track->GetMotherId();
1394  if (mother_iTrack >= 0)
1395  track_mother = (CbmMCTrack*) fMCTracks->At(mother_iTrack);
1396  else
1397  track_mother = NULL;
1398  if (notMultiPointTRDPoints.find(iTrack)
1399  == notMultiPointTRDPoints.end()) {
1400  //if (track->GetNPoints(ECbmModuleId::kSts) > 0)
1401  {
1402  Int_t nStsPoint = track->GetNPoints(ECbmModuleId::kSts);
1404  track->GetNPoints(ECbmModuleId::kSts));
1406  track->GetNPoints(ECbmModuleId::kSts));
1408  track->GetNPoints(ECbmModuleId::kSts));
1409  if (nStsPoint < 11) {
1410  fMuchTrdPoints[nStsPoint]->Fill(
1413  fMuchTofPoints[nStsPoint]->Fill(
1416  fTrdTofPoints[nStsPoint]->Fill(
1418  track->GetNPoints(ECbmModuleId::kTrd));
1419  }
1420  notMultiPointTRDPoints[iTrack] =
1422  }
1423  }
1424  Int_t Pdg_code = track->GetPdgCode();
1425 
1426  /*
1427  Double_t p_global[3] = {0.5 * (point->GetXIn() + point->GetXOut()),
1428  0.5 * (point->GetYIn() + point->GetYOut()),
1429  0.5 * (point->GetZIn() + point->GetZOut())};
1430  */
1431 
1432  Double_t p_global[3] = {0.5 * (point->GetXOut() + point->GetXIn()),
1433  0.5 * (point->GetYOut() + point->GetYIn()),
1434  0.5 * (point->GetZOut() + point->GetZIn())};
1435 
1436  gGeoManager->FindNode(p_global[0], p_global[1], p_global[2]);
1437  // const Double_t *global_point = gGeoManager->GetCurrentPoint();
1438  Double_t p_local[3] = {0.0};
1439  gGeoManager->MasterToLocal(p_global, p_local);
1440  //p_local[0] = p_global[0] - fModuleInfo->GetX();
1441  //p_local[1] = p_global[1] - fModuleInfo->GetY();
1442 
1443  Int_t xPpad(0), yPpad(0),
1444  pSectorId(-1); // correspoondig digi from point point of view
1445 
1446  fModuleInfo->GetPadInfo(p_local, pSectorId, xPpad, yPpad);
1447  yPpad = fModuleInfo->GetModuleRow(pSectorId, yPpad);
1448 
1449  for (Int_t jPoint = 0; jPoint < iPoint; jPoint++) {
1450  point2 =
1451  (CbmTrdPoint*) fPoints->At(fModulePointMapIt->second[jPoint]);
1452  Int_t jTrack = point2->GetTrackID();
1453  track2 = (CbmMCTrack*) fMCTracks->At(jTrack);
1454  Int_t mother_jTrack = track2->GetMotherId();
1455  if (mother_jTrack >= 0)
1456  track2_mother = (CbmMCTrack*) fMCTracks->At(mother_jTrack);
1457  else
1458  track2_mother = NULL;
1459  if (notMultiPointTRDPoints.find(jTrack)
1460  == notMultiPointTRDPoints.end()) {
1461  //if (track2->GetNPoints(ECbmModuleId::kSts) > 0)
1462  {
1463  Int_t nStsPoint = track2->GetNPoints(ECbmModuleId::kSts);
1465  track2->GetNPoints(ECbmModuleId::kSts));
1467  track2->GetNPoints(ECbmModuleId::kSts));
1469  track2->GetNPoints(ECbmModuleId::kSts));
1470  if (nStsPoint < 11) {
1471  fMuchTrdPoints[nStsPoint]->Fill(
1472  track2->GetNPoints(ECbmModuleId::kTrd),
1473  track2->GetNPoints(ECbmModuleId::kMuch));
1474  fMuchTofPoints[nStsPoint]->Fill(
1475  track2->GetNPoints(ECbmModuleId::kTof),
1476  track2->GetNPoints(ECbmModuleId::kMuch));
1477  fTrdTofPoints[nStsPoint]->Fill(
1478  track2->GetNPoints(ECbmModuleId::kTof),
1479  track2->GetNPoints(ECbmModuleId::kTrd));
1480  }
1481  notMultiPointTRDPoints[jTrack] =
1482  track2->GetNPoints(ECbmModuleId::kTrd);
1483  }
1484  }
1485 
1486  Double_t p_global2[3] = {0.5 * (point2->GetXOut() + point2->GetXIn()),
1487  0.5 * (point2->GetYOut() + point2->GetYIn()),
1488  0.5
1489  * (point2->GetZOut() + point2->GetZIn())};
1490 
1491  gGeoManager->FindNode(p_global2[0], p_global2[1], p_global2[2]);
1492  // const Double_t *global_point2 = gGeoManager->GetCurrentPoint();
1493  Double_t p_local2[3] = {0.0};
1494  gGeoManager->MasterToLocal(p_global2, p_local2);
1495  Int_t xPpad2(0), yPpad2(0),
1496  pSectorId2(-1); // correspoondig digi from point point of view
1497 
1498  fModuleInfo->GetPadInfo(p_local2, pSectorId2, xPpad2, yPpad2);
1499  yPpad2 = fModuleInfo->GetModuleRow(pSectorId2, yPpad2);
1500 
1501  if ((xPpad2 == xPpad) && (yPpad2 == yPpad)) { // identical pad
1502  //Double_t angle = CalcAngle(point, point2);
1503  //cout << angle*1000. << "mrad " << angle / TMath::Pi() * 180. << "deg" << endl;
1504  fMultiHitSamePadPerMcTrack_angle->Fill(CalcAngle(point, point2));
1506  track2->GetStartZ());
1509  CbmTrdUtils::PdgToGeant(track2->GetPdgCode()));
1510  if (NULL != track_mother && NULL != track2_mother) {
1512  track_mother->GetStartZ(), track2_mother->GetStartZ());
1514  CbmTrdUtils::PdgToGeant(track_mother->GetPdgCode()),
1515  CbmTrdUtils::PdgToGeant(track2_mother->GetPdgCode()));
1516  }
1517  if (hasBeenUsed.find(fModulePointMapIt->second[iPoint])
1518  == hasBeenUsed.end()) {
1519  hasBeenUsed[fModulePointMapIt->second[iPoint]] = 1;
1520  multiHitCounterModule++;
1521  if (notMultiPointTRDPoints.find(iTrack)
1522  != notMultiPointTRDPoints.end())
1523  if (notMultiPointTRDPoints[iTrack] > 0)
1524  notMultiPointTRDPoints[iTrack]--;
1525  }
1526  if (hasBeenUsed.find(fModulePointMapIt->second[jPoint])
1527  == hasBeenUsed.end()) {
1528  hasBeenUsed[fModulePointMapIt->second[jPoint]] += 1;
1529  multiHitCounterModule++;
1530  if (notMultiPointTRDPoints.find(jTrack)
1531  != notMultiPointTRDPoints.end())
1532  if (notMultiPointTRDPoints[jTrack] > 0)
1533  notMultiPointTRDPoints[jTrack]--;
1534  }
1535  } else if ((fabs(xPpad - xPpad2) <= 1
1536  && fabs(yPpad - yPpad2)
1537  <= 1)) { // surrounding neighbour pads
1538  if ((xPpad2 == xPpad) || (yPpad2 == yPpad)) { // exclude diagonal
1540  CalcAngle(point, point2));
1542  track2->GetStartZ());
1545  CbmTrdUtils::PdgToGeant(track2->GetPdgCode()));
1546  if (NULL != track_mother && NULL != track2_mother) {
1548  track_mother->GetStartZ(), track2_mother->GetStartZ());
1550  CbmTrdUtils::PdgToGeant(track_mother->GetPdgCode()),
1551  CbmTrdUtils::PdgToGeant(track2_mother->GetPdgCode()));
1552  }
1553  if (hasBeenUsed.find(fModulePointMapIt->second[iPoint])
1554  == hasBeenUsed.end()) {
1555  hasBeenUsed[fModulePointMapIt->second[iPoint]] = 1;
1556  multiHitCounterModule++;
1557  }
1558  if (hasBeenUsed.find(fModulePointMapIt->second[jPoint])
1559  == hasBeenUsed.end()) {
1560  hasBeenUsed[fModulePointMapIt->second[jPoint]] += 1;
1561  multiHitCounterModule++;
1562  }
1563  } else {
1564  //fStsTrdPointsTrackable->Fill(track->GetNPoints(ECbmModuleId::kTrd),track->GetNPoints(ECbmModuleId::kSts));
1565  }
1566  } else {
1567  //fStsTrdPointsTrackable->Fill(track->GetNPoints(ECbmModuleId::kTrd),track->GetNPoints(ECbmModuleId::kSts));
1568  }
1569  }
1570  Double_t xPPadSize(fModuleInfo->GetPadSizeX(pSectorId)),
1571  yPPadSize(fModuleInfo->GetPadSizeY(
1572  pSectorId)); // correspoondig pad sizes from point point of view
1573  //GetPadInfos( moduleAddress, p_local[0], p_local[1], xPpad, yPpad, xPPadSize, yPPadSize);
1574  if (point->GetEnergyLoss() > 0.0) {
1575  if (Pdg_code == 211 || Pdg_code == -211)
1576  fdEdxPionMc->Fill(point->GetEnergyLoss());
1577  if (Pdg_code == 11 || Pdg_code == -11)
1578  fdEdxElectronMc->Fill(point->GetEnergyLoss());
1579  }
1580  Double_t minimumDistance =
1581  sqrt(xPPadSize * xPPadSize + yPPadSize * yPPadSize);
1582  Double_t xDiviation(0), yDiviation(0);
1583  Int_t minDHitId = -1;
1584  Double_t mergedELoss = 0.0;
1585  Double_t hitELoss = 0.0;
1586  // Int_t multiHitCounter = 0;
1587  for (Int_t iHit = 0; iHit < Int_t(fModuleHitMap[moduleAddress].size());
1588  iHit++) {
1589  hit = (CbmTrdHit*) fHits->At(fModuleHitMap[moduleAddress][iHit]);
1590  Double_t h_global[3] = {hit->GetX(), hit->GetY(), hit->GetZ()};
1591  gGeoManager->FindNode(h_global[0], h_global[1], h_global[2]);
1592  // const Double_t *global_hit = gGeoManager->GetCurrentPoint();
1593  Double_t h_local[3] = {0.0};
1594  gGeoManager->MasterToLocal(h_global, h_local);
1595  //h_local[0] = h_global[0] - fModuleInfo->GetX();
1596  //h_local[1] = h_global[1] - fModuleInfo->GetY();
1597  Int_t xHpad(0), yHpad(0),
1598  hSectorId(-1); // correspoondig digi from hit point of view
1599  fModuleInfo->GetPadInfo(h_local, hSectorId, xHpad, yHpad);
1600  yHpad = fModuleInfo->GetModuleRow(hSectorId, yHpad);
1601  // Double_t xHPadSize(fModuleInfo->GetPadSizeX(hSectorId)), yHPadSize(fModuleInfo->GetPadSizeY(hSectorId)); // correspoondig pad sizes from point point of view
1602  //Double_t xHPadSize(0), yHPadSize(0); // correspoondig pad sizes from hit point of view
1603  //GetPadInfos( moduleAddress, h_local[0], h_local[1], xHpad, yHpad, xHPadSize, yHPadSize);
1604  //point_temp = new CbmTrdPoint(iTrack, hit->GetDetId(), );
1605  //r = sqrt(h_global[0] * h_global[0] + h_global[1] * h_global[1]);
1606  //r = sqrt(hit->GetX() * hit->GetX() + hit->GetY() * hit->GetY());
1607  Double_t distance =
1608  sqrt((p_local[0] - h_local[0]) * (p_local[0] - h_local[0])
1609  + (p_local[1] - h_local[1]) * (p_local[1] - h_local[1]));
1610  fDistanceMcToHitAll->Fill(distance);
1611  //if (xHpad == xPpad && yHpad == yPpad) {
1612  if (
1613  distance < minimumDistance
1614  || (xHpad == xPpad
1615  && yHpad
1616  == yPpad)) { // distance between point and hit is smaller one pad diagonal or on the same pad
1617  //if (distance < minimumDistance){
1618  minimumDistance = distance;
1619  minDHitId = iHit;
1620  xDiviation = p_local[0] - h_local[0];
1621  yDiviation = p_local[1] - h_local[1];
1622  hitELoss = hit->GetELoss();
1623  /*
1624  if (xHpad == xPpad && yHpad == yPpad){
1625  multiHitCounter++;
1626  if (samePadMerge)
1627  mergedELoss += hit->GetELoss();
1628  }
1629  */
1630  }
1631  }
1632 
1633  if (
1634  minDHitId
1635  > -1) { // If minimumDistance < pad diagonal -> delete point and hit from map
1636  //multiHitCounterModule += multiHitCounter / Float_t(fModulePointMapIt->second.size());
1637  fModuleHitMap[moduleAddress].erase(
1638  fModuleHitMap[moduleAddress].begin() + minDHitId);
1639  fModulePointMapIt->second.erase(fModulePointMapIt->second.begin()
1640  + iPoint);
1641  if (samePadMerge) {
1642  //if (mergedELoss == 0.0)
1643  //printf("(%02i, %02i) (%02i, %02i) %.2e %.2e\n",xPpad, yPpad, fModuleInfo->GetnCol(), fModuleInfo->GetnRow(), mergedELoss, point->GetEnergyLoss());
1644  if (Pdg_code == 211
1645  || Pdg_code == -211) // pdg code from associated point is used
1646  fdEdxPionHit->Fill(mergedELoss);
1647  if (Pdg_code == 11 || Pdg_code == -11)
1648  fdEdxElectronHit->Fill(mergedELoss);
1649  } else {
1650  if (Pdg_code == 211
1651  || Pdg_code == -211) // pdg code from associated point is used
1652  fdEdxPionHit->Fill(hitELoss);
1653  if (Pdg_code == 11 || Pdg_code == -11)
1654  fdEdxElectronHit->Fill(hitELoss);
1655  }
1656  fDistanceMcToHit->Fill(minimumDistance);
1657  if (
1658  xPPadSize
1659  > yPPadSize) { // ok to use here only the pad size of the point because the sapect ration does not change within one module
1660  fPositionResolutionShort->Fill(yDiviation);
1661  fPositionResolutionLong->Fill(xDiviation);
1662  } else {
1663  fPositionResolutionShort->Fill(xDiviation);
1664  fPositionResolutionLong->Fill(yDiviation);
1665  }
1666  }
1667  }
1668 
1669  fMultiHitsVsAlpha->Fill(
1670  alpha, 100. * multiHitCounterModule / Float_t(allPoints));
1671  fMultiHitsVsR->Fill(r, 100. * multiHitCounterModule / Float_t(allPoints));
1672  // left over points == lost
1673  fModuleLostMap[moduleAddress]->Fill(
1674  100. * Float_t(fModulePointMapIt->second.size()) / Float_t(allPoints));
1675  fLostPointVsR->Fill(r,
1676  100. * Float_t(fModulePointMapIt->second.size())
1677  / Float_t(allPoints));
1678  fLostPointVsAlpha->Fill(alpha,
1679  100. * Float_t(fModulePointMapIt->second.size())
1680  / Float_t(allPoints));
1681  // left over hits == ghosts
1682  fModuleGhostMap[moduleAddress]->Fill(
1683  100. * Float_t(fModuleHitMap[fModulePointMapIt->first].size())
1684  / Float_t(allPoints));
1685  fGhostHitVsR->Fill(
1686  r,
1687  100. * Float_t(fModuleHitMap[fModulePointMapIt->first].size())
1688  / Float_t(allPoints));
1689  fGhostHitVsAlpha->Fill(
1690  alpha,
1691  100. * Float_t(fModuleHitMap[fModulePointMapIt->first].size())
1692  / Float_t(allPoints));
1693  // found point hit pairs / all points == detection efficiency
1694  fModuleEfficiencyMap[moduleAddress]->Fill(
1695  100. * (allPoints - Float_t(fModulePointMapIt->second.size()))
1696  / Float_t(allPoints));
1698  r,
1699  100. * (allPoints - Float_t(fModulePointMapIt->second.size()))
1700  / Float_t(allPoints));
1702  alpha,
1703  100. * (allPoints - Float_t(fModulePointMapIt->second.size()))
1704  / Float_t(allPoints));
1705 
1706  fModuleMultiPointMap[moduleAddress]->Fill(
1707  100. * (Float_t(multiHitCounterModule)) / Float_t(allPoints));
1708  }
1709  }
1710  for (std::map<Int_t, Int_t>::iterator notMultiPointTRDPointsIt =
1711  notMultiPointTRDPoints.begin();
1712  notMultiPointTRDPointsIt != notMultiPointTRDPoints.end();
1713  notMultiPointTRDPointsIt++) {
1714  track = (CbmMCTrack*) (fMCTracks->At(notMultiPointTRDPointsIt->first));
1715  fStsTrdPointsTrackable->Fill(notMultiPointTRDPointsIt->second,
1716  track->GetNPoints(ECbmModuleId::kSts));
1717  }
1718  timer.Stop();
1719  Double_t rtime = timer.RealTime();
1720  Double_t ctime = timer.CpuTime();
1721 
1722  printf("\n\n******************** Reading Test **********************\n");
1723  printf(" RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime);
1724  printf("*********************************************************\n\n");
1725 }
1726 void CbmTrdQa::SetTriangularPads(Bool_t triangles) {
1727  fTrianglePads = triangles;
1728 }
1729 
1730 
1732  TString origpath = gDirectory->GetPath();
1733  printf("\n%s\n", origpath.Data());
1734  TString newpath = origpath;
1735  newpath.ReplaceAll("eds", "trd_qa");
1736  newpath.ReplaceAll(":/", "");
1737  TFile* tempFile = new TFile(newpath, "recreate");
1738  gDirectory = tempFile->CurrentDirectory();
1739  gDirectory->pwd();
1740 
1741  TString title;
1742  title.Form("_TH_%.2EGeV_", fTriggerThreshold);
1743  gDirectory->pwd();
1744  if (!gDirectory->Cd("TrdQa")) gDirectory->mkdir("TrdQa");
1745  gDirectory->Cd("TrdQa");
1746  TCanvas* c = new TCanvas("c", "c", 800, 600);
1747  c->cd();
1748  TLegend* l = new TLegend(0.65, 0.65, 0.85, 0.85);
1749  l->SetTextSize(0.025);
1750  l->SetTextColor(1);
1751  l->SetFillStyle(0);
1752  l->SetLineStyle(0);
1753  l->SetLineColor(0);
1754  fdEdxPionMc->DrawCopy();
1755  l->AddEntry(fdEdxElectronMc, "MC electron", "l");
1756  fdEdxElectronMc->DrawCopy("same");
1757  l->AddEntry(fdEdxElectronHit, "Hit electron", "l");
1758  fdEdxElectronHit->DrawCopy("same");
1759  l->AddEntry(fdEdxPionMc, "MC pion", "l");
1760  fdEdxPionMc->DrawCopy("same");
1761  l->AddEntry(fdEdxPionHit, "Hit pion", "l");
1762  fdEdxPionHit->DrawCopy("same");
1763  l->Draw("same");
1764  c->SaveAs("pics/TrdQadEdx" + title + ".pdf");
1765  c->SaveAs("pics/TrdQadEdx" + title + ".png");
1766  /*
1767  delete l;
1768  TLegend *l = new TLegend(0.65,0.65,0.85,0.85);
1769  l->SetTextSize(0.025);
1770  l->SetTextColor(1);
1771  l->SetFillStyle(0);
1772  l->SetLineStyle(0);
1773  l->SetLineColor(0);
1774  */
1775  l->Clear();
1776  l->AddEntry(fHitToPointEfficiencyVsR, "Hit to point efficiency", "p");
1777  fHitToPointEfficiencyVsR->DrawCopy();
1778  l->AddEntry(fGhostHitVsR, "Ghost hits", "p");
1779  fGhostHitVsR->DrawCopy("same");
1780  l->AddEntry(fLostPointVsR, "Lost points", "p");
1781  fLostPointVsR->DrawCopy("same");
1782  l->AddEntry(fMultiHitsVsR, "Multi points", "p");
1783  fMultiHitsVsR->DrawCopy("same");
1784  l->Draw("same");
1785  c->SaveAs("pics/TrdQaStatisticVsR" + title + ".pdf");
1786  c->SaveAs("pics/TrdQaStatisticVsR" + title + ".png");
1787  fHitToPointEfficiencyVsAlpha->DrawCopy();
1788  fGhostHitVsAlpha->DrawCopy("same");
1789  fLostPointVsAlpha->DrawCopy("same");
1790  fMultiHitsVsAlpha->DrawCopy("same");
1791  l->Draw("same");
1792  c->SaveAs("pics/TrdQaStatisticVsAlpha" + title + ".pdf");
1793  c->SaveAs("pics/TrdQaStatisticVsAlpha" + title + ".png");
1794  gDirectory->pwd();
1795  fdEdxPoint->Write("", TObject::kOverwrite);
1796  fdEdxDigi->Write("", TObject::kOverwrite);
1797  c->cd()->SetLogx(1);
1798  c->cd()->SetLogy(1);
1799  fdEdxDigi->Draw();
1800  c->SaveAs("pics/TrdQadEdxDigi.pdf");
1801  c->SaveAs("pics/TrdQadEdxDigi.png");
1802  fdEdxCluster->Write("", TObject::kOverwrite);
1803  fdEdxCluster->Draw();
1804  c->SaveAs("pics/TrdQadEdxCluster" + title + ".pdf");
1805  c->SaveAs("pics/TrdQadEdxCluster" + title + ".png");
1806  c->cd()->SetLogx(0);
1807  c->cd()->SetLogy(0);
1808  fdEdxHit->Write("", TObject::kOverwrite);
1809  fdEdxPionMc->Write("", TObject::kOverwrite);
1810  fdEdxPionHit->Write("", TObject::kOverwrite);
1811  fdEdxPionGhost->Write("", TObject::kOverwrite);
1812  fdEdxElectronMc->Write("", TObject::kOverwrite);
1813  fdEdxElectronHit->Write("", TObject::kOverwrite);
1814  fdEdxElectronGhost->Write("", TObject::kOverwrite);
1815  fDistanceMcToHit->Write("", TObject::kOverwrite);
1816  fDistanceMcToHitAll->Write("", TObject::kOverwrite);
1817  fMultiHitsVsR->Write("", TObject::kOverwrite);
1818  fGhostHitVsR->Write("", TObject::kOverwrite);
1819  fLostPointVsR->Write("", TObject::kOverwrite);
1820  fHitToPointEfficiencyVsR->Write("", TObject::kOverwrite);
1821  fMultiHitsVsAlpha->Write("", TObject::kOverwrite);
1822  fGhostHitVsAlpha->Write("", TObject::kOverwrite);
1823  fLostPointVsAlpha->Write("", TObject::kOverwrite);
1824  fHitToPointEfficiencyVsAlpha->Write("", TObject::kOverwrite);
1825  fPositionResolutionShort->Write("", TObject::kOverwrite);
1826  fPositionResolutionShort->DrawCopy();
1827  c->SaveAs("pics/TrdQaPositionResolutionShort" + title + ".pdf");
1828  c->SaveAs("pics/TrdQaPositionResolutionShort" + title + ".png");
1829  fPositionResolutionLong->Write("", TObject::kOverwrite);
1830  fPositionResolutionLong->DrawCopy();
1831  c->SaveAs("pics/TrdQaPositionResolutionLong" + title + ".pdf");
1832  c->SaveAs("pics/TrdQaPositionResolutionLong" + title + ".png");
1833  fClusterSize->Write("", TObject::kOverwrite);
1834  fPointsPerDigi->Write("", TObject::kOverwrite);
1835  fDigiPerCluster->Write("", TObject::kOverwrite);
1836  fClusterPerHit->Write("", TObject::kOverwrite);
1837  fPRF_1D->Write("", TObject::kOverwrite);
1838  fPRF_2D->Write("", TObject::kOverwrite);
1839  c->SetLogy(1);
1840  fMultiHitSamePadPerMcTrack->DrawCopy();
1841  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack" + title + ".pdf");
1842  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack" + title + ".png");
1843  fMultiHitSamePadPerMcTrack->Write("", TObject::kOverwrite);
1844  c->SetLogx(1);
1846  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_angle" + title + ".pdf");
1847  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_angle" + title + ".png");
1848  fMultiHitSamePadPerMcTrack_angle->Write("", TObject::kOverwrite);
1849  c->SetLogx(0);
1850  c->SetLogy(0);
1851  c->SetLogz(1);
1852  fMultiHitSamePadPerMcTrack_zBirth->DrawCopy("colz");
1853  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_zBirth" + title + ".pdf");
1854  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_zBirth" + title + ".png");
1855  fMultiHitSamePadPerMcTrack_zBirth->Write("", TObject::kOverwrite);
1856  fMultiHitSamePadPerMcTrack_motherzBirth->DrawCopy("colz");
1857  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_motherzBirth" + title
1858  + ".pdf");
1859  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_motherzBirth" + title
1860  + ".png");
1861  fMultiHitSamePadPerMcTrack_motherzBirth->Write("", TObject::kOverwrite);
1862  c->SetLogz(0);
1863  fMultiHitSamePadPerMcTrack_PID->DrawCopy("colz");
1864  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_PID" + title + ".pdf");
1865  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_PID" + title + ".png");
1866  fMultiHitSamePadPerMcTrack_PID->Write("", TObject::kOverwrite);
1867  fMultiHitSamePadPerMcTrack_motherPID->DrawCopy("colz");
1868  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_motherPID" + title + ".pdf");
1869  c->SaveAs("pics/TrdQaMultiHitSamePadPerMcTrack_motherPID" + title + ".png");
1870  fMultiHitSamePadPerMcTrack_motherPID->Write("", TObject::kOverwrite);
1871  c->SetLogz(1);
1872  c->SetLogy(1);
1873  fMultiHitAdjacentPadPerMcTrack->DrawCopy();
1874  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack" + title + ".pdf");
1875  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack" + title + ".png");
1876  fMultiHitAdjacentPadPerMcTrack->Write("", TObject::kOverwrite);
1877  c->SetLogx(1);
1879  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_angle" + title + ".pdf");
1880  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_angle" + title + ".png");
1881  fMultiHitAdjacentPadPerMcTrack_angle->Write("", TObject::kOverwrite);
1882  c->SetLogx(0);
1883  c->SetLogy(0);
1884  c->SetLogz(1);
1885  fMultiHitAdjacentPadPerMcTrack_zBirth->DrawCopy("colz");
1886  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_zBirth" + title + ".pdf");
1887  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_zBirth" + title + ".png");
1888  fMultiHitAdjacentPadPerMcTrack_zBirth->Write("", TObject::kOverwrite);
1890  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_motherzBirth" + title
1891  + ".pdf");
1892  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_motherzBirth" + title
1893  + ".png");
1894  fMultiHitAdjacentPadPerMcTrack_motherzBirth->Write("", TObject::kOverwrite);
1895  c->SetLogz(0);
1896  fMultiHitAdjacentPadPerMcTrack_motherPID->DrawCopy("colz");
1897  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_motherPID" + title
1898  + ".pdf");
1899  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_motherPID" + title
1900  + ".png");
1901  fMultiHitAdjacentPadPerMcTrack_motherPID->Write("", TObject::kOverwrite);
1902  fMultiHitAdjacentPadPerMcTrack_PID->DrawCopy("colz");
1903  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_PID" + title + ".pdf");
1904  c->SaveAs("pics/TrdQaMultiHitAdjacentPadPerMcTrack_PID" + title + ".png");
1905  fMultiHitAdjacentPadPerMcTrack_PID->Write("", TObject::kOverwrite);
1906  c->SetLogz(1);
1907  printf("------------->>>>>> TRD tracks:%i TRD tracks "
1908  "trackable:%i <<<<<<-------------\n",
1909  (Int_t) fStsTrdPoints->GetEntries(),
1910  (Int_t) fStsTrdPointsTrackable->GetEntries());
1911  fStsTrdPoints->Scale(100. / fStsTrdPoints->GetEntries());
1912  fStsTrdPoints->GetZaxis()->SetRangeUser(
1913  0,
1914  100); //100./fStsTrdPoints->GetEntries(),fStsTrdPoints->GetBinContent(fStsTrdPoints->GetMaximumBin()));
1915  fStsTrdPoints->DrawCopy("colz,text");
1916  c->SaveAs("pics/TrdQaStsTrdPoints" + title + ".pdf");
1917  c->SaveAs("pics/TrdQaStsTrdPoints" + title + ".png");
1918  fStsTrdPoints->Write("", TObject::kOverwrite);
1919 
1920  fStsMuchPoints->Scale(100. / fStsMuchPoints->GetEntries());
1921  fStsMuchPoints->GetZaxis()->SetRangeUser(
1922  0,
1923  100); //100./fStsMuchPoints->GetEntries(),fStsMuchPoints->GetBinContent(fStsMuchPoints->GetMaximumBin()));
1924  fStsMuchPoints->DrawCopy("colz,text");
1925  c->SaveAs("pics/TrdQaStsMuchPoints" + title + ".pdf");
1926  c->SaveAs("pics/TrdQaStsMuchPoints" + title + ".png");
1927  fStsMuchPoints->Write("", TObject::kOverwrite);
1928 
1929  fStsTofPoints->Scale(100. / fStsTofPoints->GetEntries());
1930  fStsTofPoints->GetZaxis()->SetRangeUser(
1931  0,
1932  100); //100./fStsTofPoints->GetEntries(),fStsTofPoints->GetBinContent(fStsTofPoints->GetMaximumBin()));
1933  fStsTofPoints->DrawCopy("colz,text");
1934  c->SaveAs("pics/TrdQaStsTofPoints" + title + ".pdf");
1935  c->SaveAs("pics/TrdQaStsTofPoints" + title + ".png");
1936  fStsTofPoints->Write("", TObject::kOverwrite);
1937  TString name;
1938  for (Int_t iStsPoints = 0; iStsPoints < 11; iStsPoints++) {
1939  name.Form("_%02iStsPoints", iStsPoints);
1940  fMuchTrdPoints[iStsPoints]->Scale(
1941  100. / fMuchTrdPoints[iStsPoints]->GetEntries());
1942  fMuchTrdPoints[iStsPoints]->GetZaxis()->SetRangeUser(
1943  0, 100); //100./fMuchTrdPoints[iStsPoints]->GetEntries(),
1944  fMuchTrdPoints[iStsPoints]->DrawCopy("colz,text");
1945  c->SaveAs("pics/TrdQaMuchTrdPoints" + name + title + ".pdf");
1946  c->SaveAs("pics/TrdQaMuchTrdPoints" + name + title + ".png");
1947  fMuchTrdPoints[iStsPoints]->Write("", TObject::kOverwrite);
1948 
1949  name.Form("_%iStsPoints", iStsPoints);
1950  fMuchTofPoints[iStsPoints]->Scale(
1951  100. / fMuchTofPoints[iStsPoints]->GetEntries());
1952  fMuchTofPoints[iStsPoints]->GetZaxis()->SetRangeUser(
1953  0, 100); //100./fMuchTofPoints[iStsPoints]->GetEntries(),
1954  fMuchTofPoints[iStsPoints]->DrawCopy("colz,text");
1955  c->SaveAs("pics/TrdQaMuchTofPoints" + name + title + ".pdf");
1956  c->SaveAs("pics/TrdQaMuchTofPoints" + name + title + ".png");
1957  fMuchTofPoints[iStsPoints]->Write("", TObject::kOverwrite);
1958 
1959  name.Form("_%iStsPoints", iStsPoints);
1960  fTrdTofPoints[iStsPoints]->Scale(100.
1961  / fTrdTofPoints[iStsPoints]->GetEntries());
1962  fTrdTofPoints[iStsPoints]->GetZaxis()->SetRangeUser(
1963  0, 100); //100./fTrdTofPoints[iStsPoints]->GetEntries(),
1964  fTrdTofPoints[iStsPoints]->DrawCopy("colz,text");
1965  c->SaveAs("pics/TrdQaTrdTofPoints" + name + title + ".pdf");
1966  c->SaveAs("pics/TrdQaTrdTofPoints" + name + title + ".png");
1967  fTrdTofPoints[iStsPoints]->Write("", TObject::kOverwrite);
1968  }
1969 
1970 
1971  fStsTrdPointsTrackable->Scale(100. / fStsTrdPointsTrackable->GetEntries());
1972  fStsTrdPointsTrackable->GetZaxis()->SetRangeUser(
1973  100. / fStsTrdPoints->GetEntries(),
1974  fStsTrdPoints->GetBinContent(
1975  fStsTrdPoints->GetMaximumBin())); // same scale for both histos
1976  fStsTrdPointsTrackable->DrawCopy("colz,text");
1977  c->SaveAs("pics/TrdQaStsTrdPointsTrackable" + title + ".pdf");
1978  c->SaveAs("pics/TrdQaStsTrdPointsTrackable" + title + ".png");
1979  fStsTrdPointsTrackable->Write("", TObject::kOverwrite);
1980 
1981  fTrdPointsPerMcTrack_PID->Write("", TObject::kOverwrite);
1982  fTrdPointsPerMcTrack_PID->DrawCopy("colz");
1983  c->SaveAs("pics/TrdQaPointsPerMcTrack_PID" + title + ".pdf");
1984  c->SaveAs("pics/TrdQaPointsPerMcTrack_PID" + title + ".png");
1985  fTrdPointsPerMcTrack_PT->Write("", TObject::kOverwrite);
1986  fTrdPointsPerMcTrack_PT->DrawCopy("colz");
1987  c->SaveAs("pics/TrdQaPointsPerMcTrack_PT" + title + ".pdf");
1988  c->SaveAs("pics/TrdQaPointsPerMcTrack_PT" + title + ".png");
1989  fTrdPointsPerMcTrack_P->Write("", TObject::kOverwrite);
1990  fTrdPointsPerMcTrack_P->DrawCopy("colz");
1991  c->SaveAs("pics/TrdQaPointsPerMcTrack_P" + title + ".pdf");
1992  c->SaveAs("pics/TrdQaPointsPerMcTrack_P" + title + ".png");
1993  fTrdTrackCrossedRadiator->Scale(100.
1994  / fTrdTrackCrossedRadiator->GetEntries());
1995  fTrdTrackCrossedRadiator->Write("", TObject::kOverwrite);
1996  fTrdTrackCrossedRadiator->DrawCopy("colz,text");
1997  c->SaveAs("pics/TrdQaTrackCrossedRadiator" + title + ".pdf");
1998  c->SaveAs("pics/TrdQaTrackCrossedRadiator" + title + ".png");
1999  c->SetLogz(0);
2000  delete l;
2001  gDirectory->Cd("..");
2002  tempFile->Close();
2003  gDirectory->Cd(origpath);
2004  gDirectory->pwd();
2005 }
2007  if (fT) {
2008  fMCTracks->Clear();
2009  fMCTracks->Delete();
2010  }
2011  if (fP) {
2012  fPoints->Clear();
2013  fPoints->Delete();
2014  for (fModulePointMapIt = fModulePointMap.begin();
2016  fModulePointMapIt++) {
2017  fModulePointMapIt->second.clear();
2018  }
2019  fModulePointMap.clear();
2020  }
2021  if (fD) {
2022  for (fModuleDigiMapIt = fModuleDigiMap.begin();
2024  fModuleDigiMapIt++) {
2025  fModuleDigiMapIt->second.clear();
2026  }
2027  fModuleDigiMap.clear();
2028  }
2029  if (fC) {
2030  fClusters->Clear();
2031  fClusters->Delete();
2032  for (fModuleClusterMapIt = fModuleClusterMap.begin();
2034  fModuleClusterMapIt++) {
2035  fModuleClusterMapIt->second.clear();
2036  }
2037  fModuleClusterMap.clear();
2038  }
2039  if (fH) {
2040  fHits->Clear();
2041  fHits->Delete();
2042  for (fModuleHitMapIt = fModuleHitMap.begin();
2043  fModuleHitMapIt != fModuleHitMap.end();
2044  fModuleHitMapIt++) {
2045  fModuleHitMapIt->second.clear();
2046  }
2047  fModuleHitMap.clear();
2048  }
2049 }
2050 void CbmTrdQa::GetPadInfos(Int_t moduleAddress,
2051  Double_t x,
2052  Double_t y,
2053  Int_t& iCol,
2054  Int_t& iRow,
2055  Double_t& padSizeX,
2056  Double_t& padSizeY) {
2057  CbmTrdParModDigi* fModuleInfo =
2058  (CbmTrdParModDigi*) fDigiPar->GetModulePar(moduleAddress);
2059  x += fModuleInfo
2060  ->GetSizeX(); // move origin from module center to lower right corner
2061  y += fModuleInfo
2062  ->GetSizeY(); // move origin from module center to lower right corner
2063  Int_t nSector = fModuleInfo->GetNofSectors();
2064  Int_t iSectorX(0), iSectorY(0);
2065  Double_t iSectorSizeX = fModuleInfo->GetSectorSizeX(iSectorX);
2066  Double_t iSectorSizeY = fModuleInfo->GetSectorSizeY(iSectorY);
2067  Double_t iPadSizeX = fModuleInfo->GetPadSizeX(iSectorX);
2068  Double_t iPadSizeY = fModuleInfo->GetPadSizeY(iSectorY);
2069  Int_t iPadX = 0;
2070  Int_t iPadY = 0;
2071  if (x > 2 * fModuleInfo->GetSizeX() || y > 2 * fModuleInfo->GetSizeY()
2072  || x < 0 || y < 0) {
2073  printf("point out of module::\n module %i (%.2f, %.2f) (%.2f, %.2f)\n",
2074  moduleAddress,
2075  x,
2076  y,
2077  2 * fModuleInfo->GetSizeX(),
2078  2 * fModuleInfo->GetSizeY());
2079  } else {
2080  while (x > iSectorSizeX && iSectorX < nSector) {
2081  x -= iSectorSizeX;
2082  iPadX += iSectorSizeX / iPadSizeX;
2083  iSectorX++;
2084  iSectorSizeX = fModuleInfo->GetSectorSizeX(iSectorX);
2085  iPadSizeX = fModuleInfo->GetPadSizeX(iSectorX);
2086  }
2087  padSizeX = iPadSizeX;
2088  iPadX += Int_t((x / padSizeX) + 0.5);
2089  iCol = iPadX;
2090  while (y > iSectorSizeY && iSectorY < nSector) {
2091  y -= iSectorSizeY;
2092  iPadY += iSectorSizeY / iPadSizeY;
2093  iSectorY++;
2094  iSectorSizeY = fModuleInfo->GetSectorSizeY(iSectorY);
2095  iPadSizeY = fModuleInfo->GetPadSizeY(iSectorY);
2096  }
2097  padSizeY = iPadSizeY;
2098  iPadY += Int_t((x / padSizeX) + 0.5);
2099  iRow = iPadY;
2100  }
2101 }
2102 void CbmTrdQa::CreateLayerView(std::map<Int_t, TH1*>& Map,
2103  TString folder,
2104  TString pics,
2105  TString zAxisTitle,
2106  Double_t fmax,
2107  Double_t fmin,
2108  Bool_t logScale) {
2109  TString origpath = gDirectory->GetPath();
2110  printf("\n%s\n", origpath.Data());
2111  TString newpath = origpath;
2112  newpath.ReplaceAll("eds", "trd_qa");
2113  newpath.ReplaceAll(":/", "");
2114  TFile* tempFile = new TFile(newpath, "recreate");
2115  gDirectory = tempFile->CurrentDirectory();
2116  gDirectory->pwd();
2117  TString title(""), name("");
2118  name.Form("_TH_%.2EGeV_", fTriggerThreshold);
2119  TPaveText* text = NULL;
2120  std::map<Int_t, TH1*>::iterator MapIt;
2121  std::vector<Int_t> fColors;
2122  std::vector<Double_t> fZLevel;
2123  //Double_t fmax(20), fmin(0);
2124  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2125  fColors.push_back(TColor::GetColorPalette(i));
2126  if (logScale)
2127  fZLevel.push_back(
2128  fmin
2129  + TMath::Power(10,
2130  TMath::Log10(fmax) / TColor::GetNumberOfColors()
2131  * i)); // log scale
2132  else
2133  fZLevel.push_back(
2134  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2135  }
2136 
2137  gDirectory->pwd();
2138  if (!gDirectory->Cd(folder)) gDirectory->mkdir(folder);
2139  gDirectory->Cd(folder);
2140 
2141  for (MapIt = Map.begin(); MapIt != Map.end(); MapIt++) {
2142  Double_t value = MapIt->second->GetMean(1);
2143  Double_t valueE = MapIt->second->GetRMS(1);
2144  CbmTrdParModDigi* fModuleInfo =
2145  (CbmTrdParModDigi*) fDigiPar->GetModulePar(MapIt->first);
2146  CbmTrdParModGeo* fModuleGeo =
2147  (CbmTrdParModGeo*) fGeoPar->GetModulePar(MapIt->first);
2148  Int_t Station = CbmTrdAddress::GetLayerId(MapIt->first) / 4
2149  + 1; //fGeoHandler->GetStation(moduleId);
2150  Int_t Layer = CbmTrdAddress::GetLayerId(MapIt->first) % 4
2151  + 1; //fGeoHandler->GetLayer(moduleId);
2152  Int_t combiId = 10 * Station + Layer;
2153  fLayerMap[combiId]->cd();
2154  if (MapIt == Map.begin()) {
2155  fLayerDummy->SetZTitle(zAxisTitle);
2156  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2157  }
2158  fLayerMap[combiId]->cd()->Update();
2159  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2160  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2161  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2162  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2163  text->SetFillStyle(1001);
2164  text->SetLineColor(1);
2165 
2166  Int_t j = 0;
2167  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2168  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2169  j++;
2170  }
2171  text->SetFillColor(fColors[j]);
2172  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2173 
2174  if (fColors[j] < 65) text->SetTextColor(kWhite);
2175  title.Form("%.1f#pm%.1f", value, valueE);
2176  text->AddText(title);
2177  text->Draw("same");
2178  }
2179  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2180  fLayerMapIt++) {
2181  fLayerMapIt->second->Write("", TObject::kOverwrite);
2182  title.Form("pics/TrdQa%s_S%i_L%i_%s%s.pdf",
2183  pics.Data(),
2184  fLayerMapIt->first / 10,
2185  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2186  fGeo.Data(),
2187  name.Data());
2188  fLayerMapIt->second->SaveAs(title);
2189  title.ReplaceAll("pdf", "png");
2190  fLayerMapIt->second->SaveAs(title);
2191  }
2192  for (MapIt = Map.begin(); MapIt != Map.end(); MapIt++) {
2193  MapIt->second->Write("", TObject::kOverwrite);
2194  }
2195  gDirectory->Cd("..");
2196 
2197  tempFile->Close();
2198  gDirectory->Cd(origpath);
2199  gDirectory->pwd();
2200 }
2201 
2203  TString origpath = gDirectory->GetPath();
2204  printf("\n%s\n", origpath.Data());
2205  TString newpath = origpath;
2206  newpath.ReplaceAll("eds", "trd_qa");
2207  newpath.ReplaceAll(":/", "");
2208  TFile* tempFile = new TFile(newpath, "recreate");
2209  gDirectory = tempFile->CurrentDirectory();
2210  gDirectory->pwd();
2211  TString title(""), name("");
2212  TPaveText* text = NULL;
2213  {
2214  std::vector<Int_t> fColors;
2215  std::vector<Double_t> fZLevel;
2216  Double_t fmax(20), fmin(0);
2217  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2218  fColors.push_back(TColor::GetColorPalette(i));
2219  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2220  fZLevel.push_back(
2221  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2222  }
2223 
2224  gDirectory->pwd();
2225  if (!gDirectory->Cd("TrdQa")) gDirectory->mkdir("TrdQa");
2226  gDirectory->Cd("TrdQa");
2227  /*
2228  if (fLayerMap.find(combiId) == fLayerMap.end()){
2229  title.Form("Station%i_Layer%i",Station,Layer);
2230  fLayerMap[combiId] = new TCanvas(title,title,1200,1000);
2231  fLayerDummy->Draw("colz");
2232  }
2233  */
2234  printf("fModuleGhostMap: %i\n", (Int_t) fModuleGhostMap.size());
2235  for (fModuleGhostMapIt = fModuleGhostMap.begin();
2237  fModuleGhostMapIt++) {
2238  Double_t value = fModuleGhostMapIt->second->GetMean(1);
2239  Double_t valueE = fModuleGhostMapIt->second->GetRMS(1);
2240  CbmTrdParModDigi* fModuleInfo =
2242  CbmTrdParModGeo* fModuleGeo =
2244  Int_t Station = CbmTrdAddress::GetLayerId(fModuleGhostMapIt->first) / 4
2245  + 1; //fGeoHandler->GetStation(moduleId);
2246  Int_t Layer = CbmTrdAddress::GetLayerId(fModuleGhostMapIt->first) % 4
2247  + 1; //fGeoHandler->GetLayer(moduleId);
2248  Int_t combiId = 10 * Station + Layer;
2249  fLayerMap[combiId]->cd();
2250  if (fModuleGhostMapIt == fModuleGhostMap.begin()) {
2251  //fLayerDummy->SetZTitle("left over hits / all points [%]");
2252  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2253  //fLayerDummy->DrawCopy("colz");
2254  }
2255  fLayerMap[combiId]->cd()->Update();
2256  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2257  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2258  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2259  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2260  text->SetFillStyle(1001);
2261  text->SetLineColor(1);
2262 
2263  Int_t j = 0;
2264  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2265  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2266  j++;
2267  }
2268  text->SetFillColor(fColors[j]);
2269  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2270 
2271  if (fColors[j] < 65) text->SetTextColor(kWhite);
2272  title.Form("%.1f#pm%.1f", value, valueE);
2273  text->AddText(title);
2274  text->Draw("same");
2275  }
2276  }
2277  {
2278  std::vector<Int_t> fColors;
2279  std::vector<Double_t> fZLevel;
2280  Double_t fmax(20), fmin(0);
2281  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2282  fColors.push_back(TColor::GetColorPalette(i));
2283  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2284  fZLevel.push_back(
2285  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2286  }
2287  gDirectory->pwd();
2288  if (!gDirectory->Cd("Ghost")) gDirectory->mkdir("Ghost");
2289  gDirectory->Cd("Ghost");
2290  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2291  fLayerMapIt++) {
2292  fLayerMapIt->second->Write("", TObject::kOverwrite);
2293  title.Form(
2294  "pics/TrdQaGhost_S%i_L%i_%s%s.pdf",
2295  fLayerMapIt->first / 10,
2296  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2297  fGeo.Data(),
2298  name
2299  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2300  fLayerMapIt->second->SaveAs(title);
2301  title.ReplaceAll("pdf", "png");
2302  fLayerMapIt->second->SaveAs(title);
2303  }
2304  for (fModuleGhostMapIt = fModuleGhostMap.begin();
2306  fModuleGhostMapIt++) {
2307  fModuleGhostMapIt->second->Write("", TObject::kOverwrite);
2308  }
2309  gDirectory->Cd("..");
2310  printf("fModuleLostMap: %i\n", (Int_t) fModuleLostMap.size());
2311  for (fModuleLostMapIt = fModuleLostMap.begin();
2313  fModuleLostMapIt++) {
2314  Double_t value = fModuleLostMapIt->second->GetMean(1);
2315  Double_t valueE = fModuleLostMapIt->second->GetRMS(1);
2316  CbmTrdParModDigi* fModuleInfo =
2318  CbmTrdParModGeo* fModuleGeo =
2320  Int_t Station = CbmTrdAddress::GetLayerId(fModuleLostMapIt->first) / 4
2321  + 1; //fGeoHandler->GetStation(moduleId);
2322  Int_t Layer = CbmTrdAddress::GetLayerId(fModuleLostMapIt->first) % 4
2323  + 1; //fGeoHandler->GetLayer(moduleId);
2324  Int_t combiId = 10 * Station + Layer;
2325  fLayerMap[combiId]->cd();
2326  if (fModuleLostMapIt == fModuleLostMap.begin()) {
2327  //fLayerDummy->SetZTitle("left over points / all points [%]");
2328  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2329  //fLayerDummy->DrawCopy("colz");
2330  }
2331  fLayerMap[combiId]->cd()->Update();
2332  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2333  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2334  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2335  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2336  text->SetFillStyle(1001);
2337  text->SetLineColor(1);
2338  Int_t j = 0;
2339  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2340  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2341  j++;
2342  }
2343  text->SetFillColor(fColors[j]);
2344  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2345 
2346  if (fColors[j] < 65) text->SetTextColor(kWhite);
2347  title.Form("%.1f#pm%.1f", value, valueE);
2348  text->AddText(title);
2349  text->Draw("same");
2350  }
2351  }
2352 
2353  {
2354  gDirectory->pwd();
2355  if (!gDirectory->Cd("Lost")) gDirectory->mkdir("Lost");
2356  gDirectory->Cd("Lost");
2357 
2358  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2359  fLayerMapIt++) {
2360  fLayerMapIt->second->Write("", TObject::kOverwrite);
2361  title.Form(
2362  "pics/TrdQaLost_S%i_L%i_%s%s.pdf",
2363  fLayerMapIt->first / 10,
2364  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2365  fGeo.Data(),
2366  name
2367  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2368  fLayerMapIt->second->SaveAs(title);
2369  title.ReplaceAll("pdf", "png");
2370  fLayerMapIt->second->SaveAs(title);
2371  }
2372  for (fModuleLostMapIt = fModuleLostMap.begin();
2374  fModuleLostMapIt++) {
2375  fModuleLostMapIt->second->Write("", TObject::kOverwrite);
2376  }
2377  gDirectory->Cd("..");
2378 
2379  std::vector<Int_t> fColors;
2380  std::vector<Double_t> fZLevel;
2381  Double_t fmax(100), fmin(0);
2382  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2383  fColors.push_back(TColor::GetColorPalette(i));
2384  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2385  fZLevel.push_back(
2386  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2387  }
2388  printf("fModuleEfficiencyMap: %i\n", (Int_t) fModuleEfficiencyMap.size());
2392  Double_t value = fModuleEfficiencyMapIt->second->GetMean(1);
2393  Double_t valueE = fModuleEfficiencyMapIt->second->GetRMS(1);
2394  CbmTrdParModDigi* fModuleInfo =
2396  fModuleEfficiencyMapIt->first);
2397  CbmTrdParModGeo* fModuleGeo =
2399  Int_t Station =
2401  + 1; //fGeoHandler->GetStation(moduleId);
2402  Int_t Layer = CbmTrdAddress::GetLayerId(fModuleEfficiencyMapIt->first) % 4
2403  + 1; //fGeoHandler->GetLayer(moduleId);
2404  Int_t combiId = 10 * Station + Layer;
2405  fLayerMap[combiId]->cd();
2407  //fLayerDummy->SetZTitle("found point hit pairs / all points [%]");
2408  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2409  //fLayerDummy->DrawCopy("colz");
2410  }
2411  fLayerMap[combiId]->cd()->Update();
2412  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2413  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2414  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2415  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2416  text->SetFillStyle(1001);
2417  text->SetLineColor(1);
2418  Int_t j = 0;
2419  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2420  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], value, fZLevel[j]);
2421  j++;
2422  }
2423  //printf (" %2i<%2i %2i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j]-50, value, fZLevel[j]);
2424  text->SetFillColor(fColors[j]);
2425  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2426 
2427  if (fColors[j] < 65) text->SetTextColor(kWhite);
2428 
2429  title.Form("%.1f#pm%.1f", value, valueE);
2430  text->AddText(title);
2431  text->Draw("same");
2432  }
2433  }
2434 
2435  gDirectory->pwd();
2436  if (!gDirectory->Cd("Efficiency")) gDirectory->mkdir("Efficiency");
2437  gDirectory->Cd("Efficiency");
2438 
2439  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2440  fLayerMapIt++) {
2441  fLayerMapIt->second->Write("", TObject::kOverwrite);
2442  title.Form(
2443  "pics/TrdQaEfficiency_S%i_L%i_%s%s.pdf",
2444  fLayerMapIt->first / 10,
2445  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2446  fGeo.Data(),
2447  name
2448  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2449  fLayerMapIt->second->SaveAs(title);
2450  title.ReplaceAll("pdf", "png");
2451  fLayerMapIt->second->SaveAs(title);
2452  }
2456  fModuleEfficiencyMapIt->second->Write("", TObject::kOverwrite);
2457  }
2458  gDirectory->Cd("..");
2459 
2460 
2461  {
2462  std::vector<Int_t> fColors;
2463  std::vector<Double_t> fZLevel;
2464  Double_t fmax(20), fmin(0);
2465  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2466  fColors.push_back(TColor::GetColorPalette(i));
2467  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2468  fZLevel.push_back(
2469  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2470  }
2471 
2472  printf("fModuleMultiPointMap: %i\n", (Int_t) fModuleMultiPointMap.size());
2476  Double_t value = fModuleMultiPointMapIt->second->GetMean(1);
2477  Double_t valueE = fModuleMultiPointMapIt->second->GetRMS(1);
2478  CbmTrdParModDigi* fModuleInfo =
2480  fModuleMultiPointMapIt->first);
2481  CbmTrdParModGeo* fModuleGeo =
2483  Int_t Station =
2485  + 1; //fGeoHandler->GetStation(moduleId);
2486  Int_t Layer = CbmTrdAddress::GetLayerId(fModuleMultiPointMapIt->first) % 4
2487  + 1; //fGeoHandler->GetLayer(moduleId);
2488  Int_t combiId = 10 * Station + Layer;
2489  fLayerMap[combiId]->cd();
2491  //fLayerDummy->SetZTitle("multi points per channel / all points [%]");
2492  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2493  //fLayerDummy->DrawCopy("colz");
2494  }
2495  fLayerMap[combiId]->cd()->Update();
2496  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2497  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2498  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2499  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2500  text->SetFillStyle(1001);
2501  text->SetLineColor(1);
2502  Int_t j = 0;
2503  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2504  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2505  j++;
2506  }
2507  text->SetFillColor(fColors[j]);
2508  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2509 
2510  if (fColors[j] < 65) text->SetTextColor(kWhite);
2511 
2512  title.Form("%.1f#pm%.1f", value, valueE);
2513  text->AddText(title);
2514  text->Draw("same");
2515  }
2516  }
2517 
2518  gDirectory->pwd();
2519  if (!gDirectory->Cd("MultiPoint")) gDirectory->mkdir("MultiPoint");
2520  gDirectory->Cd("MultiPoint");
2521 
2522  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2523  fLayerMapIt++) {
2524  fLayerMapIt->second->Write("", TObject::kOverwrite);
2525  title.Form(
2526  "pics/TrdQaMultiPoint_S%i_L%i_%s%s.pdf",
2527  fLayerMapIt->first / 10,
2528  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2529  fGeo.Data(),
2530  name
2531  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2532  fLayerMapIt->second->SaveAs(title);
2533  title.ReplaceAll("pdf", "png");
2534  fLayerMapIt->second->SaveAs(title);
2535  }
2539  fModuleMultiPointMapIt->second->Write("", TObject::kOverwrite);
2540  }
2541  gDirectory->Cd("..");
2542 
2543  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2544  {
2545  std::vector<Int_t> fColors;
2546  std::vector<Double_t> fZLevel;
2547  Double_t fmax(10), fmin(0);
2548  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2549  fColors.push_back(TColor::GetColorPalette(i));
2550  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2551  fZLevel.push_back(
2552  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2553  }
2554 
2555  printf("fModuledEdxMap: %i\n", (Int_t) fModuledEdxMap.size());
2556  for (fModuledEdxMapIt = fModuledEdxMap.begin();
2558  fModuledEdxMapIt++) {
2559  Double_t value = fModuledEdxMapIt->second->GetMean(1);
2560  Double_t valueE = fModuledEdxMapIt->second->GetRMS(1);
2561  CbmTrdParModDigi* fModuleInfo =
2563  CbmTrdParModGeo* fModuleGeo =
2565  Int_t Station = CbmTrdAddress::GetLayerId(fModuledEdxMapIt->first) / 4
2566  + 1; //fGeoHandler->GetStation(moduleId);
2567  Int_t Layer = CbmTrdAddress::GetLayerId(fModuledEdxMapIt->first) % 4
2568  + 1; //fGeoHandler->GetLayer(moduleId);
2569  Int_t combiId = 10 * Station + Layer;
2570  fLayerMap[combiId]->cd();
2571  if (fModuledEdxMapIt == fModuledEdxMap.begin()) {
2572  //fLayerDummy->SetZTitle("dE/dx [keV]");
2573  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2574  //fLayerDummy->DrawCopy("colz");
2575  }
2576  fLayerMap[combiId]->cd()->Update();
2577  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2578  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2579  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2580  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2581  text->SetFillStyle(1001);
2582  text->SetLineColor(1);
2583  Int_t j = 0;
2584  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2585  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2586  j++;
2587  }
2588  text->SetFillColor(fColors[j]);
2589  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2590 
2591  if (fColors[j] < 65) text->SetTextColor(kWhite);
2592 
2593  title.Form("%.1f#pm%.1f", value, valueE);
2594  text->AddText(title);
2595  text->Draw("same");
2596  }
2597  }
2598 
2599  gDirectory->pwd();
2600  if (!gDirectory->Cd("dEdx")) gDirectory->mkdir("dEdx");
2601  gDirectory->Cd("dEdx");
2602 
2603  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2604  fLayerMapIt++) {
2605  fLayerMapIt->second->Write("", TObject::kOverwrite);
2606  title.Form(
2607  "pics/TrdQadEdx_S%i_L%i_%s%s.pdf",
2608  fLayerMapIt->first / 10,
2609  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2610  fGeo.Data(),
2611  name
2612  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2613  fLayerMapIt->second->SaveAs(title);
2614  title.ReplaceAll("pdf", "png");
2615  fLayerMapIt->second->SaveAs(title);
2616  }
2617  for (fModuledEdxMapIt = fModuledEdxMap.begin();
2619  fModuledEdxMapIt++) {
2620  fModuledEdxMapIt->second->Write("", TObject::kOverwrite);
2621  }
2622  gDirectory->Cd("..");
2623 
2624  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2625  {
2626  std::vector<Int_t> fColors;
2627  std::vector<Double_t> fZLevel;
2628  Double_t fmax(2), fmin(0);
2629  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2630  fColors.push_back(TColor::GetColorPalette(i));
2631  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2632  fZLevel.push_back(
2633  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2634  }
2635 
2636  printf("fModuleTracklengthMap: %i\n", (Int_t) fModuleTracklengthMap.size());
2640  Double_t value = fModuleTracklengthMapIt->second->GetMean(1);
2641  Double_t valueE = fModuleTracklengthMapIt->second->GetRMS(1);
2642  CbmTrdParModDigi* fModuleInfo =
2644  fModuleTracklengthMapIt->first);
2646  fModuleTracklengthMapIt->first);
2647  Int_t Station =
2649  + 1; //fGeoHandler->GetStation(moduleId);
2650  Int_t Layer =
2652  + 1; //fGeoHandler->GetLayer(moduleId);
2653  Int_t combiId = 10 * Station + Layer;
2654  fLayerMap[combiId]->cd();
2656  //fLayerDummy->SetZTitle("track length [cm]");
2657  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2658  //fLayerDummy->DrawCopy("colz");
2659  }
2660  fLayerMap[combiId]->cd()->Update();
2661  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2662  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2663  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2664  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2665  text->SetFillStyle(1001);
2666  text->SetLineColor(1);
2667  Int_t j = 0;
2668  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2669  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2670  j++;
2671  }
2672  text->SetFillColor(fColors[j]);
2673  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2674 
2675  if (fColors[j] < 65) text->SetTextColor(kWhite);
2676 
2677  title.Form("%.1f#pm%.1f", value, valueE);
2678  text->AddText(title);
2679  text->Draw("same");
2680  }
2681  }
2682 
2683  gDirectory->pwd();
2684  if (!gDirectory->Cd("Tracklength")) gDirectory->mkdir("Tracklength");
2685  gDirectory->Cd("Tracklength");
2686 
2687  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2688  fLayerMapIt++) {
2689  fLayerMapIt->second->Write("", TObject::kOverwrite);
2690  title.Form(
2691  "pics/TrdQaTracklength_S%i_L%i_%s%s.pdf",
2692  fLayerMapIt->first / 10,
2693  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2694  fGeo.Data(),
2695  name
2696  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2697  fLayerMapIt->second->SaveAs(title);
2698  title.ReplaceAll("pdf", "png");
2699  fLayerMapIt->second->SaveAs(title);
2700  }
2704  fModuleTracklengthMapIt->second->Write("", TObject::kOverwrite);
2705  }
2706  gDirectory->Cd("..");
2707 
2708  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2709  {
2710  std::vector<Int_t> fColors;
2711  std::vector<Double_t> fZLevel;
2712  Double_t fmax(1), fmin(0);
2713  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2714  fColors.push_back(TColor::GetColorPalette(i));
2715  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2716  fZLevel.push_back(
2717  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2718  }
2719 
2720  printf("fModuleDeltaEMap: %i\n", (Int_t) fModuleDeltaEMap.size());
2721  for (fModuleDeltaEMapIt = fModuleDeltaEMap.begin();
2723  fModuleDeltaEMapIt++) {
2724  Double_t value = fModuleDeltaEMapIt->second->GetMean(1);
2725  Double_t valueE = fModuleDeltaEMapIt->second->GetRMS(1);
2726  CbmTrdParModDigi* fModuleInfo =
2728  CbmTrdParModGeo* fModuleGeo =
2730  Int_t Station = CbmTrdAddress::GetLayerId(fModuleDeltaEMapIt->first) / 4
2731  + 1; //fGeoHandler->GetStation(moduleId);
2732  Int_t Layer = CbmTrdAddress::GetLayerId(fModuleDeltaEMapIt->first) % 4
2733  + 1; //fGeoHandler->GetLayer(moduleId);
2734  Int_t combiId = 10 * Station + Layer;
2735  fLayerMap[combiId]->cd();
2736  if (fModuleDeltaEMapIt == fModuleDeltaEMap.begin()) {
2737  //fLayerDummy->SetZTitle("#delta-electrons / all points [%]");
2738  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2739  //fLayerDummy->DrawCopy("colz");
2740  }
2741  fLayerMap[combiId]->cd()->Update();
2742  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2743  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2744  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2745  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2746  text->SetFillStyle(1001);
2747  text->SetLineColor(1);
2748  Int_t j = 0;
2749  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2750  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2751  j++;
2752  }
2753  text->SetFillColor(fColors[j]);
2754  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2755 
2756  if (fColors[j] < 65) text->SetTextColor(kWhite);
2757 
2758  title.Form("%.1f#pm%.1f", value, valueE);
2759  text->AddText(title);
2760  text->Draw("same");
2761  }
2762  }
2763 
2764  gDirectory->pwd();
2765  if (!gDirectory->Cd("DeltaE")) gDirectory->mkdir("DeltaE");
2766  gDirectory->Cd("DeltaE");
2767 
2768  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2769  fLayerMapIt++) {
2770  fLayerMapIt->second->Write("", TObject::kOverwrite);
2771  title.Form(
2772  "pics/TrdQaDeltaE_S%i_L%i_%s%s.pdf",
2773  fLayerMapIt->first / 10,
2774  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2775  fGeo.Data(),
2776  name
2777  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2778  fLayerMapIt->second->SaveAs(title);
2779  title.ReplaceAll("pdf", "png");
2780  fLayerMapIt->second->SaveAs(title);
2781  }
2782  for (fModuleDeltaEMapIt = fModuleDeltaEMap.begin();
2784  fModuleDeltaEMapIt++) {
2785  fModuleDeltaEMapIt->second->Write("", TObject::kOverwrite);
2786  }
2787  gDirectory->Cd("..");
2788 
2789  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2790  {
2791  std::vector<Int_t> fColors;
2792  std::vector<Double_t> fZLevel;
2793  Double_t fmax(15), fmin(0);
2794  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2795  fColors.push_back(TColor::GetColorPalette(i));
2796  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2797  fZLevel.push_back(
2798  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2799  }
2800 
2801  printf("fModuleClusterSizeMap: %i\n", (Int_t) fModuleClusterSizeMap.size());
2805  Double_t value = fModuleClusterSizeMapIt->second->GetMean(1);
2806  Double_t valueE = fModuleClusterSizeMapIt->second->GetRMS(1);
2807  CbmTrdParModDigi* fModuleInfo =
2809  fModuleClusterSizeMapIt->first);
2811  fModuleClusterSizeMapIt->first);
2812  Int_t Station =
2814  + 1; //fGeoHandler->GetStation(moduleId);
2815  Int_t Layer =
2817  + 1; //fGeoHandler->GetLayer(moduleId);
2818  Int_t combiId = 10 * Station + Layer;
2819  fLayerMap[combiId]->cd();
2821  //fLayerDummy->SetZTitle("#delta-electrons / all points [%]");
2822  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2823  //fLayerDummy->DrawCopy("colz");
2824  }
2825  fLayerMap[combiId]->cd()->Update();
2826  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2827  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2828  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2829  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2830  text->SetFillStyle(1001);
2831  text->SetLineColor(1);
2832  Int_t j = 0;
2833  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2834  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2835  j++;
2836  }
2837  text->SetFillColor(fColors[j]);
2838  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2839 
2840  if (fColors[j] < 65) text->SetTextColor(kWhite);
2841 
2842  title.Form("%.1f#pm%.1f", value, valueE);
2843  text->AddText(title);
2844  text->Draw("same");
2845  //printf("ModuleAddress:%8i cluster size: %5.2f+-%5.2f\n",fModuleClusterSizeMapIt->first,value,valueE);
2846  }
2847  }
2848 
2849  gDirectory->pwd();
2850  if (!gDirectory->Cd("ClusterSize")) gDirectory->mkdir("ClusterSize");
2851  gDirectory->Cd("ClusterSize");
2852 
2853  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2854  fLayerMapIt++) {
2855  fLayerMapIt->second->Write("", TObject::kOverwrite);
2856  title.Form(
2857  "pics/TrdQaClusterSize_S%i_L%i_%s%s.pdf",
2858  fLayerMapIt->first / 10,
2859  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2860  fGeo.Data(),
2861  name
2862  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2863  fLayerMapIt->second->SaveAs(title);
2864  title.ReplaceAll("pdf", "png");
2865  fLayerMapIt->second->SaveAs(title);
2866  }
2870  fModuleClusterSizeMapIt->second->Write("", TObject::kOverwrite);
2871  }
2872  gDirectory->Cd("..");
2873 
2874  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2875  {
2876  std::vector<Int_t> fColors;
2877  std::vector<Double_t> fZLevel;
2878  Double_t fmax(100), fmin(0);
2879  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2880  fColors.push_back(TColor::GetColorPalette(i));
2881  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2882  fZLevel.push_back(
2883  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2884  }
2885 
2886  printf("fModuleTrackableMap: %i\n", (Int_t) fModuleTrackableMap.size());
2890  Double_t value = fModuleTrackableMapIt->second->GetMean(1);
2891  Double_t valueE = fModuleTrackableMapIt->second->GetRMS(1);
2892  CbmTrdParModDigi* fModuleInfo =
2894  fModuleTrackableMapIt->first);
2895  CbmTrdParModGeo* fModuleGeo =
2897  Int_t Station =
2899  + 1; //fGeoHandler->GetStation(moduleId);
2900  Int_t Layer = CbmTrdAddress::GetLayerId(fModuleTrackableMapIt->first) % 4
2901  + 1; //fGeoHandler->GetLayer(moduleId);
2902  Int_t combiId = 10 * Station + Layer;
2903  fLayerMap[combiId]->cd();
2904  if (fModuleTrackableMapIt == fModuleTrackableMap.begin()) {
2905  //fLayerDummy->SetZTitle("#delta-electrons / all points [%]");
2906  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2907  //fLayerDummy->DrawCopy("colz");
2908  }
2909  fLayerMap[combiId]->cd()->Update();
2910  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2911  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2912  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2913  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2914  text->SetFillStyle(1001);
2915  text->SetLineColor(1);
2916  Int_t j = 0;
2917  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2918  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
2919  j++;
2920  }
2921  text->SetFillColor(fColors[j]);
2922  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2923 
2924  if (fColors[j] < 65) text->SetTextColor(kWhite);
2925 
2926  title.Form("%.1f#pm%.1f", value, valueE);
2927  text->AddText(title);
2928  text->Draw("same");
2929  }
2930  }
2931 
2932  gDirectory->pwd();
2933  if (!gDirectory->Cd("TrackableRatio")) gDirectory->mkdir("TrackableRatio");
2934  gDirectory->Cd("TrackableRatio");
2935 
2936  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
2937  fLayerMapIt++) {
2938  fLayerMapIt->second->Write("", TObject::kOverwrite);
2939  title.Form(
2940  "pics/TrdQaTrackableRatio_S%i_L%i_%s%s.pdf",
2941  fLayerMapIt->first / 10,
2942  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
2943  fGeo.Data(),
2944  name
2945  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
2946  fLayerMapIt->second->SaveAs(title);
2947  title.ReplaceAll("pdf", "png");
2948  fLayerMapIt->second->SaveAs(title);
2949  }
2953  fModuleTrackableMapIt->second->Write("", TObject::kOverwrite);
2954  }
2955  gDirectory->Cd("..");
2956 
2957  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2958  {
2959  std::vector<Int_t> fColors;
2960  std::vector<Double_t> fZLevel;
2961  Double_t fmax(50), fmin(0);
2962  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2963  fColors.push_back(TColor::GetColorPalette(i));
2964  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
2965  fZLevel.push_back(
2966  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
2967  }
2968 
2969  printf("fModuleTrackableMap2: %i\n", (Int_t) fModuleTrackableMap2.size());
2973  Double_t value = fModuleTrackableMap2It->second->GetMean(1);
2974  Double_t valueE = fModuleTrackableMap2It->second->GetRMS(1);
2975  CbmTrdParModDigi* fModuleInfo =
2977  fModuleTrackableMap2It->first);
2978  CbmTrdParModGeo* fModuleGeo =
2980  Int_t Station =
2982  + 1; //fGeoHandler->GetStation(moduleId);
2983  Int_t Layer = CbmTrdAddress::GetLayerId(fModuleTrackableMap2It->first) % 4
2984  + 1; //fGeoHandler->GetLayer(moduleId);
2985  Int_t combiId = 10 * Station + Layer;
2986  fLayerMap[combiId]->cd();
2988  //fLayerDummy->SetZTitle("#delta-electrons / all points [%]");
2989  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2990  //fLayerDummy->DrawCopy("colz");
2991  }
2992  fLayerMap[combiId]->cd()->Update();
2993  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
2994  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
2995  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
2996  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
2997  text->SetFillStyle(1001);
2998  text->SetLineColor(1);
2999  Int_t j = 0;
3000  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
3001  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
3002  j++;
3003  }
3004  text->SetFillColor(fColors[j]);
3005  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
3006 
3007  if (fColors[j] < 65) text->SetTextColor(kWhite);
3008 
3009  title.Form("%.1f#pm%.1f", value, valueE);
3010  text->AddText(title);
3011  text->Draw("same");
3012  }
3013  }
3014 
3015  gDirectory->pwd();
3016  if (!gDirectory->Cd("Trackable")) gDirectory->mkdir("Trackable");
3017  gDirectory->Cd("Trackable");
3018 
3019  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
3020  fLayerMapIt++) {
3021  fLayerMapIt->second->Write("", TObject::kOverwrite);
3022  title.Form(
3023  "pics/TrdQaTrackable_S%i_L%i_%s%s.pdf",
3024  fLayerMapIt->first / 10,
3025  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
3026  fGeo.Data(),
3027  name
3028  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
3029  fLayerMapIt->second->SaveAs(title);
3030  title.ReplaceAll("pdf", "png");
3031  fLayerMapIt->second->SaveAs(title);
3032  }
3036  fModuleTrackableMap2It->second->Write("", TObject::kOverwrite);
3037  }
3038  gDirectory->Cd("..");
3039  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3040  {
3041  std::vector<Int_t> fColors;
3042  std::vector<Double_t> fZLevel;
3043  Double_t fmax(100), fmin(0);
3044  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
3045  fColors.push_back(TColor::GetColorPalette(i));
3046  //fZLevel.push_back(min + TMath::Power(10, TMath::Log10(max) / TColor::GetNumberOfColors() * i));// log scale
3047  fZLevel.push_back(
3048  fmin + (fmax / TColor::GetNumberOfColors() * i)); // lin scale
3049  }
3050 
3051  printf("fModuleAveragePointsMap: %i\n",
3052  (Int_t) fModuleAveragePointsMap.size());
3056  Double_t value = fModuleAveragePointsMapIt->second->GetMean(1);
3057  Double_t valueE = fModuleAveragePointsMapIt->second->GetRMS(1);
3058  CbmTrdParModDigi* fModuleInfo =
3060  fModuleAveragePointsMapIt->first);
3062  fModuleAveragePointsMapIt->first);
3063  Int_t Station =
3065  + 1; //fGeoHandler->GetStation(moduleId);
3066  Int_t Layer =
3068  + 1; //fGeoHandler->GetLayer(moduleId);
3069  Int_t combiId = 10 * Station + Layer;
3070  fLayerMap[combiId]->cd();
3072  //fLayerDummy->SetZTitle("#delta-electrons / all points [%]");
3073  fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
3074  //fLayerDummy->DrawCopy("colz");
3075  }
3076  fLayerMap[combiId]->cd()->Update();
3077  text = new TPaveText(fModuleGeo->GetX() - fModuleInfo->GetSizeX(),
3078  fModuleGeo->GetY() - fModuleInfo->GetSizeY(),
3079  fModuleGeo->GetX() + fModuleInfo->GetSizeX(),
3080  fModuleGeo->GetY() + fModuleInfo->GetSizeY());
3081  text->SetFillStyle(1001);
3082  text->SetLineColor(1);
3083  Int_t j = 0;
3084  while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
3085  //printf (" %i<%i %i %E <= %E\n",j,(Int_t)fZLevel.size(),fColors[j], rate, fZLevel[j]);
3086  j++;
3087  }
3088  text->SetFillColor(fColors[j]);
3089  if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
3090 
3091  if (fColors[j] < 65) text->SetTextColor(kWhite);
3092 
3093  title.Form("%.1f#pm%.1f", value, valueE);
3094  text->AddText(title);
3095  text->Draw("same");
3096  }
3097  }
3098 
3099  gDirectory->pwd();
3100  if (!gDirectory->Cd("Trackable")) gDirectory->mkdir("Trackable");
3101  gDirectory->Cd("Trackable");
3102 
3103  for (fLayerMapIt = fLayerMap.begin(); fLayerMapIt != fLayerMap.end();
3104  fLayerMapIt++) {
3105  fLayerMapIt->second->Write("", TObject::kOverwrite);
3106  title.Form(
3107  "pics/TrdQaAveragePoints_S%i_L%i_%s%s.pdf",
3108  fLayerMapIt->first / 10,
3109  fLayerMapIt->first - (fLayerMapIt->first / 10) * 10,
3110  fGeo.Data(),
3111  name
3112  .Data()); //(fLayerMapIt->first)/10,(fLayerMapIt->first)-(fLayerMapIt->first)/10*10,fGeo.Data());
3113  fLayerMapIt->second->SaveAs(title);
3114  title.ReplaceAll("pdf", "png");
3115  fLayerMapIt->second->SaveAs(title);
3116  }
3120  fModuleAveragePointsMapIt->second->Write("", TObject::kOverwrite);
3121  }
3122  gDirectory->Cd("..");
3123  gDirectory->Cd("..");
3124 
3125  tempFile->Close();
3126  gDirectory->Cd(origpath);
3127  gDirectory->pwd();
3128 }
3129 Double_t CbmTrdQa::CalcAngle(const CbmTrdPoint* pointA,
3130  const CbmTrdPoint* pointB) {
3131  return TMath::ACos(
3132  ((pointA->GetXOut() - pointA->GetXIn())
3133  * (pointB->GetXOut() - pointB->GetXIn())
3134  + (pointA->GetYOut() - pointA->GetYIn())
3135  * (pointB->GetYOut() - pointB->GetYIn())
3136  + (pointA->GetZOut() - pointA->GetZIn())
3137  * (pointB->GetZOut() - pointB->GetZIn()))
3138  / (TMath::Sqrt((pointA->GetXOut() - pointA->GetXIn())
3139  * (pointA->GetXOut() - pointA->GetXIn())
3140  + (pointA->GetYOut() - pointA->GetYIn())
3141  * (pointA->GetYOut() - pointA->GetYIn())
3142  + (pointA->GetZOut() - pointA->GetZIn())
3143  * (pointA->GetZOut() - pointA->GetZIn()))
3144  * TMath::Sqrt((pointB->GetXOut() - pointB->GetXIn())
3145  * (pointB->GetXOut() - pointB->GetXIn())
3146  + (pointB->GetYOut() - pointB->GetYIn())
3147  * (pointB->GetYOut() - pointB->GetYIn())
3148  + (pointB->GetZOut() - pointB->GetZIn())
3149  * (pointB->GetZOut() - pointB->GetZIn()))
3150 
3151  ));
3152 }
3154  Double_t Entries = fdEdxPoint->GetEntries();
3155  fdEdxPoint->Scale(1. / Entries);
3156  Entries = fdEdxDigi->GetEntries();
3157  fdEdxDigi->Scale(1. / Entries);
3158  Entries = fdEdxCluster->GetEntries();
3159  fdEdxCluster->Scale(1. / Entries);
3160  Entries = fdEdxHit->GetEntries();
3161  fdEdxHit->Scale(1. / Entries);
3162  Entries = fdEdxPionMc->GetEntries();
3163  fdEdxPionMc->Scale(1. / Entries);
3164  Entries = fdEdxPionHit->GetEntries();
3165  fdEdxPionHit->Scale(1. / Entries);
3166  Entries = fdEdxElectronMc->GetEntries();
3167  fdEdxElectronMc->Scale(1. / Entries);
3168  Entries = fdEdxElectronHit->GetEntries();
3169  fdEdxElectronHit->Scale(1. / Entries);
3170 }
3172  NormalizeHistos();
3173  SaveHistos();
3174  CreateLayerView();
3175 }
3177  //FairRootManager::Instance()->Register("TrdDigi","Trd Digi", fDigiCollection, IsOutputBranchPersistent("TrdDigi"));
3178  //FairRootManager::Instance()->Register("TrdDigiMatch","Trd Digi Match", fDigiMatchCollection, IsOutputBranchPersistent("TrdDigiMatch"));
3179 }
CbmTrdParModDigi::GetSectorSizeY
Double_t GetSectorSizeY(Int_t i) const
Definition: CbmTrdParModDigi.h:41
CbmTrdParModDigi::GetPadSizeY
Double_t GetPadSizeY(Int_t i) const
Definition: CbmTrdParModDigi.h:37
CbmTrdQa::SetParContainers
virtual void SetParContainers()
Definition: CbmTrdQa.cxx:330
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmTrdAddress::GetModuleAddress
static UInt_t GetModuleAddress(UInt_t address)
Return unique module ID from address.
Definition: CbmTrdAddress.h:117
CbmTrdPoint::GetYOut
Double_t GetYOut() const
Definition: CbmTrdPoint.h:67
CbmTrdQa::fModuleDigiMap
std::map< Int_t, std::vector< Int_t > > fModuleDigiMap
Definition: CbmTrdQa.h:86
CbmTrdQa::SaveHistos
void SaveHistos()
Definition: CbmTrdQa.cxx:1731
CbmTrdDigi::GetAddress
Int_t GetAddress() const
Address getter for module in the format defined by CbmTrdDigi (format of CbmTrdAddress can be accesse...
Definition: CbmTrdDigi.h:92
CbmTrdQa::fModuledEdxMapIt
std::map< Int_t, TH1I * >::iterator fModuledEdxMapIt
Definition: CbmTrdQa.h:103
CbmTrdUtils::PdgToGeant
static Int_t PdgToGeant(Int_t PdgCode)
Definition: CbmTrdUtils.cxx:236
CbmTrdPoint::GetZIn
Double_t GetZIn() const
Definition: CbmTrdPoint.h:65
CbmTrdQa::fMuchTrdPoints
TH2F * fMuchTrdPoints[11]
Definition: CbmTrdQa.h:134
CbmTrdAddress::GetAddress
static UInt_t GetAddress(Int_t layerId, Int_t moduleId, Int_t sectorId, Int_t rowId, Int_t columnId)
Return address from system ID, layer, module, sector, column and row IDs.
Definition: CbmTrdAddress.h:38
CbmTrdUtils.h
CbmTrdQa::fGeoHandler
CbmTrdGeoHandler * fGeoHandler
Definition: CbmTrdQa.h:76
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmTrdQa::fLayerDummy
TH2I * fLayerDummy
Definition: CbmTrdQa.h:130
CbmTrdQa::fTrdPointsPerMcTrack_PT
TH2F * fTrdPointsPerMcTrack_PT
Definition: CbmTrdQa.h:140
CbmTrdQa::fC
Bool_t fC
Definition: CbmTrdQa.h:125
CbmTrdQa::fHits
TClonesArray * fHits
Definition: CbmTrdQa.h:73
CbmTrdQa.h
CbmTrdQa::fLostPointVsAlpha
TProfile * fLostPointVsAlpha
Definition: CbmTrdQa.h:190
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmTrdQa::fdEdxElectronGhost
TH1F * fdEdxElectronGhost
Definition: CbmTrdQa.h:175
CbmTrdParModDigi::GetNofRowsInSector
Int_t GetNofRowsInSector(Int_t i) const
Definition: CbmTrdParModDigi.cxx:366
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmTrdParSetGeo.h
CbmTrdQa::fModuleDigiMapIt
std::map< Int_t, std::vector< Int_t > >::iterator fModuleDigiMapIt
Definition: CbmTrdQa.h:87
CbmTrdQa::fGeo
TString fGeo
Definition: CbmTrdQa.h:118
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
CbmTrdHit::GetELoss
Double_t GetELoss() const
Definition: CbmTrdHit.h:79
CbmTrdQa::fPositionResolutionShort
TH1I * fPositionResolutionShort
Definition: CbmTrdQa.h:162
CbmTrdParModDigi::GetNofColumnsInSector
Int_t GetNofColumnsInSector(Int_t i) const
Definition: CbmTrdParModDigi.cxx:359
CbmTrdQa::fMultiHitSamePadPerMcTrack_PID
TH2I * fMultiHitSamePadPerMcTrack_PID
Definition: CbmTrdQa.h:148
CbmTrdQa::fGhostHitVsR
TProfile * fGhostHitVsR
Definition: CbmTrdQa.h:185
CbmTrdQa::fModuleMultiPointMap
std::map< Int_t, TH1I * > fModuleMultiPointMap
Definition: CbmTrdQa.h:106
CbmTrdQa::CalcAngle
Double_t CalcAngle(const CbmTrdPoint *pointA, const CbmTrdPoint *pointB)
Definition: CbmTrdQa.cxx:3129
CbmTrdQa::fMultiHitsVsR
TProfile * fMultiHitsVsR
Definition: CbmTrdQa.h:184
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
CbmTrdQa::fMultiHitSamePadPerMcTrack_motherzBirth
TH2I * fMultiHitSamePadPerMcTrack_motherzBirth
Definition: CbmTrdQa.h:150
CbmTrdQa::fP
Bool_t fP
Definition: CbmTrdQa.h:124
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTrdHit
data class for a reconstructed Energy-4D measurement in the TRD
Definition: CbmTrdHit.h:35
CbmTrdQa::fMultiHitAdjacentPadPerMcTrack_zBirth
TH2I * fMultiHitAdjacentPadPerMcTrack_zBirth
Definition: CbmTrdQa.h:154
CbmTrdQa::~CbmTrdQa
virtual ~CbmTrdQa()
Definition: CbmTrdQa.cxx:161
CbmTrdQa::GetTrackLength
Double_t GetTrackLength(CbmTrdPoint *point)
Definition: CbmTrdQa.cxx:884
CbmTrdQa::fMultiHitAdjacentPadPerMcTrack_motherPID
TH2I * fMultiHitAdjacentPadPerMcTrack_motherPID
Definition: CbmTrdQa.h:157
CbmTrdPoint::GetXOut
Double_t GetXOut() const
Definition: CbmTrdPoint.h:66
CbmTrdAddress::GetLayerId
static UInt_t GetLayerId(UInt_t address)
Return layer ID from address.
Definition: CbmTrdAddress.h:69
CbmTrdAddress::GetModuleId
static UInt_t GetModuleId(UInt_t address)
Return module ID from address.
Definition: CbmTrdAddress.h:78
CbmDigiManager::GetNofDigis
static Int_t GetNofDigis(ECbmModuleId systemId)
Definition: CbmDigiManager.cxx:62
CbmTrdQa::fD
Bool_t fD
Definition: CbmTrdQa.h:122
CbmTrdQa::fMCTracks
TClonesArray * fMCTracks
Definition: CbmTrdQa.h:69
CbmTrdQa::CreateLayerView
void CreateLayerView()
Definition: CbmTrdQa.cxx:2202
CbmTrdQa::fLayerHitMapIt
std::map< Int_t, TH2I * >::iterator fLayerHitMapIt
Definition: CbmTrdQa.h:82
CbmTrdQa::FinishEvent
virtual void FinishEvent()
Definition: CbmTrdQa.cxx:2006
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmTrdQa::fDistanceMcToHit
TH1I * fDistanceMcToHit
Definition: CbmTrdQa.h:159
CbmTrdQa::fTrdTofPoints
TH2F * fTrdTofPoints[11]
Definition: CbmTrdQa.h:136
CbmTrdParModDigi::GetSizeX
Double_t GetSizeX() const
Definition: CbmTrdParModDigi.h:109
CbmTrdRadiator.h
CbmTrdParModGeo.h
CbmTrdQa::fModuleClusterMapIt
std::map< Int_t, std::vector< Int_t > >::iterator fModuleClusterMapIt
Definition: CbmTrdQa.h:89
CbmTrdQa::fdEdxDigi
TH1F * fdEdxDigi
Definition: CbmTrdQa.h:166
CbmTrdQa::fDigiPerCluster
TH1I * fDigiPerCluster
Definition: CbmTrdQa.h:179
CbmTrdQa::fModuleGhostMapIt
std::map< Int_t, TH1I * >::iterator fModuleGhostMapIt
Definition: CbmTrdQa.h:111
CbmTrdQa::fModuleAveragePointsMap
std::map< Int_t, TH1I * > fModuleAveragePointsMap
Definition: CbmTrdQa.h:94
CbmTrdQa::fMultiHitsVsAlpha
TProfile * fMultiHitsVsAlpha
Definition: CbmTrdQa.h:188
CbmTrdRadiator::LatticeHit
Bool_t LatticeHit(const CbmTrdPoint *point)
Definition: CbmTrdRadiator.cxx:618
CbmTrdQa::fMultiHitAdjacentPadPerMcTrack
TH1I * fMultiHitAdjacentPadPerMcTrack
Definition: CbmTrdQa.h:152
CbmTrdParModDigi::GetPadInfo
Bool_t GetPadInfo(const Double_t *local_point, Int_t &sectorId, Int_t &columnId, Int_t &rowId) const
Definition: CbmTrdParModDigi.cxx:436
CbmTrdGeoHandler
Definition: CbmTrdGeoHandler.h:29
CbmTrdQa::fModuleTrackableMap2It
std::map< Int_t, TH1I * >::iterator fModuleTrackableMap2It
Definition: CbmTrdQa.h:97
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
CbmTrdQa::fClusters
TClonesArray * fClusters
Definition: CbmTrdQa.h:72
CbmCluster::GetNofDigis
Int_t GetNofDigis() const
Number of digis in cluster.
Definition: CbmCluster.h:69
CbmTrdQa::fdEdxElectronHit
TH1F * fdEdxElectronHit
Definition: CbmTrdQa.h:174
CbmTrdQa::Exec
virtual void Exec(Option_t *option)
Definition: CbmTrdQa.cxx:912
CbmTrdQa::fStsTofPoints
TH2F * fStsTofPoints
Definition: CbmTrdQa.h:133
CbmTrdCluster
Data Container for TRD clusters.
Definition: CbmTrdCluster.h:23
CbmTrdParModDigi::GetPadSizeX
Double_t GetPadSizeX(Int_t i) const
Definition: CbmTrdParModDigi.h:36
CbmTrdQa::fDistanceMcToHitAll
TH1I * fDistanceMcToHitAll
Definition: CbmTrdQa.h:160
CbmTrdQa::fT
Bool_t fT
Definition: CbmTrdQa.h:123
CbmMCTrack::GetStartZ
Double_t GetStartZ() const
Definition: CbmMCTrack.h:77
CbmTrdQa::fLayerMapIt
std::map< Int_t, TCanvas * >::iterator fLayerMapIt
Definition: CbmTrdQa.h:78
CbmTrdQa::fModulePointMap
std::map< Int_t, std::vector< Int_t > > fModulePointMap
Definition: CbmTrdQa.h:84
CbmTrdParModDigi::GetSectorSizeX
Double_t GetSectorSizeX(Int_t i) const
Definition: CbmTrdParModDigi.h:40
CbmTrdDigi.h
CbmTrdQa::fPositionResolutionLong
TH1I * fPositionResolutionLong
Definition: CbmTrdQa.h:163
CbmTrdQa::fGhostHitVsAlpha
TProfile * fGhostHitVsAlpha
Definition: CbmTrdQa.h:189
CbmTrdQa::fModuleGhostMap
std::map< Int_t, TH1I * > fModuleGhostMap
Definition: CbmTrdQa.h:110
CbmTrdQa::fRadiator
CbmTrdRadiator * fRadiator
Definition: CbmTrdQa.h:196
CbmTrdQa::GetPadInfos
void GetPadInfos(Int_t moduleAddress, Double_t x, Double_t y, Int_t &iCol, Int_t &iRow, Double_t &padSizeX, Double_t &padSizeY)
Definition: CbmTrdQa.cxx:2050
CbmTrdQa::fStsTrdPointsTrackable
TH2F * fStsTrdPointsTrackable
Definition: CbmTrdQa.h:138
CbmTrdQa::fModuleClusterMap
std::map< Int_t, std::vector< Int_t > > fModuleClusterMap
Definition: CbmTrdQa.h:88
CbmTrdParModGeo
Definition of geometry for one TRD module.
Definition: CbmTrdParModGeo.h:12
CbmTrdQa::fModuleLostMapIt
std::map< Int_t, TH1I * >::iterator fModuleLostMapIt
Definition: CbmTrdQa.h:113
CbmTrdParModDigi::GetNofSectors
Int_t GetNofSectors() const
Definition: CbmTrdParModDigi.h:49
CbmTrdQa::fdEdxHit
TH1F * fdEdxHit
Definition: CbmTrdQa.h:168
CbmTrdQa::fModuleDeltaEMap
std::map< Int_t, TH1I * > fModuleDeltaEMap
Definition: CbmTrdQa.h:108
CbmTrdQa::fModuleDeltaEMapIt
std::map< Int_t, TH1I * >::iterator fModuleDeltaEMapIt
Definition: CbmTrdQa.h:109
CbmTrdQa::fMultiHitAdjacentPadPerMcTrack_angle
TH1I * fMultiHitAdjacentPadPerMcTrack_angle
Definition: CbmTrdQa.h:153
CbmMCTrack::GetNPoints
Int_t GetNPoints(ECbmModuleId detId) const
Definition: CbmMCTrack.cxx:186
CbmTrdQa::fClusterSize
TH1I * fClusterSize
Definition: CbmTrdQa.h:177
CbmTrdGeoHandler.h
Helper class to extract information from the GeoManager.
CbmTrdQa::fdEdxPoint
TH1F * fdEdxPoint
Definition: CbmTrdQa.h:165
CbmDigiManager::Get
const Digi * Get(Int_t index) const
Get a digi object.
Definition: CbmDigiManager.h:52
CbmTrdQa::fModuleHitMap
std::map< Int_t, std::vector< Int_t > > fModuleHitMap
Definition: CbmTrdQa.h:90
CbmTrdQa::fMultiHitAdjacentPadPerMcTrack_motherzBirth
TH2I * fMultiHitAdjacentPadPerMcTrack_motherzBirth
Definition: CbmTrdQa.h:156
CbmTrdQa::NormalizeHistos
void NormalizeHistos()
Definition: CbmTrdQa.cxx:3153
CbmTrdQa::fLayerMap
std::map< Int_t, TCanvas * > fLayerMap
Definition: CbmTrdQa.h:77
CbmTrdParModDigi
Definition of chamber gain conversion for one TRD module.
Definition: CbmTrdParModDigi.h:14
CbmTrdGeoHandler::Init
void Init(Bool_t isSimulation=kFALSE)
Definition: CbmTrdGeoHandler.cxx:45
CbmTrdQa::fModuledEdxMap
std::map< Int_t, TH1I * > fModuledEdxMap
Definition: CbmTrdQa.h:102
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
CbmTrdQa::fHitToPointEfficiencyVsR
TProfile * fHitToPointEfficiencyVsR
Definition: CbmTrdQa.h:187
CbmTrdQa::fTrdTrackCrossedRadiator
TH2F * fTrdTrackCrossedRadiator
Definition: CbmTrdQa.h:143
CbmTrdQa::CreateTriangularPad
TPolyLine * CreateTriangularPad(Int_t column, Int_t row, Double_t content)
Definition: CbmTrdQa.cxx:898
CbmTrdParModDigi.h
CbmTrdQa
Definition: CbmTrdQa.h:24
CbmTrdQa::fGeoPar
CbmTrdParSetGeo * fGeoPar
Definition: CbmTrdQa.h:75
CbmTrdQa::fModuleHitMapIt
std::map< Int_t, std::vector< Int_t > >::iterator fModuleHitMapIt
Definition: CbmTrdQa.h:91
CbmTrdParSet::GetModulePar
virtual const CbmTrdParMod * GetModulePar(Int_t detId) const
Definition: CbmTrdParSet.cxx:45
CbmTrdQa::fModuleEfficiencyMapIt
std::map< Int_t, TH1I * >::iterator fModuleEfficiencyMapIt
Definition: CbmTrdQa.h:115
CbmTrdQa::fModuleTrackableMap2
std::map< Int_t, TH1I * > fModuleTrackableMap2
Definition: CbmTrdQa.h:96
CbmTrdQa::fModuleAveragePointsMapIt
std::map< Int_t, TH1I * >::iterator fModuleAveragePointsMapIt
Definition: CbmTrdQa.h:95
CbmTrdHit.h
Class for hits in TRD detector.
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmTrdQa::fTrdPointsPerMcTrack_PID
TH2F * fTrdPointsPerMcTrack_PID
Definition: CbmTrdQa.h:139
CbmTrdQa::fLayerPointMap
std::map< Int_t, TH2I * > fLayerPointMap
Definition: CbmTrdQa.h:79
CbmTrdQa::fModuleLostMap
std::map< Int_t, TH1I * > fModuleLostMap
Definition: CbmTrdQa.h:112
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmTrdPoint::GetZOut
Double_t GetZOut() const
Definition: CbmTrdPoint.h:68
CbmTrdQa::fMultiHitSamePadPerMcTrack_angle
TH1I * fMultiHitSamePadPerMcTrack_angle
Definition: CbmTrdQa.h:146
CbmTrdParSetGeo
Definition: CbmTrdParSetGeo.h:9
CbmTrdQa::fPoints
TClonesArray * fPoints
Definition: CbmTrdQa.h:70
CbmTrdRadiator
Definition: CbmTrdRadiator.h:24
CbmTrdQa::fPRF_2D
TH2I * fPRF_2D
Definition: CbmTrdQa.h:193
CbmTrdQa::fMultiHitAdjacentPadPerMcTrack_PID
TH2I * fMultiHitAdjacentPadPerMcTrack_PID
Definition: CbmTrdQa.h:155
CbmMCTrack::GetPt
Double_t GetPt() const
Definition: CbmMCTrack.h:99
CbmTrdParSetDigi.h
CbmTrdPoint
Definition: CbmTrdPoint.h:23
CbmTrdQa::fModuleEfficiencyMap
std::map< Int_t, TH1I * > fModuleEfficiencyMap
Definition: CbmTrdQa.h:114
CbmTrdQa::CbmTrdQa
CbmTrdQa(CbmTrdRadiator *radiator=NULL)
Definition: CbmTrdQa.cxx:48
ECbmModuleId::kTrd
@ kTrd
Transition Radiation Detector.
CbmTrdQa::FinishTask
virtual void FinishTask()
Definition: CbmTrdQa.cxx:3171
CbmTrdQa::fDigiPar
CbmTrdParSetDigi * fDigiPar
Definition: CbmTrdQa.h:74
CbmTrdQa::fMultiHitSamePadPerMcTrack_zBirth
TH2I * fMultiHitSamePadPerMcTrack_zBirth
Definition: CbmTrdQa.h:147
CbmTrdQa::ReInit
virtual InitStatus ReInit()
Definition: CbmTrdQa.cxx:338
CbmTrdQa::fTriggerThreshold
Double_t fTriggerThreshold
Definition: CbmTrdQa.h:117
CbmMCTrack.h
CbmTrdQa::Register
void Register()
Definition: CbmTrdQa.cxx:3176
CbmTrdPoint::GetXIn
Double_t GetXIn() const
Definition: CbmTrdPoint.h:63
CbmTrdQa::fModuleTracklengthMap
std::map< Int_t, TH1I * > fModuleTracklengthMap
Definition: CbmTrdQa.h:104
CbmDigiManager.h
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmTrdParModDigi::GetSizeY
Double_t GetSizeY() const
Definition: CbmTrdParModDigi.h:110
CbmTrdQa::fModuleTrackableMapIt
std::map< Int_t, TH1I * >::iterator fModuleTrackableMapIt
Definition: CbmTrdQa.h:99
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmTrdQa::Init
virtual InitStatus Init()
Definition: CbmTrdQa.cxx:346
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmTrdQa::fTrianglePads
Bool_t fTrianglePads
Definition: CbmTrdQa.h:128
CbmTrdPoint.h
CbmTrdQa::fdEdxCluster
TH1F * fdEdxCluster
Definition: CbmTrdQa.h:167
CbmTrdQa::fLayerPointMapIt
std::map< Int_t, TH2I * >::iterator fLayerPointMapIt
Definition: CbmTrdQa.h:80
CbmTrdQa::fLayerHitMap
std::map< Int_t, TH2I * > fLayerHitMap
Definition: CbmTrdQa.h:81
CbmTrdParModGeo::GetZ
virtual Double_t GetZ() const
Definition: CbmTrdParModGeo.h:32
CbmTrdQa::SetTriggerThreshold
void SetTriggerThreshold(Double_t triggerthreshold)
Definition: CbmTrdQa.cxx:893
CbmTrdQa::fH
Bool_t fH
Definition: CbmTrdQa.h:126
CbmTrdQa::SetTriangularPads
void SetTriangularPads(Bool_t triangles)
Definition: CbmTrdQa.cxx:1726
CbmTrdDigi
Definition: CbmTrdDigi.h:14
CbmTrdQa::fStsTrdPoints
TH2F * fStsTrdPoints
Definition: CbmTrdQa.h:131
CbmTrdParSetDigi
Definition: CbmTrdParSetDigi.h:15
ECbmModuleId::kMuch
@ kMuch
Muon detection system.
CbmTrdQa::fdEdxPionHit
TH1F * fdEdxPionHit
Definition: CbmTrdQa.h:171
CbmTrdQa::fdEdxElectronMc
TH1F * fdEdxElectronMc
Definition: CbmTrdQa.h:173
CbmTrdQa::fModuleTracklengthMapIt
std::map< Int_t, TH1I * >::iterator fModuleTracklengthMapIt
Definition: CbmTrdQa.h:105
CbmTrdQa::fModuleMultiPointMapIt
std::map< Int_t, TH1I * >::iterator fModuleMultiPointMapIt
Definition: CbmTrdQa.h:107
CbmTrdCluster.h
Data Container for TRD clusters.
CbmTrdQa::fClusterPerHit
TH1I * fClusterPerHit
Definition: CbmTrdQa.h:180
CbmTrdParModGeo::GetX
virtual Double_t GetX() const
Definition: CbmTrdParModGeo.h:22
CbmTrdParModGeo::GetY
virtual Double_t GetY() const
Definition: CbmTrdParModGeo.h:27
CbmTrdQa::fPointsPerDigi
TH1I * fPointsPerDigi
Definition: CbmTrdQa.h:178
CbmTrdQa::fStsMuchPoints
TH2F * fStsMuchPoints
Definition: CbmTrdQa.h:132
CbmTrdParModDigi::GetModuleRow
Int_t GetModuleRow(Int_t &sectorId, Int_t &rowId) const
Definition: CbmTrdParModDigi.cxx:373
CbmTrdQa::fHitToPointEfficiencyVsAlpha
TProfile * fHitToPointEfficiencyVsAlpha
Definition: CbmTrdQa.h:191
CbmTrdQa::fPRF_1D
TProfile * fPRF_1D
Definition: CbmTrdQa.h:192
CbmTrdDigi::GetCharge
Double_t GetCharge() const
Charge getter for SPADIC.
Definition: CbmTrdDigi.cxx:133
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmTrdPoint::GetYIn
Double_t GetYIn() const
Definition: CbmTrdPoint.h:64
CbmTrdQa::fMultiHitSamePadPerMcTrack_motherPID
TH2I * fMultiHitSamePadPerMcTrack_motherPID
Definition: CbmTrdQa.h:149
CbmCluster::GetDigi
Int_t GetDigi(Int_t index) const
Get digi at position index.
Definition: CbmCluster.h:76
CbmTrdQa::fTrdPointsPerMcTrack_P
TH2F * fTrdPointsPerMcTrack_P
Definition: CbmTrdQa.h:141
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
CbmTrdQa::fMultiHitSamePadPerMcTrack
TH1I * fMultiHitSamePadPerMcTrack
Definition: CbmTrdQa.h:145
CbmTrdQa::fdEdxPionMc
TH1F * fdEdxPionMc
Definition: CbmTrdQa.h:170
CbmTrdQa::fMuchTofPoints
TH2F * fMuchTofPoints[11]
Definition: CbmTrdQa.h:135
CbmTrdUtils::GetGeantName
static TString GetGeantName(Int_t GeantId)
Definition: CbmTrdUtils.h:77
CbmTrdQa::fModuleClusterSizeMap
std::map< Int_t, TH1I * > fModuleClusterSizeMap
Definition: CbmTrdQa.h:100
CbmTrdQa::fdEdxPionGhost
TH1F * fdEdxPionGhost
Definition: CbmTrdQa.h:172
CbmTrdQa::fLostPointVsR
TProfile * fLostPointVsR
Definition: CbmTrdQa.h:186
CbmTrdQa::fModuleTrackableMap
std::map< Int_t, TH1I * > fModuleTrackableMap
Definition: CbmTrdQa.h:98
CbmTrdQa::fModulePointMapIt
std::map< Int_t, std::vector< Int_t > >::iterator fModulePointMapIt
Definition: CbmTrdQa.h:85
CbmTrdQa::fModuleClusterSizeMapIt
std::map< Int_t, TH1I * >::iterator fModuleClusterSizeMapIt
Definition: CbmTrdQa.h:101