CbmRoot
CbmTofTests.cxx
Go to the documentation of this file.
1 // ------------------------------------------------------------------
2 // ----- CbmTofTests -----
3 // ----- Created 29/08/2013 by pal -----
4 // ------------------------------------------------------------------
5 
6 #include "CbmTofTests.h"
7 
8 // TOF Classes and includes
9 #include "CbmTofAddress.h" // in cbmdata/tof
10 #include "CbmTofCell.h" // in tof/TofData
11 #include "CbmTofDetectorId_v12b.h" // in cbmdata/tof
12 #include "CbmTofDetectorId_v14a.h" // in cbmdata/tof
13 #include "CbmTofDigi.h" // in cbmdata/tof
14 #include "CbmTofDigiBdfPar.h" // in tof/TofParam
15 #include "CbmTofDigiPar.h" // in tof/TofParam
16 #include "CbmTofGeoHandler.h" // in tof/TofTools
17 #include "CbmTofHit.h" // in cbmdata/tof
18 #include "CbmTofPoint.h" // in cbmdata/tof
19 
20 // CBMroot classes and includes
21 #include "CbmMCTrack.h"
22 #include "CbmMatch.h"
23 #include "FairMCEventHeader.h"
24 /*
25 #include "CbmGlobalTrack.h"
26 #include "CbmHadron.h"
27 #include "CbmStsHit.h"
28 #include "CbmStsPoint.h"
29 #include "CbmStsTrack.h"
30 */
31 
32 // FAIR classes and includes
33 #include "FairLogger.h"
34 #include "FairRootManager.h"
35 #include "FairRunAna.h"
36 #include "FairRuntimeDb.h"
37 
38 // ROOT Classes and includes
39 #include "Riostream.h"
40 #include "TClonesArray.h"
41 #include "TFile.h"
42 #include "TH1.h"
43 #include "TH2.h"
44 #include "TMath.h"
45 #include "TROOT.h"
46 #include "TRandom.h"
47 #include "TString.h"
48 
49 using std::cout;
50 using std::endl;
51 
52 //___________________________________________________________________
53 //
54 // CbmTofTests
55 //
56 // Task for analysis of hadron spectra
57 //
58 // ------------------------------------------------------------------
60  : FairTask("HadronAnalysis")
61  , fEvents(0)
62  , fMCEventHeader(NULL)
64  , fTofId(NULL)
65  , fChannelInfo(NULL)
66  , iNbSmTot(0)
67  , fvTypeSmOffs()
68  , iNbRpcTot(0)
69  , fvSmRpcOffs()
70  , iNbChTot(0)
71  , fvRpcChOffs()
72  , fDigiPar(NULL)
73  , fDigiBdfPar(NULL)
74  , fTofPointsColl(NULL)
75  , fMcTracksColl(NULL)
76  , fTofDigisColl(NULL)
77  , fTofHitsColl(NULL)
78  , fTofHitMatchColl(NULL)
79  , fhTestingTime(NULL)
80  , fhPointMapXY(NULL)
81  , fhPointMapXZ(NULL)
82  , fhPointMapYZ(NULL)
83  , fhPointMapAng(NULL)
84  , fhPointMapSph(NULL)
85  , fhDigiMapXY(NULL)
86  , fhDigiMapXZ(NULL)
87  , fhDigiMapYZ(NULL)
88  , fhDigiMapAng(NULL)
89  , fhDigiMapSph(NULL)
90  , fhHitMapXY(NULL)
91  , fhHitMapXZ(NULL)
92  , fhHitMapYZ(NULL)
93  , fhHitMapAng(NULL)
94  , fhHitMapSph(NULL)
95  , fhFluxMap(NULL)
96  , fhDigiFluxMap(NULL)
97  , fhHitFluxMap(NULL)
98  , fhDigiRateCh(NULL)
99  , fhDataRateCh(NULL)
100  , fhDataRateRpc(NULL)
101  , fhDataRateSm(NULL)
102  , fhDataRateType(NULL)
103  , fhTofDataPerEvt(NULL)
104  , fhTofDataRedEvt(NULL)
105  , fhOptLnkRpc(NULL)
106  , fhOptLnkSm(NULL)
107  , fhOptLnkType(NULL)
108  , fhTofRes(NULL)
109  , fhTofResSing(NULL)
110  , fhTofPosDifX(NULL)
111  , fhTofPosDifY(NULL)
112  , fhTofPosDifZ(NULL)
113  , fhTofPosDifSingXX(NULL)
114  , fhTofPosDifSingXY(NULL)
115  , fhTofPosDifSingXZ(NULL)
116  , fhTofPosDifSingY(NULL)
117  , fhTofPosDifSingZ(NULL)
118  , fhTofPosDifXZSing(NULL)
119  , fhTofBadXPosSing(NULL)
120  , fhTofBadYPosSing(NULL)
121  , fhTofBadZPosSing(NULL)
122  , fhTofEff(NULL)
123  , fhTofMixing(NULL)
124  , fStart()
125  , fStop() {
126  cout << "CbmTofTests: Task started " << endl;
127 }
128 // ------------------------------------------------------------------
129 
130 // ------------------------------------------------------------------
131 CbmTofTests::CbmTofTests(const char* name, Int_t verbose)
132  : FairTask(name, verbose)
133  , fEvents(0)
134  , fMCEventHeader(NULL)
136  , fTofId(NULL)
137  , fChannelInfo(NULL)
138  , iNbSmTot(0)
139  , fvTypeSmOffs()
140  , iNbRpcTot(0)
141  , fvSmRpcOffs()
142  , iNbChTot(0)
143  , fvRpcChOffs()
144  , fDigiPar(NULL)
145  , fDigiBdfPar(NULL)
146  , fTofPointsColl(NULL)
147  , fMcTracksColl(NULL)
148  , fTofDigisColl(NULL)
149  , fTofHitsColl(NULL)
150  , fTofHitMatchColl(NULL)
151  , fhTestingTime(NULL)
152  , fhPointMapXY(NULL)
153  , fhPointMapXZ(NULL)
154  , fhPointMapYZ(NULL)
155  , fhPointMapAng(NULL)
156  , fhPointMapSph(NULL)
157  , fhDigiMapXY(NULL)
158  , fhDigiMapXZ(NULL)
159  , fhDigiMapYZ(NULL)
160  , fhDigiMapAng(NULL)
161  , fhDigiMapSph(NULL)
162  , fhHitMapXY(NULL)
163  , fhHitMapXZ(NULL)
164  , fhHitMapYZ(NULL)
165  , fhHitMapAng(NULL)
166  , fhHitMapSph(NULL)
167  , fhFluxMap(NULL)
168  , fhDigiFluxMap(NULL)
169  , fhHitFluxMap(NULL)
170  , fhDigiRateCh(NULL)
171  , fhDataRateCh(NULL)
172  , fhDataRateRpc(NULL)
173  , fhDataRateSm(NULL)
174  , fhDataRateType(NULL)
175  , fhTofDataPerEvt(NULL)
176  , fhTofDataRedEvt(NULL)
177  , fhOptLnkRpc(NULL)
178  , fhOptLnkSm(NULL)
179  , fhOptLnkType(NULL)
180  , fhTofRes(NULL)
181  , fhTofResSing(NULL)
182  , fhTofPosDifX(NULL)
183  , fhTofPosDifY(NULL)
184  , fhTofPosDifZ(NULL)
185  , fhTofPosDifSingXX(NULL)
186  , fhTofPosDifSingXY(NULL)
187  , fhTofPosDifSingXZ(NULL)
188  , fhTofPosDifSingY(NULL)
189  , fhTofPosDifSingZ(NULL)
190  , fhTofPosDifXZSing(NULL)
191  , fhTofBadXPosSing(NULL)
192  , fhTofBadYPosSing(NULL)
193  , fhTofBadZPosSing(NULL)
194  , fhTofEff(NULL)
195  , fhTofMixing(NULL)
196  , fStart()
197  , fStop() {}
198 // ------------------------------------------------------------------
199 
200 // ------------------------------------------------------------------
202  // Destructor
203  if (fGeoHandler) delete fGeoHandler;
204 }
205 // ------------------------------------------------------------------
206 /************************************************************************************/
207 // FairTasks inherited functions
208 InitStatus CbmTofTests::Init() {
209  if (kFALSE == RegisterInputs()) return kFATAL;
210 
211  if (kFALSE == InitParameters()) return kFATAL;
212 
213  if (kFALSE == LoadGeometry()) return kFATAL;
214 
215  if (kFALSE == CreateHistos()) return kFATAL;
216 
217  return kSUCCESS;
218 }
219 
221  // Initialize the TOF GeoHandler
222  Bool_t isSimulation = kFALSE;
223  Int_t iGeoVersion = fGeoHandler->Init(isSimulation);
224  if (k12b > iGeoVersion) {
225  LOG(error) << "CbmTofDigitizerBDF::InitParameters => Only compatible with "
226  "geometries after v12b !!!";
227  return kFALSE;
228  }
229 
230  LOG(info) << "CbmTofDigitizerBDF::InitParameters: GeoVersion " << iGeoVersion;
231 
232  switch (iGeoVersion) {
233  case k12b: fTofId = new CbmTofDetectorId_v12b(); break;
234  case k14a: fTofId = new CbmTofDetectorId_v14a(); break;
235  default:
236  LOG(error) << "CbmTofDigitizerBDF::InitParameters: Invalid Detector ID "
237  << iGeoVersion;
238  }
239  return kTRUE;
240 }
241 
243  LOG(info) << " CbmTofTests => Get the digi parameters for tof";
244 
245  // Get Base Container
246  FairRunAna* ana = FairRunAna::Instance();
247  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
248 
249  fDigiPar = (CbmTofDigiPar*) (rtdb->getContainer("CbmTofDigiPar"));
250 
251  fDigiBdfPar = (CbmTofDigiBdfPar*) (rtdb->getContainer("CbmTofDigiBdfPar"));
252 }
253 
254 void CbmTofTests::Exec(Option_t* /*option*/) {
255  // Task execution
256 
257  LOG(debug) << " CbmTofTests => New event";
258 
259  fStart.Set();
260  FillHistos();
261  fStop.Set();
262  fhTestingTime->Fill(fStop.GetSec() - fStart.GetSec()
263  + (fStop.GetNanoSec() - fStart.GetNanoSec()) / 1e9);
264 
265  if (0 == (fEvents % 100) && 0 < fEvents) {
266  cout << "-I- CbmTofTests::Exec : "
267  << "event " << fEvents << " processed." << endl;
268  }
269  fEvents += 1;
270 }
271 
273  // Normalisations
274  cout << "CbmTofTests::Finish up with " << fEvents << " analyzed events "
275  << endl;
276 
277  Double_t dEvtRate = 1. / fEvents; // [1/events]
278  Double_t dIntRate = 1.E7; // [interactions/s]
279  Double_t dOptLinkCapa = 2.5; // Nominal bandwidth [GByte/s]
280  Double_t dOptLinkAvBw =
281  0.8; // Bandwidth available for data transport [Nominal bandwidth ratio]
282  Double_t dKiloByte = 1024;
283  Double_t dMegaByte = 1024 * dKiloByte;
284  Double_t dGigaByte = 1024 * dMegaByte;
285 
286  cout << "<I> Normalisation factors " << dIntRate * dEvtRate << " [1/s], "
287  << dOptLinkCapa * dOptLinkAvBw << " [GByte/s]" << endl;
288 
289  fhFluxMap->Scale(dIntRate * dEvtRate);
290  fhDigiFluxMap->Scale(dIntRate * dEvtRate);
291  fhHitFluxMap->Scale(dIntRate * dEvtRate);
292  fhDigiRateCh->Scale(dIntRate * dEvtRate);
293  fhDataRateCh->Scale(dIntRate * dEvtRate / dMegaByte);
294  fhDataRateRpc->Scale(dIntRate * dEvtRate / dGigaByte);
295  fhDataRateSm->Scale(dIntRate * dEvtRate / dGigaByte);
296  fhDataRateType->Scale(dIntRate * dEvtRate / dGigaByte);
297  fhTofDataPerEvt->Scale(1 / dKiloByte);
298  // fhHitRateCh->Scale(dIntRate*dEvtRate);
299 
300  fhOptLnkRpc->Scale(dIntRate * dEvtRate / dGigaByte
301  / (dOptLinkCapa * dOptLinkAvBw));
302  fhOptLnkSm->Scale(dIntRate * dEvtRate / dGigaByte
303  / (dOptLinkCapa * dOptLinkAvBw));
304  fhOptLnkType->Scale(dIntRate * dEvtRate / dGigaByte
305  / (dOptLinkCapa * dOptLinkAvBw));
306 
307  WriteHistos();
308  // Prevent them from being sucked in by the CbmHadronAnalysis WriteHistograms method
309  DeleteHistos();
310 }
311 
312 /************************************************************************************/
313 // Functions common for all clusters approximations
315  FairRootManager* fManager = FairRootManager::Instance();
316  /*
317  fMCEventHeader = (CbmMCEventHeader*) fManager->GetObject("MCEventHeader");
318  if( NULL == fMCEventHeader)
319  {
320  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the MCEventHeader TClonesArray!!!";
321  return kFALSE;
322  } // if( NULL == fMCEventHeader)
323 */
324  fTofPointsColl = (TClonesArray*) fManager->GetObject("TofPoint");
325  if (NULL == fTofPointsColl) {
326  LOG(error) << "CbmTofTests::RegisterInputs => Could not get the TofPoint "
327  "TClonesArray!!!";
328  return kFALSE;
329  } // if( NULL == fTofPointsColl)
330 
331  fMcTracksColl = (TClonesArray*) fManager->GetObject("MCTrack");
332  if (NULL == fMcTracksColl) {
333  LOG(error) << "CbmTofTests::RegisterInputs => Could not get the MCTrack "
334  "TClonesArray!!!";
335  return kFALSE;
336  } // if( NULL == fMcTracksColl)
337 
338  fTofDigisColl = (TClonesArray*) fManager->GetObject("TofDigi");
339  if (NULL == fTofDigisColl) {
340  LOG(error) << "CbmTofTests::RegisterInputs => Could not get the TofDigi "
341  "TClonesArray!!!";
342  return kFALSE;
343  } // if( NULL == fTofDigisColl)
344 
345  fTofHitsColl = (TClonesArray*) fManager->GetObject("TofHit");
346  if (NULL == fTofHitsColl) {
347  LOG(error) << "CbmTofTests::RegisterInputs => Could not get the TofHit "
348  "TClonesArray!!!";
349  return kFALSE;
350  } // if( NULL == fTofHitsColl)
351 
352  fTofHitMatchColl = (TClonesArray*) fManager->GetObject("TofHitMatch");
353  if (NULL == fTofHitMatchColl) {
354  LOG(error) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
355  "TofHitMatch TClonesArray!!!";
356  return kFALSE;
357  } // if( NULL == fTofDigiMatchPointsColl)
358 
359  /*
360  fGlobalTracks = (TClonesArray*) fManager->GetObject("GlobalTrack");
361  if( NULL == fGlobalTracks)
362  {
363  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the GlobalTrack TClonesArray!!!";
364  return kFALSE;
365  } // if( NULL == fGlobalTracks)
366 
367  fHadrons = (TClonesArray*) fManager->GetObject("Hadron");
368  if( NULL == fHadrons)
369  {
370  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the Hadron TClonesArray!!!";
371  return kFALSE;
372  } // if( NULL == fHadrons)
373 
374  fStsTracks = (TClonesArray*) fManager->GetObject("StsTrack");
375  if( NULL == fStsTracks)
376  {
377  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the StsTrack TClonesArray!!!";
378  return kFALSE;
379  } // if( NULL == fStsTracks)
380  fStsHits = (TClonesArray*) fManager->GetObject("StsHit");
381  if( NULL == fStsHits)
382  {
383  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the StsHit TClonesArray!!!";
384  return kFALSE;
385  } // if( NULL == fStsHits)
386  fStsPoints = (TClonesArray*) fManager->GetObject("StsPoint");
387  if( NULL == fStsPoints)
388  {
389  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the StsPoint TClonesArray!!!";
390  return kFALSE;
391  } // if( NULL == fStsPoints)
392 
393  // PAL modif
394  fRichHits = (TClonesArray*) fManager->GetObject("RichHit");
395  if( NULL == fRichHits)
396  {
397  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the RichHit TClonesArray!!!";
398  fbRichThere = kFALSE;
399  } // if( NULL == fRichHits)
400  else fbRichThere = kTRUE;
401 
402  fTrdHits = (TClonesArray*) fManager->GetObject("TrdHit");
403  if( NULL == fTrdHits)
404  {
405  LOG(error)<<"CbmTofTests::RegisterInputs => Could not get the TrdHit TClonesArray!!!";
406  fbTrdThere = kFALSE;
407  } // if( NULL == fTrdHits)
408  else fbTrdThere = kTRUE;
409 */
410 
411  return kTRUE;
412 }
413 /************************************************************************************/
415  /*
416  Type 0: 5 RPC/SM, 24 SM, 32 ch/RPC => 3840 ch , 120 RPC ,
417  Type 1: 5 RPC/SM, 142 SM, 32 ch/RPC => 22720 ch => 26560 , 710 RPC => 830 , => 166
418  Type 3: 3 RPC/SM, 50 SM, 56 ch/RPC => 8400 ch => 34960 , 150 RPC => 980 , => 216
419  Type 4: 5 RPC/SM, 8 SM, 96 ch/RPC => 3840 ch => 38800 , 40 RPC => 1020 , => 224
420  Type 5: 5 RPC/SM, 8 SM, 96 ch/RPC => 3840 ch => 42640 , 40 RPC => 1060 , => 232
421  Type 6: 2 RPC/SM, 10 SM, 96 ch/RPC => 1920 ch => 44560 , 20 RPC => 1080 , => 242
422  */
423 
424  // Count the total number of channels and
425  // generate an array with the global channel index of the first channe in each RPC
426  Int_t iNbSmTypes = fDigiBdfPar->GetNbSmTypes();
427  fvTypeSmOffs.resize(iNbSmTypes);
428  fvSmRpcOffs.resize(iNbSmTypes);
429  fvRpcChOffs.resize(iNbSmTypes);
430  iNbSmTot = 0;
431  iNbRpcTot = 0;
432  iNbChTot = 0;
433  for (Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++) {
434  Int_t iNbSm = fDigiBdfPar->GetNbSm(iSmType);
435  Int_t iNbRpc = fDigiBdfPar->GetNbRpc(iSmType);
436 
437  fvTypeSmOffs[iSmType] = iNbSmTot;
438  iNbSmTot += iNbSm;
439 
440  fvSmRpcOffs[iSmType].resize(iNbSm);
441  fvRpcChOffs[iSmType].resize(iNbSm);
442 
443  for (Int_t iSm = 0; iSm < iNbSm; iSm++) {
444  fvSmRpcOffs[iSmType][iSm] = iNbRpcTot;
445  iNbRpcTot += iNbRpc;
446 
447  fvRpcChOffs[iSmType][iSm].resize(iNbRpc);
448  for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) {
449  fvRpcChOffs[iSmType][iSm][iRpc] = iNbChTot;
450  iNbChTot += fDigiBdfPar->GetNbChan(iSmType, iRpc);
451  } // for( Int_t iRpc = 0; iRpc < iNbRpc; iRpc++ )
452  } // for( Int_t iSm = 0; iSm < iNbSm; iSm++ )
453  } // for( Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++ )
454 
455  return kTRUE;
456 }
457 /************************************************************************************/
458 // ------------------------------------------------------------------
460  // Create histogramms
461 
462  TDirectory* oldir =
463  gDirectory; // <= To prevent histos from being sucked in by the param file of the TRootManager!
464  gROOT
465  ->cd(); // <= To prevent histos from being sucked in by the param file of the TRootManager !
466 
467  // Test class performance
468  fhTestingTime =
469  new TH1I("TofDigiBdf_TestingTime",
470  "Time needed to for the test processing in each event; Time [s]",
471  4000,
472  0.0,
473  4.0);
474  /*
475  Double_t ymin=-1.;
476  Double_t ymax=4.;
477  Double_t ptmmax=2.5;
478  Int_t ptm_nbx=30;
479  Int_t ptm_nby=30;
480 
481  Double_t v1_nbx=20.;
482  Double_t v1_nby=20.;
483  Double_t yvmax=1.3;
484 */
485  // xy - hit densities and rates
486  Int_t nbinx = 1500;
487  Int_t nbiny = 1000;
488  Int_t nbinz = 1500;
489  Double_t xrange = 750.;
490  Double_t yrange = 500.;
491  Double_t zmin = 950.;
492  Double_t zmax = 1100.;
493 
494  // angular densities for overlap check
495  Int_t iNbBinThetaX = 1200;
496  Double_t dThetaXMin = -60.0;
497  Double_t dThetaXMax = 60.0;
498  Int_t iNbBinThetaY = 800;
499  Double_t dThetaYMin = -40.0;
500  Double_t dThetaYMax = 40.0;
501  /*
502  Int_t iNbBinPhi = 100;
503  Double_t dPhiMin = 0;
504  Double_t dPhiMax = 10;
505  Int_t iNbBinTheta = 360;
506  Double_t dThetaMin = - 180.0;
507  Double_t dThetaMax = 180.0;
508  */
509  Int_t iNbBinPhi = 180;
510  Double_t dPhiMin = 0;
511  Double_t dPhiMax = TMath::Pi() * 90 / 180;
512  Int_t iNbBinTheta = 180;
513  Double_t dThetaMin = -TMath::Pi();
514  Double_t dThetaMax = TMath::Pi();
515 
516  // Mapping
517  // points
518  fhPointMapXY =
519  new TH2D("TofTests_PointsMapXY",
520  "Position of the Tof Points; X[cm]; Y[cm]; # [Points]",
521  nbinx,
522  -xrange,
523  xrange,
524  nbiny,
525  -yrange,
526  yrange);
527  fhPointMapXZ =
528  new TH2D("TofTests_PointsMapXZ",
529  "Position of the Tof Points; X[cm]; Z[cm]; # [Points]",
530  nbinx,
531  -xrange,
532  xrange,
533  nbinz,
534  zmin,
535  zmax);
536  fhPointMapYZ =
537  new TH2D("TofTests_PointsMapYZ",
538  "Position of the Tof Points; Y[cm]; Z[cm]; # [Points]",
539  nbiny,
540  -yrange,
541  yrange,
542  nbinz,
543  zmin,
544  zmax);
545  fhPointMapAng = new TH2D("TofTests_PointsMapAng",
546  "Position of the Tof Points; #theta_{x}[Deg.]; "
547  "#theta_{y}[Deg.]; # [Points]",
548  iNbBinThetaX,
549  dThetaXMin,
550  dThetaXMax,
551  iNbBinThetaY,
552  dThetaYMin,
553  dThetaYMax);
554  fhPointMapSph =
555  new TH2D("TofTests_PointsMapSph",
556  "Position of the Tof Points; #theta[rad.]; #phi[rad.]; # [Points]",
557  iNbBinTheta,
558  dThetaMin,
559  dThetaMax,
560  iNbBinPhi,
561  dPhiMin,
562  dPhiMax);
563  // Digis
564  fhDigiMapXY = new TH2D("TofTests_DigisMapXY",
565  "Position of the Tof Digis; X[cm]; Y[cm]; # [Digi]",
566  nbinx,
567  -xrange,
568  xrange,
569  nbiny,
570  -yrange,
571  yrange);
572  fhDigiMapXZ = new TH2D("TofTests_DigisMapXZ",
573  "Position of the Tof Digis; X[cm]; Z[cm]; # [Digi]",
574  nbinx,
575  -xrange,
576  xrange,
577  nbinz,
578  zmin,
579  zmax);
580  fhDigiMapYZ = new TH2D("TofTests_DigisMapYZ",
581  "Position of the Tof Digis; Y[cm]; Z[cm]; # [Digi]",
582  nbiny,
583  -yrange,
584  yrange,
585  nbinz,
586  zmin,
587  zmax);
588  fhDigiMapAng = new TH2D(
589  "TofTests_DigisMapAng",
590  "Position of the Tof Digis; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Digi]",
591  iNbBinThetaX,
592  dThetaXMin,
593  dThetaXMax,
594  iNbBinThetaY,
595  dThetaYMin,
596  dThetaYMax);
597  fhDigiMapSph =
598  new TH2D("TofTests_DigisMapSph",
599  "Position of the Tof Digis; #theta[rad.]; #phi[rad.]; # [Points]",
600  iNbBinTheta,
601  dThetaMin,
602  dThetaMax,
603  iNbBinPhi,
604  dPhiMin,
605  dPhiMax);
606 
607  // Hits
608  fhHitMapXY = new TH2D("TofTests_HitsMapXY",
609  "Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]",
610  nbinx,
611  -xrange,
612  xrange,
613  nbiny,
614  -yrange,
615  yrange);
616  fhHitMapXZ = new TH2D("TofTests_HitsMapXZ",
617  "Position of the Tof Hits; X[cm]; Z[cm]; # [Hits]",
618  nbinx,
619  -xrange,
620  xrange,
621  nbinz,
622  zmin,
623  zmax);
624  fhHitMapYZ = new TH2D("TofTests_HitsMapYZ",
625  "Position of the Tof Hits; Y[cm]; Z[cm]; # [Hits]",
626  nbiny,
627  -yrange,
628  yrange,
629  nbinz,
630  zmin,
631  zmax);
632  fhHitMapAng = new TH2D(
633  "TofTests_HitsMapAng",
634  "Position of the Tof Hits; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Hits]",
635  iNbBinThetaX,
636  dThetaXMin,
637  dThetaXMax,
638  iNbBinThetaY,
639  dThetaYMin,
640  dThetaYMax);
641  fhHitMapSph =
642  new TH2D("TofTests_HitsMapSph",
643  "Position of the Tof Hits; #theta[rad.]; #phi[rad.]; # [Points]",
644  iNbBinTheta,
645  dThetaMin,
646  dThetaMax,
647  iNbBinPhi,
648  dPhiMin,
649  dPhiMax);
650 
651  // Rates and data rates
652  Int_t iNbSmTypes = fDigiBdfPar->GetNbSmTypes();
653  fhFluxMap = new TH2D(
654  "TofTests_FluxMap",
655  "Tof Point rate as function of position; X[cm]; Y[cm]; Flux [1/(s*cm^2)]",
656  nbinx,
657  -xrange,
658  xrange,
659  nbiny,
660  -yrange,
661  yrange);
662  fhDigiFluxMap = new TH2D(
663  "TofTests_DigisFluxMap",
664  "Tof Hit rate as function of position; X[cm]; Y[cm]; Flux [Digi/(s*cm^2)]",
665  nbinx,
666  -xrange,
667  xrange,
668  nbiny,
669  -yrange,
670  yrange);
671  fhHitFluxMap = new TH2D(
672  "TofTests_HitsFluxMap",
673  "Tof Hit rate as function of position; X[cm]; Y[cm]; Flux [Hits/(s*cm^2)]",
674  nbinx,
675  -xrange,
676  xrange,
677  nbiny,
678  -yrange,
679  yrange);
680  fhDigiRateCh = new TH1D("TofTests_DigiRateCh",
681  "Digi rate per channel; Channel []; Rate [1/s]",
682  2 * iNbChTot,
683  0,
684  2 * iNbChTot);
685  fhDataRateCh = new TH1D("TofTests_DataRateCh",
686  "Data rate per channel; Channel []; Data Rate [kB/s]",
687  2 * iNbChTot,
688  0,
689  2 * iNbChTot);
690  fhDataRateRpc = new TH1D("TofTests_DataRateRpc",
691  "Data rate per RPC; RPC []; Rate [GB/s]",
692  iNbRpcTot,
693  0,
694  iNbRpcTot);
695  fhDataRateSm = new TH1D("TofTests_DataRateSm",
696  "Data rate per SM; SM []; Rate [GB/s]",
697  iNbSmTot,
698  0,
699  iNbSmTot);
700  fhDataRateType = new TH1D("TofTests_DataRateType",
701  "Data rate per SM; SM Type[]; Rate [GB/s]",
702  iNbSmTypes,
703  0,
704  iNbSmTypes);
706  new TH1D("TofTests_DataPerEvt",
707  "Data per event for the full wall; Event Size [kB]",
708  1000,
709  0,
710  1000.0);
711  fhTofDataRedEvt = new TH1D("TofTests_DataRedEvt",
712  "Possible data reduction per event for the full "
713  "wall; Event Size Reduction [kB]",
714  iNbChTot,
715  0,
716  iNbChTot);
717  // fhHitRateCh = new TH1D("TofTests_HitRateCh", "Tof Hit rate per channel; Channel []; Rate [1/s]",
718  // iNbChTot, 0, iNbChTot);
719  fhOptLnkRpc = new TH1D("TofTests_OptLnkRpc",
720  "Number of optical links needed per RPC; RPC []",
721  iNbRpcTot,
722  0,
723  iNbRpcTot);
724  fhOptLnkSm =
725  new TH1D("TofTests_OptLnkSm",
726  "Number of optical links needed per SM; SM []; Optical Links []",
727  iNbSmTot,
728  0,
729  iNbSmTot);
730  fhOptLnkType = new TH1D(
731  "TofTests_OptLnkType",
732  "Number of optical links needed per SM type; SM Type[]; Optical Links []",
733  iNbSmTypes,
734  0,
735  iNbSmTypes);
736 
737  // Performances check
738  fhTofRes = new TH1I(
739  "TofTests_TimeRes",
740  "Time difference between TofHits and TofPoint; tMcPoint -tTofHit [ns]",
741  5000,
742  -5.0,
743  5.0);
744  fhTofResSing = new TH1I("TofTests_TimeResSing",
745  "Time difference between TofHits and TofPoint, only "
746  "1 MC Track/Point per Hit; tMcPoint -tTofHit [ns]",
747  5000,
748  -5.0,
749  5.0);
750 
751  fhTofPosDifX = new TH2D(
752  "TofTests_PosDifX",
753  "Position Accuracy of the Tof Hits in X; X[cm]; PtX - HitX[cm]; # [Hits]",
754  nbinx,
755  -xrange,
756  xrange,
757  200,
758  -50,
759  50);
760  fhTofPosDifY = new TH2D(
761  "TofTests_PosDifY",
762  "Position Accuracy of the Tof Hits in Y; Y[cm]; PtY - HitY[cm]; # [Hits]",
763  nbiny,
764  -yrange,
765  yrange,
766  200,
767  -50,
768  50);
769  fhTofPosDifZ = new TH2D(
770  "TofTests_PosDifZ",
771  "Position Accuracy of the Tof Hits in Z; Z[cm]; PtZ - HitZ[cm]; # [Hits]",
772  600,
773  950,
774  1100,
775  200,
776  -10,
777  10);
779  new TH2D("TofTests_PosDifSingXX",
780  "Position Accuracy of the Tof Hits in X, hits from single MC "
781  "point; Pt X[cm]; PtX - HitX[cm]; # [Hits]",
782  nbinx,
783  -xrange,
784  xrange,
785  500,
786  -50,
787  50);
789  new TH2D("TofTests_PosDifSingXY",
790  "Position Accuracy of the Tof Hits in X, hits from single MC "
791  "point; Pt Y[cm]; PtX - HitX[cm]; # [Hits]",
792  nbiny,
793  -yrange,
794  yrange,
795  500,
796  -50,
797  50);
799  new TH2D("TofTests_PosDifSingXZ",
800  "Position Accuracy of the Tof Hits in X, hits from single MC "
801  "point; Pt Z[cm]; PtX - HitX[cm]; # [Hits]",
802  nbinz,
803  zmin,
804  zmax,
805  500,
806  -50,
807  50);
809  new TH2D("TofTests_PosDifSingY",
810  "Position Accuracy of the Tof Hits in Y, hits from single MC "
811  "point; Pt Y[cm]; PtY - HitY[cm]; # [Hits]",
812  nbiny,
813  -yrange,
814  yrange,
815  500,
816  -50,
817  50);
819  new TH2D("TofTests_PosDifSingZ",
820  "Position Accuracy of the Tof Hits in Z, hits from single MC "
821  "point; Pt Z[cm]; PtZ - HitZ[cm]; # [Hits]",
822  600,
823  950,
824  1100,
825  200,
826  -10,
827  10);
829  new TH2D("TofTests_PosDifXZSing",
830  "Position Accuracy of the Tof Hits in Z, hits from single MC "
831  "point; PtX - HitX[cm]; PtZ - HitZ[cm]; # [Hits]",
832  200,
833  -50,
834  50,
835  200,
836  -10,
837  10);
838 
840  new TH2D("TofTests_BadXPosSing",
841  "Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]",
842  nbinx,
843  -xrange,
844  xrange,
845  nbiny,
846  -yrange,
847  yrange);
849  new TH2D("TofTests_BadYPosSing",
850  "Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]",
851  nbinx,
852  -xrange,
853  xrange,
854  nbiny,
855  -yrange,
856  yrange);
858  new TH2D("TofTests_BadZPosSing",
859  "Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]",
860  nbinx,
861  -xrange,
862  xrange,
863  nbiny,
864  -yrange,
865  yrange);
866 
867  fhTofEff = new TH1I("TofTests_TofEff",
868  "Fraction of tracks reaching Tof producing a non mixed "
869  "TofHit; # non-mixed Hits/ # Tof Tracks []",
870  1000,
871  0.0,
872  1.0);
873  fhTofMixing = new TH1I("TofTests_TofMix",
874  "Fraction of TofHits built from more than 1 McTrack; "
875  "# mixed Hits/ # Hits []",
876  1000,
877  0.0,
878  0.1);
879 
880  gDirectory->cd(
881  oldir
882  ->GetPath()); // <= To prevent histos from being sucked in by the param file of the TRootManager!
883 
884  return kTRUE;
885 }
886 
887 // ------------------------------------------------------------------
889  // Constants, TODO => put as parameter !!!
890  Int_t iDataSizeHit = 48; // [bits]
891 
892  // Declare variables outside the loop
893  CbmMCTrack* pMcTrk;
894  CbmTofPoint* pTofPoint;
895  CbmTofHit* pTofHit;
896  CbmMatch* pMatchHitPnt;
897 
898  Int_t iNbTracks, iNbTofPts, iNbTofDigis, iNbTofHits;
899 
900  iNbTracks = fMcTracksColl->GetEntriesFast();
901  iNbTofPts = fTofPointsColl->GetEntriesFast();
902  iNbTofDigis = fTofDigisColl->GetEntriesFast();
903  iNbTofHits = fTofHitsColl->GetEntriesFast();
904 
905  // Tracks Info
906  Int_t iNbTofTracks = 0;
907  Int_t iNbTofTracksPrim = 0;
908  for (Int_t iTrkInd = 0; iTrkInd < iNbTracks; iTrkInd++) {
909  pMcTrk = (CbmMCTrack*) fMcTracksColl->At(iTrkInd);
910 
911  if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) { iNbTofTracks++; }
912  if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)
913  && -1 == pMcTrk->GetMotherId())
914  iNbTofTracksPrim++;
915 
916  } // for(Int_t iTrkInd = 0; iTrkInd < nMcTracks; iTrkInd++)
917 
918  // Points info
919  for (Int_t iPntInd = 0; iPntInd < iNbTofPts; iPntInd++) {
920  // Get a pointer to the TOF point
921  pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iPntInd);
922 
923  // Obtain position
924  TVector3 vPntPos;
925  pTofPoint->Position(vPntPos);
926 
927  Double_t dX = vPntPos.X();
928  Double_t dY = vPntPos.Y();
929  Double_t dZ = vPntPos.Z();
930 
931  fhPointMapXY->Fill(dX, dY);
932  fhPointMapXZ->Fill(dX, dZ);
933  fhPointMapYZ->Fill(dY, dZ);
934  fhFluxMap->Fill(dX, dY);
935 
936  Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
937  Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
938  fhPointMapAng->Fill(dThetaX, dThetaY);
939 
940  Double_t dPhi =
941  TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ); //*180.0/TMath::Pi();
942  Double_t dTheta = TMath::ATan2(dY, dX); //*180.0/TMath::Pi();
943  fhPointMapSph->Fill(dTheta, dPhi);
944  } // for (Int_t iPntInd = 0; iPntInd < nTofPoint; iPntInd++ )
945 
946  // Digis info
947  Double_t dTotalDataSize = 0;
948  if (kTRUE == fDigiBdfPar->UseExpandedDigi()) {
949  CbmTofDigi* pDigi;
950  for (Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++) {
951  pDigi = (CbmTofDigi*) fTofDigisColl->At(iDigInd);
952 
953  Int_t iSmType = pDigi->GetType();
954  Int_t iSm = pDigi->GetSm();
955  Int_t iRpc = pDigi->GetRpc();
956  Int_t iCh = pDigi->GetChannel();
957  // First Get X/Y position info
958  if (fGeoHandler->GetGeoVersion() < k14a)
959  iCh = iCh + 1; //FIXME: Reason found in TofMC and TofGeoHandler
960  CbmTofDetectorInfo xDetInfo(
961  ECbmModuleId::kTof, iSmType, iSm, iRpc, 0, iCh);
962  Int_t iChId = fTofId->SetDetectorInfo(xDetInfo);
963  fChannelInfo = fDigiPar->GetCell(iChId);
964 
965  Double_t dX = fChannelInfo->GetX();
966  Double_t dY = fChannelInfo->GetY();
967  Double_t dZ = fChannelInfo->GetZ();
968 
969  fhDigiMapXY->Fill(dX, dY);
970  fhDigiMapXZ->Fill(dX, dZ);
971  fhDigiMapYZ->Fill(dY, dZ);
972  fhDigiFluxMap->Fill(dX, dY);
973 
974  Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
975  Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
976  fhDigiMapAng->Fill(dThetaX, dThetaY);
977 
978  Double_t dPhi =
979  TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ); //*180.0/TMath::Pi();
980  Double_t dTheta = TMath::ATan2(dY, dX); //*180.0/TMath::Pi();
981  fhDigiMapSph->Fill(dTheta, dPhi);
982 
983  Int_t iGlobalChan = iCh + fvRpcChOffs[iSmType][iSm][iRpc];
984  Int_t iGlobalRpc = iRpc + fvSmRpcOffs[iSmType][iSm];
985  Int_t iGlobalSm = iSm + fvTypeSmOffs[iSmType];
986  fhDigiRateCh->Fill(iGlobalChan + iNbChTot * pDigi->GetSide());
987  fhDataRateCh->Fill(iGlobalChan + iNbChTot * pDigi->GetSide(),
988  iDataSizeHit);
989  fhDataRateRpc->Fill(iGlobalRpc, iDataSizeHit);
990  fhDataRateSm->Fill(iGlobalSm, iDataSizeHit);
991  fhDataRateType->Fill(iSmType, iDataSizeHit);
992  fhOptLnkRpc->Fill(iGlobalRpc, iDataSizeHit);
993  fhOptLnkSm->Fill(iGlobalSm, iDataSizeHit);
994  fhOptLnkType->Fill(iSmType, iDataSizeHit);
995  dTotalDataSize += iDataSizeHit;
996  } // for( Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++ )
997  } // if( kTRUE == fDigiBdfPar->UseExpandedDigi() )
998 
999  fhTofDataPerEvt->Fill(dTotalDataSize);
1000 
1001  // Hits info
1002  Int_t iNbMixedHits = 0;
1003  for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
1004  pTofHit = (CbmTofHit*) fTofHitsColl->At(iHitInd);
1005  pMatchHitPnt = (CbmMatch*) fTofHitMatchColl->At(iHitInd);
1006 
1007  // Need a method to reconvert position in a "central channel"
1008  // fhHitRateCh->Fill();
1009 
1010  Double_t dX = pTofHit->GetX();
1011  Double_t dY = pTofHit->GetY();
1012  Double_t dZ = pTofHit->GetZ();
1013 
1014  fhHitMapXY->Fill(dX, dY);
1015  fhHitMapXZ->Fill(dX, dZ);
1016  fhHitMapYZ->Fill(dY, dZ);
1017  fhHitFluxMap->Fill(dX, dY);
1018 
1019  Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
1020  Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
1021  fhHitMapAng->Fill(dThetaX, dThetaY);
1022 
1023  Double_t dPhi =
1024  TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ); //*180.0/TMath::Pi();
1025  Double_t dTheta = TMath::ATan2(dY, dX); //*180.0/TMath::Pi();
1026  fhHitMapSph->Fill(dPhi, dTheta);
1027 
1028  // Get Nb of links in Match and index of Point for best link
1029  Int_t iNbPntHit = pMatchHitPnt->GetNofLinks();
1030  CbmLink lPnt = pMatchHitPnt->GetMatchedLink();
1031  Int_t iPtIdx = lPnt.GetIndex();
1032  CbmTofPoint* pPt = (CbmTofPoint*) fTofPointsColl->At(iPtIdx);
1033 
1034  fhTofRes->Fill(pTofHit->GetTime() - pPt->GetTime());
1035 
1036  fhTofPosDifX->Fill(pPt->GetX(), pPt->GetX() - pTofHit->GetX());
1037  fhTofPosDifY->Fill(pPt->GetY(), pPt->GetY() - pTofHit->GetY());
1038  fhTofPosDifZ->Fill(pPt->GetZ(), pPt->GetZ() - pTofHit->GetZ());
1039 
1040  if (1 == iNbPntHit) {
1041  fhTofPosDifSingXX->Fill(pPt->GetX(), pPt->GetX() - pTofHit->GetX());
1042  fhTofPosDifSingXY->Fill(pPt->GetY(), pPt->GetX() - pTofHit->GetX());
1043  fhTofPosDifSingXZ->Fill(pPt->GetZ(), pPt->GetX() - pTofHit->GetX());
1044  fhTofPosDifSingY->Fill(pPt->GetY(), pPt->GetY() - pTofHit->GetY());
1045  fhTofPosDifSingZ->Fill(pPt->GetZ(), pPt->GetZ() - pTofHit->GetZ());
1046  fhTofPosDifXZSing->Fill(pPt->GetX() - pTofHit->GetX(),
1047  pPt->GetZ() - pTofHit->GetZ());
1048 
1049  if (pPt->GetX() - pTofHit->GetX() < -0.7
1050  || 0.7 < pPt->GetX() - pTofHit->GetX())
1051  fhTofBadXPosSing->Fill(pPt->GetX(), pPt->GetY());
1052  // fhTofBadXPosSing->Fill( pTofHit->GetX(), pTofHit->GetY() );
1053  if (pPt->GetY() - pTofHit->GetY() < -2.0
1054  || 2.0 < pPt->GetY() - pTofHit->GetY())
1055  fhTofBadYPosSing->Fill(pPt->GetX(), pPt->GetY());
1056  // fhTofBadYPosSing->Fill( pTofHit->GetX(), pTofHit->GetY() );
1057  if (pPt->GetZ() - pTofHit->GetZ() < -0.6
1058  || 0.6 < pPt->GetZ() - pTofHit->GetZ())
1059  fhTofBadZPosSing->Fill(pPt->GetX(), pPt->GetY());
1060  // fhTofBadZPosSing->Fill( pTofHit->GetX(), pTofHit->GetY() );
1061 
1062  fhTofResSing->Fill(pTofHit->GetTime() - pPt->GetTime());
1063  } // if( 1 == pTofHit->GetFlag() )
1064  else
1065  iNbMixedHits++;
1066 
1067  } // for( Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++)
1068  if (0 < iNbTofHits) fhTofMixing->Fill(iNbMixedHits / iNbTofHits);
1069 
1070  return kTRUE;
1071 }
1072 // ------------------------------------------------------------------
1073 
1075  // TODO: add sub-folders
1076 
1077  // Write histogramms to the file
1078  TDirectory* oldir = gDirectory;
1079  TFile* fHist = new TFile("./tofTests.hst.root", "RECREATE");
1080  fHist->cd();
1081 
1082  // Test class performance
1083  fhTestingTime->Write();
1084 
1085  // Mapping
1086  fhPointMapXY->Write();
1087  fhPointMapXZ->Write();
1088  fhPointMapYZ->Write();
1089  fhPointMapAng->Write();
1090  fhPointMapSph->Write();
1091  fhDigiMapXY->Write();
1092  fhDigiMapXZ->Write();
1093  fhDigiMapYZ->Write();
1094  fhDigiMapAng->Write();
1095  fhDigiMapSph->Write();
1096  fhHitMapXY->Write();
1097  fhHitMapXZ->Write();
1098  fhHitMapYZ->Write();
1099  fhHitMapAng->Write();
1100  fhHitMapSph->Write();
1101 
1102  // Rates and data rates
1103  fhFluxMap->Write();
1104  fhDigiFluxMap->Write();
1105  fhHitFluxMap->Write();
1106  fhDigiRateCh->Write();
1107  fhDataRateCh->Write();
1108  fhDataRateRpc->Write();
1109  fhDataRateSm->Write();
1110  fhDataRateType->Write();
1111  fhTofDataPerEvt->Write();
1112  fhTofDataRedEvt->Write();
1113  // fhHitRateCh->Write();
1114  fhOptLnkRpc->Write();
1115  fhOptLnkSm->Write();
1116  fhOptLnkType->Write();
1117 
1118  // Performances check
1119  fhTofRes->Write();
1120  fhTofResSing->Write();
1121  fhTofPosDifX->Write();
1122  fhTofPosDifY->Write();
1123  fhTofPosDifZ->Write();
1124  fhTofPosDifSingXX->Write();
1125  fhTofPosDifSingXY->Write();
1126  fhTofPosDifSingXZ->Write();
1127 
1128  fhTofPosDifSingY->Write();
1129  fhTofPosDifSingZ->Write();
1130  fhTofPosDifXZSing->Write();
1131 
1132  fhTofBadXPosSing->Write();
1133  fhTofBadYPosSing->Write();
1134  fhTofBadZPosSing->Write();
1135 
1136  fhTofEff->Write();
1137  fhTofMixing->Write();
1138 
1139  gDirectory->cd(oldir->GetPath());
1140 
1141  fHist->Close();
1142 
1143  return kTRUE;
1144 }
1146  // Test class performance
1147  delete fhTestingTime;
1148 
1149  // Mapping
1150  delete fhPointMapXY;
1151  delete fhPointMapXZ;
1152  delete fhPointMapYZ;
1153  delete fhPointMapAng;
1154  delete fhPointMapSph;
1155  delete fhDigiMapXY;
1156  delete fhDigiMapXZ;
1157  delete fhDigiMapYZ;
1158  delete fhDigiMapAng;
1159  delete fhDigiMapSph;
1160  delete fhHitMapXY;
1161  delete fhHitMapXZ;
1162  delete fhHitMapYZ;
1163  delete fhHitMapAng;
1164  delete fhHitMapSph;
1165 
1166  // Rates and data rates
1167  delete fhFluxMap;
1168  delete fhDigiFluxMap;
1169  delete fhHitFluxMap;
1170  delete fhDigiRateCh;
1171  delete fhDataRateCh;
1172  delete fhDataRateRpc;
1173  delete fhDataRateSm;
1174  delete fhDataRateType;
1175  delete fhTofDataPerEvt;
1176  delete fhTofDataRedEvt;
1177  // delete fhHitRateCh;
1178  delete fhOptLnkRpc;
1179  delete fhOptLnkSm;
1180  delete fhOptLnkType;
1181 
1182  // Performances check
1183  delete fhTofRes;
1184  delete fhTofResSing;
1185  delete fhTofPosDifX;
1186  delete fhTofPosDifY;
1187  delete fhTofPosDifZ;
1188 
1189  delete fhTofPosDifSingXX;
1190  delete fhTofPosDifSingXY;
1191  delete fhTofPosDifSingXZ;
1192 
1193  delete fhTofPosDifSingY;
1194  delete fhTofPosDifSingZ;
1195  delete fhTofPosDifXZSing;
1196 
1197  delete fhTofBadXPosSing;
1198  delete fhTofBadYPosSing;
1199  delete fhTofBadZPosSing;
1200 
1201  delete fhTofEff;
1202  delete fhTofMixing;
1203 
1204  return kTRUE;
1205 }
1206 
1207 
CbmTofDigiBdfPar.h
CbmTofTests::fhTestingTime
TH1 * fhTestingTime
Definition: CbmTofTests.h:99
CbmTofCell::GetZ
Double_t GetZ() const
Definition: CbmTofCell.h:38
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmTofTests::fhTofPosDifSingXY
TH2 * fhTofPosDifSingXY
Definition: CbmTofTests.h:140
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmTofTests::fhTofPosDifSingXX
TH2 * fhTofPosDifSingXX
Definition: CbmTofTests.h:139
CbmTofGeoHandler::GetGeoVersion
Int_t GetGeoVersion()
Definition: CbmTofGeoHandler.h:45
CbmTofTests::CbmTofTests
CbmTofTests()
Definition: CbmTofTests.cxx:59
CbmTofTests::Exec
virtual void Exec(Option_t *option)
Definition: CbmTofTests.cxx:254
CbmTofTests::fhDataRateSm
TH1 * fhDataRateSm
Definition: CbmTofTests.h:124
CbmTofTests::fhPointMapXZ
TH2 * fhPointMapXZ
Definition: CbmTofTests.h:102
CbmMatch
Definition: CbmMatch.h:22
CbmTofAnaTestbeam::fMCEventHeader
CbmMCDataObject * fMCEventHeader
Definition: CbmTofAnaTestbeam.h:798
CbmTofTests::fDigiBdfPar
CbmTofDigiBdfPar * fDigiBdfPar
Definition: CbmTofTests.h:79
CbmTofAnaTestbeam::fDigiBdfPar
CbmTofDigiBdfPar * fDigiBdfPar
Definition: CbmTofAnaTestbeam.h:329
CbmTofTests::fhDataRateType
TH1 * fhDataRateType
Definition: CbmTofTests.h:125
CbmTofTests::fhTofPosDifSingXZ
TH2 * fhTofPosDifSingXZ
Definition: CbmTofTests.h:141
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmTofTests::Init
virtual InitStatus Init()
Definition: CbmTofTests.cxx:208
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmTofTests::fhDigiMapXZ
TH2 * fhDigiMapXZ
Definition: CbmTofTests.h:107
CbmTofTests::fhOptLnkType
TH1 * fhOptLnkType
Definition: CbmTofTests.h:131
CbmTofTests::fhTofPosDifX
TH2 * fhTofPosDifX
Definition: CbmTofTests.h:136
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmTofAnaTestbeam::iNbRpcTot
Int_t iNbRpcTot
Definition: CbmTofAnaTestbeam.h:320
CbmTofDigiBdfPar::GetNbChan
Int_t GetNbChan(Int_t iSmType, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:570
CbmTofTests::fStop
TTimeStamp fStop
Definition: CbmTofTests.h:153
CbmTofAnaTestbeam::iNbSmTot
Int_t iNbSmTot
Definition: CbmTofAnaTestbeam.h:317
CbmTofTests::fhDigiMapXY
TH2 * fhDigiMapXY
Definition: CbmTofTests.h:106
CbmTofDigiBdfPar::GetNbRpc
Int_t GetNbRpc(Int_t iSmType) const
Definition: CbmTofDigiBdfPar.cxx:519
CbmTofTests::fTofHitMatchColl
TClonesArray * fTofHitMatchColl
Definition: CbmTofTests.h:86
CbmTofAnaTestbeam::fvTypeSmOffs
std::vector< Int_t > fvTypeSmOffs
Definition: CbmTofAnaTestbeam.h:319
CbmTofTests::fvSmRpcOffs
std::vector< std::vector< Int_t > > fvSmRpcOffs
Definition: CbmTofTests.h:72
CbmTofTests::fhDigiFluxMap
TH2 * fhDigiFluxMap
Definition: CbmTofTests.h:119
CbmTofDetectorId_v12b
Definition: CbmTofDetectorId_v12b.h:33
CbmTofAnaTestbeam::iNbChTot
Int_t iNbChTot
Definition: CbmTofAnaTestbeam.h:323
CbmTofTests::fhHitMapXY
TH2 * fhHitMapXY
Definition: CbmTofTests.h:111
CbmTofDigiBdfPar::GetNbSmTypes
Int_t GetNbSmTypes() const
Definition: CbmTofDigiBdfPar.h:56
CbmTofTests::~CbmTofTests
virtual ~CbmTofTests()
Definition: CbmTofTests.cxx:201
CbmTofTests::fhFluxMap
TH2 * fhFluxMap
Definition: CbmTofTests.h:118
CbmTofTests::fTofHitsColl
TClonesArray * fTofHitsColl
Definition: CbmTofTests.h:84
CbmTofDigi.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmTofTests::fhTofPosDifXZSing
TH2 * fhTofPosDifXZSing
Definition: CbmTofTests.h:144
CbmTofDigiPar.h
CbmMatch.h
CbmTofTests::FillHistos
Bool_t FillHistos()
Definition: CbmTofTests.cxx:888
CbmTofTests::fhDigiRateCh
TH1 * fhDigiRateCh
Definition: CbmTofTests.h:121
CbmTofDigi::GetSm
Double_t GetSm() const
Sm.
Definition: CbmTofDigi.h:124
CbmTofTests::fhTofResSing
TH1 * fhTofResSing
Definition: CbmTofTests.h:135
CbmTofTests::fStart
TTimeStamp fStart
Definition: CbmTofTests.h:152
CbmTofDigiPar::GetCell
CbmTofCell * GetCell(Int_t i)
Definition: CbmTofDigiPar.h:48
CbmTofTests::fhHitMapXZ
TH2 * fhHitMapXZ
Definition: CbmTofTests.h:112
CbmTofTests::fhPointMapSph
TH2 * fhPointMapSph
Definition: CbmTofTests.h:105
CbmTofTests::iNbRpcTot
Int_t iNbRpcTot
Definition: CbmTofTests.h:70
CbmTofTests::fTofId
CbmTofDetectorId * fTofId
Definition: CbmTofTests.h:65
CbmTofAnaTestbeam::fGeoHandler
CbmTofGeoHandler * fGeoHandler
Definition: CbmTofAnaTestbeam.h:308
CbmTofTests::SetParContainers
virtual void SetParContainers()
Inherited from FairTask.
Definition: CbmTofTests.cxx:242
CbmTofAnaTestbeam::fEvents
Int_t fEvents
Definition: CbmTofAnaTestbeam.h:305
CbmTofGeoHandler.h
CbmTofTests::fhPointMapAng
TH2 * fhPointMapAng
Definition: CbmTofTests.h:104
CbmTofDetectorId_v14a.h
CbmTofDigi::GetSide
Double_t GetSide() const
Channel Side.
Definition: CbmTofDigi.h:142
CbmTofTests::fTofDigisColl
TClonesArray * fTofDigisColl
Definition: CbmTofTests.h:83
CbmTofAnaTestbeam::fDigiPar
CbmTofDigiPar * fDigiPar
Definition: CbmTofAnaTestbeam.h:328
CbmTofTests::fhTofEff
TH1 * fhTofEff
Definition: CbmTofTests.h:148
CbmTofDigi::GetType
Double_t GetType() const
Sm Type .
Definition: CbmTofDigi.h:128
CbmTofTests::Finish
virtual void Finish()
Definition: CbmTofTests.cxx:272
CbmMCTrack::GetNPoints
Int_t GetNPoints(ECbmModuleId detId) const
Definition: CbmMCTrack.cxx:186
CbmTofTests::fhTofPosDifZ
TH2 * fhTofPosDifZ
Definition: CbmTofTests.h:138
CbmTofGeoHandler
Definition: CbmTofGeoHandler.h:30
CbmTofTests::CreateHistos
Bool_t CreateHistos()
Definition: CbmTofTests.cxx:459
k12b
@ k12b
Definition: CbmTofGeoHandler.h:17
CbmTofTests::iNbSmTot
Int_t iNbSmTot
Definition: CbmTofTests.h:67
CbmTofCell::GetX
Double_t GetX() const
Definition: CbmTofCell.h:36
CbmTofTests::fhPointMapXY
TH2 * fhPointMapXY
Definition: CbmTofTests.h:101
CbmTofDetectorId_v12b.h
CbmTofTests::RegisterInputs
Bool_t RegisterInputs()
Definition: CbmTofTests.cxx:314
CbmTofDigi::GetChannel
Double_t GetChannel() const
Channel .
Definition: CbmTofDigi.h:136
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmTofTests::fhDataRateRpc
TH1 * fhDataRateRpc
Definition: CbmTofTests.h:123
CbmTofTests::fvTypeSmOffs
std::vector< Int_t > fvTypeSmOffs
Definition: CbmTofTests.h:69
CbmTofTests::fhDigiMapAng
TH2 * fhDigiMapAng
Definition: CbmTofTests.h:109
CbmTofTests::fhTofBadZPosSing
TH2 * fhTofBadZPosSing
Definition: CbmTofTests.h:147
k14a
@ k14a
Definition: CbmTofGeoHandler.h:17
CbmTofTests::fhDigiMapSph
TH2 * fhDigiMapSph
Definition: CbmTofTests.h:110
CbmTofAddress.h
CbmTofDetectorId_v14a
Definition: CbmTofDetectorId_v14a.h:36
CbmTofTests
Definition: CbmTofTests.h:27
CbmTofGeoHandler::Init
Int_t Init(Bool_t isSimulation=kFALSE)
Definition: CbmTofGeoHandler.cxx:39
CbmTofTests::fhHitMapSph
TH2 * fhHitMapSph
Definition: CbmTofTests.h:115
CbmTofAnaTestbeam::fChannelInfo
CbmTofCell * fChannelInfo
Definition: CbmTofAnaTestbeam.h:310
CbmTofAnaTestbeam::fvSmRpcOffs
std::vector< std::vector< Int_t > > fvSmRpcOffs
Definition: CbmTofAnaTestbeam.h:322
CbmTofDigiBdfPar
Parameters class for the CBM ToF digitizer using beam data distributions.
Definition: CbmTofDigiBdfPar.h:30
CbmTofTests::fhHitMapAng
TH2 * fhHitMapAng
Definition: CbmTofTests.h:114
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmTofDetectorId::SetDetectorInfo
virtual Int_t SetDetectorInfo(const CbmTofDetectorInfo detectorInfo)=0
CbmTofCell.h
CbmTofAnaTestbeam::fStop
TTimeStamp fStop
Definition: CbmTofAnaTestbeam.h:711
CbmTofTests::fhTofBadXPosSing
TH2 * fhTofBadXPosSing
Definition: CbmTofTests.h:145
CbmTofTests::fhTofBadYPosSing
TH2 * fhTofBadYPosSing
Definition: CbmTofTests.h:146
CbmTofTests::fhOptLnkRpc
TH1 * fhOptLnkRpc
Definition: CbmTofTests.h:129
CbmTofTests::fhDigiMapYZ
TH2 * fhDigiMapYZ
Definition: CbmTofTests.h:108
CbmTofAnaTestbeam::fStart
TTimeStamp fStart
Definition: CbmTofAnaTestbeam.h:710
CbmTofDetectorInfo
Definition: CbmTofDetectorId.h:20
CbmTofTests::fChannelInfo
CbmTofCell * fChannelInfo
Definition: CbmTofTests.h:66
fTofHitsColl
TClonesArray * fTofHitsColl
Definition: CbmHadronAnalysis.cxx:52
CbmTofDigi
Data class for expanded digital TOF information.
Definition: CbmTofDigi.h:38
CbmTofTests::fhTofDataRedEvt
TH1 * fhTofDataRedEvt
Definition: CbmTofTests.h:127
ClassImp
ClassImp(CbmTofTests)
CbmTofTests.h
CbmTofAnaTestbeam::fvRpcChOffs
std::vector< std::vector< std::vector< Int_t > > > fvRpcChOffs
Definition: CbmTofAnaTestbeam.h:325
CbmTofTests::DeleteHistos
Bool_t DeleteHistos()
Definition: CbmTofTests.cxx:1145
CbmTofDigiBdfPar::UseExpandedDigi
Bool_t UseExpandedDigi() const
Definition: CbmTofDigiBdfPar.h:85
CbmTofDigi::GetRpc
Double_t GetRpc() const
Detector aka Module aka RPC .
Definition: CbmTofDigi.h:132
CbmTofTests::fhHitFluxMap
TH2 * fhHitFluxMap
Definition: CbmTofTests.h:120
CbmTofTests::InitParameters
Bool_t InitParameters()
Definition: CbmTofTests.cxx:220
CbmTofTests::LoadGeometry
Bool_t LoadGeometry()
Load the geometry: for now just resizing the Digis temporary vectors.
Definition: CbmTofTests.cxx:414
CbmTofTests::fhOptLnkSm
TH1 * fhOptLnkSm
Definition: CbmTofTests.h:130
CbmMCTrack.h
CbmTofTests::fvRpcChOffs
std::vector< std::vector< std::vector< Int_t > > > fvRpcChOffs
Definition: CbmTofTests.h:75
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmTofDigiPar
Definition: CbmTofDigiPar.h:18
CbmTofPoint.h
CbmTofAnaTestbeam::fTofId
CbmTofDetectorId * fTofId
Definition: CbmTofAnaTestbeam.h:309
CbmTofTests::fhTofPosDifSingZ
TH2 * fhTofPosDifSingZ
Definition: CbmTofTests.h:143
CbmTofTests::fhTofPosDifSingY
TH2 * fhTofPosDifSingY
Definition: CbmTofTests.h:142
CbmTofTests::iNbChTot
Int_t iNbChTot
Definition: CbmTofTests.h:73
CbmTofTests::fhTofDataPerEvt
TH1 * fhTofDataPerEvt
Definition: CbmTofTests.h:126
CbmTofPoint
Geometric intersection of a MC track with a TOFb detector.
Definition: CbmTofPoint.h:40
CbmTofTests::fhHitMapYZ
TH2 * fhHitMapYZ
Definition: CbmTofTests.h:113
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmTofCell::GetY
Double_t GetY() const
Definition: CbmTofCell.h:37
CbmTofTests::fhTofPosDifY
TH2 * fhTofPosDifY
Definition: CbmTofTests.h:137
CbmTofTests::fhDataRateCh
TH1 * fhDataRateCh
Definition: CbmTofTests.h:122
CbmTofTests::fhTofMixing
TH1 * fhTofMixing
Definition: CbmTofTests.h:149
CbmTofTests::fGeoHandler
CbmTofGeoHandler * fGeoHandler
Definition: CbmTofTests.h:64
CbmTofTests::fDigiPar
CbmTofDigiPar * fDigiPar
Definition: CbmTofTests.h:78
CbmTofTests::fTofPointsColl
TClonesArray * fTofPointsColl
Definition: CbmTofTests.h:81
CbmTofTests::fEvents
Int_t fEvents
Definition: CbmTofTests.h:60
CbmTofTests::fMcTracksColl
TClonesArray * fMcTracksColl
Definition: CbmTofTests.h:82
CbmTofAnaTestbeam::fTofDigisColl
TClonesArray * fTofDigisColl
Definition: CbmTofAnaTestbeam.h:331
CbmTofTests::fhTofRes
TH1 * fhTofRes
Definition: CbmTofTests.h:134
CbmTofTests::fhPointMapYZ
TH2 * fhPointMapYZ
Definition: CbmTofTests.h:103
CbmTofTests::WriteHistos
Bool_t WriteHistos()
Definition: CbmTofTests.cxx:1074
CbmTofDigiBdfPar::GetNbSm
Int_t GetNbSm(Int_t iSmType) const
Definition: CbmTofDigiBdfPar.cxx:513