CbmRoot
CbmTrdHitRateQa.cxx
Go to the documentation of this file.
1 #include "CbmTrdHitRateQa.h"
2 
3 #include "CbmTrdAddress.h"
4 #include "CbmTrdGeoHandler.h"
5 #include "CbmTrdParModDigi.h"
6 #include "CbmTrdParModGeo.h"
7 #include "CbmTrdParSetAsic.h"
8 #include "CbmTrdParSetDigi.h"
9 #include "CbmTrdParSetGeo.h"
10 #include "CbmTrdRadiator.h"
11 
12 #include "FairRootManager.h"
13 #include "FairRunAna.h"
14 #include "FairRuntimeDb.h"
15 
16 #include "TBox.h"
17 #include "TCanvas.h"
18 #include "TClonesArray.h"
19 #include "TColor.h"
20 #include "TGeoManager.h"
21 #include "TH2.h"
22 #include "TImage.h"
23 #include "TLine.h"
24 #include "TPRegexp.h"
25 #include "TPolyMarker.h"
26 #include "TStyle.h"
27 #include <TFile.h>
28 
29 #include "Riostream.h"
30 #include <cmath>
31 #include <fstream>
32 #include <iostream>
33 #include <vector>
34 
35 #define winsize 2000 // 1500 // 5500 // 6000
36 
37 using std::cin;
38 using std::cout;
39 using std::endl;
40 using std::flush;
41 using std::ios;
42 using std::pair;
43 using std::setw;
44 using std::vector;
45 
46 // ---- Default constructor -------------------------------------------
48 // --------------------------------------------------------------------
49 
50 // ---- Constructor ----------------------------------------------------
51 CbmTrdHitRateQa::CbmTrdHitRateQa(const char* name, const char*)
52  : FairTask(name)
53  , Digicounter(-1)
54  , tFile(NULL)
55  , fDraw(kFALSE)
56  , fPlane(-1)
57  , fStation(-1)
58  , fLayer(-1)
59  , fCol_mean(-1)
60  , fCol_in(-1)
61  , fCol_out(-1)
62  , fRow_mean(-1)
63  , fRow_in(-1)
64  , fRow_out(-1)
65  , fModuleID(-1)
66  , fMCindex(-1)
67  , local_meanLL()
68  , local_meanC()
69  , global_meanLL()
70  , global_meanC()
71  , local_inLL()
72  , local_inC()
73  , global_inLL()
74  , global_inC()
75  , local_outLL()
76  , local_outC()
77  , global_outLL()
78  , global_outC()
79  , fx_in(0.)
80  , fx_out(0.)
81  , fy_in(0.)
82  , fy_out(0.)
83  , fz_in(0.)
84  , fz_out(0.)
85  , fx_mean(0.)
86  , fy_mean(0.)
87  , fz_mean(0.)
88  , fSector(-1)
89  , padsize()
90  , modulesize()
91  , fELoss(-1.)
92  , fELossdEdX(-1.)
93  , fELossTR(-1.)
94  , fPosXLL(0.)
95  , fPosYLL(0.)
96  , fPadPosxLL(0.)
97  , fPadPosyLL(0.)
98  , fPadPosxC(0.)
99  , fPadPosyC(0.)
100  , fDeltax(0.)
101  , fDeltay(0.)
102  , fPadCharge()
103  , fPRFHitPositionLL(0.)
104  , fPRFHitPositionC(0.)
105  , fEfficiency(1.)
106  , fTrdPoints(NULL)
107  , fDigiCollection(NULL)
108  , fDigiMatchCollection(NULL)
109  , fMCStacks(NULL)
110  , fAsicPar(NULL)
111  , fDigiPar(NULL)
112  , fGeoPar(NULL)
113  , fGeoHandler(new CbmTrdGeoHandler())
114  , fDigiMap()
115  , fDigiMapIt() {}
116 // --------------------------------------------------------------------
117 
118 // ---- Destructor ----------------------------------------------------
120  // FairRootManager *ioman =FairRootManager::Instance();
121  //ioman->Write();
122  //fDigiCollection->Clear("C");
123  //delete fDigiCollection;
124  //fDigiMatchCollection->Clear("C");
125  //delete fDigiMatchCollection;
126 }
127 // --------------------------------------------------------------------
128 
129 // ---- Initialisation ----------------------------------------------
131  cout << " * CbmTrdHitRateQa * :: SetParContainers() " << endl;
132 
133 
134  // Get Base Container
135  FairRunAna* ana = FairRunAna::Instance();
136  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
137 
138  fAsicPar = (CbmTrdParSetAsic*) (rtdb->getContainer("CbmTrdParSetAsic"));
139  fDigiPar = (CbmTrdParSetDigi*) (rtdb->getContainer("CbmTrdParSetDigi"));
140  fGeoPar = (CbmTrdParSetGeo*) (rtdb->getContainer("CbmTrdParSetGeo"));
141 }
142 // --------------------------------------------------------------------
143 
144 // ---- ReInit -------------------------------------------------------
146 
147  cout << " * CbmTrdHitRateQa * :: ReInit() " << endl;
148 
149 
150  FairRunAna* ana = FairRunAna::Instance();
151  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
152 
153  fAsicPar = (CbmTrdParSetAsic*) (rtdb->getContainer("CbmTrdParSetAsic"));
154  fDigiPar = (CbmTrdParSetDigi*) (rtdb->getContainer("CbmTrdParSetDigi"));
155  fGeoPar = (CbmTrdParSetGeo*) (rtdb->getContainer("CbmTrdParSetGeo"));
156 
157  return kSUCCESS;
158 }
159 // --------------------------------------------------------------------
160 
161 // ---- Init ----------------------------------------------------------
162 InitStatus CbmTrdHitRateQa::Init() {
163 
164  cout << " * CbmTrdHitRate * :: Init() " << endl;
165 
166  FairRootManager* ioman = FairRootManager::Instance();
167  if (!ioman) Fatal("Init", "No FairRootManager");
168 
169  fTrdPoints = (TClonesArray*) ioman->GetObject("TrdPoint");
170  if (!fTrdPoints) {
171  cout << "-W CbmTrdCluster::Init: No TrdPoints array!" << endl;
172  cout << " Task will be inactive" << endl;
173  return kERROR;
174  }
175 
176  fMCStacks = (TClonesArray*) ioman->GetObject("MCTrack");
177  if (!fMCStacks) {
178  cout << "-W CbmTrdCluster::Init: No MCTrack array!" << endl;
179  cout << " Task will be inactive" << endl;
180  return kERROR;
181  }
182  /*
183  fDigiCollection = new TClonesArray("CbmTrdDigi", 100);
184  ioman->Register("TrdDigi","TRD Digis",fDigiCollection,IsOutputBranchPersistent("TrdDigi"));
185 
186  fDigiMatchCollection = new TClonesArray("CbmTrdDigiMatch", 100);
187  ioman->Register("TrdDigiMatch","TRD Digis",fDigiMatchCollection,IsOutputBranchPersistent("TrdDigiMatch"));
188  */
189  fGeoHandler->Init();
190 
191  //fRadiators->Init();
192 
193  return kSUCCESS;
194 }
195 // --------------------------------------------------------------------
196 
197 
198 // ---- Exec ----------------------------------------------------------
199 void CbmTrdHitRateQa::Exec(Option_t*) {
200  //TStyle::SetNumberContours(99);
201  gStyle->SetNumberContours(99);
202  //TH2::SetContour(99);
203  /*
204  const Int_t Number = 11;
205  Double_t r[Number] = {1.00, 0.50, 0.00, 0.00, 0.00, 0.00, 0.00, 0.50, 1.00, 0.50, 1.00};
206  Double_t g[Number] = {0.00, 0.00, 0.00, 0.50, 1.00, 1.00, 1.00, 1.00, 1.00, 0.50, 1.00};
207  Double_t b[Number] = {1.00, 1.00, 1.00, 1.00, 1.00, 0.50, 0.00, 0.00, 0.00, 0.50, 1.00};
208  Double_t length[Number] = {0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00};
209  Int_t nb = 99;
210  Int_t a = TColor::CreateGradientColorTable(Number,length,r,g,b,nb);
211  */
212  printf("Introduction:\n");
213  HitRateGeoPara* GeoPara = new HitRateGeoPara;
214  Bool_t Lines;
215  Bool_t Fast =
216  true; // false; // true; // false; // will not fill the root file (in Histo)!!
217  // Bool_t firstLayer = false;
218  fDraw = true; // false;
219  Double_t ZRangeL = 1e00; //1e05;
220  Double_t ZRangeU = 1e05; //1e06;
221  Double_t mm2bin = 2.5; // 20.0; // 10.0; // 5.0; // 2.5;
222 
223  fStation = 0;
224  fLayer = 0;
225  tFile =
226  new TFile("CbmTrdHitRateQa.root", "RECREATE", " ROOT file with histograms");
227 
228  TH1F* h1HitPad = NULL;
229  TH2F* h2Layer = NULL;
230  TH2F* h2Topview[3] = {NULL, NULL, NULL};
231  TCanvas* c1 = NULL;
232  TCanvas* c2 = NULL;
233  TCanvas* c0 = NULL;
234  if (fDraw) {
235  c0 = new TCanvas("c0", "c0", 1800, 450);
236  c0->Divide(3, 1);
237  }
238  const Int_t z_cave = 12000;
239  h2Topview[0] = new TH2F("TopView",
240  "TopView",
241  int(2 * winsize / mm2bin),
242  -winsize,
243  winsize,
244  int(z_cave / mm2bin),
245  0,
246  z_cave);
247  h2Topview[0]->SetXTitle("x-Coordinate [mm]");
248  h2Topview[0]->SetYTitle("z-Coordinate [mm]");
249  h2Topview[0]->SetZTitle("#");
250  h2Topview[1] = new TH2F("FrontView",
251  "FrontView",
252  int(2 * winsize / mm2bin),
253  -winsize,
254  winsize,
255  int(2 * winsize / mm2bin),
256  -winsize,
257  winsize);
258  h2Topview[1]->SetXTitle("x-Coordinate [mm]");
259  h2Topview[1]->SetYTitle("y-Coordinate [mm]");
260  h2Topview[1]->SetZTitle("#");
261  h2Topview[2] = new TH2F("SideView",
262  "SideView",
263  int(z_cave / mm2bin),
264  0,
265  z_cave,
266  int(2 * winsize / mm2bin),
267  -winsize,
268  winsize);
269  h2Topview[2]->SetXTitle("z-Coordinate [mm]");
270  h2Topview[2]->SetYTitle("y-Coordinate [mm]");
271  h2Topview[2]->SetZTitle("#");
272  for (Int_t i = 0; i < 3; i++) {
273  h2Topview[i]->SetContour(99);
274  h2Topview[i]->SetStats(kFALSE);
275  h2Topview[i]->GetXaxis()->SetLabelSize(0.02);
276  h2Topview[i]->GetYaxis()->SetLabelSize(0.02);
277  h2Topview[i]->GetZaxis()->SetLabelSize(0.02);
278  h2Topview[i]->GetXaxis()->SetTitleSize(0.02);
279  h2Topview[i]->GetXaxis()->SetTitleOffset(1.5);
280  h2Topview[i]->GetYaxis()->SetTitleSize(0.02);
281  h2Topview[i]->GetYaxis()->SetTitleOffset(2);
282  h2Topview[i]->GetZaxis()->SetTitleSize(0.02);
283  h2Topview[i]->GetZaxis()->SetTitleOffset(-2);
284  if (fDraw) {
285  c0->cd(i + 1);
286  h2Topview[i]->Draw("colz");
287  }
288  }
289  for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++)
290  printf("%2i %3i\n", i, TColor::GetColorPalette(i));
291  //h2Topview->GetZaxis()->SetRangeUser(ZRangeL,ZRangeU);
292  // return;
293 
294  vector<int> Plane01;
295  vector<int> Plane02;
296  vector<int> Plane03;
297  vector<int> Plane04;
298  vector<int> Plane05;
299  vector<int> Plane06;
300  vector<int> Plane07;
301  vector<int> Plane08;
302  vector<int> Plane09;
303  vector<int> Plane10;
304 
305  Int_t ModuleID;
306  // Int_t Sector = 0;
307  const Int_t NofModules = fDigiPar->GetNrOfModules();
308 
309  //const Int_t NofModules = 80; // DE
310  //TH2F *Module[NofModules];
311 
312  for (Int_t i = 0; i < NofModules; i++) {
313 
314  ModuleID = fDigiPar->GetModuleId(i);
315  // CbmTrdParModDigi *fModuleInfo = (CbmTrdParModDigi*)fDigiPar->GetModulePar(ModuleID);
316  //printf("%d:\n %.1f %.1f %.1f\n",ModuleID,fModuleInfo->GetX(), fModuleInfo->GetY(),fModuleInfo->GetZ());
317 
318  fPlane = CbmTrdAddress::GetLayerId(ModuleID);
319  fStation = fPlane / 4 + 1; // OK for SIS100 and SIS300
320  fLayer = fPlane % 4 + 1; // OK for SIS100 and SIS300
321 
322  cout << "module " << i + 1 << ": ID " << ModuleID << " - P" << fPlane
323  << " S" << fStation << " L" << fLayer << endl;
324 
325  // fill plane vectors
326  if (fPlane == 0) Plane01.push_back(ModuleID);
327  if (fPlane == 1) Plane02.push_back(ModuleID);
328  if (fPlane == 2) Plane03.push_back(ModuleID);
329  if (fPlane == 3) Plane04.push_back(ModuleID);
330  if (fPlane == 4) Plane05.push_back(ModuleID);
331  if (fPlane == 5) Plane06.push_back(ModuleID);
332  if (fPlane == 6) Plane07.push_back(ModuleID);
333  if (fPlane == 7) Plane08.push_back(ModuleID);
334  if (fPlane == 8) Plane09.push_back(ModuleID);
335  if (fPlane == 9) Plane10.push_back(ModuleID);
336  }
337 
338  vector<vector<int>> LiSi;
339  //LiSi.push_back(Plane01);
340  //LiSi.push_back(Plane02);
341  //LiSi.push_back(Plane05);
342  //LiSi.push_back(Plane06);
343  //LiSi.push_back(Plane09);
344  //LiSi.push_back(Plane10);
345  LiSi.push_back(Plane01);
346  LiSi.push_back(Plane02);
347  LiSi.push_back(Plane03);
348  LiSi.push_back(Plane04);
349  LiSi.push_back(Plane05);
350  LiSi.push_back(Plane06);
351  LiSi.push_back(Plane07);
352  LiSi.push_back(Plane08);
353  LiSi.push_back(Plane09);
354  LiSi.push_back(Plane10);
355 
356  Char_t OutFile1[200];
357  Char_t OutFile2[200];
358 
359  TImage* Outimage1 = NULL;
360  TImage* Outimage2 = NULL;
361 
362  TLine* MaxHitRatePerPad =
363  new TLine(1e05, 0, 1e05, 1e04); // 100.000 hits per pad
364  MaxHitRatePerPad->SetLineColor(2); // make it red
365  MaxHitRatePerPad->SetLineWidth(8); // make it thick
366 
367  /*
368  h2Layer = new TH2F("dummy1","dummy1",1,-0.5,0.5,1,-0.5,0.5);
369  h1HitPad = new TH1F("dummy2","dummy2",1,-0.5,0.5);
370  c1 = new TCanvas("dummy3","dummy3",10,10);
371  c2 = new TCanvas("dummy4","dummy4",10,10);
372  */
373  //**************************************************************************************
374 
375  for (vector<vector<int>>::size_type j = 0; j < LiSi.size(); j++) {
376  // fix layer number
377  fPlane = CbmTrdAddress::GetLayerId(LiSi[j][0]);
378  fStation = fPlane / 4 + 1; // OK for SIS100 and SIS300
379  fLayer = fPlane % 4 + 1; // OK for SIS100 and SIS300
380  // cout << fStation << ", " << fLayer << endl;
381 
382  UInt_t nModulesInThisLayer = LiSi[j].size();
383  // cout << nModulesInThisLayer << " modules in this layer" << endl;
384 
385  h2Topview[0]->Reset();
386  h2Topview[1]->Reset();
387  h2Topview[2]->Reset();
388 
389  sprintf(OutFile1, "pics/HitRateLayerPadView_S%d_L%d.png", fStation, fLayer);
390  sprintf(
391  OutFile2, "pics/HitRateLayerSpectrum_S%d_L%d.png", fStation, fLayer);
392 
393  HistoInit(c1, c2, h2Layer, h1HitPad, ZRangeL, ZRangeU, mm2bin);
394 
395  if (fDraw) MaxHitRatePerPad->Draw("same"); // draw red line
396 
397  // generate HitPerPadSpectra
398  // generate png files
399  Lines = false;
400  for (vector<int>::size_type i = 0; i < nModulesInThisLayer; i++)
402  Fast,
403  Lines,
404  LiSi[j][i],
405  h2Layer,
406  c1,
407  h1HitPad,
408  c2,
409  h2Topview,
410  c0,
411  mm2bin);
412 
413  if (fDraw) {
414  c1->cd(1)->SetLogz(1);
415  h2Layer->Draw("colz"); // draw layer view
416  }
417 
418  Lines = true;
419  for (vector<int>::size_type i = 0; i < nModulesInThisLayer; i++)
421  Fast,
422  Lines,
423  LiSi[j][i],
424  h2Layer,
425  c1,
426  h1HitPad,
427  c2,
428  h2Topview,
429  c0,
430  mm2bin);
431 
432  if (fDraw) // dump png file for this layer
433  {
434  Outimage1 = TImage::Create();
435  Outimage1->FromPad(c1);
436  Outimage1->WriteImage(OutFile1);
437  }
438 
439  if (fDraw) {
440  delete c1;
441  delete Outimage1;
442  h1HitPad->Draw("same");
443  Outimage2 = TImage::Create();
444  Outimage2->FromPad(c2);
445  Outimage2->WriteImage(OutFile2);
446  }
447 
448  /*
449  sprintf(OutFile1,"pics/%s_S%d_L%d.eps",trddigiparpath,fStation,fLayer);
450  c1->cd(1)->Print(OutFile1);
451  */
452  delete h2Layer;
453 
454  /*
455  sprintf(OutFile2,"pics/%s_HitPerPad_S%d_L%d.eps",trddigiparpath,fStation,fLayer);
456  c2->cd(1)->Print(OutFile2);
457  */
458  delete h1HitPad;
459 
460  if (fDraw) {
461  delete c2;
462  delete Outimage2;
463  }
464 
465  if (fDraw) c0->Update();
466  }
467 
468  if (fDraw) c0->Update();
469 
470  // // write modules histos to file
471  // for (Int_t i = 0; i < NofModules; i++)
472  // Module[i]->Write("", TObject::kOverwrite);
473 
474  // tFile->Close(); // this causes a segfalut
475 }
476 
477 
478 void CbmTrdHitRateQa::HistoInit(TCanvas*& c1,
479  TCanvas*& c2,
480  TH2F*& Layer,
481  TH1F*& HitPad,
482  Double_t ZRangeL,
483  Double_t ZRangeU,
484  Double_t mm2bin) {
485  Char_t name[50];
486  Char_t title[50];
487 
488  sprintf(name, "S%d_L%d", fStation, fLayer);
489  sprintf(title, "Station %d, Layer %d", fStation, fLayer);
490  printf("%s\n", title);
491 
492  Layer = new TH2F(name,
493  title,
494  int(2 * winsize / mm2bin),
495  -winsize,
496  winsize,
497  int(2 * winsize / mm2bin),
498  -winsize,
499  winsize);
500  Layer->SetContour(99);
501  Layer->SetXTitle("x-Coordinate [mm]");
502  Layer->SetYTitle("y-Coordinate [mm]");
503  Layer->SetZTitle("Hits/Pad [Hz]");
504  Layer->SetStats(kFALSE);
505  Layer->GetXaxis()->SetLabelSize(0.02);
506  Layer->GetYaxis()->SetLabelSize(0.02);
507  Layer->GetZaxis()->SetLabelSize(0.02);
508  Layer->GetXaxis()->SetTitleSize(0.02);
509  Layer->GetXaxis()->SetTitleOffset(1.5);
510  Layer->GetYaxis()->SetTitleSize(0.02);
511  Layer->GetYaxis()->SetTitleOffset(2);
512  Layer->GetZaxis()->SetTitleSize(0.02);
513  Layer->GetZaxis()->SetTitleOffset(-2);
514  Layer->GetZaxis()->SetRangeUser(ZRangeL, ZRangeU);
515 
516  sprintf(name, "HP_S%d_L%d", fStation, fLayer);
517  sprintf(title, "HitPad_Station %d, Layer %d", fStation, fLayer);
518  HitPad = new TH1F(name, title, 10000, 1e00, 1e06);
519  HitPad->SetXTitle("Hits/Pad [Hz]");
520  HitPad->SetYTitle("count");
521  HitPad->GetYaxis()->SetRangeUser(1, 1e04);
522 
523  sprintf(name, "c1_S%d_L%d", fStation, fLayer);
524  sprintf(title, "c1 Station %d, Layer %d", fStation, fLayer);
525  if (fDraw) {
526  c1 = new TCanvas(name, title, 1000, 900);
527  c1->Divide(1, 1);
528  c1->cd(1)->SetLogz(1);
529  Layer->Draw();
530  }
531  sprintf(name, "c2_S%d_L%d", fStation, fLayer);
532  sprintf(title, "c2 Station %d, Layer %d", fStation, fLayer);
533  if (fDraw) {
534  c2 = new TCanvas(name, title, 1000, 900 / 2);
535  c2->Divide(1, 1);
536  c2->cd(1)->SetLogx(1);
537  c2->cd(1)->SetLogy(1);
538  c2->cd(1)->SetGridx(1);
539  c2->cd(1)->SetGridy(1);
540  HitPad->Draw();
541  }
542 }
543 
544 // --------------------------------------------------------------------
545 
546 // ---- FinishTask-----------------------------------------------------
548  fDigiMap.clear();
549  if (fDigiCollection) fDigiCollection->Clear();
551 }
552 
553 // --------------------------------------------------------------------
554 // ----GetModuleInformation ------------------------------------------
556  // Extract the information about station, layer, module type
557  // and cpoy number of the module from the full path to the
558  // node.
559  // The full path is tokenized at the "/" which diide the different
560  // levels of the geometry.
561  // Knowing the nameing scheme of the volumes one gets the required
562  // information with simple string manipulation.
563  // This is probably not the fastes way, but the speed has to be checked.
564  // The methode works only for versions of Root > 5.20.0, before the
565  // class TStringTocken is not implemented
566 
567  TString path = gGeoManager->GetPath();
568  cout << "Path: " << path << endl;
569  TStringToken* bla = new TStringToken(path, "/");
570 
571  while (bla->NextToken()) {
572  if (bla->Contains("layer")) {
573  TString bla3 = (TString) *bla;
574  Ssiz_t pos = bla3.Last('_');
575  Ssiz_t substringLength = bla3.Length() - pos - 1;
576  TString bla2 = bla3((bla3.Last('_') + 1), substringLength);
577  TString bla1 = bla3(3, 1);
578  fStation = bla1.Atoi();
579  fLayer = bla2.Atoi();
580  }
581  if (bla->Contains("mod")) {
582  TString bla3 = (TString) *bla;
583  Ssiz_t pos = bla3.Last('_');
584  Ssiz_t substringLength = bla3.Length() - pos - 1;
585  TString bla2 = bla3(pos + 1, substringLength);
586  substringLength = pos - 7;
587  TString bla1 = bla3(7, substringLength);
588  break;
589  }
590  }
591 }
592 
593 // --------------------------------------------------------------------
594 // ----GetModuleInformationFromDigiPar ------------------------------------------
596  Bool_t Fast,
597  Bool_t Lines,
598  Int_t VolumeID,
599  TH2F* Layer,
600  TCanvas* c1,
601  TH1F* HitPad,
602  TCanvas* c2,
603  TH2F* Topview[3],
604  TCanvas* c0,
605  Double_t mm2bin) {
606  // fPos is >0 for x and y and not rotated
607  // origin of the local coordinate system in
608  // the lower left corner of the chamber,
609  // x to the right (small side of the pads), y up
610  //cout << "GetModuleInformationFromDigiPar" << endl;
611 
612  CbmTrdParModDigi* fModuleInfo =
613  (CbmTrdParModDigi*) fDigiPar->GetModulePar(VolumeID);
614  CbmTrdParModGeo* fModuleGeo =
615  (CbmTrdParModGeo*) fGeoPar->GetModulePar(VolumeID);
616  if (fModuleInfo != NULL) {
617 
618  // fill GeoPara
619  TVector3 padPos;
620  TVector3 padSize;
621 
622  GeoPara->nSec = fModuleInfo->GetNofSectors(); // is always 3
623  GeoPara->moduleId = VolumeID;
624  GeoPara->layerId = fLayer;
625  GeoPara->stationId = fStation;
626 
627  GeoPara->mPos[0] = fModuleGeo->GetX() * 10;
628  GeoPara->mPos[1] = fModuleGeo->GetY() * 10;
629  GeoPara->mPos[2] = fModuleGeo->GetZ() * 10; // == z(station) ??
630 
631  GeoPara->mSize[0] = fModuleInfo->GetSizeX() * 10;
632  GeoPara->mSize[1] = fModuleInfo->GetSizeY() * 10;
633  GeoPara->mSize[2] = 0;
634 
635  GeoPara->nCol = 0; // reset total number of columns
636  GeoPara->nRow = 0; // reset total number of rows
637 
638  for (Int_t s = 0; s < GeoPara->nSec; s++) // for all (3) sectors
639  {
640  GeoPara->sCol[s] = 0; // reset number of columns in sector
641  GeoPara->sRow[s] = 0; // reset number of rows in sector
642 
643  fModuleInfo->GetPosition(/*VolumeID, */ s, 0, 0, padPos, padSize);
644  GeoPara->pSize[s][2] = 0;
645 
646  for (Int_t i = 0; i < 2; i++) // for x and y
647  {
648  GeoPara->pSize[s][i] = padSize[i] * 10; // convert to mm
649 
650  if (i == 0) // x direction
651  {
652  GeoPara->sSize[s][i] = fModuleInfo->GetSectorSizeX(s) * 10;
653  if (GeoPara->sSize[s][i]
654  < 2 * GeoPara->mSize[i]) // if sector smaller than module
655  {
656  GeoPara->sCol[s] =
657  round(GeoPara->sSize[s][i]
658  / GeoPara->pSize[s][i]); // calculate number of pads
659  } else // only one sector
660  {
661  if (s == 0)
662  GeoPara->sCol[s] =
663  round(GeoPara->sSize[s][i]
664  / GeoPara->pSize[s][i]); // calculate number of pads
665  else
666  GeoPara->sCol[s] = 0; // set other sectors 0
667  }
668  GeoPara->nCol += GeoPara->sCol[s]; // sum up columns
669  }
670 
671  if (i == 1) // y direction
672  {
673  GeoPara->sSize[s][i] = fModuleInfo->GetSectorSizeY(s) * 10;
674  if (GeoPara->sSize[s][i]
675  < 2 * GeoPara->mSize[i]) // if sector smaller than module
676  {
677  GeoPara->sRow[s] =
678  round(GeoPara->sSize[s][i] / GeoPara->pSize[s][i]);
679  } else // only one sector
680  {
681  if (s == 0)
682  GeoPara->sRow[s] =
683  round(GeoPara->sSize[s][i]
684  / GeoPara->pSize[s][i]); // calculate number of pads
685  else
686  GeoPara->sRow[s] = 0; // set other sectors 0
687  }
688  GeoPara->nRow += GeoPara->sRow[s]; // sum up columns
689  }
690  }
691  }
692 
693  // swap, if required
694  if (GeoPara->nRow > GeoPara->nCol) // if mofre rows than columns
695  {
696  Int_t itemp;
697  Double_t dtemp;
698 
699  itemp = GeoPara->nRow;
700  GeoPara->nRow = GeoPara->nCol;
701  GeoPara->nCol = itemp;
702 
703  for (Int_t s = 0; s < GeoPara->nSec; s++) // for all (3) sectors
704  {
705  dtemp = GeoPara->sRow[s];
706  GeoPara->sRow[s] = GeoPara->sCol[s];
707  GeoPara->sCol[s] = dtemp;
708 
709  dtemp = GeoPara->sSize[s][0];
710  GeoPara->sSize[s][0] = GeoPara->sSize[s][1];
711  GeoPara->sSize[s][1] = dtemp;
712 
713  dtemp = GeoPara->pSize[s][0];
714  GeoPara->pSize[s][0] = GeoPara->pSize[s][1];
715  GeoPara->pSize[s][1] = dtemp;
716  }
717  cout << "swapped x and y" << endl;
718  }
719 
720  // get origin
721  fModuleInfo->GetPosition(/*VolumeID, */ 0, 0, 0, padPos, padSize);
722  GeoPara->vOrigin[0] = padPos[0] * 10;
723  GeoPara->vOrigin[1] = padPos[1] * 10;
724  GeoPara->vOrigin[2] = padPos[2] * 10;
725 
726  // get col offset
727  fModuleInfo->GetPosition(/*VolumeID, */ 0, 1, 0, padPos, padSize);
728  GeoPara->vX[0] = padPos[0] * 10 - GeoPara->vOrigin[0];
729  GeoPara->vX[1] = padPos[1] * 10 - GeoPara->vOrigin[1];
730  GeoPara->vX[2] = padPos[2] * 10 - GeoPara->vOrigin[2];
731 
732  // get row offset
733  // fModuleInfo->GetPosition(VolumeID, 0, 0, 1, padPos, padSize); // rather take next of 3 sectors
734  fModuleInfo->GetPosition(/*VolumeID, */ 1, 0, 0, padPos, padSize);
735  GeoPara->vY[0] = padPos[0] * 10 - GeoPara->vOrigin[0];
736  GeoPara->vY[1] = padPos[1] * 10 - GeoPara->vOrigin[1];
737  GeoPara->vY[2] = padPos[2] * 10 - GeoPara->vOrigin[2];
738 
739  // normal vector
740  GeoPara->vN[0] =
741  GeoPara->vX[1] * GeoPara->vY[2] - GeoPara->vX[2] * GeoPara->vY[1];
742  GeoPara->vN[1] =
743  GeoPara->vX[2] * GeoPara->vY[0] - GeoPara->vX[0] * GeoPara->vY[2];
744  GeoPara->vN[2] =
745  GeoPara->vX[0] * GeoPara->vY[1] - GeoPara->vX[1] * GeoPara->vY[0];
746 
747  // inclination angle
748  GeoPara->lambda = (GeoPara->vOrigin[0] * GeoPara->vN[0]
749  + GeoPara->vOrigin[1] * GeoPara->vN[1]
750  + GeoPara->vOrigin[2] * GeoPara->vN[2]);
751 
752  /*x-direction*/
753  GeoPara->cosX =
754  (GeoPara->vX[0] * 1 + GeoPara->vX[1] * 0 + GeoPara->vX[2] * 0)
755  / sqrt(pow(GeoPara->vX[0], 2) + pow(GeoPara->vX[1], 2)
756  + pow(GeoPara->vX[2], 2));
757  /*y-direction*/
758  GeoPara->cosY =
759  (GeoPara->vY[0] * 0 + GeoPara->vY[1] * 1 + GeoPara->vY[2] * 0)
760  / sqrt(pow(GeoPara->vY[0], 2) + pow(GeoPara->vY[1], 2)
761  + pow(GeoPara->vY[2], 2));
762 
763  // check and fix cos values (were larger than 1)
764  // cout << "a cosX " << GeoPara->cosX << " cosY " << GeoPara->cosY << endl;
765 
766  if (GeoPara->cosX > 1) GeoPara->cosX = 1;
767  if (GeoPara->cosX < -1) GeoPara->cosX = -1;
768  if (GeoPara->cosY > 1) GeoPara->cosY = 1;
769  if (GeoPara->cosY < -1) GeoPara->cosY = -1;
770 
771  // cout << "b cosX " << GeoPara->cosX << " cosY " << GeoPara->cosY << endl;
772 
773  if (GeoPara->vX[0] != 0)
774  GeoPara->stepDirection[0] =
775  fabs(GeoPara->vX[0])
776  / (GeoPara
777  ->vX[0]); // is the next pad (1,0,0) on the left or right side?
778  else
779  GeoPara->stepDirection[0] =
780  -fabs(GeoPara->vX[1])
781  / (GeoPara
782  ->vX[1]); // is the next pad (1,0,0) on the left or right side?
783 
784  if (GeoPara->vY[1] != 0)
785  GeoPara->stepDirection[1] =
786  fabs(GeoPara->vY[1])
787  / (GeoPara
788  ->vY[1]); // is the next pad (0,1,0) on the upper or lower side?
789  else
790  GeoPara->stepDirection[1] =
791  -fabs(GeoPara->vY[0])
792  / (GeoPara
793  ->vY[0]); // is the next pad (0,1,0) on the upper or lower side?
794 
795  // transfer values to old variables
796  Double_t Mpos[3];
797  Double_t Msize[3];
798  for (Int_t i = 0; i < 3; i++) // for x, y and z
799  {
800  Mpos[i] = GeoPara->mPos[i]; // set module position
801  Msize[i] = GeoPara->mSize[i]; // set module size
802  }
803 
804  cout.setf(ios::fixed);
805  cout.precision(0);
806  if (Lines)
807  cout << "pos " << setw(6) << Mpos[0] << setw(6) << Mpos[1] << setw(6)
808  << Mpos[2] << " size " << setw(6) << Msize[0] << setw(6) << Msize[1]
809  << setw(6) << Msize[2] << endl;
810 
811 
812  const Int_t nSec = fModuleInfo->GetNofSectors(); // is always 3
813  // cout << nSec << " nSec" << endl;
814  Double_t Ssize[3 * nSec]; // sector size
815  Double_t Psize[3 * nSec]; // pad size
816  for (Int_t iSec = 0; iSec < nSec; iSec++) // iSec = Sector
817  {
818  Ssize[0 + iSec * nSec] = GeoPara->sSize[iSec][0];
819  Ssize[1 + iSec * nSec] = GeoPara->sSize[iSec][1];
820  Ssize[2 + iSec * nSec] = 0;
821 
822  Psize[0 + iSec * nSec] = GeoPara->pSize[iSec][0];
823  Psize[1 + iSec * nSec] = GeoPara->pSize[iSec][1];
824  Psize[2 + iSec * nSec] = 0;
825  }
826 
827  if (Lines)
828  cout << "sec " << setw(10) << Ssize[0] << setw(10) << Ssize[1]
829  << setw(10) << Ssize[3] << setw(10) << Ssize[4] << setw(10)
830  << Ssize[6] << setw(10) << Ssize[7] << endl;
831 
832  cout.precision(2);
833  if (Lines)
834  cout << "pad " << setw(10) << Psize[0] << setw(10) << Psize[1]
835  << setw(10) << Psize[3] << setw(10) << Psize[4] << setw(10)
836  << Psize[6] << setw(10) << Psize[7] << endl;
837 
838  // nCol and nRow
839  Int_t nCol = GeoPara->nCol; // columns per module - or - pads per row
840  Int_t nRow = GeoPara->nRow; // rows per module
841 
842  const Int_t mCol = fModuleInfo->GetNofColumns();
843  const Int_t mRow = fModuleInfo->GetNofRows();
844 
845  if (Lines) {
846  cout << "col0 " << setw(10) << GeoPara->sCol[0] << " row0 " << setw(10)
847  << GeoPara->sRow[0] << endl;
848  cout << "col1 " << setw(10) << GeoPara->sCol[1] << " row1 " << setw(10)
849  << GeoPara->sRow[1] << endl;
850  cout << "col2 " << setw(10) << GeoPara->sCol[2] << " row2 " << setw(10)
851  << GeoPara->sRow[2] << endl;
852  cout << "col " << setw(10) << nCol << " row " << setw(10) << nRow
853  << endl;
854 
855  cout << "mcol " << setw(10) << mCol << " mrow " << setw(10) << mRow
856  << endl;
857  cout << "0col " << setw(10) << fModuleInfo->GetNofColumnsInSector(0)
858  << " 0row " << setw(10) << fModuleInfo->GetNofRowsInSector(0)
859  << endl;
860  cout << "1col " << setw(10) << fModuleInfo->GetNofColumnsInSector(1)
861  << " 1row " << setw(10) << fModuleInfo->GetNofRowsInSector(1)
862  << endl;
863  cout << "2col " << setw(10) << fModuleInfo->GetNofColumnsInSector(2)
864  << " 2row " << setw(10) << fModuleInfo->GetNofRowsInSector(2)
865  << endl;
866  }
867 
868 
870  // Int_t nCol = 0; // columns per module - or - pads per row
871  // Int_t nRow = 0; // rows per module
872  //
873  // for (Int_t i = 0; i < fnSec; i++)
874  // {
875  // if (Ssize[0+i*nSec] < 2 * Msize[0] && Ssize[0+i*nSec] > 0) // sector size within module size
876  // {
877  // nCol += int(Ssize[0+i*nSec]/Psize[0+i*nSec]);
878  // }
879  // else
880  // {
881  // nCol = int(Ssize[0+i*nSec]/Psize[0+i*nSec]);
882  // }
883  //
884  // if (Ssize[1+i*nSec] < 2 * Msize[1] && Ssize[1+i*nSec] > 0) // sector size within module size
885  // {
886  // nRow += int(Ssize[1+i*nSec]/Psize[1+i*nSec]);
887  // }
888  // else
889  // {
890  // nRow = int(Ssize[1+i*nSec]/Psize[1+i*nSec]);
891  // }
892  // }
893  //
894  // if (Lines)
895  // cout << "nCol " << setw(10) << nCol << " nRow "<< setw(10) << nRow << endl;
896 
897  if (Lines) {
898  cout << "vX0 " << setw(10) << GeoPara->vX[0] << endl;
899  cout << "vX1 " << setw(10) << GeoPara->vX[1] << endl;
900  cout << "vY0 " << setw(10) << GeoPara->vY[0] << endl;
901  cout << "vY1 " << setw(10) << GeoPara->vY[1] << endl;
902  cout << "step " << setw(10) << GeoPara->stepDirection[0] << setw(10)
903  << GeoPara->stepDirection[1] << endl;
904  cout << "cos " << setw(10) << GeoPara->cosX << setw(10) << GeoPara->cosY
905  << endl;
906  cout << "v00xy " << setw(10) << GeoPara->mPos[0] - GeoPara->vOrigin[0]
907  << setw(10) << GeoPara->mPos[1] - GeoPara->vOrigin[1] << endl;
908 
909  // cout << "------------------------------------------------------" << endl;
910  }
911 
912  // angles are relative to y direction
913  if ((GeoPara->stepDirection[0] == 1)
914  && (GeoPara->stepDirection[1] == 1)) // OK - vert up
915  GeoPara->rot_angle = 0;
916  if ((GeoPara->stepDirection[0] == -1)
917  && (GeoPara->stepDirection[1] == 1)) // OK - hori left
918  GeoPara->rot_angle = 1;
919  if ((GeoPara->stepDirection[0] == -1)
920  && (GeoPara->stepDirection[1] == -1)) // OK - vert down
921  GeoPara->rot_angle = 2;
922  if ((GeoPara->stepDirection[0] == 1)
923  && (GeoPara->stepDirection[1] == -1)) // OK - hori right
924  GeoPara->rot_angle = 3;
925 
926  // GeoPara->ori = fModuleInfo->GetOrientation(); // is 0,1,2,3
927  if (Lines)
928  cout << "ori " << setw(10) << fModuleInfo->GetOrientation()
929  << " rot " << setw(10) << GeoPara->rot_angle << endl;
930 
931  // if (GeoPara->rot_angle == 3)
932  // {
933  // fModuleInfo->GetPosition(VolumeID, 2, GeoPara->sCol[0], GeoPara->sRow[2], padPos, padSize);
934  // if (Lines)
935  // {
942  // cout << "v11xy " << setw(10) << padPos[0] * 10 - GeoPara->vOrigin[0]
943  // << setw(10) << padPos[1] * 10 - GeoPara->vOrigin[1] << endl;
944  // }
945  // GeoPara->vOrigin[0] = padPos[0] * 10;
946  // GeoPara->vOrigin[1] = padPos[1] * 10;
947  // }
948 
949  if (Lines)
950  cout << "------------------------------------------------------" << endl;
951 
952  Topview[0]->Fill(GeoPara->mPos[0], GeoPara->mPos[2]);
953  Topview[1]->Fill(GeoPara->mPos[0], GeoPara->mPos[1]);
954  Topview[2]->Fill(GeoPara->mPos[2], GeoPara->mPos[1]);
955 
956  if (Lines) {
957  DrawPads(GeoPara, Layer, c1);
958  DrawBorders(GeoPara, Layer, c1);
959  } else {
960  Histo(GeoPara, Fast, Layer, c1, HitPad, c2, Topview, c0, mm2bin);
961  }
962 
963  if (Lines)
964  for (Int_t s = 0; s < GeoPara->nSec; s++) // for all (3) sectors
965  {
966  fModuleInfo->GetPosition(/*VolumeID, */ s, 0, 0, padPos, padSize);
967 
968  TPolyMarker* start = new TPolyMarker(1);
969  start->SetPoint(0, padPos(0) * 10, padPos(1) * 10);
970  start->SetMarkerStyle(22);
971  start->SetMarkerSize(.8);
972 
973  if (fDraw) {
974  c1->cd(1);
975  start->Draw("same");
976  }
977 
978  fModuleInfo->GetPosition(/*VolumeID, */ s,
979  GeoPara->sCol[0] - 1,
980  GeoPara->sRow[s] - 1,
981  padPos,
982  padSize);
983 
984  TPolyMarker* end = new TPolyMarker(1);
985  end->SetPoint(0, padPos(0) * 10, padPos(1) * 10);
986  end->SetMarkerStyle(20);
987  end->SetMarkerSize(.8);
988 
989  if (fDraw) {
990  c1->cd(1);
991  end->Draw("same");
992  }
993  }
994 
995  }
996 
997  else
998  printf("fModuleInfo == NULL\n");
999 }
1000 
1001 
1003  Double_t StartX,
1004  Double_t /*StopX*/,
1005  Int_t xSteps,
1006  Double_t StartY,
1007  Double_t /*StopY*/,
1008  Int_t ySteps,
1009  Double_t* /*Mpos*/,
1010  TH2F* Topview[3],
1011  TCanvas* /*c0*/) {
1012  //cout << "CalcHitRate" << endl;
1013  Double_t HitRate = 0; //1. / sqrt( pow( StartX,2) + pow( StartY,2));
1014  Double_t r = 0;
1015  Double_t alpha = 0;
1016  // Int_t counter = 0;
1017  // Double_t a[3] = { 7.66582e+00, 6.97712e+00, 6.53780e+00};
1018  // Double_t b[3] = {-2.72375e-03, -1.85168e-03, -1.42673e-03};
1019 
1020  Double_t xStepWidth = GeoPara->cosX;
1021  Double_t yStepWidth = GeoPara->cosY;
1022  Double_t x =
1023  StartX + 0.5 * GeoPara->cosX; // don't start on the pad border line
1024  Double_t y = StartY + 0.5 * GeoPara->cosY;
1025 
1026  // Double_t xStepWidth = fabs(GeoPara->cosX);
1027  // Double_t yStepWidth = fabs(GeoPara->cosY);
1028  // Double_t x = StartX + 0.5 * fabs(GeoPara->cosX); // don't start on the pad border line
1029  // Double_t y = StartY + 0.5 * fabs(GeoPara->cosY);
1030  Double_t z = (GeoPara->lambda - (x * GeoPara->vN[0] + y * GeoPara->vN[1]))
1031  / GeoPara->vN[2];
1032  for (Int_t yStep = 0; yStep < ySteps; yStep++) {
1033  x = StartX + 0.5 * GeoPara->cosX;
1034  // x = StartX + 0.5 * fabs(GeoPara->cosX);
1035  for (Int_t xStep = 0; xStep < xSteps; xStep++) {
1036  z = (GeoPara->lambda - (x * GeoPara->vN[0] + y * GeoPara->vN[1]))
1037  / GeoPara->vN[2];
1038  r = sqrt(pow(x, 2) + pow(y, 2));
1039  alpha = atan(r / z) * 1000.;
1040  /* //Fit without errors
1041  HitRate +=
1042  exp(4.54156e00 + -8.47377e-03 * alpha) +
1043  exp(2.40005e01 + -1.19541e-02 * alpha) /
1044  (z * z)
1045  ;
1046  */
1047  HitRate += // fit including errors
1048  exp(4.536355e00 + -8.393716e-03 * alpha)
1049  + exp(2.400547e01 + -1.208306e-02 * alpha) / (z * z);
1050 
1051  Topview[0]->Fill(x, z);
1052  Topview[1]->Fill(x, y);
1053  Topview[2]->Fill(z, y);
1054 
1055  x += xStepWidth;
1056  }
1057  y += yStepWidth;
1058  }
1059  return (
1060  HitRate /*/(counter/100.)*/); /*Convertes Hits/Pad -> Hits/cm² on each Pad*/
1061 }
1062 
1063 
1065  Bool_t Fast,
1066  TH2F* h2Layer,
1067  TCanvas* /*c1*/,
1068  TH1F* h1HitPad,
1069  TCanvas* /*c2*/,
1070  TH2F* Topview[3],
1071  TCanvas* c0,
1072  Double_t mm2bin) {
1073  Double_t ZRangeL = 1e00; //1e05;
1074  Double_t ZRangeU = 1e05; //1e06;
1075  TString name;
1076 
1077  // show only current module name
1078  name.Form("ModuleID %5d", GeoPara->moduleId);
1079  // cout << " " << name << "\r" << flush;
1080  cout << " " << name << "\n" << flush;
1081 
1082  name.Form("Module%05d", GeoPara->moduleId);
1083  TH2F* h2Module;
1084  if (GeoPara->mSize[0] < 500) // small module
1085  h2Module = new TH2F(name,
1086  name,
1087  600 / mm2bin + 1,
1088  -300.5,
1089  300.5,
1090  600 / mm2bin + 1,
1091  -300.5,
1092  300.5); // 501 x 501 bins
1093  else // large module
1094  h2Module = new TH2F(name,
1095  name,
1096  1000 / mm2bin + 1,
1097  -500.5,
1098  500.5,
1099  1000 / mm2bin + 1,
1100  -500.5,
1101  500.5); // 1001 x 1001 bins
1102  // TH2F *h2Module = new TH2F(name,name,1500/mm2bin+1,-750.5,750.5,1500/mm2bin+1,-750.5,750.5);
1103  h2Module->GetZaxis()->SetRangeUser(ZRangeL, ZRangeU);
1104 
1105  name.Form("Module%05dHitPad", GeoPara->moduleId);
1106  TH1F* h1HitPadModule = new TH1F(name, name, 1200, 0, 120000);
1107  // TH1F* h1HitPadModule = new TH1F(name,name,10000,1e00,1e06);
1108 
1109  //cout << "Histo" << endl;
1110 
1111  // printf(" Xp %6d Xs %6d Yp %6d Ys %6d\n", (Int_t)GeoPara->mPos[0], (Int_t)GeoPara->mSize[0], (Int_t)GeoPara->mPos[1], (Int_t)GeoPara->mSize[1]);
1112  // cout << endl << "Xp " << GeoPara->mPos[0] << " Xs " << GeoPara->mSize[0] << " Yp " << GeoPara->mPos[1] << " Ys " << GeoPara->mSize[1] << endl;
1113 
1114  Double_t HiteRate = 0;
1115 
1116  Int_t iSecX = 0;
1117  Int_t iSecY = 0;
1118 
1119  Double_t planeStartX = GeoPara->mPos[0] - GeoPara->mSize[0];
1120  Double_t planeStopX = planeStartX + GeoPara->pSize[iSecX][0];
1121 
1122  Double_t planeStartY = GeoPara->mPos[1] - GeoPara->mSize[1];
1123  Double_t planeStopY = planeStartY + GeoPara->pSize[iSecY][1];
1124 
1125  Double_t StartX =
1126  GeoPara->vOrigin[0]
1127  + 0.5 * GeoPara->pSize[iSecX][0]
1128  * GeoPara->cosX; // vOrigin points to the center of pad (0,0,0)
1129  Double_t StopX = StartX + GeoPara->pSize[iSecX][0] * GeoPara->cosX;
1130 
1131  Double_t StartY =
1132  GeoPara->vOrigin[1] + 0.5 * GeoPara->pSize[iSecY][1] * GeoPara->cosY;
1133  Double_t StopY = StartY + GeoPara->pSize[iSecY][1] * GeoPara->cosY;
1134 
1135  Int_t xSteps = 0;
1136  Int_t ySteps = 0;
1137 
1138  // cout << "x " << GeoPara->pSize[iSecX][0] << " y " << GeoPara->pSize[iSecX][1] << endl;
1139 
1140  // printf("stX %6d spX %6d stY %6d spY %6d\n", (Int_t)StartX, (Int_t)StopX, (Int_t)StartY, (Int_t)StopY);
1141 
1142  //Int_t xStepDirection = GeoPara->vX[0] / fabs(GeoPara->vX[0]); // is the next pad (1,0,0) on the left or right side?
1143  //Int_t yStepDirection = GeoPara->vY[1] / fabs(GeoPara->vY[1]); // is the next pad (0,1,0) on the upper or lower side?
1144 
1145  //----------------------------------------------------------------------------------------
1146 
1147  //if (GeoPara->rot_angle == 1)
1148  //if (GeoPara->rot_angle != 3)
1149  for (Int_t iR = 0; iR < GeoPara->nRow; iR++) // rows
1150  {
1151  StartX =
1152  GeoPara->vOrigin[0]
1153  + 0.5 * GeoPara->pSize[iSecX][0] * GeoPara->cosX; // why to the left?
1154  StopX = StartX + GeoPara->pSize[iSecX][0] * GeoPara->cosX;
1155  planeStartX = GeoPara->mPos[0] - GeoPara->mSize[0];
1156  planeStopX = planeStartX + GeoPara->pSize[iSecX][0];
1157 
1158  for (Int_t iC = 0; iC < GeoPara->nCol; iC++) // for all columns
1159  {
1160  xSteps = GeoPara->pSize[iSecX][0] - 1; // 1 Step / mm
1161  ySteps = GeoPara->pSize[iSecY][1] - 1;
1162 
1163  if (Fast) {
1164  //DE
1165  // if (GeoPara->mPos[0] > -1 && GeoPara->mPos[1] > -1)
1166  if (GeoPara->mPos[0] < 1
1167  && GeoPara->mPos[1] < 1) // copy the bottom left quadrant
1168  {
1169  HiteRate = CalcHitRate(GeoPara,
1170  StartX,
1171  StopX,
1172  xSteps,
1173  StartY,
1174  StopY,
1175  ySteps,
1176  GeoPara->mPos,
1177  Topview,
1178  c0);
1179  h1HitPad->Fill(HiteRate, 4); // weight 4 for each quadrant
1180  }
1181  }
1182 
1183  else // slow, for each module
1184  {
1185  HiteRate = CalcHitRate(GeoPara,
1186  StartX,
1187  StopX,
1188  xSteps,
1189  StartY,
1190  StopY,
1191  ySteps,
1192  GeoPara->mPos,
1193  Topview,
1194  c0);
1195  h1HitPad->Fill(HiteRate);
1196  h1HitPadModule->Fill(HiteRate); // single module, goes into root file
1197  }
1198 
1199  // fill HitRate into h2Layer histo
1200 
1201  Int_t mStepX = Int_t((planeStartX - GeoPara->mPos[0]));
1202  Int_t mStepY = Int_t((planeStartY - GeoPara->mPos[1]));
1203 
1204  for (Int_t stepY = int(planeStartY / mm2bin);
1205  stepY < int(planeStopY / mm2bin);
1206  stepY++) {
1207  // mStepX = Int_t((planeStartX-GeoPara->mPos[0]));
1208 
1209  for (Int_t stepX = int(planeStartX / mm2bin);
1210  stepX < int(planeStopX / mm2bin);
1211  stepX++) {
1212 
1213  if (Fast) {
1214  //DE
1215  // if (GeoPara->mPos[0]/*GeoPara->mPos[0]*/ > -1 && GeoPara->mPos[1]/*GeoPara->mPos[1]*/ > -1)
1216  if (GeoPara->mPos[0] /*GeoPara->mPos[0]*/ < 1
1217  && GeoPara->mPos[1] /*GeoPara->mPos[1]*/ < 1) {
1218 
1219  h2Layer->SetBinContent(stepX + int(winsize / mm2bin),
1220  stepY + int(winsize / mm2bin),
1221  HiteRate); // bin coordiantes
1222  h2Layer->SetBinContent(-1 * stepX + int(winsize / mm2bin),
1223  stepY + int(winsize / mm2bin),
1224  HiteRate); // bin coordiantes
1225  h2Layer->SetBinContent(stepX + int(winsize / mm2bin),
1226  -1 * stepY + int(winsize / mm2bin),
1227  HiteRate); // bin coordiantes
1228  h2Layer->SetBinContent(-1 * stepX + int(winsize / mm2bin),
1229  -1 * stepY + int(winsize / mm2bin),
1230  HiteRate); // bin coordiantes
1231 
1232  if (GeoPara->moduleId == 5) {
1233  // cout << "filling 5 " << mStepX << " " << mStepY << " " << HiteRate << endl;
1234  h2Module->Fill(mStepX,
1235  mStepY,
1236  HiteRate); // single module, goes into root file
1237  }
1238  }
1239  }
1240 
1241  else // slow
1242  {
1243 
1244  h2Layer->SetBinContent(stepX + int(winsize / mm2bin),
1245  stepY + int(winsize / mm2bin),
1246  HiteRate); // bin coordinates
1247 
1248  // cout << "StepX " << stepX << " StepY " << stepY << endl;
1249 
1250  if (GeoPara->moduleId == 5) {
1251  cout << "filling 5 " << mStepX << " " << mStepY << " " << HiteRate
1252  << endl;
1253  h2Module->Fill(mStepX,
1254  mStepY,
1255  HiteRate); // single module, goes into root file
1256  }
1257  // cout << "mStepX " << mStepX << " mStepY " << mStepY << endl;
1258  }
1259 
1260  mStepX += mm2bin;
1261  }
1262 
1263  mStepY += mm2bin;
1264  }
1265 
1266  //printf("Sx Sy (%d,%d) nC nR (%d,%d) iC iR (%d,%d) SC SR (%d,%d) Px Py (%.1f,%.1f) StartX StartY (%.1f,%.1f)\n",iSecX,iSecY,nC,nR,iC,iR,SecCol,SecRow,Psize[0+iSecX*nSec],Psize[1+iSecY*nSec],StartX,StartY);
1267 
1268  // if (iC == GeoPara->sCol[iSecX]-1) // why -1 ??
1269  if (iC == GeoPara->sCol[iSecX]) {
1270  // cout << "iC " << iC << " " << GeoPara->nCol << " " << iSecX << endl;
1271  iSecX++;
1272  }
1273  StartX +=
1274  GeoPara->stepDirection[0] * GeoPara->pSize[iSecX][0] * GeoPara->cosX;
1275  StopX +=
1276  GeoPara->stepDirection[0] * GeoPara->pSize[iSecX][0] * GeoPara->cosX;
1277  planeStartX += GeoPara->stepDirection[0] * GeoPara->pSize[iSecX][0];
1278  planeStopX += GeoPara->stepDirection[0] * GeoPara->pSize[iSecX][0];
1279  // StartX += GeoPara->pSize[iSecX][0] * GeoPara->cosX;
1280  // StopX += GeoPara->pSize[iSecX][0] * GeoPara->cosX;
1281  // planeStartX += GeoPara->pSize[iSecX][0];
1282  // planeStopX += GeoPara->pSize[iSecX][0];
1283  }
1284 
1285  iSecX = 0;
1286 
1287  // if (iR == GeoPara->sRow[iSecY]-1) // why -1 ??
1288  if (iR == GeoPara->sRow[iSecY]) {
1289  // cout << "iR " << iR << " " << GeoPara->nRow << " " << iSecY << endl;
1290  iSecY++;
1291  }
1292 
1293  StartY +=
1294  GeoPara->stepDirection[1] * GeoPara->pSize[iSecY][1] * GeoPara->cosY;
1295  StopY +=
1296  GeoPara->stepDirection[1] * GeoPara->pSize[iSecY][1] * GeoPara->cosY;
1297  planeStartY += GeoPara->stepDirection[1] * GeoPara->pSize[iSecY][1];
1298  planeStopY += GeoPara->stepDirection[1] * GeoPara->pSize[iSecY][1];
1299  // StartY += GeoPara->pSize[iSecY][1] * GeoPara->cosY;
1300  // StopY += GeoPara->pSize[iSecY][1] * GeoPara->cosY;
1301  // planeStartY += GeoPara->pSize[iSecY][1];
1302  // planeStopY += GeoPara->pSize[iSecY][1];
1303  }
1304 
1305  //----------------------------------------------------------------------------------------
1306 
1307  for (Int_t i = 0; i < 3; i++)
1308  Topview[i]->Write("", TObject::kOverwrite);
1309 
1310  h2Layer->Write("", TObject::kOverwrite);
1311  h1HitPad->Write("", TObject::kOverwrite);
1312  h2Module->Write("", TObject::kOverwrite);
1313  h1HitPadModule->Write("", TObject::kOverwrite);
1314 
1315  delete h2Module;
1316  delete h1HitPadModule;
1317 }
1318 
1319 
1321  TH2F* /*Layer*/,
1322  TCanvas* c1) {
1323  //----------------------Sector--------------------------------------
1324  Double_t SecXStart = 0.0;
1325  Double_t SecYStart = 0.0;
1326  Double_t SecXStop = 0.0;
1327  Double_t SecYStop = 0.0;
1328 
1329  for (Int_t iSec = 0; iSec < GeoPara->nSec - 1;
1330  iSec++) // would be enough to iterate up to nSec-1
1331  {
1332 
1333  if (GeoPara->sSize[iSec][0] < 2 * GeoPara->mSize[0]
1334  && GeoPara->sSize[iSec][0] > 0) // in x direction
1335  {
1336  SecXStart += GeoPara->sSize[iSec][0];
1337  SecXStop = SecXStart;
1338  } else {
1339  SecXStart = 0.0;
1340  SecXStop = GeoPara->sSize[iSec][0];
1341  }
1342 
1343  if (GeoPara->sSize[iSec][1] < 2 * GeoPara->mSize[1]
1344  && GeoPara->sSize[iSec][1] > 0) // in x direction
1345  {
1346  SecYStart += GeoPara->sSize[iSec][1];
1347  SecYStop = SecYStart;
1348  } else {
1349  SecYStart = 0.0;
1350  SecYStop = GeoPara->sSize[iSec][1];
1351  }
1352 
1353 
1354  TLine* sector = new TLine(GeoPara->mPos[0] - GeoPara->mSize[0] + SecXStart,
1355  GeoPara->mPos[1] - GeoPara->mSize[1] + SecYStart,
1356  GeoPara->mPos[0] - GeoPara->mSize[0] + SecXStop,
1357  GeoPara->mPos[1] - GeoPara->mSize[1] + SecYStop);
1358  sector->SetLineColor(15);
1359  sector->SetLineStyle(2);
1360 
1361  TPolyMarker* corner = new TPolyMarker(1);
1362  corner->SetPoint(
1363  0,
1364  GeoPara->mPos[0] - GeoPara->stepDirection[0] * GeoPara->mSize[0],
1365  GeoPara->mPos[1] - GeoPara->stepDirection[1] * GeoPara->mSize[1]);
1366  corner->SetMarkerStyle(21);
1367  corner->SetMarkerSize(.8);
1368 
1369  if (fDraw) {
1370  c1->cd(1);
1371  sector->Draw("same");
1372  corner->Draw("same");
1373  }
1374  }
1375 
1376 
1377  //----------------------Module--------------------------------------
1378  TBox* module = new TBox(GeoPara->mPos[0] - GeoPara->mSize[0],
1379  GeoPara->mPos[1] - GeoPara->mSize[1],
1380  GeoPara->mPos[0] + GeoPara->mSize[0],
1381  GeoPara->mPos[1] + GeoPara->mSize[1]);
1382  module->SetFillStyle(0);
1383  module->SetLineColor(1);
1384 
1385  TBox* M_inner = new TBox(GeoPara->mPos[0] - 100,
1386  GeoPara->mPos[1] - 100,
1387  GeoPara->mPos[0] + 100,
1388  GeoPara->mPos[1] + 100);
1389  // M_inner->SetUniqueID(ModuleId);
1390  M_inner->SetFillColor(kWhite);
1391 
1392  if (fDraw) {
1393  c1->cd(1);
1394  module->Draw("same"); // black module frame
1395  // M_inner->Draw("same"); // white box in module center // do not draw fot the time being
1396  c1->Write("", TObject::kOverwrite);
1397  }
1398 }
1399 // --------------------------------------------------------------------
1400 
1401 
1403  TH2F* /*Layer*/,
1404  TCanvas* c1) {
1405  //----------------------Pad--------------------------------------
1406  // const Int_t nR = GeoPara->nRow;
1407  // const Int_t nC = GeoPara->nCol;
1408 
1409  Int_t iSecX = 0;
1410  Int_t iSecY = 0;
1411 
1412  Double_t StartX = GeoPara->mPos[0] - GeoPara->mSize[0];
1413  Double_t StartY = GeoPara->mPos[1] - GeoPara->mSize[1];
1414 
1415  Int_t SecCol = GeoPara->sCol[iSecX];
1416  Int_t SecRow = GeoPara->sRow[iSecY];
1417 
1418  for (Int_t iR = 0; iR < GeoPara->nRow; iR++) // rows
1419  {
1420  StartX = GeoPara->mPos[0] - GeoPara->mSize[0];
1421  for (Int_t iC = 0; iC < GeoPara->nCol; iC++) // cols
1422  {
1423  TLine* Pa = new TLine(StartX, // - low
1424  StartY,
1425  StartX + GeoPara->pSize[iSecX][0],
1426  StartY);
1427  TLine* Pb = new TLine(StartX, // - high
1428  StartY + GeoPara->pSize[iSecY][1],
1429  StartX + GeoPara->pSize[iSecX][0],
1430  StartY + GeoPara->pSize[iSecY][1]);
1431  TLine* Pc = new TLine(StartX, // | left
1432  StartY,
1433  StartX,
1434  StartY + GeoPara->pSize[iSecY][1]);
1435  TLine* Pd = new TLine(StartX + GeoPara->pSize[iSecX][0], // | right
1436  StartY,
1437  StartX + GeoPara->pSize[iSecX][0],
1438  StartY + GeoPara->pSize[iSecY][1]);
1439  c1->cd(1);
1440  Pa->SetLineColor(17);
1441  //Pa->SetLineStyle(3);
1442  Pa->Draw("same");
1443 
1444  Pb->SetLineColor(17);
1445  //Pb->SetLineStyle(3);
1446  Pb->Draw("same");
1447 
1448  Pc->SetLineColor(17);
1449  //Pc->SetLineStyle(3);
1450  Pc->Draw("same");
1451 
1452  Pd->SetLineColor(17);
1453  //Pd->SetLineStyle(3);
1454  Pd->Draw("same");
1455 
1456  //printf("Sx Sy (%d,%d) nC nR (%d,%d) iC iR (%d,%d) SC SR (%d,%d) Px Py (%.1f,%.1f) StartX StartY (%.1f,%.1f)\n",iSecX,iSecY,GeoPara->nCol,GeoPara->nRow,iC,iR,SecCol,SecRow,GeoPara->pSize[iSecX][0],GeoPara->pSize[iSecY][1],StartX,StartY);
1457 
1458  if (iC == SecCol - 1) {
1459  iSecX++;
1460  SecCol += GeoPara->sCol[iSecX];
1461  }
1462  StartX += GeoPara->pSize[iSecX][0];
1463  }
1464  iSecX = 0;
1465  if (iR == SecRow - 1) {
1466  iSecY++;
1467  SecRow += GeoPara->sRow[iSecY];
1468  }
1469  StartY += GeoPara->pSize[iSecY][1];
1470  }
1471 }
1472 // --------------------------------------------------------------------
1473 
1474 
1475 // ------DrawDigi------------------------------------------------------
1477 // --------------------------------------------------------------------
1478 
1479 
1480 // ---- Register ------------------------------------------------------
1482  //FairRootManager::Instance()->Register("TrdDigi","Trd Digi", fDigiCollection, IsOutputBranchPersistent("TrdDigi"));
1483  //FairRootManager::Instance()->Register("TrdDigiMatch","Trd Digi Match", fDigiMatchCollection, IsOutputBranchPersistent("TrdDigiMatch"));
1484 }
1485 // --------------------------------------------------------------------
1486 
CbmTrdParModDigi::GetSectorSizeY
Double_t GetSectorSizeY(Int_t i) const
Definition: CbmTrdParModDigi.h:41
exp
friend F32vec4 exp(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:134
CbmTrdHitRateQa::fStation
Int_t fStation
Definition: CbmTrdHitRateQa.h:144
CbmTrdHitRateQa::tFile
TFile * tFile
Definition: CbmTrdHitRateQa.h:139
CbmTrdHitRateQa::fLayer
Int_t fLayer
Definition: CbmTrdHitRateQa.h:145
CbmTrdHitRateQa::fDigiCollection
TClonesArray * fDigiCollection
Trd MC points.
Definition: CbmTrdHitRateQa.h:212
HitRateGeoPara::vY
Double_t vY[3]
Definition: CbmTrdHitRateQa.h:42
CbmTrdAddress.h
Helper class to convert unique channel ID back and forth.
CbmTrdHitRateQa::fGeoHandler
CbmTrdGeoHandler * fGeoHandler
Definition: CbmTrdHitRateQa.h:220
HitRateGeoPara
struct HitRateGeoPara HitRateGeoPara
HitRateGeoPara::nSec
Int_t nSec
Definition: CbmTrdHitRateQa.h:32
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
CbmTrdParModDigi::GetNofRows
Int_t GetNofRows() const
Definition: CbmTrdParModDigi.cxx:340
CbmTrdParModDigi::GetNofColumnsInSector
Int_t GetNofColumnsInSector(Int_t i) const
Definition: CbmTrdParModDigi.cxx:359
CbmTrdHitRateQa::FinishEvent
virtual void FinishEvent()
Definition: CbmTrdHitRateQa.cxx:547
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTrdParSetAsic
Describe TRD module ASIC settings (electronic gain, delays, etc)
Definition: CbmTrdParSetAsic.h:18
CbmTrdHitRateQa::fAsicPar
CbmTrdParSetAsic * fAsicPar
MC Track information.
Definition: CbmTrdHitRateQa.h:216
CbmTrdHitRateQa::fPlane
Int_t fPlane
Definition: CbmTrdHitRateQa.h:143
CbmTrdHitRateQa::fDigiMap
std::map< std::pair< Int_t, std::pair< Int_t, Int_t > >, CbmTrdDigi * > fDigiMap
Definition: CbmTrdHitRateQa.h:224
CbmTrdAddress::GetLayerId
static UInt_t GetLayerId(UInt_t address)
Return layer ID from address.
Definition: CbmTrdAddress.h:69
HitRateGeoPara::moduleId
Int_t moduleId
Definition: CbmTrdHitRateQa.h:22
CbmTrdParModDigi::GetSizeX
Double_t GetSizeX() const
Definition: CbmTrdParModDigi.h:109
CbmTrdRadiator.h
CbmTrdHitRateQa::DrawDigi
void DrawDigi()
Definition: CbmTrdHitRateQa.cxx:1476
CbmTrdParModGeo.h
CbmTrdParSetAsic.h
CbmTrdGeoHandler
Definition: CbmTrdGeoHandler.h:29
CbmTrdHitRateQa::Register
void Register()
Definition: CbmTrdHitRateQa.cxx:1481
CbmTrdHitRateQa::CbmTrdHitRateQa
CbmTrdHitRateQa()
Definition: CbmTrdHitRateQa.cxx:47
CbmTrdParSet::GetNrOfModules
virtual Int_t GetNrOfModules() const
Definition: CbmTrdParSet.h:34
CbmTrdHitRateQa.h
HitRateGeoPara::mSize
Double_t mSize[3]
Definition: CbmTrdHitRateQa.h:27
HitRateGeoPara::vX
Double_t vX[3]
Definition: CbmTrdHitRateQa.h:41
CbmTrdParModDigi::GetSectorSizeX
Double_t GetSectorSizeX(Int_t i) const
Definition: CbmTrdParModDigi.h:40
HitRateGeoPara
Definition: CbmTrdHitRateQa.h:21
CbmTrdHitRateQa::SetParContainers
virtual void SetParContainers()
Definition: CbmTrdHitRateQa.cxx:130
CbmTrdHitRateQa::GetModuleInformation
void GetModuleInformation()
Definition: CbmTrdHitRateQa.cxx:555
CbmTrdParModGeo
Definition of geometry for one TRD module.
Definition: CbmTrdParModGeo.h:12
CbmTrdParModDigi::GetNofSectors
Int_t GetNofSectors() const
Definition: CbmTrdParModDigi.h:49
CbmTrdParSet::GetModuleId
virtual Int_t GetModuleId(Int_t i) const
Definition: CbmTrdParSet.cxx:32
winsize
#define winsize
Definition: CbmTrdHitRateQa.cxx:35
CbmTrdGeoHandler.h
Helper class to extract information from the GeoManager.
HitRateGeoPara::pSize
Double_t pSize[3][3]
Definition: CbmTrdHitRateQa.h:30
HitRateGeoPara::vN
Double_t vN[3]
Definition: CbmTrdHitRateQa.h:43
HitRateGeoPara::layerId
Int_t layerId
Definition: CbmTrdHitRateQa.h:23
CbmTrdParModDigi::GetOrientation
Int_t GetOrientation() const
Definition: CbmTrdParModDigi.h:35
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
CbmTrdHitRateQa::fDraw
Bool_t fDraw
Definition: CbmTrdHitRateQa.h:141
HitRateGeoPara::stepDirection
Int_t stepDirection[3]
Definition: CbmTrdHitRateQa.h:48
CbmTrdParModDigi.h
CbmTrdHitRateQa::CalcHitRate
Double_t CalcHitRate(HitRateGeoPara *GeoPara, Double_t StartX, Double_t StopX, Int_t xSteps, Double_t StartY, Double_t StopY, Int_t ySteps, Double_t *Mpos, TH2F *Topview[3], TCanvas *c0)
Definition: CbmTrdHitRateQa.cxx:1002
HitRateGeoPara::nCol
Int_t nCol
Definition: CbmTrdHitRateQa.h:35
HitRateGeoPara::sCol
Int_t sCol[3]
Definition: CbmTrdHitRateQa.h:37
CbmTrdParSet::GetModulePar
virtual const CbmTrdParMod * GetModulePar(Int_t detId) const
Definition: CbmTrdParSet.cxx:45
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmTrdHitRateQa::fMCStacks
TClonesArray * fMCStacks
Corresponding MCPoints to TRD digis.
Definition: CbmTrdHitRateQa.h:214
HitRateGeoPara::lambda
Double_t lambda
Definition: CbmTrdHitRateQa.h:45
CbmTrdHitRateQa::Exec
virtual void Exec(Option_t *option)
Definition: CbmTrdHitRateQa.cxx:199
CbmTrdParSetGeo
Definition: CbmTrdParSetGeo.h:9
CbmTrdHitRateQa::fTrdPoints
TClonesArray * fTrdPoints
Definition: CbmTrdHitRateQa.h:211
HitRateGeoPara::rot_angle
Int_t rot_angle
Definition: CbmTrdHitRateQa.h:33
HitRateGeoPara::cosX
Double_t cosX
Definition: CbmTrdHitRateQa.h:46
CbmTrdHitRateQa::DrawPads
void DrawPads(HitRateGeoPara *GeoPara, TH2F *Layer, TCanvas *c1)
Definition: CbmTrdHitRateQa.cxx:1402
CbmTrdParSetDigi.h
HitRateGeoPara::sRow
Int_t sRow[3]
Definition: CbmTrdHitRateQa.h:38
HitRateGeoPara::sSize
Double_t sSize[3][3]
Definition: CbmTrdHitRateQa.h:29
CbmTrdHitRateQa::fDigiPar
CbmTrdParSetDigi * fDigiPar
Definition: CbmTrdHitRateQa.h:217
CbmTrdParModDigi::GetPosition
void GetPosition(Int_t sectorId, Int_t columnId, Int_t rowId, TVector3 &padPos, TVector3 &padSize) const
Definition: CbmTrdParModDigi.cxx:806
CbmTrdHitRateQa::Init
virtual InitStatus Init()
Definition: CbmTrdHitRateQa.cxx:162
HitRateGeoPara::vOrigin
Double_t vOrigin[3]
Definition: CbmTrdHitRateQa.h:40
CbmTrdHitRateQa
Definition: CbmTrdHitRateQa.h:52
CbmTrdHitRateQa::DrawBorders
void DrawBorders(HitRateGeoPara *GeoPara, TH2F *Layer, TCanvas *c1)
Definition: CbmTrdHitRateQa.cxx:1320
CbmTrdHitRateQa::HistoInit
void HistoInit(TCanvas *&c1, TCanvas *&c2, TH2F *&Layer, TH1F *&HitPad, Double_t ZRangeL, Double_t ZRangeU, Double_t mm2bin)
Definition: CbmTrdHitRateQa.cxx:478
CbmTrdParModDigi::GetSizeY
Double_t GetSizeY() const
Definition: CbmTrdParModDigi.h:110
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmTrdHitRateQa::fDigiMatchCollection
TClonesArray * fDigiMatchCollection
TRD digis.
Definition: CbmTrdHitRateQa.h:213
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmTrdParModGeo::GetZ
virtual Double_t GetZ() const
Definition: CbmTrdParModGeo.h:32
CbmTrdHitRateQa::ReInit
virtual InitStatus ReInit()
Definition: CbmTrdHitRateQa.cxx:145
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmTrdParSetDigi
Definition: CbmTrdParSetDigi.h:15
HitRateGeoPara::mPos
Double_t mPos[3]
Definition: CbmTrdHitRateQa.h:26
CbmTrdParModGeo::GetX
virtual Double_t GetX() const
Definition: CbmTrdParModGeo.h:22
CbmTrdHitRateQa::fGeoPar
CbmTrdParSetGeo * fGeoPar
Definition: CbmTrdHitRateQa.h:218
CbmTrdParModGeo::GetY
virtual Double_t GetY() const
Definition: CbmTrdParModGeo.h:27
HitRateGeoPara::cosY
Double_t cosY
Definition: CbmTrdHitRateQa.h:47
HitRateGeoPara::nRow
Int_t nRow
Definition: CbmTrdHitRateQa.h:36
CbmTrdHitRateQa::GetModuleInformationFromDigiPar
void GetModuleInformationFromDigiPar(HitRateGeoPara *GeoPara, Bool_t Fast, Bool_t Lines, Int_t VolumeID, TH2F *Layer, TCanvas *c1, TH1F *HitPad, TCanvas *c2, TH2F *Topview[3], TCanvas *c0, Double_t mm2bin)
Definition: CbmTrdHitRateQa.cxx:595
CbmTrdHitRateQa::~CbmTrdHitRateQa
virtual ~CbmTrdHitRateQa()
Definition: CbmTrdHitRateQa.cxx:119
CbmTrdHitRateQa::Histo
void Histo(HitRateGeoPara *GeoPara, Bool_t Fast, TH2F *Layer, TCanvas *c1, TH1F *HitPad, TCanvas *c2, TH2F *Topview[3], TCanvas *c0, Double_t mm2bin)
Definition: CbmTrdHitRateQa.cxx:1064
HitRateGeoPara::stationId
Int_t stationId
Definition: CbmTrdHitRateQa.h:24
CbmTrdParModDigi::GetNofColumns
Int_t GetNofColumns() const
Definition: CbmTrdParModDigi.cxx:321