CbmRoot
CbmRichMCbmQaReal.cxx
Go to the documentation of this file.
1 #include "CbmRichMCbmQaReal.h"
2 
3 #include "TCanvas.h"
4 #include "TClonesArray.h"
5 #include "TEllipse.h"
6 #include "TF1.h"
7 #include "TGeoBBox.h"
8 #include "TGeoManager.h"
9 #include "TGeoNode.h"
10 #include "TH1.h"
11 #include "TH1D.h"
12 #include "TLine.h"
13 #include "TMarker.h"
14 #include "TMath.h"
15 #include "TStyle.h"
16 #include "TSystem.h"
17 #include <TFile.h>
18 
19 #include <TBox.h>
20 #include <TLegend.h>
21 
22 
23 #include "CbmDrawHist.h"
24 #include "CbmEvent.h"
25 #include "CbmGlobalTrack.h"
26 #include "CbmMatchRecoToMC.h"
27 #include "CbmRichDigi.h"
28 #include "CbmRichDraw.h"
29 #include "CbmRichGeoManager.h"
30 #include "CbmRichHit.h"
31 #include "CbmRichPoint.h"
32 #include "CbmRichRing.h"
34 #include "CbmRichUtil.h"
35 #include "CbmStsDigi.h"
36 #include "CbmTofDigi.h"
37 #include "CbmTofHit.h"
38 #include "CbmTofTracklet.h"
39 #include "CbmTrackMatchNew.h"
40 #include "CbmTrdTrack.h"
41 #include "TLatex.h"
42 
43 #include "CbmRichMCbmSEDisplay.h"
44 
45 #include "CbmRichConverter.h"
46 
47 #include "CbmDigiManager.h"
48 #include "CbmHistManager.h"
49 #include "CbmUtils.h"
50 //#include <CbmSetup.h>
51 
52 #include <boost/assign/list_of.hpp>
53 #include <cmath>
54 #include <iomanip>
55 #include <iostream>
56 #include <sstream>
57 #include <string>
58 
59 using namespace std;
60 using boost::assign::list_of;
61 
62 //double RichZPos = 348.;
63 double RichZPos = 355.2;
64 
66  : FairTask("CbmRichMCbmQaReal")
67  , fT0Digis(nullptr)
68  , fRichHits(nullptr)
69  , fRichRings(nullptr)
70  , fTofHits(nullptr)
71  , fTofTracks(nullptr)
72  , fCbmEvent(nullptr)
73  , fHM(nullptr)
74  , fXOffsetHisto(0.)
75  , fTotRichMin(23.7)
76  , fTotRichMax(30.0)
77  , fEventNum(0)
78  , fNofDrawnRings(0)
79  , fNofDrawnRichTofEv(0)
80  , fMaxNofDrawnEvents(100)
81  , fTriggerRichHits(0)
82  , fTriggerTofHits(0)
83  , fOutputDir("result") {}
84 
86  cout << "CbmRichMCbmQaReal::Init" << endl;
87 
88  FairRootManager* ioman = FairRootManager::Instance();
89  if (nullptr == ioman) {
90  Fatal("CbmRichMCbmQaReal::Init", "RootManager not instantised!");
91  }
92 
94  fDigiMan->Init();
95 
97  Fatal("CbmRichMCbmQaReal::Init", "No Rich Digis!");
98 
100  Fatal("CbmRichMCbmQaReal::Init", "No Tof Digis!");
101 
102 
103  fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
104  if (nullptr == fRichHits) {
105  Fatal("CbmRichMCbmQaReal::Init", "No Rich Hits!");
106  }
107 
108  fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
109  if (nullptr == fRichRings) {
110  Fatal("CbmRichMCbmQaReal::Init", "No Rich Rings!");
111  }
112 
113  fTofHits = (TClonesArray*) ioman->GetObject("TofHit");
114  if (nullptr == fTofHits) { Fatal("CbmRichMCbmQaReal::Init", "No Tof Hits!"); }
115 
116  fTofTracks = (TClonesArray*) ioman->GetObject("TofTracks");
117  if (nullptr == fTofTracks) {
118  Fatal("CbmRichMCbmQaReal::Init", "No Tof Tracks!");
119  }
120 
121  // fT0Digis =(TClonesArray*) ioman->GetObject("CbmT0Digi");
122  // if (nullptr == fT0Digis) { Fatal("CbmRichMCbmQaReal::Init", "No T0 Digis!");}
123  // Get a pointer to the previous already existing data level
124  fT0Digis = ioman->InitObjectAs<std::vector<CbmTofDigi> const*>("T0Digi");
125  /*if ( ! fT0DigiVec ) {
126  fT0DigiArr = dynamic_cast<TClonesArray*>(ioman->GetObject("T0Digi"));
127  if ( ! fT0DigiArr ) {
128  LOG(fatal) << "No TClonesArray with T0 digis found.";
129  }
130  }*/
131 
132  // ---- Init Z Positioning ---------
133  /* CbmSetup *pSetup=CbmSetup::Instance();
134  TString geoTag;
135  if ( pSetup->IsActive(ECbmModuleId::kRich) ) {
136  pSetup->GetGeoTag(ECbmModuleId::kRich, geoTag);
137  }
138 
139  if (geoTag == "v20d") RichZPos = 340.8;
140  std::cout<<"mRICH Geo Tag is "<< geoTag<< ". Z Position of PMT plane set to "<<RichZPos<<"."<<std::endl;
141  */
142  // ---------------------------------
143 
144  fCbmEvent = (TClonesArray*) ioman->GetObject("CbmEvent");
145  if (nullptr == fCbmEvent) { Fatal("CbmRichMCbmQaReal::Init", "No Event!"); }
146 
147  InitHistograms();
148 
149  //--- Init Single Event display -----------------------------
158  //-----------------------------------------------------------
159 
160 
161  //--- Init Single Event display for Correlated Tracks/Rings---
170  fSeDsply_TR->SetCanvasDir("SE_Corr");
171  //-----------------------------------------------------------
172 
173 
174  return kSUCCESS;
175 }
176 
178  fHM = new CbmHistManager();
179 
180  fHM->Create1<TH1D>("fhNofEvents", "fhNofEvents;Entries", 1, 0.5, 1.5);
181  fHM->Create1<TH1D>("fhNofCbmEvents", "fhNofCbmEvents;Entries", 1, 0.5, 1.5);
182  fHM->Create1<TH1D>(
183  "fhNofCbmEventsRing", "fhNofCbmEventsRing;Entries", 1, 0.5, 1.5);
184 
185  fHM->Create1<TH1D>(
186  "fhHitsInTimeslice", "fhHitsInTimeslice;Timeslice;#Hits", 200, 1, 200);
187 
188  // nof objects per timeslice
189  fHM->Create1<TH1D>(
190  "fhNofRichDigisInTimeslice",
191  "fhNofRichDigisInTimeslice;# RICH digis / timeslice;Entries",
192  100,
193  -0.5,
194  999.5);
195  fHM->Create1<TH1D>("fhNofRichHitsInTimeslice",
196  "fhNofRichHitsInTimeslice;# RICH hits / timeslice;Entries",
197  100,
198  -0.5,
199  999.5);
200  fHM->Create1<TH1D>(
201  "fhNofRichRingsInTimeslice",
202  "fhNofRichRingsInTimeslice;# RICH rings / timeslice;Entries",
203  10,
204  -0.5,
205  9.5);
206 
207  // RICH hits
208  fHM->Create2<TH2D>("fhRichHitXY",
209  "fhRichHitXY;RICH hit X [cm];RICH hit Y [cm];Entries",
210  67,
211  -20.1 + fXOffsetHisto,
212  20.1 + fXOffsetHisto,
213  84,
214  -25.2,
215  25.2);
216  fHM->Create2<TH2D>("fhRichDigiPixelRate",
217  "fhRichDigiPixelRate;RICH Digi X [cm];RICH Digi Y [cm];Hz",
218  67,
219  -20.1 + fXOffsetHisto,
220  20.1 + fXOffsetHisto,
221  84,
222  -25.2,
223  25.2);
224 
225 
226  // RICH digis, the limits of log histograms are set in Exec method
227  fHM->Create1<TH1D>("fhRichDigisTimeLog",
228  "fhNofRichDigisTimeLog;Time [ns];Entries",
229  400,
230  0.,
231  0.);
232  fHM->Create1<TH1D>("fhRichDigisTimeLogZoom",
233  "fhNofRichDigisTimeLogZoom;Time [ns];Entries",
234  400,
235  0.,
236  0.);
237  fHM->Create1<TH1D>("fhRichDigisTimeLogZoom2",
238  "fhNofRichDigisTimeLogZoom2;Time [ns];Entries",
239  400,
240  0.,
241  0.);
242 
243  fHM->Create1<TH1D>("fhRichRingsTimeLog",
244  "fhNofRichRingsTimeLog;Time [ns];Entries",
245  400,
246  0.,
247  0.);
248  fHM->Create1<TH1D>("fhRichRingsTimeLogZoom",
249  "fhNofRichRingsTimeLogZoom;Time [ns];Entries",
250  400,
251  0.,
252  0.);
253  fHM->Create1<TH1D>("fhRichRingsTimeLogZoom2",
254  "fhNofRichRingsTimeLogZoom2;Time [ns];Entries",
255  400,
256  0.,
257  0.);
258 
259  fHM->Create1<TH1D>(
260  "fhTofDigisTimeLog", "fhTofDigisTimeLog;Time [ns];Entries", 400, 0., 0.);
261  fHM->Create1<TH1D>("fhTofDigisTimeLogZoom",
262  "fhTofDigisTimeLogZoom;Time [ns];Entries",
263  400,
264  0.,
265  0.);
266  fHM->Create1<TH1D>("fhTofDigisTimeLogZoom2",
267  "fhTofDigisTimeLogZoom2;Time [ns];Entries",
268  400,
269  0.,
270  0.);
271 
272  fHM->Create1<TH1D>(
273  "fhStsDigisTimeLog", "fhStsDigisTimeLog;Time [ns];Entries", 400, 0., 0.);
274  fHM->Create1<TH1D>("fhStsDigisTimeLogZoom",
275  "fhStsDigisTimeLogZoom;Time [ns];Entries",
276  400,
277  0.,
278  0.);
279  fHM->Create1<TH1D>("fhStsDigisTimeLogZoom2",
280  "fhStsDigisTimeLogZoom2;Time [ns];Entries",
281  400,
282  0.,
283  0.);
284 
285  fHM->Create1<TH1D>(
286  "fhT0DigisTimeLog", "fhT0DigisTimeLog;Time [ns];Entries", 400, 0., 0.);
287  fHM->Create1<TH1D>("fhT0DigisTimeLogZoom",
288  "fhT0DigisTimeLogZoom;Time [ns];Entries",
289  400,
290  0.,
291  0.);
292  fHM->Create1<TH1D>("fhT0DigisTimeLogZoom2",
293  "fhT0DigisTimeLogZoom2;Time [ns];Entries",
294  400,
295  0.,
296  0.);
297 
298  //ToT
299  fHM->Create1<TH1D>(
300  "fhRichDigisToT", "fhRichDigisToT;ToT [ns];Entries", 601, 9.975, 40.025);
301  fHM->Create1<TH1D>(
302  "fhRichHitToT", "fhRichHitToT;ToT [ns];Entries", 601, 9.975, 40.025);
303  fHM->Create1<TH1D>("fhRichHitToTEvent",
304  "fhRichHitToTEvent;ToT [ns];Entries",
305  601,
306  9.975,
307  40.025);
308  fHM->Create2<TH2D>("fhRichHitXYEvent",
309  "fhRichHitXYEvent;RICH hit X [cm];RICH hit Y [cm];Entries",
310  67,
311  -20.1 + fXOffsetHisto,
312  20.1 + fXOffsetHisto,
313  84,
314  -25.2,
315  25.2);
316 
317 
318  // RICH rings
319  fHM->Create2<TH2D>(
320  "fhRichRingXY",
321  "fhRichRingXY;Ring center X [cm];Ring center Y [cm];Entries",
322  67,
323  -20.1 + fXOffsetHisto,
324  20.1 + fXOffsetHisto,
325  84,
326  -25.2,
327  25.2);
328  fHM->Create2<TH2D>(
329  "fhRichRingXY_goodTrack",
330  "fhRichRingXY_goodTrack;Ring center X [cm];Ring center Y [cm];Entries",
331  67,
332  -20.1 + fXOffsetHisto,
333  20.1 + fXOffsetHisto,
334  84,
335  -25.2,
336  25.2);
337  fHM->Create2<TH2D>(
338  "fhRichRing_goodTrackXY",
339  "fhRichRing_goodTrackXY;Track center X [cm];Track center Y [cm];Entries",
340  67,
341  -20.1 + fXOffsetHisto,
342  20.1 + fXOffsetHisto,
343  84,
344  -25.2,
345  25.2);
346 
347  fHM->Create2<TH2D>(
348  "fhRichRingRadiusY",
349  "fhRichRingRadiusY;Ring Radius [cm]; Y position[cm];Entries",
350  70,
351  -0.05,
352  6.95,
353  84,
354  -25.2,
355  25.2);
356  fHM->Create2<TH2D>(
357  "fhRichHitsRingRadius",
358  "fhRichHitsRingRadius;#Rich Hits/Ring; Ring Radius [cm];Entries",
359  50,
360  -0.5,
361  49.5,
362  70,
363  -0.05,
364  6.95);
365 
366  fHM->Create1<TH1D>("fhRichRingRadius",
367  "fhRichRingRadius;Ring radius [cm];Entries",
368  100,
369  0.,
370  7.);
371  fHM->Create1<TH1D>("fhNofHitsInRing",
372  "fhNofHitsInRing;# hits in ring;Entries",
373  50,
374  -0.5,
375  49.5);
376 
377  fHM->Create1<TH1D>("fhRichRingRadius_goodRing",
378  "fhRichRingRadius_goodRing;Ring radius [cm];Entries",
379  100,
380  0.,
381  7.);
382  fHM->Create1<TH1D>("fhNofHitsInRing_goodRing",
383  "fhNofHitsInRing_goodRing;# hits in ring;Entries",
384  50,
385  -0.5,
386  49.5);
387 
388  //Tof Rich correlation
389  fHM->Create2<TH2D>("fhTofRichX",
390  "fhTofRichX;Rich Hit X [cm];TofHit X [cm];Entries",
391  67,
392  -20.1 + fXOffsetHisto,
393  20.1 + fXOffsetHisto,
394  400,
395  -50,
396  110);
397  fHM->Create2<TH2D>("fhTofRichX_stack1",
398  "fhTofRichX_stack1;Rich Hit X [cm];TofHit X [cm];Entries",
399  67,
400  -20.1 + fXOffsetHisto,
401  20.1 + fXOffsetHisto,
402  400,
403  -50,
404  110);
405  fHM->Create2<TH2D>("fhTofRichX_stack2",
406  "fhTofRichX_stack2;Rich Hit X [cm];TofHit X [cm];Entries",
407  67,
408  -20.1 + fXOffsetHisto,
409  20.1 + fXOffsetHisto,
410  400,
411  -50,
412  110);
413  fHM->Create2<TH2D>("fhTofRichX_stack3",
414  "fhTofRichX_stack3;Rich Hit X [cm];TofHit X [cm];Entries",
415  67,
416  -20.1 + fXOffsetHisto,
417  20.1 + fXOffsetHisto,
418  400,
419  -50,
420  110);
421  fHM->Create2<TH2D>("fhTofRichY",
422  "fhTofRichY;Rich Hit Y [cm];TofHit Y [cm];Entries",
423  84,
424  -25.2,
425  25.2,
426  200,
427  -80,
428  80);
429  //fHM->Create2<TH2D>("fhTofRichRingHitX","fhTofRichRingHitX;Rich Ring Hit X [cm];TofHit X [cm];Entries", 67, -20.1 + fXOffsetHisto, 20.1 + fXOffsetHisto, 400, -50, 110);
430  fHM->Create2<TH2D>(
431  "fhTofTrackRichHitX",
432  "fhTofTrackRichHitX;RICH Hit X [cm];TofTrack X [cm];Entries",
433  67,
434  -20.1 + fXOffsetHisto,
435  20.1 + fXOffsetHisto,
436  400,
437  -50,
438  110);
439  fHM->Create2<TH2D>(
440  "fhTofTrackRichHitY",
441  "fhTofTrackRichHitY;RICH Hit Y [cm];TofTrack Y [cm];Entries",
442  84,
443  -25.2,
444  25.2,
445  200,
446  -80,
447  80);
448 
449 
450  fHM->Create2<TH2D>("fhTofTrackHitRichHitX_oBetacuts_dtime",
451  "fhTofTrackHitRichHitX_oBetacuts_dtime;Rich Hit X "
452  "[cm];TofHit X [cm];Entries",
453  67,
454  -20.1 + fXOffsetHisto,
455  20.1 + fXOffsetHisto,
456  400,
457  -50,
458  110);
459  fHM->Create2<TH2D>("fhTofTrackHitRichHitY_oBetacuts_dtime",
460  "fhTofTrackHitRichHitY_oBetacuts_dtime;Rich Hit Y "
461  "[cm];TofHit Y [cm];Entries",
462  84,
463  -25.2,
464  25.2,
465  200,
466  -80,
467  80);
468 
469 
470  fHM->Create2<TH2D>(
471  "fhTofTrackRichHitX_cuts",
472  "fhTofTrackRichHitX_cuts;RICH Hit X [cm];TofTrack X [cm];Entries",
473  67,
474  -20.1 + fXOffsetHisto,
475  20.1 + fXOffsetHisto,
476  400,
477  -50,
478  110);
479  fHM->Create2<TH2D>(
480  "fhTofTrackRichHitY_cuts",
481  "fhTofTrackRichHitY_cuts;RICH Hit Y [cm];TofTrack Y [cm];Entries",
482  84,
483  -25.2,
484  25.2,
485  200,
486  -80,
487  80);
488 
489  fHM->Create2<TH2D>(
490  "fhTofTrackRichHitX_oBetacuts",
491  "fhTofTrackRichHitX_oBetacuts;RICH Hit X [cm];TofTrack X [cm];Entries",
492  67,
493  -20.1 + fXOffsetHisto,
494  20.1 + fXOffsetHisto,
495  400,
496  -50,
497  110);
498  fHM->Create2<TH2D>(
499  "fhTofTrackRichHitY_oBetacuts",
500  "fhTofTrackRichHitY_oBetacuts;RICH Hit Y [cm];TofTrack Y [cm];Entries",
501  84,
502  -25.2,
503  25.2,
504  200,
505  -80,
506  80);
507  fHM->Create1<TH1D>("fhTofTrackRichHitTime_oBetacuts",
508  "fhTofTrackRichHitTime_oBetacuts;#Delta Time [ns];Entries",
509  280,
510  -70.,
511  70.);
512 
513  fHM->Create2<TH2D>(
514  "fhTofTrackRichHitX_uBetacuts",
515  "fhTofTrackRichHitX_uBetacuts;RICH Hit X [cm];TofTrack X [cm];Entries",
516  67,
517  -20.1 + fXOffsetHisto,
518  20.1 + fXOffsetHisto,
519  400,
520  -50,
521  110);
522  fHM->Create2<TH2D>(
523  "fhTofTrackRichHitY_uBetacuts",
524  "fhTofTrackRichHitY_uBetacuts;RICH Hit Y [cm];TofTrack Y [cm];Entries",
525  84,
526  -25.2,
527  25.2,
528  200,
529  -80,
530  80);
531 
532  fHM->Create2<TH2D>("fhTofTrackRichHitX_oBetacuts_dtime",
533  "fhTofTrackRichHitX_oBetacuts_dtime;RICH Hit X "
534  "[cm];TofTrack X [cm];Entries",
535  67,
536  -20.1 + fXOffsetHisto,
537  20.1 + fXOffsetHisto,
538  400,
539  -50,
540  110);
541  fHM->Create2<TH2D>("fhTofTrackRichHitY_oBetacuts_dtime",
542  "fhTofTrackRichHitY_oBetacuts_dtime;RICH Hit Y "
543  "[cm];TofTrack Y [cm];Entries",
544  84,
545  -25.2,
546  25.2,
547  200,
548  -80,
549  80);
550 
551  fHM->Create2<TH2D>("fhTofTrackRichHitX_oBetacuts_dtime_4",
552  "fhTofTrackRichHitX_oBetacuts_dtime_4;RICH Hit X "
553  "[cm];TofTrack X [cm];Entries",
554  67,
555  -20.1 + fXOffsetHisto,
556  20.1 + fXOffsetHisto,
557  400,
558  -50,
559  110);
560  fHM->Create2<TH2D>("fhTofTrackRichHitY_oBetacuts_dtime_4",
561  "fhTofTrackRichHitY_oBetacuts_dtime_4;RICH Hit Y "
562  "[cm];TofTrack Y [cm];Entries",
563  84,
564  -25.2,
565  25.2,
566  200,
567  -80,
568  80);
569 
570  fHM->Create2<TH2D>("fhTofTrackRichHitX_oBetacuts_dtime_6",
571  "fhTofTrackRichHitX_oBetacuts_dtime_6;RICH Hit X "
572  "[cm];TofTrack X [cm];Entries",
573  67,
574  -20.1 + fXOffsetHisto,
575  20.1 + fXOffsetHisto,
576  400,
577  -50,
578  110);
579  fHM->Create2<TH2D>("fhTofTrackRichHitY_oBetacuts_dtime_6",
580  "fhTofTrackRichHitY_oBetacuts_dtime_6;RICH Hit Y "
581  "[cm];TofTrack Y [cm];Entries",
582  84,
583  -25.2,
584  25.2,
585  200,
586  -80,
587  80);
588 
589  fHM->Create2<TH2D>("fhTofTrackRichHitX_oBetacuts_dtime_8",
590  "fhTofTrackRichHitX_oBetacuts_dtime_8;RICH Hit X "
591  "[cm];TofTrack X [cm];Entries",
592  67,
593  -20.1 + fXOffsetHisto,
594  20.1 + fXOffsetHisto,
595  400,
596  -50,
597  110);
598  fHM->Create2<TH2D>("fhTofTrackRichHitY_oBetacuts_dtime_8",
599  "fhTofTrackRichHitY_oBetacuts_dtime_8;RICH Hit Y "
600  "[cm];TofTrack Y [cm];Entries",
601  84,
602  -25.2,
603  25.2,
604  200,
605  -80,
606  80);
607 
608  fHM->Create2<TH2D>("fhTofTrackRichHitX_oBetacuts_dtime_10",
609  "fhTofTrackRichHitX_oBetacuts_dtime_10;RICH Hit X "
610  "[cm];TofTrack X [cm];Entries",
611  67,
612  -20.1 + fXOffsetHisto,
613  20.1 + fXOffsetHisto,
614  400,
615  -50,
616  110);
617  fHM->Create2<TH2D>("fhTofTrackRichHitY_oBetacuts_dtime_10",
618  "fhTofTrackRichHitY_oBetacuts_dtime_10;RICH Hit Y "
619  "[cm];TofTrack Y [cm];Entries",
620  84,
621  -25.2,
622  25.2,
623  200,
624  -80,
625  80);
626 
627  fHM->Create2<TH2D>(
628  "fhTofTrackRichRingHitX",
629  "fhTofTrackRichRingHitX;RICH Ring Hit X [cm];TofTrack X [cm];Entries",
630  67,
631  -20.1 + fXOffsetHisto,
632  20.1 + fXOffsetHisto,
633  400,
634  -50,
635  110);
636  fHM->Create2<TH2D>(
637  "fhTofTrackRichRingHitY",
638  "fhTofTrackRichRingHitY;RICH Ring Hit Y [cm];TofTrack Y [cm];Entries",
639  84,
640  -25.2,
641  25.2,
642  200,
643  -80,
644  80);
645 
646  fHM->Create2<TH2D>(
647  "fhTofHitRichRingHitX",
648  "fhTofHitRichRingHitX;RICH Ring Hit X [cm];Tof Hit X [cm];Entries",
649  67,
650  -20.1 + fXOffsetHisto,
651  20.1 + fXOffsetHisto,
652  400,
653  -50,
654  110);
655  fHM->Create2<TH2D>(
656  "fhTofHitRichRingHitY",
657  "fhTofHitRichRingHitY;RICH Ring Hit Y [cm];Tof Hit Y [cm];Entries",
658  84,
659  -25.2,
660  25.2,
661  200,
662  -80,
663  80);
664 
665  //Tof Rich correlation
666  fHM->Create2<TH2D>("fhTofRichX_zoomed",
667  "fhTofRichX_zoomed;Rich Hit X [cm];TofHit X [cm];Entries",
668  27,
669  -8.1 + fXOffsetHisto,
670  8.1 + fXOffsetHisto,
671  180,
672  -15,
673  75);
674  fHM->Create2<TH2D>("fhTofRichY_zoomed",
675  "fhTofRichY_zoomed;Rich Hit Y [cm];TofHit Y [cm];Entries",
676  14,
677  7.8,
678  16.2,
679  30,
680  -5.,
681  25);
682 
683  fHM->Create2<TH2D>(
684  "fhClosTrackRingX",
685  "fhClosTrackRingX;Rich Ring center X [cm];Tof Track X [cm];Entries",
686  67,
687  -20.1 + fXOffsetHisto,
688  20.1 + fXOffsetHisto,
689  400,
690  -50,
691  110);
692  fHM->Create2<TH2D>(
693  "fhClosTrackRingY",
694  "fhClosTrackRingY;Rich Ring center Y [cm];Tof Track Y [cm];Entries",
695  84,
696  -25.2,
697  25.2,
698  200,
699  -80,
700  80);
701 
702  fHM->Create2<TH2D>(
703  "fhTofRichRingX",
704  "fhTofRichRingX;Rich Ring Center X [cm];TofHit X [cm];Entries",
705  100,
706  -20 + fXOffsetHisto,
707  20 + fXOffsetHisto,
708  400,
709  -50,
710  110);
711  fHM->Create2<TH2D>(
712  "fhTofRichRingY",
713  "fhTofRichRingY;Ring Ring Center Y [cm];TofHit Y [cm];Entries",
714  125,
715  -25,
716  25,
717  200,
718  -80,
719  80);
720  fHM->Create2<TH2D>("fhTofRichRingXZ",
721  "fhTofRichXZ; Z [cm];Hit/Ring X [cm];Entries",
722  140,
723  230,
724  370,
725  400,
726  -50,
727  110);
728 
729  fHM->Create2<TH2D>("fhTofTrackRichRingXY",
730  "fhTofTrackRichRingXY; X [cm]; Y [cm];Entries",
731  100,
732  -20 + fXOffsetHisto,
733  20 + fXOffsetHisto,
734  120,
735  -10,
736  20); //1bin == 2mm
737  fHM->Create2<TH2D>("fhTofClosTrackRichRingXY",
738  "fhTofClosTrackRichRingXY; X [cm]; Y [cm];Entries",
739  100,
740  -20 + fXOffsetHisto,
741  20 + fXOffsetHisto,
742  120,
743  -10,
744  20); //1bin == 2mm
745 
746  fHM->Create3<TH3D>(
747  "fhTofXYZ",
748  "fhTofXYZ;Tof Hit X [cm];TofHit Z [cm];Tof Hit Y [cm];Entries",
749  100,
750  -20,
751  20,
752  141,
753  230.,
754  370.,
755  100,
756  -20,
757  20);
758  fHM->Create2<TH2D>("fhTofHitsXY",
759  "fhTofHitsXY;Tof Hit X [cm];Tof Hit Y [cm];Entries",
760  100,
761  -20,
762  20,
763  200,
764  -80,
765  80);
766  fHM->Create1<TH1D>(
767  "fhTofHitsZ", "fhTofHitsZ;Z [cm];Entries", 350, -0.5, 349.5);
768  fHM->Create2<TH2D>("fhTofHitsXZ",
769  "fhTofHitsXZ;Z [cm];X [cm];Entries",
770  350,
771  -0.5,
772  349.5,
773  400,
774  -50,
775  110);
776  //Tof Tracks
777  fHM->Create1<TH1D>("fhTofTracksPerEvent",
778  "fhTofTracksPerEvent;NofTracks/Event;Entries",
779  20,
780  -0.5,
781  19.5);
782  fHM->Create1<TH1D>("fhTofTracksPerRichEvent",
783  "fhTofTracksPerRichEvent;NofTracks/RichEvent;Entries",
784  20,
785  -0.5,
786  19.5);
787  fHM->Create2<TH2D>(
788  "fhTofTracksXY",
789  "fhTofTracksXY;X[cm];Y[cm];NofTracks/cm^2",
790  250,
791  -100,
792  150,
793  300,
794  -150,
795  150); //50 , -20 + fXOffsetHisto, 30 + fXOffsetHisto, 180,-90,90); // projected in RICH Plane
796 
797  fHM->Create2<TH2D>(
798  "fhTofTracksXY_Target",
799  "fhTofTracksXY_Target;X[cm];Y[cm];NofTracks/cm^2",
800  100,
801  -50,
802  50,
803  100,
804  -50,
805  50); //50 , -20 + fXOffsetHisto, 30 + fXOffsetHisto, 180,-90,90); // projected in Z=0
806  fHM->Create2<TH2D>(
807  "fhGoodRingsXY_TargetPos",
808  "fhGoodRingsXY_TargetPos;X[cm];Y[cm];NofTracks/cm^2",
809  100,
810  -50,
811  50,
812  100,
813  -50,
814  50); //50 , -20 + fXOffsetHisto, 30 + fXOffsetHisto, 180,-90,90); // projected in Z=0
815 
816  fHM->Create2<TH2D>(
817  "fhTofTrackRichRingX",
818  "fhTofTrackRichRingX;Rich Ring Center X [cm];TofTrack X [cm];Entries",
819  100,
820  -20 + fXOffsetHisto,
821  20 + fXOffsetHisto,
822  400,
823  -50,
824  110);
825  fHM->Create2<TH2D>(
826  "fhTofTrackRichRingY",
827  "fhTofTrackRichRingY;Ring Ring Center Y [cm];TofTrack Y [cm];Entries",
828  125,
829  -25,
830  25,
831  200,
832  -80,
833  80);
834 
835  fHM->Create2<TH2D>("fhTofTracksXYRICH",
836  "fhTofTracksXYRICH;X[cm];Y[cm];NofTracks/cm^2",
837  50,
838  -20 + fXOffsetHisto,
839  30 + fXOffsetHisto,
840  180,
841  -90,
842  90); // projected in RICH Plane
843  fHM->Create1<TH1D>("fhNofTofTracks",
844  "fhNofTofTracks;X[cm];Y[cm];NofTracks",
845  4,
846  0,
847  4); // 1: All 2: left; 3: right; 4: RICH
848 
849  fHM->Create1<TH1D>("fhRingTrackDistance",
850  "fhRingTrackDistance;RingTrackDistance [cm];Entries",
851  31,
852  -0.25,
853  14.75);
854 
855  fHM->Create1<TH1D>("fhTrackRingDistance",
856  "fhTrackRingDistance;TrackRingDistance [cm];Entries",
857  31,
858  -0.5,
859  30.5);
860  fHM->Create1<TH1D>(
861  "fhTrackRingDistanceOnTarget",
862  "fhTrackRingDistanceOnTarget;TrackRingDistance [cm];Entries",
863  31,
864  -0.5,
865  30.5);
866  fHM->Create1<TH1D>(
867  "fhTrackRingDistanceOffTarget",
868  "fhTrackRingDistanceOffTarget;TrackRingDistance [cm];Entries",
869  31,
870  -0.5,
871  30.5);
872  fHM->Create2<TH2D>("fhTrackRingDistanceVSRingradius",
873  "fhTrackRingDistanceVSRingradius;TrackRingDistance "
874  "[cm];RingRadius [cm];Entries",
875  81,
876  -0.5,
877  80.5,
878  100,
879  0.,
880  7.);
881 
882  fHM->Create2<TH2D>(
883  "fhTrackRingDistanceVSRingChi2",
884  "fhTrackRingDistanceVSRingChi2;TrackRingDistance [cm];\\Chi^2;Entries",
885  60,
886  0,
887  30,
888  101,
889  0.,
890  10.1);
891  fHM->Create2<TH2D>("fhTrackRingDistanceVSRingChi2_goodRing",
892  "fhTrackRingDistanceVSRingChi2_goodRing;TrackRingDistance "
893  "[cm];\\Chi^2;Entries",
894  40,
895  0,
896  10.0,
897  101,
898  0.,
899  10.1);
900 
901  fHM->Create1<TH1D>("fhTrackRingDistance_corr",
902  "fhTrackRingDistance_corr;TrackRingDistance [cm];Entries",
903  31,
904  -0.5,
905  30.5);
906 
907  fHM->Create1<TH1D>("fhTofBetaTracksWithHitsNoRing",
908  "fhTofBetaTracksWithHitsNoRing; \\beta;Entries",
909  151,
910  -0.005,
911  1.505);
912  fHM->Create1<TH1D>("fhTofBetaTracksWithHits",
913  "fhTofBetaTracksWithHits; \\beta;Entries",
914  151,
915  -0.005,
916  1.505);
917  fHM->Create1<TH1D>("fhTofBetaTracksNoRing",
918  "fhTofBetaTracksNoRing; \\beta;Entries",
919  151,
920  -0.005,
921  1.505);
922  fHM->Create1<TH1D>("fhTofBetaTrackswithClosestRingInRange",
923  "fhTofBetaTrackswithClosestRingInRange; \\beta;Entries",
924  151,
925  -0.005,
926  1.505);
927 
928  fHM->Create1<TH1D>(
929  "fhRichRingBeta", "fhRichRingBeta; \\beta;Entries", 151, -0.005, 1.505);
930  fHM->Create1<TH1D>("fhRichRingBeta_GoodRing",
931  "fhRichRingBeta_GoodRing; \\beta;Entries",
932  151,
933  -0.005,
934  1.505);
935 
936  fHM->Create1<TH1D>(
937  "fhTofBetaRing", "fhTofBetaRing; \\beta;Entries", 151, -0.005, 1.505);
938  fHM->Create1<TH1D>(
939  "fhTofBetaAll", "fhTofBetaAll; \\beta;Entries", 151, -0.005, 1.505);
940  fHM->Create2<TH2D>("fhTofBetaVsRadius",
941  "fhTofBetaVsRadius; \\beta;ring radius [cm];Entries",
942  151,
943  -0.005,
944  1.505,
945  100,
946  0.,
947  7.);
948  fHM->Create2<TH2D>("fhTofBetaRingDist",
949  "fhTofBetaRingDist; \\beta;ring Dist [cm];Entries",
950  151,
951  -0.005,
952  1.505,
953  100,
954  0.,
955  20.);
956  fHM->Create1<TH1D>("fhTofBetaAllFullAcc",
957  "fhTofBetaAllFullAcc; \\beta;Entries",
958  301,
959  -1.505,
960  1.505);
961 
962  fHM->Create1<TH1D>("fhRingDeltaTime",
963  "fhRingDeltaTime; \\Delta Time/ns;Entries",
964  101,
965  -10.1,
966  10.1);
967  fHM->Create1<TH1D>(
968  "fhRingToTs", "fhRingToTs; ToT/ns;Entries", 601, 9.975, 40.025);
969  fHM->Create1<TH1D>("fhRingLE", "fhRingLE;LE/ns;Entries", 201, -0.5, 200.5);
970  fHM->Create1<TH1D>(
971  "fhGoodRingLE", "fhGoodRingLE;LE/ns;Entries", 201, -0.5, 200.5);
972  fHM->Create1<TH1D>(
973  "fhRingNoClTrackLE", "fhRingNoClTrackLE;LE/ns;Entries", 201, -0.5, 200.5);
974  fHM->Create1<TH1D>("fhRingClTrackFarAwayLE",
975  "fhRingClTrackFarAwayLE;LE/ns;Entries",
976  201,
977  -0.5,
978  200.5);
979  fHM->Create2<TH2D>("fhRingLEvsToT",
980  "fhRingLEvsToT;LE/ns;ToT/ns;Entries",
981  201,
982  -0.5,
983  200.5,
984  601,
985  9.975,
986  40.025);
987 
988  fHM->Create1<TH1D>("fhInnerRingDeltaTime",
989  "fhInnerRingDeltaTime; \\Delta Time/ns;Entries",
990  101,
991  -10.1,
992  10.1);
993  fHM->Create1<TH1D>(
994  "fhInnerRingToTs", "fhInnerRingToTs; ToT/ns;Entries", 601, 9.975, 40.025);
995  fHM->Create1<TH1D>(
996  "fhInnerRingLE", "fhInnerRingLE;LE/ns;Entries", 201, -0.5, 200.5);
997  fHM->Create1<TH1D>(
998  "fhInnerGoodRingLE", "fhInnerGoodRingLE;LE/ns;Entries", 201, -0.5, 200.5);
999  fHM->Create1<TH1D>("fhInnerRingNoClTrackLE",
1000  "fhInnerRingNoClTrackLE;LE/ns;Entries",
1001  201,
1002  -0.5,
1003  200.5);
1004  fHM->Create1<TH1D>("fhInnerRingClTrackFarAwayLE",
1005  "fhInnerRingClTrackFarAwayLE;LE/ns;Entries",
1006  201,
1007  -0.5,
1008  200.5);
1009  fHM->Create1<TH1D>(
1010  "fhInnerRingFlag", "fhInnerRingFlag;Has|HasNot;Entries", 2, -0.5, 1.5);
1011  fHM->Create1<TH1D>(
1012  "fhNofInnerHits", "fhNofInnerHits;#Hits;Entries", 31, -0.5, 30.5);
1013 
1014  fHM->Create1<TH1D>(
1015  "fhDiRICHsInRegion", "fhNofInnerHits;#Hits;DiRICH", 4096, 28672, 32767);
1016 
1017  fHM->Create1<TH1D>(
1018  "fhBlobTrackDistX",
1019  "fhBlobTrackDistX; |TofTrackX - MAPMT center X| [cm];Entries",
1020  30,
1021  -0.5,
1022  29.5);
1023  fHM->Create1<TH1D>(
1024  "fhBlobTrackDistY",
1025  "fhBlobTrackDistY; |TofTrackY - MAPMT center Y| [cm];Entries",
1026  30,
1027  -0.5,
1028  29.5);
1029  fHM->Create1<TH1D>(
1030  "fhBlobTrackDist",
1031  "fhBlobTrackDist; |TofTrack - MAPMT center dist| [cm];Entries",
1032  30,
1033  -0.5,
1034  29.5);
1035 
1036  fHM->Create1<TH1D>("fhNofBlobEvents",
1037  "fhNofBlobEvents;;#Events with min. one Blob",
1038  1,
1039  0.5,
1040  1.5);
1041  fHM->Create1<TH1D>("fhNofBlobsInEvent",
1042  "fhNofBlobsInEvent;#Blobs in Event;Entries",
1043  36,
1044  0.5,
1045  36.5);
1046 
1047  fHM->Create1<TH1D>("fhRichDigisConsecTime",
1048  "fhRichDigisConsecTime;consecutive time [ns];Entries",
1049  500,
1050  -0.5,
1051  499.5);
1052  fHM->Create1<TH1D>("fhRichDigisConsecTimeTOT",
1053  "fhRichDigisConsecTimeTOT;consecutive time [ns];Entries",
1054  500,
1055  -0.5,
1056  499.5);
1057 
1058  fHM->Create1<TH1D>("fhNofHitsInGoodRing",
1059  "fhNofHitsInGoodRing;# hits in ring;Entries",
1060  50,
1061  -0.5,
1062  49.5);
1063  fHM->Create1<TH1D>(
1064  "fhTracksWithRings", "fhTracksWithRings;Scenarios;Entries", 5, -0.5, 4.5);
1065 
1066  fHM->Create1<TH1D>(
1067  "fhRichRingChi2", "fhRichRingChi2;\\Chi^2;Entries", 101, 0., 10.1);
1068  fHM->Create1<TH1D>("fhRichRingChi2_goodRing",
1069  "fhRichRingChi2_goodRing;\\Chi^2;Entries",
1070  101,
1071  0.,
1072  10.1);
1073 
1074  fHM->Create2<TH2D>("fhTofTracksXYRICH_Accectance",
1075  "fhTofTracksXYRICH_Accectance;X[cm];Y[cm];NofTracks/cm^2",
1076  50,
1077  -20 + fXOffsetHisto,
1078  30 + fXOffsetHisto,
1079  180,
1080  -90,
1081  90); // projected in RICH Plane
1082 }
1083 
1084 
1085 void CbmRichMCbmQaReal::Exec(Option_t* /*option*/) {
1086  fEventNum++;
1087  fHM->H1("fhNofEvents")->Fill(1);
1088  cout << "CbmRichMCbmQaReal, event No. " << fEventNum << endl;
1089 
1090  if (fDigiHitsInitialized == false) {
1091  auto nOfCbmEvent = fCbmEvent->GetEntriesFast();
1092  if (nOfCbmEvent > 0) {
1093  CbmEvent* ev = static_cast<CbmEvent*>(fCbmEvent->At(0));
1094  /*if ((fDigiMan->GetNofDigis(ECbmModuleId::kRich)> 10) &&
1095  //(fDigiMan->GetNofDigis(ECbmModuleId::kSts) > 30) ||
1096  //(fRichRings->GetEntries()> 0) ||
1097  (fDigiMan->GetNofDigis(ECbmModuleId::kTof) > 10)
1098  )*/
1099  if (ev != nullptr) {
1100  double minTime =
1101  ev->GetStartTime(); //std::numeric_limits<double>::max();
1102  /* for (int i = 0; i < fDigiMan->GetNofDigis(ECbmModuleId::kRich); i++) {
1103  const CbmRichDigi* richDigi = fDigiMan->Get<CbmRichDigi>(i);
1104  // fHM->H1("fhRichDigisToT")->Fill(richDigi->GetToT());
1105  if (richDigi->GetTime() < minTime) minTime = richDigi->GetTime();
1106  }*/
1107 
1108  double dT = 40e9;
1109  double dTZoom1 = 0.8e9;
1110  double dTZoom2 = 0.008e9;
1111  fHM->H1("fhRichDigisTimeLog")
1112  ->GetXaxis()
1113  ->SetLimits(minTime, minTime + dT);
1114  fHM->H1("fhRichDigisTimeLogZoom")
1115  ->GetXaxis()
1116  ->SetLimits(minTime, minTime + dTZoom1);
1117  fHM->H1("fhRichDigisTimeLogZoom2")
1118  ->GetXaxis()
1119  ->SetLimits(minTime, minTime + dTZoom2);
1120 
1121  fHM->H1("fhRichRingsTimeLog")
1122  ->GetXaxis()
1123  ->SetLimits(minTime, minTime + dT);
1124  fHM->H1("fhRichRingsTimeLogZoom")
1125  ->GetXaxis()
1126  ->SetLimits(minTime, minTime + dTZoom1);
1127  fHM->H1("fhRichRingsTimeLogZoom2")
1128  ->GetXaxis()
1129  ->SetLimits(minTime, minTime + dTZoom2);
1130 
1131  fHM->H1("fhTofDigisTimeLog")
1132  ->GetXaxis()
1133  ->SetLimits(minTime, minTime + dT);
1134  fHM->H1("fhTofDigisTimeLogZoom")
1135  ->GetXaxis()
1136  ->SetLimits(minTime, minTime + dTZoom1);
1137  fHM->H1("fhTofDigisTimeLogZoom2")
1138  ->GetXaxis()
1139  ->SetLimits(minTime, minTime + dTZoom2);
1140 
1141  fHM->H1("fhStsDigisTimeLog")
1142  ->GetXaxis()
1143  ->SetLimits(minTime, minTime + dT);
1144  fHM->H1("fhStsDigisTimeLogZoom")
1145  ->GetXaxis()
1146  ->SetLimits(minTime, minTime + dTZoom1);
1147  fHM->H1("fhStsDigisTimeLogZoom2")
1148  ->GetXaxis()
1149  ->SetLimits(minTime, minTime + dTZoom2);
1150 
1151  fHM->H1("fhT0DigisTimeLog")
1152  ->GetXaxis()
1153  ->SetLimits(minTime, minTime + dT);
1154  fHM->H1("fhT0DigisTimeLogZoom")
1155  ->GetXaxis()
1156  ->SetLimits(minTime, minTime + dTZoom1);
1157  fHM->H1("fhT0DigisTimeLogZoom2")
1158  ->GetXaxis()
1159  ->SetLimits(minTime, minTime + dTZoom2);
1160 
1161  fDigiHitsInitialized = true;
1162  }
1163  }
1164  } // if (fDigiHitsInitialized == false)
1165 
1166  if (fDigiHitsInitialized == true) {
1167 
1168  int nofRichDigis = fDigiMan->GetNofDigis(ECbmModuleId::kRich);
1169  fHM->H1("fhNofRichDigisInTimeslice")->Fill(nofRichDigis);
1170  for (int i = 0; i < nofRichDigis; i++) {
1171  const CbmRichDigi* digi = fDigiMan->Get<CbmRichDigi>(i);
1172  fHM->H1("fhRichDigisTimeLog")->Fill(digi->GetTime());
1173  fHM->H1("fhRichDigisTimeLogZoom")->Fill(digi->GetTime());
1174  fHM->H1("fhRichDigisTimeLogZoom2")->Fill(digi->GetTime());
1175  }
1176 
1177  int nofRichRings = fRichRings->GetEntries();
1178  for (int i = 0; i < nofRichRings; i++) {
1179  CbmRichRing* ring = static_cast<CbmRichRing*>(fRichRings->At(i));
1180  fHM->H1("fhRichRingsTimeLog")->Fill(ring->GetTime());
1181  fHM->H1("fhRichRingsTimeLogZoom")->Fill(ring->GetTime());
1182  fHM->H1("fhRichRingsTimeLogZoom2")->Fill(ring->GetTime());
1183  }
1184 
1185  int nofTofDigis = fDigiMan->GetNofDigis(ECbmModuleId::kTof);
1186  for (int i = 0; i < nofTofDigis; i++) {
1187  const CbmTofDigi* digi = fDigiMan->Get<CbmTofDigi>(i);
1188  fHM->H1("fhTofDigisTimeLog")->Fill(digi->GetTime());
1189  fHM->H1("fhTofDigisTimeLogZoom")->Fill(digi->GetTime());
1190  fHM->H1("fhTofDigisTimeLogZoom2")->Fill(digi->GetTime());
1191  }
1192 
1194  int nofStsDigis = fDigiMan->GetNofDigis(ECbmModuleId::kSts);
1195  for (int i = 0; i < nofStsDigis; i++) {
1196  const CbmStsDigi* digi = fDigiMan->Get<CbmStsDigi>(i);
1197  fHM->H1("fhStsDigisTimeLog")->Fill(digi->GetTime());
1198  fHM->H1("fhStsDigisTimeLogZoom")->Fill(digi->GetTime());
1199  fHM->H1("fhStsDigisTimeLogZoom2")->Fill(digi->GetTime());
1200  }
1201  }
1202 
1203  {
1204  Int_t nrT0Digis = 0;
1205  if (fT0Digis) nrT0Digis = fT0Digis->size();
1206  //else if ( fT0DigiArr ) nrT0Digis = fT0DigiArr->GetEntriesFast();
1207  LOG(debug) << "T0Digis: " << nrT0Digis;
1208 
1209  for (Int_t iT0 = 0; iT0 < nrT0Digis; ++iT0) {
1210  const CbmTofDigi* T0Digi = nullptr;
1211  if (fT0Digis) T0Digi = &(fT0Digis->at(iT0));
1212  //else if ( fT0DigiArr ) T0Digi = dynamic_cast<const CbmTofDigi*>(fT0DigiArr->At(iT0));
1213  assert(T0Digi);
1214  fHM->H1("fhT0DigisTimeLog")->Fill(T0Digi->GetTime());
1215  fHM->H1("fhT0DigisTimeLogZoom")->Fill(T0Digi->GetTime());
1216  fHM->H1("fhT0DigisTimeLogZoom2")->Fill(T0Digi->GetTime());
1217  }
1218  }
1219  }
1220 
1221  int nofRichHits = fRichHits->GetEntries();
1222  fHM->H1("fhNofRichHitsInTimeslice")->Fill(nofRichHits);
1223  fHM->H1("fhHitsInTimeslice")->Fill(fEventNum, nofRichHits);
1224 
1225  {
1226  int nofRichDigis = fDigiMan->GetNofDigis(ECbmModuleId::kRich);
1227  for (int i = 0; i < nofRichDigis; i++) {
1228  const CbmRichDigi* richDigi = fDigiMan->Get<CbmRichDigi>(i);
1229  fHM->H1("fhRichDigisToT")->Fill(richDigi->GetToT());
1230 
1231  if (i > 0) {
1232  const CbmRichDigi* richDigi_prev = fDigiMan->Get<CbmRichDigi>(i - 1);
1233  fHM->H1("fhRichDigisConsecTime")
1234  ->Fill(richDigi->GetTime() - richDigi_prev->GetTime());
1235  if (doToT(richDigi) && doToT(richDigi_prev))
1236  fHM->H1("fhRichDigisConsecTimeTOT")
1237  ->Fill(richDigi->GetTime() - richDigi_prev->GetTime());
1238  }
1239 
1240  //fHM->H2("fhRichDigiPixelRate")->Fill(richDigi->GetX(),richDigi->GetY());
1241  }
1242  }
1243 
1244  Double_t zPos_tmp = 0.;
1245  for (int iH = 0; iH < nofRichHits; iH++) {
1246  CbmRichHit* richHit = static_cast<CbmRichHit*>(fRichHits->At(iH));
1247  fHM->H2("fhRichHitXY")->Fill(richHit->GetX(), richHit->GetY());
1248  fHM->H1("fhRichHitToT")->Fill(richHit->GetToT());
1249  zPos_tmp = ((zPos_tmp * iH) + richHit->GetZ()) / (iH + 1);
1250  //printf("HitToT: %f \n", richHit->GetToT());
1251  }
1252  if (nofRichHits > 0) RichZPos = zPos_tmp;
1253 
1254  //std::cout<<"[INFO] Mean Z-Position of RICH Hits: "<<RichZPos<<std::endl;
1255  //CBMEVENT
1256  auto fNCbmEvent = fCbmEvent->GetEntriesFast();
1257 
1258  for (int i = 0; i < fNCbmEvent; i++) {
1259  fHM->H1("fhNofCbmEvents")->Fill(1);
1260  CbmEvent* ev = static_cast<CbmEvent*>(fCbmEvent->At(i));
1261 
1262  if (fTriggerRichHits != 0
1264  continue;
1265  if (fTriggerTofHits != 0
1267  continue;
1268 
1269  //if (ev->GetNofData(ECbmDataType::kTofHit) > (fTriggerTofHits+10) ) continue;
1270 
1271  std::vector<int> ringIndx;
1272  std::vector<int> evRichHitIndx;
1273  std::array<uint32_t, 36> pmtHits;
1274  for (auto& a : pmtHits)
1275  a = 0;
1276 
1277  fEventPnt = ev;
1279 
1280 
1281  // Scan Event to find first Digi that triggered.
1282  // std::cout<<"Sts Digis:"<< ev->GetNofData(kStsDigi)<<std::endl;
1283  // std::cout<<"Much Digis:"<< ev->GetNofData(kMuchDigi)<<std::endl;
1284  // std::cout<<"Tof Digis:"<< ev->GetNofData(kTofDigi)<<std::endl;
1285  // std::cout<<"Rich Digis:"<< ev->GetNofData(kRichDigi)<<std::endl;
1286  // std::cout<<"Psd Digis:"<< ev->GetNofData(kPsdDigi)<<std::endl;
1287  // unsigned int flagRich = 0;
1288  Double_t startTime = std::numeric_limits<Double_t>::max();
1289 
1290  for (int j = 0; j < ev->GetNofData(ECbmDataType::kRichHit); j++) {
1291  auto iRichHit = ev->GetIndex(ECbmDataType::kRichHit, j);
1292  evRichHitIndx.push_back(iRichHit);
1293  CbmRichHit* richHit = static_cast<CbmRichHit*>(fRichHits->At(iRichHit));
1294  fHM->H1("fhRichHitToTEvent")->Fill(richHit->GetToT());
1295  fHM->H2("fhRichHitXYEvent")->Fill(richHit->GetX(), richHit->GetY());
1296  //Blob finder
1297  uint32_t pmtId = (((richHit->GetAddress()) >> 20) & 0xF)
1298  + (((richHit->GetAddress()) >> 24) & 0xF) * 9;
1299  pmtHits[pmtId]++;
1300 
1301  //std::cout<<"\t\t * "<<i<<". Event, Hit "<< j <<": "<< iRichHit <<"\t " << std::fixed << std::setprecision(5) << richHit->GetTime() <<std::endl;
1302  if (richHit->GetTime() < startTime) {
1303  startTime = richHit->GetTime(); /*flagRich = 1;*/
1304  }
1305  int nofRichRings2 = fRichRings->GetEntries();
1306  for (int l = 0; l < nofRichRings2; l++) {
1307  CbmRichRing* ring = static_cast<CbmRichRing*>(fRichRings->At(l));
1308  auto NofRingHits = ring->GetNofHits();
1309  for (int m = 0; m < NofRingHits; m++) {
1310  auto RingHitIndx = ring->GetHit(m);
1311  if (RingHitIndx == iRichHit) {
1312  Bool_t used = false;
1313  for (auto check : ringIndx) {
1314  if (check == l) {
1315  used = true;
1316  break;
1317  }
1318  }
1319  if (used == false) ringIndx.push_back(l);
1320  break;
1321  }
1322  }
1323  }
1324 
1325  for (int k = 0; k < ev->GetNofData(ECbmDataType::kTofHit); k++) {
1326  auto iTofHit = ev->GetIndex(ECbmDataType::kTofHit, k);
1327  CbmTofHit* tofHit = static_cast<CbmTofHit*>(fTofHits->At(iTofHit));
1328  if (tofHit->GetTime() < startTime) {
1329  startTime = tofHit->GetTime(); /* flagRich = 0;*/
1330  }
1331  if (tofHit->GetZ() < 2.) continue; // Cut T0 away!
1332  fHM->H2("fhTofRichX")->Fill(richHit->GetX(), tofHit->GetX());
1333 
1334  //Befor tof_v20b
1335  /*if (tofHit->GetZ()> 230. && tofHit->GetZ() < 250) fHM->H2("fhTofRichX_stack1")->Fill(richHit->GetX(),tofHit->GetX());
1336  if (tofHit->GetZ()> 250. && tofHit->GetZ() < 265) fHM->H2("fhTofRichX_stack2")->Fill(richHit->GetX(),tofHit->GetX());
1337  if (tofHit->GetZ()> 265. && tofHit->GetZ() < 285) fHM->H2("fhTofRichX_stack3")->Fill(richHit->GetX(),tofHit->GetX());
1338  */
1339  if (tofHit->GetZ() > 230. && tofHit->GetZ() < 255)
1340  fHM->H2("fhTofRichX_stack1")->Fill(richHit->GetX(), tofHit->GetX());
1341  if (tofHit->GetZ() >= 255. && tofHit->GetZ() < 272)
1342  fHM->H2("fhTofRichX_stack2")->Fill(richHit->GetX(), tofHit->GetX());
1343  if (tofHit->GetZ() >= 272. && tofHit->GetZ() < 290)
1344  fHM->H2("fhTofRichX_stack3")->Fill(richHit->GetX(), tofHit->GetX());
1345 
1346  fHM->H2("fhTofRichY")->Fill(richHit->GetY(), tofHit->GetY());
1347  fHM->H2("fhTofRichX_zoomed")->Fill(richHit->GetX(), tofHit->GetX());
1348  fHM->H2("fhTofRichY_zoomed")->Fill(richHit->GetY(), tofHit->GetY());
1349 
1350  fHM->H2("fhTofHitsXY")->Fill(tofHit->GetX(), tofHit->GetY());
1351  }
1352  }
1353 
1354  //std::cout<<"Diff in StartTime DigiToHit: "<< startTime - fCbmEventStartTime << "\t" <<flagRich<<std::endl;
1355  fCbmEventStartTime = startTime;
1356 
1357  fSeDisplay->DrawEvent(ev, ringIndx, 1);
1358 
1359  // std::cout<<DrawCbmEvent<<std::endl;
1360  // for (int j=0;j<ev->GetNofData(ECbmDataType::kRichDigi);j++){
1361  // auto iRichDigi = ev->GetIndex(ECbmDataType::kRichDigi, j);
1362  // CbmRichDigi* richDigi = static_cast<CbmRichDigi*>(fRichDigis->At(iRichDigi));
1363  // std::cout<<"\t\t * "<<i<<". Event, Digi "<< j <<": "<< iRichDigi <<"\t " << std::fixed << std::setprecision(5) << richDigi->GetTime()<<std::endl;
1364  // }
1365 
1366  //std::vector<int> evTofTrack;
1367 
1368  //*** Tracks in CbmEvent -> Here Trigger is on! This is seen in Track Position
1369  //std::cout<<"TRACKS in CbmEvent: "<<ev->GetNofData(ECbmDataType::kTofTrack)<<std::endl;
1370  auto noftofTracks = ev->GetNofData(ECbmDataType::kTofTrack);
1371  fHM->H1("fhTofTracksPerEvent")->Fill(noftofTracks);
1372 
1373  for (int j = 0; j < noftofTracks; j++) {
1374  auto iTofTrack = ev->GetIndex(ECbmDataType::kTofTrack, j);
1375  CbmTofTracklet* tTrack =
1376  static_cast<CbmTofTracklet*>(fTofTracks->At(iTofTrack));
1377  if (tTrack == nullptr) continue;
1378 
1379  fHM->H1("fhTracksWithRings")->Fill(0);
1380  fHM->H2("fhTofTracksXY")
1381  ->Fill(tTrack->GetFitX(RichZPos), tTrack->GetFitY(RichZPos));
1382  fHM->H2("fhTofTracksXY_Target")
1383  ->Fill(tTrack->GetFitX(0.), tTrack->GetFitY(0.));
1384  fHM->H1("fhNofTofTracks")
1385  ->Fill(0.5); // 1: All 2: left; 3: right; 4: RICH
1386  fHM->H1("fhTofBetaAllFullAcc")->Fill(getBeta(tTrack));
1387  //std::cout<<"beta Track "<< j <<": "<<getBeta(tTrack)<<std::endl;
1388 
1389  if (tTrack->GetFitX(RichZPos) > -10. && tTrack->GetFitX(RichZPos) < +10.
1390  && tTrack->GetFitY(RichZPos) > -25.
1391  && tTrack->GetFitY(RichZPos) < +25. && isOnTarget(tTrack)) {
1392  //Track in RICH
1393  fTracksinRich++;
1394  Int_t goodHit = 0;
1395  for (int k = 0; k < ev->GetNofData(ECbmDataType::kRichHit); k++) {
1396  auto iRichHit = ev->GetIndex(ECbmDataType::kRichHit, k);
1397  CbmRichHit* richHit =
1398  static_cast<CbmRichHit*>(fRichHits->At(iRichHit));
1399  if (richHit == nullptr) continue;
1400  if (std::fabs(richHit->GetY() - tTrack->GetFitY(RichZPos)) < 5.
1401  && std::fabs(richHit->GetX() - tTrack->GetFitX(RichZPos)) < 9.)
1402  goodHit++;
1403  }
1404  if (goodHit > 0) fTracksinRichWithRichHits[0]++;
1405  if (goodHit > 5) fTracksinRichWithRichHits[1]++;
1406  if (goodHit > 10) fTracksinRichWithRichHits[2]++;
1407  if (goodHit > 15) fTracksinRichWithRichHits[3]++;
1408  }
1409 
1410  if (isAccmRICH(tTrack)) {
1411  if (RestrictToFullAcc(tTrack)) {
1412  fHM->H2("fhTofTracksXYRICH")
1413  ->Fill(tTrack->GetFitX(RichZPos),
1414  tTrack->GetFitY(RichZPos)); // projected in RICH Plane
1415  fHM->H1("fhNofTofTracks")
1416  ->Fill(3.5); // 1: All 2: left; 3: right; 4: RICH
1417  std::vector<int> evTofTrack;
1418  evTofTrack.push_back(iTofTrack);
1419  DrawRichTofEv(evRichHitIndx, evTofTrack);
1420 
1421  if (ringIndx.size() == 0 && evRichHitIndx.size() > 0)
1422  fHM->H1("fhTofBetaTracksWithHitsNoRing")
1423  ->Fill(getBeta(tTrack)); // no Ring in CbmEvent found
1424  if (evRichHitIndx.size() > 0)
1425  fHM->H1("fhTofBetaTracksWithHits")->Fill(getBeta(tTrack));
1426  if (ringIndx.size() == 0)
1427  fHM->H1("fhTofBetaTracksNoRing")->Fill(getBeta(tTrack));
1428 
1429  if ((tTrack->GetNofHits() == 4
1430  && (getBeta(tTrack) > 0.90 && getBeta(tTrack) < 1.10))) {
1431  //tracks after cut
1432  Double_t trackXpos = tTrack->GetFitX(RichZPos);
1433  Double_t trackYpos = tTrack->GetFitY(RichZPos);
1434 
1435  if (trackXpos > -8 && trackXpos < 13 && trackYpos > -21
1436  && trackYpos < 24) {
1437  if (!(trackXpos > -8 && trackXpos < -3 && trackYpos > 5
1438  && trackYpos < 7.5)
1439  && !(trackXpos > 7.8 && trackXpos < 13 && trackYpos > 5
1440  && trackYpos < 7.5)
1441  && !(trackXpos > -8 && trackXpos < 2 && trackYpos > 21
1442  && trackYpos < 24)
1443  && !(trackXpos > 7.8 && trackXpos < 13 && trackYpos > 21
1444  && trackYpos < 24)
1445  && !(trackXpos > 2.2 && trackXpos < 13 && trackYpos > 21
1446  && trackYpos < 16)) {
1447  fHM->H2("fhTofTracksXYRICH_Accectance")
1448  ->Fill(trackXpos, trackYpos);
1449  fHM->H1("fhTracksWithRings")->Fill(2);
1450  if (ringIndx.size() > 0) fHM->H1("fhTracksWithRings")->Fill(4);
1451  if (FindClosestRing(tTrack, ringIndx).first > -1)
1452  fHM->H1("fhTracksWithRings")->Fill(3);
1453  }
1454  }
1455 
1456  // filter on Rich Acc.
1457  // filter on
1458  }
1459 
1460  std::pair<int, double> closeRing = FindClosestRing(tTrack, ringIndx);
1461  if (closeRing.first > -1) {
1462  fHM->H1("fhTofBetaTrackswithClosestRingInRange")
1463  ->Fill(getBeta(tTrack));
1464  fHM->H1("fhRingTrackDistance")->Fill(closeRing.second);
1465  fHM->H1("fhTracksWithRings")->Fill(1);
1466  }
1467  //if (ringIndx.size() > 0)fHM->H1("fhTofBetaTrackswithRing")->Fill(getBeta(tTrack)); // ring is somewehere in Acc
1468  fHM->H1("fhTofBetaAll")->Fill(getBeta(tTrack));
1469  }
1470  }
1471  if (tTrack->GetFitX(RichZPos) > 30) { // right
1472  fHM->H1("fhNofTofTracks")
1473  ->Fill(2.5); // 1: All 2: left; 3: right; 4: RICH
1474  } else { //left
1475  fHM->H1("fhNofTofTracks")->Fill(1.5);
1476  }
1477  }
1478 
1479 
1480  std::vector<TVector3> RichTofEv;
1481 
1482  for (int j = 0; j < ev->GetNofData(ECbmDataType::kTofHit); j++) {
1483  auto iTofHit = ev->GetIndex(ECbmDataType::kTofHit, j);
1484  CbmTofHit* tofHit = static_cast<CbmTofHit*>(fTofHits->At(iTofHit));
1485  if (tofHit->GetZ() < 2.) continue; // Cut T0 away!
1486 
1487  fHM->H1("fhTofHitsZ")->Fill(tofHit->GetZ());
1488  fHM->H2("fhTofHitsXZ")->Fill(tofHit->GetZ(), tofHit->GetX());
1489  //fHM->H2("fhTofHitsXY")->Fill(tofHit->GetX(),tofHit->GetY());
1490  fHM->H3("fhTofXYZ")->Fill(tofHit->GetX(), tofHit->GetZ(), tofHit->GetY());
1491 
1492  if (ringIndx.size() > 0) {
1493  //fHM->H2("fhTofRichRingXZ")->Fill(tofHit->GetZ(),tofHit->GetX());
1494  //RichTofEv.emplace_back(tofHit->GetX(),tofHit->GetY(),tofHit->GetZ());
1495  for (unsigned int rings = 0; rings < ringIndx.size(); rings++) {
1496  CbmRichRing* ring =
1497  static_cast<CbmRichRing*>(fRichRings->At(ringIndx[rings]));
1498  fHM->H2("fhTofRichRingX")->Fill(ring->GetCenterX(), tofHit->GetX());
1499  fHM->H2("fhTofRichRingY")->Fill(ring->GetCenterY(), tofHit->GetY());
1500  for (int k = 0; k < ring->GetNofHits(); k++) {
1501  Int_t hitInd = ring->GetHit(k);
1502  CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
1503  if (nullptr == hit) continue;
1504  fHM->H2("fhTofHitRichRingHitX")->Fill(hit->GetX(), tofHit->GetX());
1505  fHM->H2("fhTofHitRichRingHitY")->Fill(hit->GetY(), tofHit->GetY());
1506  }
1507  //fhTofRichRingHitX here loop over hits in ring.
1508  }
1509  }
1510  }
1511 
1512  if (ringIndx.size() > 0) { // Ring in CbmEvent
1513  std::vector<CbmTofTracklet*> TracksOfEvnt;
1514  //TRACKS
1515  auto nofTofTracks = ev->GetNofData(ECbmDataType::kTofTrack);
1516  fHM->H1("fhTofTracksPerRichEvent")->Fill(nofTofTracks);
1517  for (int j = 0; j < nofTofTracks; j++) {
1518  auto iTofTrack = ev->GetIndex(ECbmDataType::kTofTrack, j);
1519  CbmTofTracklet* track =
1520  static_cast<CbmTofTracklet*>(fTofTracks->At(iTofTrack));
1521  if (track == nullptr) continue;
1522  if (track->GetNofHits() <= 3) continue;
1523  TracksOfEvnt.emplace_back(track);
1524  if (!isOnTarget(track)) continue;
1525  fHM->H2("fhTofTrackRichRingXY")
1526  ->Fill(track->GetFitX(RichZPos), track->GetFitY(RichZPos));
1527  for (int k = 0; k < ev->GetNofData(ECbmDataType::kRichHit); k++) {
1528  auto iRichHit = ev->GetIndex(ECbmDataType::kRichHit, k);
1529  CbmRichHit* richHit =
1530  static_cast<CbmRichHit*>(fRichHits->At(iRichHit));
1531  if (richHit == nullptr) continue;
1532  fHM->H2("fhTofTrackRichHitX")
1533  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1534  fHM->H2("fhTofTrackRichHitY")
1535  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1536 
1537  //cuts:
1538  // >3 hits /track
1539  // if (track->GetNofHits() > 3) {
1540  fHM->H2("fhTofTrackRichHitX_cuts")
1541  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1542  fHM->H2("fhTofTrackRichHitY_cuts")
1543  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1544  if (getBeta(track) > 0.90 && getBeta(track) < 1.10) {
1545  fHM->H2("fhTofTrackRichHitX_oBetacuts")
1546  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1547  fHM->H2("fhTofTrackRichHitY_oBetacuts")
1548  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1549  double deltatime = richHit->GetTime() - track->GetTime();
1550  fHM->H1("fhTofTrackRichHitTime_oBetacuts")->Fill(deltatime);
1551  if (deltatime > -10 && deltatime < +40) {
1552  if (track->GetNofHits() == 4) {
1553  fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime")
1554  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1555  fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime")
1556  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1557  }
1558 
1559  if (track->GetNofHits() > 4) {
1560  fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_4")
1561  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1562  fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_4")
1563  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1564  } else if (track->GetNofHits() > 6) {
1565  fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_6")
1566  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1567  fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_6")
1568  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1569  } else if (track->GetNofHits() > 8) {
1570  fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_8")
1571  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1572  fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_8")
1573  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1574  } else if (track->GetNofHits() > 10) {
1575  fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_10")
1576  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1577  fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_10")
1578  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1579  }
1580 
1581  if (track->GetNofHits() == 4) {
1582  for (int l = 0; l < track->GetNofHits(); ++l) {
1583  auto hitIndex = track->GetHitIndex(l);
1584  auto iTofHit = ev->GetIndex(ECbmDataType::kTofHit, hitIndex);
1585  const CbmTofHit* tofHit =
1586  static_cast<CbmTofHit*>(fTofHits->At(iTofHit));
1587  if (tofHit->GetZ() < 2.) continue; // Cut T0 away!
1588  fHM->H2("fhTofTrackHitRichHitX_oBetacuts_dtime")
1589  ->Fill(richHit->GetX(), tofHit->GetX());
1590  fHM->H2("fhTofTrackHitRichHitY_oBetacuts_dtime")
1591  ->Fill(richHit->GetY(), tofHit->GetY());
1592  }
1593  }
1594  }
1595  } else {
1596  fHM->H2("fhTofTrackRichHitX_uBetacuts")
1597  ->Fill(richHit->GetX(), track->GetFitX(RichZPos));
1598  fHM->H2("fhTofTrackRichHitY_uBetacuts")
1599  ->Fill(richHit->GetY(), track->GetFitY(RichZPos));
1600  }
1601  //}
1602  }
1603  }
1604 
1605  //rings
1606  //std::cout<< "Found Rings in CbmEvent: "<< ringIndx.size() <<std::endl;
1607  fRingsWithTrack[1] += ringIndx.size();
1608  fRingsWithTrack[2] += nofTofTracks;
1609  fRingsWithTrack[5] += ringIndx.size() * nofTofTracks;
1610 
1611  for (unsigned int rings = 0; rings < ringIndx.size(); rings++) {
1612  CbmRichRing* ring =
1613  static_cast<CbmRichRing*>(fRichRings->At(ringIndx[rings]));
1614  if (nullptr == ring) continue;
1615 
1616  fHM->H1("fhRichRingChi2")->Fill(ring->GetChi2());
1617 
1618  if (!cutRadius(ring)) continue;
1619  fRingsWithTrack[3]++; // Rings After Cut
1620  //DEFAULT: //DrawRing(ring,TracksOfEvnt,true); // here normally; now only Rings with high BETA
1621 
1622  fHM->H1("fhRichRingBeta")->Fill(getBeta(ring));
1623 
1624  auto clTrack =
1625  FindClosestTrack(ring, TracksOfEvnt); // has no cut on distance
1626  analyseRing(ring, ev, clTrack);
1627 
1628  for (int j = 0; j < nofTofTracks; j++) {
1629  auto iTofTrack = ev->GetIndex(ECbmDataType::kTofTrack, j);
1630  CbmTofTracklet* track =
1631  static_cast<CbmTofTracklet*>(fTofTracks->At(iTofTrack));
1632  if (track == nullptr) continue;
1633  if (!(track->GetNofHits() == 4
1634  && (getBeta(track) > 0.90 && getBeta(track) < 1.10)))
1635  continue;
1636  if (rings == 0) {
1637  fRingsWithTrack[4]++;
1638  if (ring->GetChi2() < 4.)
1640  ev, ringIndx, 1); //Some will be drawn double, but for now ok
1641  }
1642  fHM->H2("fhTofTrackRichRingX")
1643  ->Fill(ring->GetCenterX(), track->GetFitX(RichZPos));
1644  fHM->H2("fhTofTrackRichRingY")
1645  ->Fill(ring->GetCenterY(), track->GetFitY(RichZPos));
1646 
1647  const double xDist = (track->GetFitX(RichZPos) - ring->GetCenterX());
1648  const double yDist = (track->GetFitY(RichZPos) - ring->GetCenterY());
1649  const double rDist = std::sqrt(xDist * xDist + yDist * yDist);
1650  fHM->H1("fhTrackRingDistance_corr")->Fill(rDist);
1651 
1652  fRingsWithTrack[0]++;
1653 
1654  for (int k = 0; k < ring->GetNofHits(); k++) {
1655  Int_t hitInd = ring->GetHit(k);
1656  CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
1657  if (nullptr == hit) continue;
1658  fHM->H2("fhTofTrackRichRingHitX")
1659  ->Fill(hit->GetX(), track->GetFitX(RichZPos));
1660  fHM->H2("fhTofTrackRichRingHitY")
1661  ->Fill(hit->GetY(), track->GetFitY(RichZPos));
1662  }
1663  }
1664 
1665  if (clTrack.first > -1) {
1666  // first: TrackIndex; second: Distance;
1667  //FIXME
1668  //if (getBeta(TracksOfEvnt[clTrack.first]) > 0.9) DrawRing(ring,TracksOfEvnt,true);
1669  fHM->H1("fhTrackRingDistance")->Fill(clTrack.second);
1670  CbmTofTracklet* track = TracksOfEvnt
1671  [clTrack
1672  .first]; //static_cast<CbmTofTracklet *>(fTofTracks->At(clTrack.first));
1673  if (track == nullptr) continue;
1674  if (isOnTarget(track)) {
1675  fHM->H1("fhTrackRingDistanceOnTarget")->Fill(clTrack.second);
1676 
1677  } else {
1678  fHM->H1("fhTrackRingDistanceOffTarget")->Fill(clTrack.second);
1679  }
1680  fHM->H2("fhTrackRingDistanceVSRingradius")
1681  ->Fill(clTrack.second, ring->GetRadius());
1682  fHM->H2("fhTrackRingDistanceVSRingChi2")
1683  ->Fill(clTrack.second, ring->GetChi2());
1684  //if ( (clTrack.second < 20.0 )) {
1685  fHM->H2("fhRichRingXY_goodTrack")
1686  ->Fill(ring->GetCenterX(), ring->GetCenterY());
1687  fHM->H2("fhRichRing_goodTrackXY")
1688  ->Fill(track->GetFitX(RichZPos), track->GetFitY(RichZPos));
1689  //}
1690  fHM->H2("fhClosTrackRingX")
1691  ->Fill(ring->GetCenterX(), track->GetFitX(RichZPos));
1692  fHM->H2("fhClosTrackRingY")
1693  ->Fill(ring->GetCenterY(), track->GetFitY(RichZPos));
1694  fHM->H2("fhTofClosTrackRichRingXY")
1695  ->Fill(track->GetFitX(RichZPos), track->GetFitY(RichZPos));
1696  if ((clTrack.second < (ring->GetRadius() * 1.2))) { //Good Ring
1697  fHM->H2("fhGoodRingsXY_TargetPos")
1698  ->Fill(track->GetFitX(0.), track->GetFitY(0.));
1699  fHM->H1("fhRichRingChi2_goodRing")->Fill(ring->GetChi2());
1700  fHM->H2("fhTrackRingDistanceVSRingChi2_goodRing")
1701  ->Fill(clTrack.second, ring->GetChi2());
1702  fHM->H1("fhTofBetaRing")->Fill(getBeta(track));
1703  fHM->H2("fhTofBetaRingDist")->Fill(getBeta(track), clTrack.second);
1704  fHM->H2("fhTofBetaVsRadius")
1705  ->Fill(getBeta(track), ring->GetRadius());
1706  //Ring properties of "Good rings"
1707  fHM->H1("fhRichRingRadius_goodRing")->Fill(ring->GetRadius());
1708  fHM->H1("fhNofHitsInRing_goodRing")->Fill(ring->GetNofHits());
1709  fHM->H1("fhRichRingBeta_GoodRing")->Fill(getBeta(ring));
1710  }
1711  }
1712 
1713  fHM->H2("fhTofRichRingXZ")
1714  ->Fill(
1715  RichZPos,
1716  ring
1717  ->GetCenterX()); //Z Axis by Hand because ring has no Z component
1718  RichTofEv.emplace_back(
1719  ring->GetCenterX(), ring->GetCenterY(), RichZPos);
1720  // Draw XY position of center of rings; later add the Tracks in Tof
1721  fHM->H2("fhTofTrackRichRingXY")
1722  ->Fill(ring->GetCenterX(),
1723  ring->GetCenterY(),
1724  3); // 3 to change color for Rings
1725  }
1726 
1727  //DrawRichTofEv(RichTofEv);
1728  fHM->H1("fhNofCbmEventsRing")->Fill(1);
1729  }
1730 
1731 
1732  // std::cout<< "TOF Digis:\t" << ev->GetNofData(ECbmDataType::kTofDigi) <<std::endl;
1733  // std::cout<< "TOF Hits:\t" << ev->GetNofData(ECbmDataType::kTofHit) <<std::endl;
1734  // std::cout<< "TOF Tracks:\t" << ev->GetNofData(ECbmDataType::kTofTrack) <<std::endl;
1735 
1736 
1737  //Select and Analyse Blobs
1738  uint32_t blob = 0;
1739  for (unsigned int j = 0; j < pmtHits.size(); ++j) {
1740  if (pmtHits[j] > 30) {
1741  blob++;
1742  // Blob found
1743  double xBlob = -7.95 + (int((j / 9)) * 5.3) + fXOffsetHisto;
1744  double yBlob = 21.2 - ((j % 9) * 5.3);
1745  //std::cout<<"BLOB X:" << i << " "<< xBlob << std::endl;
1746  for (int k = 0; k < ev->GetNofData(ECbmDataType::kTofTrack); k++) {
1747  auto iTofTrack = ev->GetIndex(ECbmDataType::kTofTrack, k);
1748  CbmTofTracklet* track =
1749  static_cast<CbmTofTracklet*>(fTofTracks->At(iTofTrack));
1750  if (track == nullptr) continue;
1751  double xBlobTrack = track->GetFitX(RichZPos) - xBlob;
1752  double yBlobTrack = track->GetFitY(RichZPos) - yBlob;
1753  fHM->H1("fhBlobTrackDistX")->Fill(std::fabs(xBlobTrack));
1754  fHM->H1("fhBlobTrackDistY")->Fill(std::fabs(yBlobTrack));
1755  fHM->H1("fhBlobTrackDist")
1756  ->Fill(
1757  std::sqrt(xBlobTrack * xBlobTrack + yBlobTrack * yBlobTrack));
1758  }
1759  }
1760  }
1761  if (blob > 0) {
1762  fHM->H1("fhNofBlobEvents")->Fill(1);
1763  fHM->H1("fhNofBlobsInEvent")->Fill(blob);
1764  }
1765 
1766  } //End CbmEvent loop
1767 
1768 
1769  RichRings();
1770 }
1771 
1773  int nofRichRings = fRichRings->GetEntries();
1774  fHM->H1("fhNofRichRingsInTimeslice")->Fill(nofRichRings);
1775  for (int i = 0; i < nofRichRings; i++) {
1776  CbmRichRing* ring = static_cast<CbmRichRing*>(fRichRings->At(i));
1777  if (ring == nullptr) continue;
1778  //DrawRing(ring);
1779  fHM->H2("fhRichRingXY")->Fill(ring->GetCenterX(), ring->GetCenterY());
1780  fHM->H1("fhRichRingRadius")->Fill(ring->GetRadius());
1781  fHM->H1("fhNofHitsInRing")->Fill(ring->GetNofHits());
1782  fHM->H2("fhRichRingRadiusY")->Fill(ring->GetRadius(), ring->GetCenterY());
1783  fHM->H2("fhRichHitsRingRadius")
1784  ->Fill(ring->GetNofHits(), ring->GetRadius());
1785  }
1786 }
1787 
1788 std::pair<int, double>
1790  const std::vector<CbmTofTracklet*> track) {
1791  int ringX = ring->GetCenterX();
1792  int ringY = ring->GetCenterY();
1793 
1794  int closTrack = -1;
1795  double closDist = -999999.99;
1796 
1797  for (unsigned int indx = 0; indx < track.size(); ++indx) {
1798 
1799  //Calc if Track is in Ring (+20% )
1800  if (track[indx]->GetNofHits() <= 3) continue;
1801  const double xDist = (track[indx]->GetFitX(RichZPos) - ringX);
1802  const double yDist = (track[indx]->GetFitY(RichZPos) - ringY);
1803  const double rDist = std::sqrt(xDist * xDist + yDist * yDist);
1804  const double RadiusFactor =
1805  1.2; // Factor of how big radius of acceptance should
1806 
1807  if (rDist < ring->GetRadius() * RadiusFactor) {
1808  //std::cout<<"Track in defined Ring range ("<<ring->GetRadius()*RadiusFactor<<"cm) (RingRadius: "<<ring->GetRadius()<<"cm). ";
1809  }
1810  //if (rDist < ring->GetRadius()*RadiusFactor && ring->GetRadius() > 2. && ring->GetRadius() < 4.2) {
1811  if (indx == 0) {
1812  closDist = rDist;
1813  closTrack = indx;
1814  } else {
1815  if (closDist > rDist) {
1816  closDist = rDist;
1817  closTrack = indx;
1818  }
1819  }
1820  //}
1821  }
1822  //if (closTrack > -1 ) std::cout<< "closestTrack to ring "<< ring <<": "<<closTrack<<" " << static_cast<CbmTofTracklet *>(fTofTracks->At(closTrack)) <<std::endl;
1823  std::pair<int, double> p;
1824  p.first = closTrack;
1825  p.second = closDist;
1826 
1827  return p;
1828 }
1829 
1830 std::pair<int, double>
1832  std::vector<int>& ringIndx) {
1833  // Closest Ring to Track in +20% Ring Radius!
1834  const double x_track = track->GetFitX(RichZPos);
1835  const double y_track = track->GetFitY(RichZPos);
1836 
1837  int closTrack = -1;
1838  double closDist = -999999.99;
1839 
1840  for (unsigned int indx = 0; indx < ringIndx.size(); ++indx) {
1841  CbmRichRing* ring =
1842  static_cast<CbmRichRing*>(fRichRings->At(ringIndx[indx]));
1843 
1844  int ringX = ring->GetCenterX();
1845  int ringY = ring->GetCenterY();
1846 
1847  //Calc if Track is in Ring (+20% )
1848  const double xDist = (x_track - ringX);
1849  const double yDist = (y_track - ringY);
1850  const double rDist = std::sqrt(xDist * xDist + yDist * yDist);
1851  const double RadiusFactor =
1852  1.2; // Factor of how big radius of acceptance should
1853 
1854  if (rDist < ring->GetRadius() * RadiusFactor && cutRadius(ring)) {
1855  //std::cout<<"Track in defined Ring range ("<<ring->GetRadius()*RadiusFactor<<"cm) (RingRadius: "<<ring->GetRadius()<<"cm). ";
1856 
1857  if (indx == 0) {
1858  closDist = rDist;
1859  closTrack = indx;
1860  } else {
1861  if (closDist > rDist) {
1862  closDist = rDist;
1863  closTrack = indx;
1864  }
1865  }
1866  }
1867  }
1868 
1869  //if (closTrack > -1 ) std::cout<< "closestRing to Track "<< track <<": "<<closTrack <<" "<< static_cast<CbmRichRing *>(fRichRings->At(ringIndx[closTrack])) <<std::endl;
1870  std::pair<int, double> p;
1871  p.first = closTrack;
1872  p.second = closDist;
1873 
1874  return p;
1875 }
1876 
1878  cout.precision(4);
1879 
1880  //SetDefaultDrawStyle();
1881  double nofEvents = fHM->H1("fhNofCbmEvents")->GetEntries();
1882  fHM->ScaleByPattern("fh_.*", 1. / nofEvents);
1883 
1884  {
1885  fHM->CreateCanvas(
1886  "rich_mcbm_fhNofCbmEvents", "rich_mcbm_fhNofCbmEvents", 600, 600);
1887  DrawH1(fHM->H1("fhNofCbmEvents"));
1888  }
1889 
1890  {
1891  fHM->CreateCanvas(
1892  "rich_mcbm_fhNofCbmEventsRing", "rich_mcbm_fhNofCbmEventsRing", 600, 600);
1893  DrawH1(fHM->H1("fhNofCbmEventsRing"));
1894  }
1895 
1896  {
1897  fHM->CreateCanvas(
1898  "rich_mcbm_fhNofEvents", "rich_mcbm_fhNofEvents", 600, 600);
1899  DrawH1(fHM->H1("fhNofEvents"));
1900  }
1901 
1902  {
1903  fHM->CreateCanvas("HitsInTimeslice", "HitsInTimeslice", 600, 600);
1904  DrawH1(fHM->H1("fhHitsInTimeslice"));
1905  }
1906 
1907  {
1908  fHM->CreateCanvas("RichDigisConsecTime", "RichDigisConsecTime", 600, 600);
1909  DrawH1(fHM->H1("fhRichDigisConsecTime"), kLinear, kLog);
1910  }
1911 
1912 
1913  {
1914  fHM->CreateCanvas(
1915  "RichDigisConsecTimeTOT", "RichDigisConsecTimeTOT", 600, 600);
1916  DrawH1(fHM->H1("fhRichDigisConsecTimeTOT"), kLinear, kLog);
1917  }
1918 
1919 
1920  /*{ // NO position info for Digis :(
1921  fHM->CreateCanvas("Pixelrate","Pixelrate", 600 , 600);
1922  double time = nofEvents * 0.0128; //seconds
1923  fHM->H1("fhRichDigiPixelRate")->Scale(1./time);
1924  DrawH1(fHM->H1("fhRichDigiPixelRate"));
1925  }*/
1926 
1927  {
1928  TCanvas* c = fHM->CreateCanvas(
1929  "RichRingXY_goodTrack", "RichRingXY_goodTrack", 1200, 600);
1930  c->Divide(2, 1);
1931  c->cd(1);
1932  DrawH2(fHM->H2("fhRichRingXY_goodTrack"));
1933  c->cd(2);
1934  DrawH2(fHM->H2("fhRichRing_goodTrackXY"));
1935  }
1936 
1937 
1938  {
1939  TCanvas* c = fHM->CreateCanvas("rich_mcbm_nofObjectsInTimeslice",
1940  "rich_mcbm_nofObjectsInTimeslice",
1941  1500,
1942  500);
1943  c->Divide(3, 1);
1944  c->cd(1);
1945  DrawH1(fHM->H1("fhNofRichDigisInTimeslice"), kLinear, kLog);
1946  c->cd(2);
1947  DrawH1(fHM->H1("fhNofRichHitsInTimeslice"), kLinear, kLog);
1948  c->cd(3);
1949  DrawH1(fHM->H1("fhNofRichRingsInTimeslice"), kLinear, kLog);
1950  }
1951 
1952  {
1953  TCanvas* c = fHM->CreateCanvas("rich_mcbm_XY", "rich_mcbm_XY", 1200, 600);
1954  c->Divide(2, 1);
1955  c->cd(1);
1956  DrawH2(fHM->H2("fhRichHitXY"));
1957  c->cd(2);
1958  DrawH2(fHM->H2("fhRichRingXY"));
1959  }
1960 
1961 
1962  {
1963  TCanvas* c = fHM->CreateCanvas("rich_tof_XY", "rich_tof_XY", 1200, 600);
1964  c->Divide(2, 1);
1965  c->cd(1);
1966  DrawH2(fHM->H2("fhTofRichX"));
1967  c->cd(2);
1968  DrawH2(fHM->H2("fhTofRichY"));
1969  }
1970 
1971 
1972  {
1973  TCanvas* c =
1974  fHM->CreateCanvas("rich_tof_XY_zoomed", "rich_tof_XY_zoomed", 1200, 600);
1975  c->Divide(2, 1);
1976  c->cd(1);
1977  DrawH2(fHM->H2("fhTofRichX_zoomed"));
1978  c->cd(2);
1979  DrawH2(fHM->H2("fhTofRichY_zoomed"));
1980  }
1981 
1982 
1983  {
1984  TCanvas* c = fHM->CreateCanvas(
1985  "rich_mcbm_richDigisTimeLog", "rich_mcbm_richDigisTimeLog", 1200, 1200);
1986  c->Divide(1, 2);
1987  c->cd(1);
1988  DrawH1({fHM->H1("fhRichDigisTimeLog"),
1989  fHM->H1("fhTofDigisTimeLog"),
1990  fHM->H1("fhT0DigisTimeLog"),
1991  fHM->H1("fhStsDigisTimeLog")},
1992  {"RICH", "TOF", "T0", "STS"},
1993  kLinear,
1994  kLog,
1995  true,
1996  0.87,
1997  0.75,
1998  0.99,
1999  0.99);
2000  gPad->SetLeftMargin(0.1);
2001  gPad->SetRightMargin(0.10);
2002  fHM->H1("fhStsDigisTimeLog")->GetYaxis()->SetTitleOffset(0.7);
2003  fHM->H1("fhStsDigisTimeLog")->SetMinimum(0.9);
2004  c->cd(2);
2005  DrawH1({fHM->H1("fhRichDigisTimeLogZoom"),
2006  fHM->H1("fhTofDigisTimeLogZoom"),
2007  fHM->H1("fhT0DigisTimeLogZoom"),
2008  fHM->H1("fhStsDigisTimeLogZoom")},
2009  {"RICH", "TOF", "T0", "STS"},
2010  kLinear,
2011  kLog,
2012  true,
2013  0.87,
2014  0.75,
2015  0.99,
2016  0.99);
2017  gPad->SetLeftMargin(0.1);
2018  gPad->SetRightMargin(0.1);
2019  fHM->H1("fhStsDigisTimeLogZoom")->GetYaxis()->SetTitleOffset(0.7);
2020  fHM->H1("fhStsDigisTimeLogZoom")->SetMinimum(0.9);
2021  }
2022 
2023  {
2024  fHM->CreateCanvas(
2025  "rich_mcbm_richDigisTimeLog2", "rich_mcbm_richDigisTimeLog2", 1200, 600);
2026  DrawH1({fHM->H1("fhRichDigisTimeLogZoom2"),
2027  fHM->H1("fhTofDigisTimeLogZoom2"),
2028  fHM->H1("fhT0DigisTimeLogZoom2"),
2029  fHM->H1("fhStsDigisTimeLogZoom2")},
2030  {"RICH", "TOF", "T0", "STS"},
2031  kLinear,
2032  kLog,
2033  true,
2034  0.87,
2035  0.75,
2036  0.99,
2037  0.99);
2038  gPad->SetLeftMargin(0.1);
2039  gPad->SetRightMargin(0.1);
2040  fHM->H1("fhStsDigisTimeLogZoom2")->GetYaxis()->SetTitleOffset(0.7);
2041  fHM->H1("fhStsDigisTimeLogZoom2")->SetMinimum(0.9);
2042  }
2043 
2044  {
2045  fHM->CreateCanvas("rich_mcbm_richDigisRingTimeLog",
2046  "rich_mcbm_richDigisRingTimeLog",
2047  1200,
2048  600);
2049  TH1D* copyRichDigi = (TH1D*) fHM->H1("fhRichDigisTimeLog")->Clone();
2050  TH1D* copyRichRing = (TH1D*) fHM->H1("fhRichRingsTimeLog")->Clone();
2051  DrawH1({copyRichDigi,
2052  fHM->H1("fhTofDigisTimeLog"),
2053  fHM->H1("fhT0DigisTimeLog"),
2054  copyRichRing},
2055  {"RICH", "TOF", "T0", "RICH RING"},
2056  kLinear,
2057  kLog,
2058  true,
2059  0.83,
2060  0.75,
2061  0.99,
2062  0.99);
2063  gPad->SetLeftMargin(0.1);
2064  gPad->SetRightMargin(0.1);
2065  copyRichDigi->GetYaxis()->SetTitleOffset(0.7);
2066  copyRichDigi->SetMinimum(0.9);
2067  }
2068 
2069  {
2070 
2071  TCanvas* c = fHM->CreateCanvas(
2072  "rich_mcbm_richRingsTimeLog", "rich_mcbm_richRingsTimeLog", 1200, 1200);
2073  c->Divide(1, 2);
2074  c->cd(1);
2075  DrawH1({fHM->H1("fhRichDigisTimeLog"), fHM->H1("fhRichRingsTimeLog")},
2076  {"Digis", "Rings"},
2077  kLinear,
2078  kLog,
2079  true,
2080  0.87,
2081  0.75,
2082  0.99,
2083  0.99);
2084  gPad->SetLeftMargin(0.1);
2085  gPad->SetRightMargin(0.10);
2086  fHM->H1("fhRichDigisTimeLog")->GetYaxis()->SetTitleOffset(0.7);
2087  fHM->H1("fhRichDigisTimeLog")->SetMinimum(0.9);
2088  c->cd(2);
2089  DrawH1(
2090  {fHM->H1("fhRichDigisTimeLogZoom"), fHM->H1("fhRichRingsTimeLogZoom")},
2091  {"Digis", "Rings"},
2092  kLinear,
2093  kLog,
2094  true,
2095  0.87,
2096  0.75,
2097  0.99,
2098  0.99);
2099  gPad->SetLeftMargin(0.1);
2100  gPad->SetRightMargin(0.1);
2101  fHM->H1("fhRichDigisTimeLogZoom")->GetYaxis()->SetTitleOffset(0.7);
2102  fHM->H1("fhRichDigisTimeLogZoom")->SetMinimum(0.9);
2103  }
2104 
2105  {
2106  fHM->CreateCanvas(
2107  "rich_mcbm_richRingsTimeLog2", "rich_mcbm_richRingsTimeLog2", 1200, 600);
2108  DrawH1(
2109  {fHM->H1("fhRichDigisTimeLogZoom2"), fHM->H1("fhRichRingsTimeLogZoom2")},
2110  {"Digis", "Rings"},
2111  kLinear,
2112  kLog,
2113  true,
2114  0.87,
2115  0.75,
2116  0.99,
2117  0.99);
2118  gPad->SetLeftMargin(0.1);
2119  gPad->SetRightMargin(0.1);
2120  fHM->H1("fhRichDigisTimeLogZoom2")->GetYaxis()->SetTitleOffset(0.7);
2121  fHM->H1("fhRichDigisTimeLogZoom2")->SetMinimum(0.9);
2122  }
2123 
2124 
2125  {
2126  TCanvas* c = fHM->CreateCanvas("rich_ToT", "rich_ToT", 1200, 600);
2127  c->Divide(2, 1);
2128  c->cd(1);
2129  DrawH1(fHM->H1("fhRichDigisToT"));
2130  c->cd(2);
2131  DrawH1(fHM->H1("fhRichHitToT"));
2132  }
2133 
2134  {
2135  TCanvas* c =
2136  fHM->CreateCanvas("rich_BlobTrackDist", "rich_BlobTrackDist", 1800, 600);
2137  c->Divide(3, 1);
2138  c->cd(1);
2139  DrawH1(fHM->H1("fhBlobTrackDistX"));
2140  c->cd(2);
2141  DrawH1(fHM->H1("fhBlobTrackDistY"));
2142  c->cd(3);
2143  DrawH1(fHM->H1("fhBlobTrackDist"));
2144  }
2145 
2146  {
2147  fHM->CreateCanvas("ToF_XYZ", "ToF_XYZ", 1200, 1200);
2148  fHM->H3("fhTofXYZ")->Draw();
2149  }
2150 
2151 
2152  {
2153  TCanvas* c =
2154  fHM->CreateCanvas("rich_mcbm_rings", "rich_mcbm_rings", 1200, 600);
2155  c->Divide(2, 1);
2156  c->cd(1);
2157  DrawH1(fHM->H1("fhRichRingRadius"));
2158  c->cd(2);
2159  DrawH1(fHM->H1("fhNofHitsInRing"));
2160  }
2161 
2162  {
2163  fHM->CreateCanvas("TofHitsZ", "TofHitsZ", 1200, 1200);
2164  fHM->H1("fhTofHitsZ")->Draw();
2165  }
2166 
2167  {
2168  fHM->CreateCanvas("TofTracksPerEvent", "TofTracksPerEvent", 1200, 1200);
2169  DrawH1(fHM->H1("fhTofTracksPerEvent"), kLinear, kLog);
2170  }
2171 
2172  {
2173  fHM->CreateCanvas(
2174  "TofTracksPerRichEvent", "TofTracksPerRichEvent", 1200, 1200);
2175  DrawH1(fHM->H1("fhTofTracksPerRichEvent"), kLinear, kLog);
2176  }
2177 
2178  {
2179  TCanvas* c =
2180  fHM->CreateCanvas("TofRichRingX_Y", "TofRichRingX_Y", 1200, 1200);
2181  c->Divide(2, 1);
2182  c->cd(1);
2183  DrawH2(fHM->H2("fhTofRichRingX"));
2184  c->cd(2);
2185  DrawH2(fHM->H2("fhTofRichRingY"));
2186  }
2187 
2188  {
2189  TCanvas* c =
2190  fHM->CreateCanvas("TofRichX_Stacks", "TofRichX_Stacks", 1800, 600);
2191  c->Divide(3, 1);
2192  c->cd(1);
2193  DrawH2(fHM->H2("fhTofRichX_stack1"));
2194  c->cd(2);
2195  DrawH2(fHM->H2("fhTofRichX_stack2"));
2196  c->cd(3);
2197  DrawH2(fHM->H2("fhTofRichX_stack3"));
2198  }
2199 
2200  {
2201  fHM->CreateCanvas("TofRichRingXZ", "TofRichRingXZ", 1200, 1200);
2202 
2203  DrawH2(fHM->H2("fhTofRichRingXZ"));
2204  }
2205 
2206  {
2207  fHM->CreateCanvas("TofHitsXZ", "TofHitsXZ", 1200, 1200);
2208 
2209  DrawH2(fHM->H2("fhTofHitsXZ"));
2210  }
2211 
2212  {
2213  fHM->CreateCanvas("TofHitsXY", "TofHitsXY", 1200, 1200);
2214 
2215  DrawH2(fHM->H2("fhTofHitsXY"));
2216  }
2217 
2218  {
2219  fHM->CreateCanvas("TofTrackRichRingXY", "TofTrackRichRingXY", 1200, 1200);
2220 
2221  DrawH2(fHM->H2("fhTofTrackRichRingXY"));
2222  }
2223 
2224  {
2225  fHM->CreateCanvas(
2226  "TofClosTrackRichRingXY", "TofClosTrackRichRingXY", 1200, 1200);
2227 
2228  DrawH2(fHM->H2("fhTofClosTrackRichRingXY"));
2229  }
2230 
2231  {
2232  TCanvas* c = fHM->CreateCanvas("TrackRingDist", "TrackRingDist", 1200, 800);
2233  c->Divide(2, 1);
2234  c->cd(1);
2235  DrawH1(fHM->H1("fhTrackRingDistance"));
2236  c->cd(2);
2237  DrawH2(fHM->H2("fhTrackRingDistanceVSRingradius"));
2238  }
2239 
2240  {
2241  fHM->CreateCanvas("RingTrackDist", "RingTrackDist", 1200, 800);
2242  DrawH1(fHM->H1("fhRingTrackDistance"));
2243  }
2244 
2245  {
2246  TCanvas* c =
2247  fHM->CreateCanvas("ClosTrackRingXY", "ClosTrackRingXY", 1200, 800);
2248  c->Divide(2, 1);
2249  c->cd(1);
2250  DrawH2(fHM->H2("fhClosTrackRingX"));
2251  c->cd(2);
2252  DrawH2(fHM->H2("fhClosTrackRingY"));
2253  }
2254 
2255  {
2256  TCanvas* c = fHM->CreateCanvas("TrackRingXY", "TrackRingXY", 1200, 800);
2257  c->Divide(2, 1);
2258  c->cd(1);
2259  DrawH2(fHM->H2("fhTofTrackRichRingX"));
2260  c->cd(2);
2261  DrawH2(fHM->H2("fhTofTrackRichRingY"));
2262  }
2263 
2264  {
2265  TCanvas* c = fHM->CreateCanvas("TofTracksXY", "TofTracksXY", 1200, 800);
2266  c->Divide(2, 1);
2267  c->cd(1);
2268  DrawH2(fHM->H2("fhTofTracksXY"));
2269  c->cd(2);
2270  DrawH2(fHM->H2("fhTofTracksXYRICH"));
2271  }
2272 
2273  {
2274  fHM->CreateCanvas("TofTracksXY_Target", "TofTracksXY_Target", 800, 800);
2275  DrawH2(fHM->H2("fhTofTracksXY_Target"));
2276  }
2277 
2278  {
2279  fHM->CreateCanvas(
2280  "GoodRingsXY_TargetPos", "GoodRingsXY_TargetPos", 800, 800);
2281  DrawH2(fHM->H2("fhGoodRingsXY_TargetPos"));
2282  }
2283 
2284  {
2285  fHM->CreateCanvas("TofBeta", "TofBeta", 800, 800);
2286  gStyle->SetOptStat(0);
2287  fHM->H1("fhTofBetaAll")->Draw("HIST");
2288  fHM->H1("fhTofBetaTracksWithHitsNoRing")->SetLineColorAlpha(kGreen, 1);
2289  fHM->H1("fhTofBetaTracksWithHitsNoRing")->Draw("HIST SAME");
2290 
2291  //fHM->H1("fhTofBetaTracksNoRing")->SetLineColorAlpha(8, 1);
2292  //fHM->H1("fhTofBetaTracksNoRing")->Draw("HIST SAME");
2293 
2294  //fHM->H1("fhTofBetaTracksWithHits")->SetLineColorAlpha(44, 1);
2295  //fHM->H1("fhTofBetaTracksWithHits")->Draw("HIST SAME");
2296 
2297  fHM->H1("fhTofBetaTrackswithClosestRingInRange")->SetLineColorAlpha(44, 1);
2298  fHM->H1("fhTofBetaTrackswithClosestRingInRange")->Draw("HIST SAME");
2299 
2300  fHM->H1("fhTofBetaRing")->SetLineColorAlpha(kRed, 1);
2301  fHM->H1("fhTofBetaRing")->Draw("HIST SAME");
2302 
2303  auto legend = new TLegend(0.1, 0.75, 0.4, 0.9);
2304  legend->AddEntry(fHM->H1("fhTofBetaTracksWithHitsNoRing"),
2305  "Tracks with RichHits and no Ring",
2306  "l");
2307  //legend->AddEntry(fHM->H1("fhTofBetaTracksWithHits"),"Tracks with RichHits","l");
2308  //legend->AddEntry(fHM->H1("fhTofBetaTracksNoRing"),"Tracks with no Ring","l");
2309  legend->AddEntry(fHM->H1("fhTofBetaTrackswithClosestRingInRange"),
2310  "Tracks with clos. Ring in +20% Radius",
2311  "l");
2312  legend->AddEntry(fHM->H1("fhTofBetaRing"), "Tracks in good ring", "l");
2313  if (fRestrictToAcc) {
2314  legend->AddEntry(
2315  fHM->H1("fhTofBetaAll"), "All Tracks in mRICH Acc.", "l");
2316  } else if (fRestrictToFullAcc) {
2317  legend->AddEntry(
2318  fHM->H1("fhTofBetaAll"), "All Tracks in full mRICH Acc.", "l");
2319  } else {
2320  legend->AddEntry(fHM->H1("fhTofBetaAll"), "All Tracks", "l");
2321  }
2322  legend->Draw();
2323  }
2324 
2325  {
2326  TCanvas* c = fHM->CreateCanvas("TofBetaLog", "TofBetaLog", 1000, 1000);
2327  c->SetLogy();
2328 
2329  Double_t max = fHM->H1("fhTofBetaAll")->GetMaximum();
2330  fHM->H1("fhTofBetaAll")->Draw("HIST");
2331 
2332  if (fHM->H1("fhTofBetaTracksWithHitsNoRing")->GetMaximum() > max)
2333  max = fHM->H1("fhTofBetaTracksWithHitsNoRing")->GetMaximum();
2334  fHM->H1("fhTofBetaTracksWithHitsNoRing")->SetLineColorAlpha(kGreen, 1);
2335  fHM->H1("fhTofBetaTracksWithHitsNoRing")->Draw("HIST SAME");
2336 
2337  //fHM->H1("fhTofBetaTracksNoRing")->SetLineColorAlpha(8, 1);
2338  //fHM->H1("fhTofBetaTracksNoRing")->Draw("HIST SAME");
2339 
2340  //fHM->H1("fhTofBetaTracksWithHits")->SetLineColorAlpha(44, 1);
2341  //fHM->H1("fhTofBetaTracksWithHits")->Draw("HIST SAME");
2342 
2343  if (fHM->H1("fhTofBetaTrackswithClosestRingInRange")->GetMaximum() > max)
2344  max = fHM->H1("fhTofBetaTrackswithClosestRingInRange")->GetMaximum();
2345  fHM->H1("fhTofBetaTrackswithClosestRingInRange")->SetLineColorAlpha(12, 1);
2346  fHM->H1("fhTofBetaTrackswithClosestRingInRange")->Draw("HIST SAME");
2347 
2348  if (fHM->H1("fhTofBetaRing")->GetMaximum() > max)
2349  max = fHM->H1("fhTofBetaRing")->GetMaximum();
2350  fHM->H1("fhTofBetaRing")->SetLineColorAlpha(kRed, 1);
2351  fHM->H1("fhTofBetaRing")->Draw("HIST SAME");
2352 
2353  fHM->H1("fhTofBetaAll")->SetAxisRange(1., max * 1.8, "Y");
2354 
2355  auto legend = new TLegend(0.75, 0.77, 0.99, 0.96);
2356  legend->AddEntry(fHM->H1("fhTofBetaTracksWithHitsNoRing"),
2357  "Tracks with RichHits and no Ring",
2358  "l");
2359  //legend->AddEntry(fHM->H1("fhTofBetaTracksWithHits"),"Tracks with RichHits","l");
2360  //legend->AddEntry(fHM->H1("fhTofBetaTracksNoRing"),"Tracks with no Ring","l");
2361  legend->AddEntry(fHM->H1("fhTofBetaTrackswithClosestRingInRange"),
2362  "Tracks with clos. Ring in +20% Radius",
2363  "l");
2364  legend->AddEntry(fHM->H1("fhTofBetaRing"), "Tracks in good ring", "l");
2365  if (fRestrictToAcc) {
2366  legend->AddEntry(
2367  fHM->H1("fhTofBetaAll"), "All Tracks in mRICH Acc.", "l");
2368  } else if (fRestrictToFullAcc) {
2369  legend->AddEntry(
2370  fHM->H1("fhTofBetaAll"), "All Tracks in full mRICH Acc.", "l");
2371  } else {
2372  legend->AddEntry(fHM->H1("fhTofBetaAll"), "All Tracks", "l");
2373  }
2374  legend->Draw();
2375  }
2376 
2377  {
2378  fHM->CreateCanvas("TofBetaVsRadius", "TofBetaVsRadius", 800, 800);
2379  DrawH2(fHM->H2("fhTofBetaVsRadius"));
2380  }
2381 
2382  {
2383  fHM->CreateCanvas("TofBetaRingDist", "TofBetaRingDist", 800, 800);
2384  DrawH2(fHM->H2("fhTofBetaRingDist"));
2385  }
2386 
2387  {
2388  fHM->CreateCanvas("TofBetaAllFullAcc", "TofBetaAllFullAcc", 800, 800);
2389  DrawH1(fHM->H1("fhTofBetaAllFullAcc"));
2390  }
2391 
2392  {
2393  TCanvas* c = fHM->CreateCanvas(
2394  "TofBetaAllFullAccLog", "TofBetaAllFullAccLog", 800, 800);
2395  c->SetLogy();
2396  DrawH1(fHM->H1("fhTofBetaAllFullAcc"));
2397  }
2398 
2399  {
2400  TCanvas* c = fHM->CreateCanvas("RingAnalysis", "RingAnalysis", 1000, 1000);
2401  //c->SetLogy();
2402  c->Divide(2, 2);
2403  c->cd(1);
2404  DrawH1(fHM->H1("fhRingDeltaTime"));
2405  c->cd(2);
2406  DrawH1(fHM->H1("fhRingToTs"));
2407  c->cd(3);
2408  DrawH1({fHM->H1("fhRingLE"),
2409  fHM->H1("fhRingNoClTrackLE"),
2410  fHM->H1("fhRingClTrackFarAwayLE"),
2411  fHM->H1("fhGoodRingLE")},
2412  {"all Rings",
2413  "Rings w/o closest Track",
2414  "Rings w/ closest Track >5cm",
2415  "Good Rings"},
2416  kLinear,
2417  kLinear,
2418  true,
2419  0.70,
2420  0.75,
2421  0.95,
2422  0.99);
2423  c->cd(4);
2424  DrawH2(fHM->H2("fhRingLEvsToT"));
2425  }
2426 
2427  {
2428  TCanvas* c =
2429  fHM->CreateCanvas("InnerRingAnalysis", "InnerRingAnalysis", 1000, 1200);
2430  //c->SetLogy();
2431  c->Divide(2, 3);
2432  c->cd(1);
2433  DrawH1(fHM->H1("fhInnerRingDeltaTime"));
2434  c->cd(2);
2435  DrawH1(fHM->H1("fhInnerRingToTs"));
2436  c->cd(3);
2437  DrawH1({fHM->H1("fhInnerRingLE"),
2438  fHM->H1("fhInnerRingNoClTrackLE"),
2439  fHM->H1("fhInnerRingClTrackFarAwayLE"),
2440  fHM->H1("fhInnerGoodRingLE")},
2441  {"all Rings",
2442  "Rings w/o closest Track",
2443  "Rings w/ closest Track >5cm",
2444  "Good Rings"},
2445  kLinear,
2446  kLinear,
2447  true,
2448  0.70,
2449  0.75,
2450  0.95,
2451  0.99);
2452  c->cd(4);
2453  DrawH1(fHM->H1("fhInnerRingFlag"));
2454  c->cd(5);
2455  DrawH1(fHM->H1("fhNofInnerHits"));
2456  }
2457 
2458  {
2459  fHM->CreateCanvas("DiRICHInRegion", "DiRICHInRegion", 800, 800);
2460  //c->SetLogy();
2461  DrawH1(fHM->H1("fhDiRICHsInRegion"));
2462  }
2463 
2464  {
2465  fHM->CreateCanvas("RichRingRadiusVsY", "RichRingRadiusVsY", 800, 800);
2466  //c->SetLogy();
2467  DrawH2(fHM->H2("fhRichRingRadiusY"));
2468  }
2469 
2470  {
2471  fHM->CreateCanvas("RichRingHitsVsRadius", "RichRingHitsVsRadius", 800, 800);
2472  //c->SetLogy();
2473  DrawH2(fHM->H2("fhRichHitsRingRadius"));
2474  }
2475 
2476  {
2477  fHM->CreateCanvas("RichHitToTEvent", "RichHitToTEvent", 800, 800);
2478  DrawH1(fHM->H1("fhRichHitToTEvent"));
2479  }
2480 
2481  {
2482  fHM->CreateCanvas("RichHitXYEvent", "RichHitXYEvent", 800, 800);
2483  DrawH2(fHM->H2("fhRichHitXYEvent"));
2484  }
2485 
2486  {
2487  fHM->CreateCanvas(
2488  "rich_mcbm_fhBlobEvents", "rich_mcbm_fhBlobEvents", 600, 600);
2489  DrawH1(fHM->H1("fhNofBlobEvents"));
2490  }
2491 
2492  {
2493  fHM->CreateCanvas(
2494  "rich_mcbm_fhBlobsInCbmEvent", "rich_mcbm_fhBlobsInCbmEvent", 600, 600);
2495  DrawH1(fHM->H1("fhNofBlobsInEvent"));
2496  }
2497 
2498  {
2499  TCanvas* c =
2500  fHM->CreateCanvas("TofTrackRichHitXY", "TofTrackRichHitXY", 1200, 800);
2501  c->Divide(2, 1);
2502  c->cd(1);
2503  DrawH2(fHM->H2("fhTofTrackRichHitX"));
2504  c->cd(2);
2505  DrawH2(fHM->H2("fhTofTrackRichHitY"));
2506  }
2507 
2508  {
2509  TCanvas* c = fHM->CreateCanvas(
2510  "TofTrackRichRingHitXY", "TofTrackRichRingHitXY", 1200, 800);
2511  c->Divide(2, 1);
2512  c->cd(1);
2513  DrawH2(fHM->H2("fhTofTrackRichRingHitX"));
2514  c->cd(2);
2515  DrawH2(fHM->H2("fhTofTrackRichRingHitY"));
2516  }
2517 
2518  {
2519  TCanvas* c = fHM->CreateCanvas(
2520  "TofHitRichRingHitXY", "TofHitRichRingHitXY", 1200, 800);
2521  c->Divide(2, 1);
2522  c->cd(1);
2523  DrawH2(fHM->H2("fhTofHitRichRingHitX"));
2524  c->cd(2);
2525  DrawH2(fHM->H2("fhTofHitRichRingHitY"));
2526  }
2527 
2528  {
2529  TCanvas* c = fHM->CreateCanvas(
2530  "TrackRingDistance_Target", "TrackRingDistance_Target", 1200, 800);
2531  c->Divide(2, 1);
2532  c->cd(1);
2533  DrawH1(fHM->H1("fhTrackRingDistanceOnTarget"));
2534  c->cd(2);
2535  DrawH1(fHM->H1("fhTrackRingDistanceOffTarget"));
2536  }
2537 
2538  {
2539  TCanvas* c = fHM->CreateCanvas(
2540  "TofTrackRichHitXY_cut", "TofTrackRichHitXY_cut", 1200, 800);
2541  c->Divide(2, 1);
2542  c->cd(1);
2543  DrawH2(fHM->H2("fhTofTrackRichHitX_cuts"));
2544  c->cd(2);
2545  DrawH2(fHM->H2("fhTofTrackRichHitY_cuts"));
2546  }
2547 
2548  {
2549  TCanvas* c = fHM->CreateCanvas("TofTrackRichHitXY_overBetaCut",
2550  "TofTrackRichHitXY_overBetaCut",
2551  1200,
2552  800);
2553  c->Divide(2, 1);
2554  c->cd(1);
2555  DrawH2(fHM->H2("fhTofTrackRichHitX_oBetacuts"));
2556  c->cd(2);
2557  DrawH2(fHM->H2("fhTofTrackRichHitY_oBetacuts"));
2558  }
2559 
2560  {
2561  TCanvas* c = fHM->CreateCanvas("TofTrackRichHitXY_underBetaCut",
2562  "TofTrackRichHitXY_underBetaCut",
2563  1200,
2564  800);
2565  c->Divide(2, 1);
2566  c->cd(1);
2567  DrawH2(fHM->H2("fhTofTrackRichHitX_uBetacuts"));
2568  c->cd(2);
2569  DrawH2(fHM->H2("fhTofTrackRichHitY_uBetacuts"));
2570  }
2571 
2572  {
2573  TCanvas* c = fHM->CreateCanvas("TofTrackRichHitXY_oBetacuts_dtime",
2574  "TofTrackRichHitXY_oBetacuts_dtime",
2575  1200,
2576  800);
2577  c->Divide(2, 1);
2578  c->cd(1);
2579  DrawH2(fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime"));
2580  c->cd(2);
2581  DrawH2(fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime"));
2582  }
2583 
2584  {
2585  TCanvas* c = fHM->CreateCanvas("TofTrackHitRichHitXY_oBetacuts_dtime",
2586  "TofTrackHitRichHitXY_oBetacuts_dtime",
2587  1200,
2588  800);
2589  c->Divide(2, 1);
2590  c->cd(1);
2591  DrawH2(fHM->H2("fhTofTrackHitRichHitX_oBetacuts_dtime"));
2592  c->cd(2);
2593  DrawH2(fHM->H2("fhTofTrackHitRichHitY_oBetacuts_dtime"));
2594  }
2595 
2596  {
2597  fHM->CreateCanvas("TofTrackRichHitTime_oBetacuts",
2598  "TofTrackRichHitTime_oBetacuts",
2599  600,
2600  600);
2601  DrawH1(fHM->H1("fhTofTrackRichHitTime_oBetacuts"));
2602  }
2603 
2604 
2605  {
2606  TCanvas* c = fHM->CreateCanvas("TofTrackHitRichHitXY_oBetacuts_dtime_evo",
2607  "TofTrackHitRichHitXY_oBetacuts_dtime_evo",
2608  1200,
2609  3200);
2610  c->Divide(2, 4);
2611  c->cd(1);
2612  DrawH2(fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_4"));
2613  c->cd(2);
2614  DrawH2(fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_4"));
2615 
2616  c->cd(3);
2617  DrawH2(fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_6"));
2618  c->cd(4);
2619  DrawH2(fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_6"));
2620 
2621  c->cd(5);
2622  DrawH2(fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_8"));
2623  c->cd(6);
2624  DrawH2(fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_8"));
2625 
2626  c->cd(7);
2627  DrawH2(fHM->H2("fhTofTrackRichHitX_oBetacuts_dtime_10"));
2628  c->cd(8);
2629  DrawH2(fHM->H2("fhTofTrackRichHitY_oBetacuts_dtime_10"));
2630  }
2631 
2632  {
2633  fHM->CreateCanvas(
2634  "TrackRingDistance_AfterCorr", "TrackRingDistance_AfterCorr", 600, 600);
2635  DrawH1(fHM->H1("fhTrackRingDistance_corr"));
2636  }
2637 
2638  {
2639  fHM->CreateCanvas("TracksWithRings", "TracksWithRings", 600, 600);
2640  DrawH1(fHM->H1("fhTracksWithRings"));
2641  }
2642 
2643  {
2644  TCanvas* c = fHM->CreateCanvas("GoodRings", "GoodRings", 1200, 800);
2645  c->Divide(2, 1);
2646  c->cd(1);
2647  DrawH1(fHM->H1("fhRichRingRadius_goodRing"));
2648  c->cd(2);
2649  DrawH1(fHM->H1("fhNofHitsInRing_goodRing"));
2650  }
2651 
2652  {
2653  TCanvas* c = fHM->CreateCanvas("richRingBeta", "richRingBeta", 1200, 800);
2654  c->Divide(2, 1);
2655  c->cd(1);
2656  DrawH1(fHM->H1("fhRichRingBeta"));
2657  c->cd(2);
2658  DrawH1(fHM->H1("fhRichRingBeta_GoodRing"));
2659  }
2660 
2661  {
2662  TCanvas* c = fHM->CreateCanvas(
2663  "TrackRingDistanceVSRingChi2", "TrackRingDistanceVSRingChi2", 1200, 800);
2664  c->Divide(2, 1);
2665  c->cd(1);
2666  DrawH2(fHM->H2("fhTrackRingDistanceVSRingChi2"));
2667  c->cd(2);
2668  DrawH2(fHM->H2("fhTrackRingDistanceVSRingChi2_goodRing"));
2669  }
2670 
2671 
2672  {
2673  TCanvas* c = fHM->CreateCanvas("RichRingChi2", "RichRingChi2", 1600, 800);
2674  //c->SetLogy();
2675  c->Divide(2, 1);
2676  c->cd(1);
2677  DrawH1(fHM->H1("fhRichRingChi2"));
2678  c->cd(2);
2679  DrawH1(fHM->H1("fhRichRingChi2_goodRing"));
2680  }
2681 
2682  {
2683  fHM->CreateCanvas(
2684  "TofTracksXYRICH_Accectance", "TofTracksXYRICH_Accectance", 1200, 1200);
2685  DrawH2(fHM->H2("fhTofTracksXYRICH_Accectance"));
2686  }
2687 }
2688 
2690  std::vector<CbmTofTracklet*> track;
2691  this->DrawRing(ring, track);
2692 }
2693 
2695  std::vector<CbmTofTracklet*> track,
2696  bool full) {
2697  //std::cout<<"#!#DRAW!!!"<<std::endl;
2698  if (fNofDrawnRings > 20) return;
2699  fNofDrawnRings++;
2700  stringstream ss;
2701  ss << "Event" << fNofDrawnRings;
2702  //fNofDrawnRings++;
2703  TCanvas* c = nullptr;
2704  if (full == true) {
2705  c = fHM->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 800, 800);
2706  } else {
2707  c = fHM->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 500, 500);
2708  }
2709  c->SetGrid(true, true);
2710  TH2D* pad = nullptr;
2711  if (full == true) {
2712  pad = new TH2D(ss.str().c_str(),
2713  (ss.str() + ";X [cm];Y [cm]").c_str(),
2714  1,
2715  -15.,
2716  10.,
2717  1,
2718  -5.,
2719  20);
2720  } else {
2721  pad = new TH2D(ss.str().c_str(),
2722  (ss.str() + ";X [cm];Y [cm]").c_str(),
2723  1,
2724  -5.,
2725  5.,
2726  1,
2727  -5.,
2728  5);
2729  }
2730 
2731  pad->SetStats(false);
2732  pad->Draw();
2733 
2734  if (full == true) {
2735  //rough Drawing of RichDetectorAcceptance
2736  TLine* line0 = new TLine(-6.25, 8, -6.25, 15.9);
2737  line0->Draw();
2738  TLine* line1 = new TLine(-6.25, 15.9, -1.05, 15.9);
2739  line1->Draw();
2740  TLine* line2 = new TLine(-1.05, 15.9, -1.05, 13.2);
2741  line2->Draw();
2742  TLine* line3 = new TLine(-1.05, 13.2, +4.25, 13.2);
2743  line3->Draw();
2744  TLine* line4 = new TLine(4.25, 13.2, +4.25, 8);
2745  line4->Draw();
2746  TLine* line5 = new TLine(4.25, 8, -6.25, 8);
2747  line5->Draw();
2748  }
2749 
2750  // find min and max x and y positions of the hits
2751  // in order to shift drawing
2752  double xCur = 0.;
2753  double yCur = 0.;
2754 
2755  if (full == false) {
2756  double xmin = 99999., xmax = -99999., ymin = 99999., ymax = -99999.;
2757  for (int i = 0; i < ring->GetNofHits(); i++) {
2758  Int_t hitInd = ring->GetHit(i);
2759  CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
2760  if (nullptr == hit) continue;
2761  if (xmin > hit->GetX()) xmin = hit->GetX();
2762  if (xmax < hit->GetX()) xmax = hit->GetX();
2763  if (ymin > hit->GetY()) ymin = hit->GetY();
2764  if (ymax < hit->GetY()) ymax = hit->GetY();
2765  }
2766  xCur = (xmin + xmax) / 2.;
2767  yCur = (ymin + ymax) / 2.;
2768  }
2769 
2770  //Draw circle and center
2771  TEllipse* circle = new TEllipse(
2772  ring->GetCenterX() - xCur, ring->GetCenterY() - yCur, ring->GetRadius());
2773  circle->SetFillStyle(0);
2774  circle->SetLineWidth(3);
2775  circle->Draw();
2776  TEllipse* center =
2777  new TEllipse(ring->GetCenterX() - xCur, ring->GetCenterY() - yCur, .1);
2778  center->Draw();
2779 
2780 
2781  double hitZ = 0;
2782  uint nofDrawHits = 0;
2783 
2784  // Draw hits
2785  for (int i = 0; i < ring->GetNofHits(); i++) {
2786  Int_t hitInd = ring->GetHit(i);
2787  CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
2788  if (nullptr == hit) continue;
2789  TEllipse* hitDr = new TEllipse(hit->GetX() - xCur, hit->GetY() - yCur, .25);
2790  //std::cout<<"LE of Hit: "<< hit->GetTime()- fCbmEventStartTime << "\t" << hit->GetTime() << "\t" << fCbmEventStartTime <<std::endl;
2791  if (doToT(hit)) { // Good ToT selection
2792  hitDr->SetFillColor(kRed);
2793  } else {
2794  hitDr->SetFillColor(kBlue);
2795  }
2796  hitZ += hit->GetZ();
2797  nofDrawHits++;
2798  hitDr->Draw();
2799  }
2800  hitZ /= nofDrawHits;
2801 
2802  int Tc = 0;
2803 
2804  //Draw Tracks
2805  if (track.size() > 0) {
2806  stringstream ss3;
2807  std::string sTrackLabel;
2808  double dist = -99999.999;
2809  for (auto trackInd : track) {
2810  TEllipse* hitDr = new TEllipse(
2811  trackInd->GetFitX(hitZ) - xCur, trackInd->GetFitY(hitZ) - yCur, .25);
2812  hitDr->SetFillColor(kGreen);
2813  hitDr->Draw();
2814  //ss3 << "\\beta : "<< getBeta(trackInd); //inVel <<"x10^7 m/s";
2815  if (trackInd->GetFitX(hitZ) < 30.0) { // Track on correct side of ToF
2816  Tc++;
2817  double tmp_dist =
2818  std::sqrt(trackInd->GetFitX(hitZ) * trackInd->GetFitX(hitZ)
2819  + trackInd->GetFitY(hitZ) * trackInd->GetFitY(hitZ));
2820  if (dist < -99999.0) {
2821  dist = tmp_dist;
2822  sTrackLabel =
2823  "\\beta : " + std::to_string((double) getBeta(trackInd));
2824  } else if (dist > tmp_dist) {
2825  dist = tmp_dist;
2826  sTrackLabel =
2827  "\\beta : " + std::to_string((double) getBeta(trackInd));
2828  }
2829  }
2830  }
2831  ss3 << sTrackLabel;
2832  TLatex* latex1 = new TLatex(-4., 0.5, ss3.str().c_str());
2833  latex1->Draw();
2834  } else {
2835  //std::cout<<"No Tracks to Draw."<<std::endl;
2836  }
2837 
2838 
2839  //Draw information
2840  stringstream ss2;
2841  if (full == false) {
2842  ss2 << "(x,y,r,n)=(" << setprecision(3) << ring->GetCenterX() << ", "
2843  << ring->GetCenterY() << ", " << ring->GetRadius() << ", "
2844  << ring->GetNofHits() << ")";
2845  } else {
2846  ss2 << "(x,y,r,n,T,Tc)=(" << setprecision(3) << ring->GetCenterX() << ", "
2847  << ring->GetCenterY() << ", " << ring->GetRadius() << ", "
2848  << ring->GetNofHits() << ", " << track.size() << ", " << Tc << ")";
2849  }
2850  TLatex* latex = nullptr;
2851  if (full == true) {
2852  latex = new TLatex(
2853  ring->GetCenterX() - 13., ring->GetCenterY() + 5., ss2.str().c_str());
2854  } else {
2855  latex = new TLatex(-4., 4., ss2.str().c_str());
2856  }
2857  latex->Draw();
2858 }
2859 
2860 void CbmRichMCbmQaReal::DrawRichTofEv(const std::vector<int> richHitIndx,
2861  const std::vector<int> tofTrackIndx) {
2862  if (richHitIndx.size() < 1 || tofTrackIndx.size() < 1) return;
2863  if (fNofDrawnRichTofEv > 30) return;
2865  std::string dir = "./" + fOutputDir + "/png/TREv/";
2866  gSystem->mkdir(dir.c_str(), true); // create directory if it does not exist
2867  stringstream ss;
2868  ss << "TREv/TofRichEvent" << fNofDrawnRichTofEv;
2869  TCanvas* c = nullptr;
2870  c = fHM->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 800, 800);
2871  c->SetGrid(true, true);
2872 
2873  TH2D* pad = new TH2D(ss.str().c_str(),
2874  (ss.str() + ";X [cm];Y [cm]").c_str(),
2875  1,
2876  -15.,
2877  10.,
2878  1,
2879  -5.,
2880  20);
2881 
2882  pad->SetStats(false);
2883  pad->Draw();
2884 
2885  //rough Drawing of RichDetectorAcceptance
2886  TLine* line0 = new TLine(-6.25, 8, -6.25, 15.9);
2887  line0->Draw();
2888  TLine* line1 = new TLine(-6.25, 15.9, -1.05, 15.9);
2889  line1->Draw();
2890  TLine* line2 = new TLine(-1.05, 15.9, -1.05, 13.2);
2891  line2->Draw();
2892  TLine* line3 = new TLine(-1.05, 13.2, +4.25, 13.2);
2893  line3->Draw();
2894  TLine* line4 = new TLine(4.25, 13.2, +4.25, 8);
2895  line4->Draw();
2896  TLine* line5 = new TLine(4.25, 8, -6.25, 8);
2897  line5->Draw();
2898 
2899  int nofDrawHits = 0;
2900  double hitZ = 0.;
2901 
2902  for (unsigned int i = 0; i < richHitIndx.size(); i++) {
2903  CbmRichHit* hit = (CbmRichHit*) fRichHits->At(richHitIndx[i]);
2904  if (nullptr == hit) continue;
2905  TEllipse* hitDr = new TEllipse(hit->GetX(), hit->GetY(), .25);
2906  if (doToT(hit)) { // Good ToT selection
2907  hitDr->SetFillColor(kRed);
2908  } else {
2909  hitDr->SetFillColor(kBlue);
2910  }
2911  hitZ += hit->GetZ();
2912  nofDrawHits++;
2913  hitDr->Draw();
2914  }
2915  if (nofDrawHits != 0) {
2916  hitZ /= nofDrawHits;
2917  } else {
2918  hitZ = RichZPos;
2919  }
2920 
2921  stringstream ss2;
2922 
2923  for (unsigned int i = 0; i < tofTrackIndx.size(); i++) {
2924  CbmTofTracklet* track = (CbmTofTracklet*) fTofTracks->At(tofTrackIndx[i]);
2925  if (track == nullptr) continue;
2926  TEllipse* trDr =
2927  new TEllipse(track->GetFitX(hitZ), track->GetFitY(hitZ), .25);
2928  trDr->SetFillColor(kGreen);
2929  trDr->Draw();
2930 
2931  ss2 << "\\beta: " << getBeta(track);
2932  }
2933 
2934  TLatex* latex = new TLatex(-4., 4., ss2.str().c_str());
2935 
2936  latex->Draw();
2937 }
2938 
2939 
2941  //std::cout<<"Tracks: "<< fTofTracks->GetEntriesFast() <<std::endl;
2942  std::cout << "Drawing Hists...";
2943  DrawHist();
2944  std::cout << "DONE!" << std::endl;
2945 
2946  if (this->fDoDrawCanvas) {
2947  fHM->SaveCanvasToImage(fOutputDir, "png");
2948  std::cout << "Canvas saved to Images!" << std::endl;
2949  }
2950 
2951  if (this->fDoWriteHistToFile) {
2952  TDirectory* oldir = gDirectory;
2953  std::string s = fOutputDir + "/RecoHists.root";
2954  TFile* outFile = new TFile(s.c_str(), "RECREATE");
2955  if (outFile->IsOpen()) {
2956  fHM->WriteToFile();
2957  std::cout << "Written to Root-file \"" << s << "\" ...";
2958  outFile->Close();
2959  std::cout << "Done!" << std::endl;
2960  }
2961  gDirectory->cd(oldir->GetPath());
2962  }
2963 
2964  std::cout << "fTracksinRich: " << fTracksinRich << std::endl;
2965  Double_t result = (static_cast<Double_t>(fTracksinRichWithRichHits[0])
2966  / static_cast<Double_t>(fTracksinRich))
2967  * 100.;
2968  std::cout << "fTracksinRichWithRichHits > 0: "
2969  << fTracksinRichWithRichHits[0] << "\t Percent: " << result << "%"
2970  << std::endl;
2971  result = (static_cast<Double_t>(fTracksinRichWithRichHits[1])
2972  / static_cast<Double_t>(fTracksinRich))
2973  * 100.;
2974  std::cout << "fTracksinRichWithRichHits > 5: "
2975  << fTracksinRichWithRichHits[1] << "\t Percent: " << result << "%"
2976  << std::endl;
2977  result = (static_cast<Double_t>(fTracksinRichWithRichHits[2])
2978  / static_cast<Double_t>(fTracksinRich))
2979  * 100.;
2980  std::cout << "fTracksinRichWithRichHits > 10: "
2981  << fTracksinRichWithRichHits[2] << "\t Percent: " << result << "%"
2982  << std::endl;
2983  result = (static_cast<Double_t>(fTracksinRichWithRichHits[3])
2984  / static_cast<Double_t>(fTracksinRich))
2985  * 100.;
2986  std::cout << "fTracksinRichWithRichHits > 15: "
2987  << fTracksinRichWithRichHits[3] << "\t Percent: " << result << "%"
2988  << std::endl;
2989 
2990 
2991  std::cout << "RingsWithTrack: " << fRingsWithTrack[0]
2992  << " Rings: " << fRingsWithTrack[1]
2993  << " Tracks: " << fRingsWithTrack[2] << std::endl;
2994  std::cout << "\t \t Rings Cutted: " << fRingsWithTrack[3]
2995  << " Tracks Cutted: " << fRingsWithTrack[4]
2996  << " Possible Combinations: " << fRingsWithTrack[5] << std::endl;
2997 }
2998 
2999 
3000 void CbmRichMCbmQaReal::DrawFromFile(const string& fileName,
3001  const string& outputDir) {
3002  fOutputDir = outputDir;
3003 
3004  if (fHM != nullptr) delete fHM;
3005 
3006  fHM = new CbmHistManager();
3007  TFile* file = new TFile(fileName.c_str());
3008  fHM->ReadFromFile(file);
3009  DrawHist();
3010 
3012 }
3013 
3015  //check if Track is in mRICH acceptance
3016 
3017  bool inside = false;
3018  if (!fRestrictToAcc) return true;
3019  double x = track->GetFitX(RichZPos);
3020  double y = track->GetFitY(RichZPos);
3021  if (x >= -6.25 && x <= -1.05) {
3022  // left part of mRICH
3023  if (y > 8 && y < 15.9) { inside = true; }
3024  } else if (x > -1.05 && x < 4.25) {
3025  //right part
3026  if (y > 8 && y < 13.2) { inside = true; }
3027  }
3028 
3029  return inside;
3030 }
3031 
3032 
3034  Double_t inVel = 1e7 / (track->GetTt()); // in m/s
3035  Double_t beta = inVel / TMath::C();
3036 
3037  return beta;
3038 }
3039 
3041 
3042  // calculate distance of ring center to penetration point in aerogel with assumption,
3043  // that particle is from target.
3044  // INFO: use center of Aerogel as reference -> 11.5cm to MAPMT (TODO: get this from GEO-File)
3045  const Double_t Aerogel_Dist = 11.5;
3046  const Double_t aeroPenetr_Y =
3047  ring->GetCenterY() * (1. - Aerogel_Dist / (RichZPos));
3048  const Double_t aeroPenetr_X =
3049  ring->GetCenterX() * (1. - Aerogel_Dist / (RichZPos));
3050 
3051  const Double_t dist = std::sqrt(
3052  (ring->GetCenterX() - aeroPenetr_X) * (ring->GetCenterX() - aeroPenetr_X)
3053  + (ring->GetCenterY() - aeroPenetr_Y) * (ring->GetCenterY() - aeroPenetr_Y)
3054  + Aerogel_Dist * Aerogel_Dist);
3055 
3056  const Double_t ioR = 1.05; // Index of Reflection
3057 
3058  Double_t beta =
3059  std::sqrt((((ring->GetRadius() * ring->GetRadius()) / dist * dist) + 1)
3060  / (ioR * ioR));
3061 
3062  //std::cout<<" beta:"<<beta<<std::endl;
3063 
3064  return beta;
3065 }
3066 
3068  //check if Track is in mRICH acceptance
3069 
3070  double x = track->GetFitX(RichZPos);
3071  double y = track->GetFitY(RichZPos);
3072  return this->RestrictToFullAcc(x, y);
3073 }
3074 
3076  Double_t x = pos.X();
3077  Double_t y = pos.Y();
3078 
3079  return this->RestrictToFullAcc(x, y);
3080 }
3081 
3083  Double_t x,
3084  Double_t y) { //check if Track is in mRICH acceptance
3085  if (fRestrictToFullAcc == false) return true;
3086  bool inside = false;
3087  if (x >= -16.85 && x <= 4.25) { //TODO:check values
3088  // left part of mRICH
3089  if (y >= -23.8 && y <= 23.8) { inside = true; }
3090  }
3091 
3092  return inside;
3093 }
3094 
3096  CbmEvent* ev,
3097  std::pair<int, double>& clTrack) {
3098 
3099  //std::cout<<"analyse a Ring"<<std::endl;
3100 
3101  Double_t meanTime = 0.;
3102  unsigned int hitCnt = 0;
3103  Double_t minRHit2 = std::numeric_limits<Double_t>::max();
3104  for (int i = 0; i < ring->GetNofHits(); i++) {
3105  Int_t hitInd = ring->GetHit(i);
3106  CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
3107  if (nullptr == hit) continue;
3108 
3109  meanTime += hit->GetTime();
3110  hitCnt++;
3111 
3112  const Float_t diffX = hit->GetX() - ring->GetCenterX();
3113  const Float_t diffY = hit->GetY() - ring->GetCenterY();
3114  const Float_t tmpHitRadius2 = (diffX * diffX + diffY * diffY);
3115 
3116  if (tmpHitRadius2 < minRHit2) { minRHit2 = tmpHitRadius2; }
3117  }
3118  meanTime = meanTime / hitCnt;
3119 
3120  //std::cout<<"mean: "<<meanTime<<std::endl;
3121  for (int i = 0; i < ring->GetNofHits(); i++) {
3122  Int_t hitInd = ring->GetHit(i);
3123  CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
3124  if (nullptr == hit) continue;
3125  //std::cout<<"DeltatTime: "<< meanTime - hit->GetTime()<<std::endl;
3126  //fHM->H1("fhRingDeltaTime")->Fill(static_cast<Double_t>(meanTime - hit->GetTime()));
3127 
3128  fHM->H1("fhRingToTs")->Fill(hit->GetToT());
3129  fHM->H1("fhRingLE")
3130  ->Fill(static_cast<Double_t>(hit->GetTime() - ev->GetStartTime()));
3131  fHM->H2("fhRingLEvsToT")
3132  ->Fill(static_cast<Double_t>(hit->GetTime() - ev->GetStartTime()),
3133  hit->GetToT());
3134  //std::vector<int> tmpRingIndx;
3135  //tmpRingIndx.push_back(ring->GetIndex);
3136  const Double_t Tdiff_ring = (hit->GetTime() - ev->GetStartTime());
3137  if ((Tdiff_ring > 20.) && (Tdiff_ring < 30.)) {
3138  // std::cout<<ev->GetNumber()<<" Address_ring: "<<std::hex<< CbmRichUtil::GetDirichId(hit->GetAddress())<<std::dec<<" "<< CbmRichUtil::GetDirichChannel(hit->GetAddress()) <<" "<< hit->GetToT()<<" "<<ring->GetRadius()<<std::endl;
3139  //fHM->H1("fhDiRICHsInRegion")->Fill(CbmRichUtil::GetDirichId(hit->GetAddress()));
3140  }
3141 
3142  if (clTrack.first == -1)
3143  fHM->H1("fhRingNoClTrackLE")
3144  ->Fill(static_cast<Double_t>(hit->GetTime() - ev->GetStartTime()));
3145  if ((clTrack.first >= 0) && !(clTrack.second < 10.))
3146  fHM->H1("fhRingClTrackFarAwayLE")
3147  ->Fill(static_cast<Double_t>(hit->GetTime() - ev->GetStartTime()));
3148  if (cutDistance(clTrack) && cutRadius(ring)) { //Good Ring
3149  fHM->H1("fhGoodRingLE")
3150  ->Fill(static_cast<Double_t>(hit->GetTime() - ev->GetStartTime()));
3151  fHM->H1("fhRingDeltaTime")
3152  ->Fill(static_cast<Double_t>(meanTime - hit->GetTime()));
3153  }
3154  }
3155 
3156  int InnerHitCnt = 0;
3157  int InnerHitCnt_cut = 0;
3158  for (int j = 0; j < ev->GetNofData(ECbmDataType::kRichHit); j++) {
3159  auto iRichHit = ev->GetIndex(ECbmDataType::kRichHit, j);
3160  CbmRichHit* richHit = static_cast<CbmRichHit*>(fRichHits->At(iRichHit));
3161  if (nullptr == richHit) continue;
3162  const Float_t diffX = richHit->GetX() - ring->GetCenterX();
3163  const Float_t diffY = richHit->GetY() - ring->GetCenterY();
3164  //select inner Part of Ring
3165  if (diffX * diffX + diffY * diffY < minRHit2) {
3166  InnerHitCnt++;
3167  const Double_t Tdiff_inner = (richHit->GetTime() - ev->GetStartTime());
3168  if ((Tdiff_inner > 20.) && (Tdiff_inner < 30.)) {
3169  InnerHitCnt_cut++;
3170  //if (InnerHitCnt_cut == 1) {DrawRing(ring);}
3171  //std::cout<<ev->GetNumber()<<" Address_inner: "<<std::hex<< CbmRichUtil::GetDirichId(richHit->GetAddress())<<std::dec<<" "<< CbmRichUtil::GetDirichChannel(richHit->GetAddress()) <<" "<< richHit->GetToT()<<" "<<ring->GetRadius()<<std::endl;
3172  fHM->H1("fhDiRICHsInRegion")
3173  ->Fill(CbmRichUtil::GetDirichId(richHit->GetAddress()));
3174  }
3175 
3176  fHM->H1("fhInnerRingDeltaTime")
3177  ->Fill(static_cast<Double_t>(meanTime - richHit->GetTime()));
3178  fHM->H1("fhInnerRingToTs")->Fill(richHit->GetToT());
3179  fHM->H1("fhInnerRingLE")
3180  ->Fill(static_cast<Double_t>(richHit->GetTime() - ev->GetStartTime()));
3181  if (clTrack.first == -1)
3182  fHM->H1("fhInnerRingNoClTrackLE")
3183  ->Fill(
3184  static_cast<Double_t>(richHit->GetTime() - ev->GetStartTime()));
3185  if ((clTrack.first >= 0) && !(clTrack.second < 5.))
3186  fHM->H1("fhInnerRingClTrackFarAwayLE")
3187  ->Fill(
3188  static_cast<Double_t>(richHit->GetTime() - ev->GetStartTime()));
3189  if (cutDistance(clTrack) && cutRadius(ring)) { //Good Ring
3190  fHM->H1("fhInnerGoodRingLE")
3191  ->Fill(
3192  static_cast<Double_t>(richHit->GetTime() - ev->GetStartTime()));
3193  }
3194  }
3195  }
3196  if (InnerHitCnt == 0) {
3197  fHM->H1("fhInnerRingFlag")->Fill(1);
3198  } else {
3199  fHM->H1("fhInnerRingFlag")->Fill(0);
3200  }
3201  fHM->H1("fhNofInnerHits")->Fill(InnerHitCnt);
3202 }
3203 
3204 
3206  if (ring->GetRadius() > 2. && ring->GetRadius() < 4.2) return true;
3207 
3208  return false;
3209 }
3210 
3211 
3212 Bool_t CbmRichMCbmQaReal::cutDistance(std::pair<int, double>& clTrack) {
3213  if ((clTrack.first >= 0) && (clTrack.second < 10.)) return true;
3214 
3215  return false;
3216 }
3217 
CbmRichMCbmQaReal::DrawFromFile
void DrawFromFile(const string &fileName, const string &outputDir)
Draw histogram from file.
Definition: CbmRichMCbmQaReal.cxx:3000
CbmRichMCbmQaReal::fT0Digis
const std::vector< CbmTofDigi > * fT0Digis
Definition: CbmRichMCbmQaReal.h:129
CbmRichPoint.h
CbmRichMCbmQaReal::fDoDrawCanvas
bool fDoDrawCanvas
Definition: CbmRichMCbmQaReal.h:177
CbmRichRing::GetTime
Double_t GetTime() const
Definition: CbmRichRing.h:102
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmRichMCbmQaReal::Init
virtual InitStatus Init()
Inherited from FairTask.
Definition: CbmRichMCbmQaReal.cxx:85
CbmEvent::GetIndex
UInt_t GetIndex(ECbmDataType type, UInt_t iData)
Definition: CbmEvent.cxx:24
CbmRichMCbmQaReal::fTriggerTofHits
Int_t fTriggerTofHits
Definition: CbmRichMCbmQaReal.h:161
CbmRichRingFinderHoughImpl.h
Ring finder implementation based on Hough Transform method.
CbmRichMCbmQaReal::fTofHits
TClonesArray * fTofHits
Definition: CbmRichMCbmQaReal.h:135
CbmRichMCbmQaReal::FindClosestRing
std::pair< int, double > FindClosestRing(CbmTofTracklet *track, std::vector< int > &ringIndx)
Definition: CbmRichMCbmQaReal.cxx:1831
CbmRichMCbmQaReal::fTofTracks
TClonesArray * fTofTracks
Definition: CbmRichMCbmQaReal.h:137
CbmRichMCbmQaReal::fRichRings
TClonesArray * fRichRings
Definition: CbmRichMCbmQaReal.h:133
CbmHistManager::WriteToFile
void WriteToFile()
Write all histograms to current opened file.
Definition: core/base/CbmHistManager.cxx:103
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmRichMCbmSEDisplay::XOffsetHistos
void XOffsetHistos(Double_t val=0.)
Definition: CbmRichMCbmSEDisplay.h:45
CbmRichMCbmQaReal::DrawHist
void DrawHist()
Draw histograms.
Definition: CbmRichMCbmQaReal.cxx:1877
CbmTofTracklet::GetHitIndex
Int_t GetHitIndex(Int_t ind) const
Definition: CbmTofTracklet.h:51
CbmTofTracklet::GetNofHits
Int_t GetNofHits() const
Definition: CbmTofTracklet.h:48
CbmHistManager::ScaleByPattern
void ScaleByPattern(const std::string &pattern, Double_t scale)
Scale histograms which name matches specified pattern.
Definition: core/base/CbmHistManager.cxx:221
CbmRichMCbmQaReal::cutDistance
Bool_t cutDistance(std::pair< int, double > &clTrack)
Definition: CbmRichMCbmQaReal.cxx:3212
CbmRichDigi
Definition: CbmRichDigi.h:25
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmHistManager::Create3
void Create3(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY, Int_t nofBinsZ, Double_t minBinZ, Double_t maxBinZ)
Helper function for creation of 3-dimensional histograms and profiles. Template argument is a real ob...
Definition: CbmHistManager.h:140
CbmRichMCbmSEDisplay
Definition: CbmRichMCbmSEDisplay.h:17
CbmRichMCbmQaReal::fXOffsetHisto
Double_t fXOffsetHisto
Definition: CbmRichMCbmQaReal.h:145
CbmRichMCbmQaReal::cutRadius
Bool_t cutRadius(CbmRichRing *ring)
Definition: CbmRichMCbmQaReal.cxx:3205
CbmRichMCbmQaReal::fNofDrawnRings
Int_t fNofDrawnRings
Definition: CbmRichMCbmQaReal.h:153
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmHistManager::ReadFromFile
void ReadFromFile(TFile *file)
Read histograms from file.
Definition: core/base/CbmHistManager.cxx:110
CbmRichHit::GetToT
Double_t GetToT() const
Definition: CbmRichHit.h:62
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
CbmRichMCbmQaReal::DrawRichTofEv
void DrawRichTofEv(const std::vector< int > richHitIndx, const std::vector< int > tofTrackIndx)
Definition: CbmRichMCbmQaReal.cxx:2860
CbmHistManager::Create2
void Create2(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real ob...
Definition: CbmHistManager.h:104
CbmRichMCbmQaReal::RestrictToFullAcc
bool RestrictToFullAcc(CbmTofTracklet *track)
Definition: CbmRichMCbmQaReal.cxx:3067
CbmRichMCbmQaReal::doToT
bool doToT(T *hit)
Definition: CbmRichMCbmQaReal.h:232
CbmRichMCbmQaReal::getBeta
Double_t getBeta(CbmTofTracklet *track)
Definition: CbmRichMCbmQaReal.cxx:3033
CbmTofTracklet
Provides information on attaching a TofHit to a TofTrack.
Definition: CbmTofTracklet.h:25
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmRichRing::GetChi2
Double_t GetChi2() const
Definition: CbmRichRing.h:95
CbmRichMCbmQaReal::isAccmRICH
bool isAccmRICH(CbmTofTracklet *track)
Definition: CbmRichMCbmQaReal.cxx:3014
CbmRichMCbmQaReal::isOnTarget
bool isOnTarget(CbmTofTracklet *tTrack)
Definition: CbmRichMCbmQaReal.h:116
CbmRichUtil::GetDirichId
static uint16_t GetDirichId(Int_t Address)
Definition: utils/CbmRichUtil.h:35
CbmHistManager::H2
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
Definition: CbmHistManager.h:190
CbmRichMCbmQaReal::fNofDrawnRichTofEv
Int_t fNofDrawnRichTofEv
Definition: CbmRichMCbmQaReal.h:155
CbmGlobalTrack.h
CbmRichMCbmQaReal::CbmRichMCbmQaReal
CbmRichMCbmQaReal()
Standard constructor.
Definition: CbmRichMCbmQaReal.cxx:65
ECbmDataType::kRichHit
@ kRichHit
CbmRichMCbmSEDisplay::SetRichRings
void SetRichRings(TClonesArray *ring=nullptr)
Definition: CbmRichMCbmSEDisplay.h:63
CbmRichMCbmQaReal::fRingsWithTrack
Int_t fRingsWithTrack[6]
Definition: CbmRichMCbmQaReal.h:165
CbmDigiManager::GetNofDigis
static Int_t GetNofDigis(ECbmModuleId systemId)
Definition: CbmDigiManager.cxx:62
CbmRichRing::GetNofHits
Int_t GetNofHits() const
Definition: CbmRichRing.h:40
CbmRichRing
Definition: CbmRichRing.h:17
ECbmDataType::kTofHit
@ kTofHit
CbmTofDigi.h
CbmRichRing.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmDrawHist.h
Helper functions for drawing 1D and 2D histograms and graphs.
CbmRichDraw.h
CbmRichMCbmQaReal::fTotRichMin
Double_t fTotRichMin
Definition: CbmRichMCbmQaReal.h:147
CbmRichMCbmQaReal
Definition: CbmRichMCbmQaReal.h:25
CbmHistManager.h
Histogram manager.
CbmMatchRecoToMC.h
FairTask for matching RECO data to MC.
CbmRichMCbmQaReal::fTracksinRich
Int_t fTracksinRich
Definition: CbmRichMCbmQaReal.h:163
CbmDigiManager::IsPresent
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
Definition: CbmDigiManager.cxx:112
CbmTofTracklet.h
CbmHistManager::H3
TH3 * H3(const std::string &name) const
Return pointer to TH3 histogram.
Definition: CbmHistManager.h:210
CbmRichMCbmQaReal::fRestrictToAcc
bool fRestrictToAcc
Definition: CbmRichMCbmQaReal.h:173
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
fTofTracks
TClonesArray * fTofTracks
Definition: CbmHadronAnalysis.cxx:51
CbmRichGeoManager.h
CbmRichDigi.h
ECbmDataType::kTofTrack
@ kTofTrack
CbmEvent.h
CbmRichMCbmSEDisplay::SetOutDir
void SetOutDir(std::string dir)
Definition: CbmRichMCbmSEDisplay.h:85
DrawH1
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
Definition: CbmDrawHist.cxx:49
CbmRichMCbmQaReal::fCbmEventStartTime
Double_t fCbmEventStartTime
Definition: CbmRichMCbmQaReal.h:185
CbmRichMCbmQaReal::DrawRing
void DrawRing(CbmRichRing *ring)
Definition: CbmRichMCbmQaReal.cxx:2689
CbmRichMCbmQaReal::Finish
virtual void Finish()
Inherited from FairTask.
Definition: CbmRichMCbmQaReal.cxx:2940
CbmRichMCbmQaReal::fEventPnt
CbmEvent * fEventPnt
Definition: CbmRichMCbmQaReal.h:186
CbmRichRing::GetHit
UInt_t GetHit(Int_t i) const
Definition: CbmRichRing.h:42
CbmRichMCbmQaReal::fEventNum
Int_t fEventNum
Definition: CbmRichMCbmQaReal.h:151
CbmStsDigi.h
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmRichMCbmQaReal::fRichHits
TClonesArray * fRichHits
Definition: CbmRichMCbmQaReal.h:131
CbmRichDigi::GetTime
Double_t GetTime() const
Definition: CbmRichDigi.h:61
CbmRichMCbmQaReal::fSeDsply_TR
CbmRichMCbmSEDisplay * fSeDsply_TR
Definition: CbmRichMCbmQaReal.h:194
CbmDigiManager::Get
const Digi * Get(Int_t index) const
Get a digi object.
Definition: CbmDigiManager.h:52
CbmRichConverter.h
Convert internal data classes to cbmroot common data classes.
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmRichMCbmQaReal::fTotRichMax
Double_t fTotRichMax
Definition: CbmRichMCbmQaReal.h:149
kLinear
@ kLinear
Definition: CbmDrawHist.h:79
CbmStsDigi::GetTime
Double_t GetTime() const
Definition: CbmStsDigi.h:83
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
CbmTrackMatchNew.h
CbmTofTracklet::GetTt
Double_t GetTt() const
Definition: CbmTofTracklet.h:54
CbmTofDigi::GetTime
Double_t GetTime() const
Inherited from CbmDigi.
Definition: CbmTofDigi.h:111
CbmHistManager::Create1
void Create1(const std::string &name, const std::string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
Definition: CbmHistManager.h:81
CbmRichMCbmQaReal::fDigiHitsInitialized
bool fDigiHitsInitialized
Definition: CbmRichMCbmQaReal.h:179
ECbmModuleId::kRich
@ kRich
Ring-Imaging Cherenkov Detector.
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmRichMCbmSEDisplay::SetTofTracks
void SetTofTracks(TClonesArray *track=nullptr)
Definition: CbmRichMCbmSEDisplay.h:68
CbmRichMCbmSEDisplay::SetCanvasDir
void SetCanvasDir(std::string dir)
Definition: CbmRichMCbmSEDisplay.h:91
RichZPos
double RichZPos
Definition: CbmRichMCbmQaReal.cxx:63
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmStsDigi
Data class for a single-channel message in the STS.
Definition: CbmStsDigi.h:29
CbmRichMCbmQaReal::fSeDisplay
CbmRichMCbmSEDisplay * fSeDisplay
Definition: CbmRichMCbmQaReal.h:192
first
bool first
Definition: LKFMinuit.cxx:143
CbmRichMCbmQaReal::fHM
CbmHistManager * fHM
Definition: CbmRichMCbmQaReal.h:142
CbmUtils.h
CbmTofDigi
Data class for expanded digital TOF information.
Definition: CbmTofDigi.h:38
CbmHistManager::CreateCanvas
TCanvas * CreateCanvas(const std::string &name, const std::string &title, Int_t width, Int_t height)
Create and draw TCanvas and store pointer to it.
Definition: core/base/CbmHistManager.cxx:267
CbmRichMCbmSEDisplay::DrawEvent
void DrawEvent(CbmEvent *ev, std::vector< int > &ringIndx, bool full)
Draw histograms.
Definition: CbmRichMCbmSEDisplay.cxx:47
CbmEvent::GetNofData
Int_t GetNofData() const
Definition: CbmEvent.h:90
CbmRichMCbmQaReal::fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmRichMCbmQaReal.h:126
CbmHistManager::SaveCanvasToImage
void SaveCanvasToImage(const std::string &outputDir, const std::string &options="png,eps")
Save all stored canvases to images.
Definition: core/base/CbmHistManager.cxx:276
CbmTofTracklet::GetTime
Double_t GetTime() const
Definition: CbmTofTracklet.h:112
CbmTofTracklet::GetFitX
Double_t GetFitX(Double_t Z)
Definition: CbmTofTracklet.cxx:516
CbmDigiManager.h
CbmRichMCbmSEDisplay::SetMaxNofDrawnEvents
void SetMaxNofDrawnEvents(Int_t val=100)
Definition: CbmRichMCbmSEDisplay.h:73
CbmRichMCbmQaReal.h
CbmRichMCbmQaReal::RichRings
void RichRings()
Definition: CbmRichMCbmQaReal.cxx:1772
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
CbmTofTracklet::GetFitY
Double_t GetFitY(Double_t Z)
Definition: CbmTofTracklet.cxx:520
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmRichMCbmQaReal::analyseRing
void analyseRing(CbmRichRing *ring, CbmEvent *ev, std::pair< int, double > &clTrack)
Definition: CbmRichMCbmQaReal.cxx:3095
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmRichRing::GetRadius
Float_t GetRadius() const
Definition: CbmRichRing.h:82
CbmRichRing::GetCenterY
Float_t GetCenterY() const
Definition: CbmRichRing.h:81
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
DrawH2
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
Definition: CbmDrawHist.cxx:84
CbmRichMCbmQaReal::FindClosestTrack
std::pair< int, double > FindClosestTrack(const CbmRichRing *ring, const std::vector< CbmTofTracklet * > track)
Definition: CbmRichMCbmQaReal.cxx:1789
CbmRichDigi::GetToT
Double_t GetToT() const
Definition: CbmRichDigi.h:67
CbmRichHit.h
CbmTrdTrack.h
CbmRichMCbmQaReal::fTracksinRichWithRichHits
Int_t fTracksinRichWithRichHits[4]
Definition: CbmRichMCbmQaReal.h:168
CbmRichMCbmSEDisplay.h
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmRichMCbmQaReal::Exec
virtual void Exec(Option_t *option)
Inherited from FairTask.
Definition: CbmRichMCbmQaReal.cxx:1085
CbmRichMCbmQaReal::fTriggerRichHits
Int_t fTriggerRichHits
Definition: CbmRichMCbmQaReal.h:159
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmRichMCbmQaReal::fOutputDir
string fOutputDir
Definition: CbmRichMCbmQaReal.h:171
CbmRichMCbmQaReal::fCbmEvent
TClonesArray * fCbmEvent
Definition: CbmRichMCbmQaReal.h:139
CbmRichMCbmSEDisplay::SetRichHits
void SetRichHits(TClonesArray *hits=nullptr)
Definition: CbmRichMCbmSEDisplay.h:58
kLog
@ kLog
Definition: CbmDrawHist.h:78
CbmRichRing::GetCenterX
Float_t GetCenterX() const
Definition: CbmRichRing.h:80
CbmRichMCbmSEDisplay::SetTotRich
void SetTotRich(Double_t min, Double_t max)
Definition: CbmRichMCbmSEDisplay.h:50
CbmRichMCbmQaReal::fMaxNofDrawnEvents
Int_t fMaxNofDrawnEvents
Definition: CbmRichMCbmQaReal.h:157
CbmRichMCbmQaReal::fRestrictToFullAcc
bool fRestrictToFullAcc
Definition: CbmRichMCbmQaReal.h:174
CbmRichHit
Definition: CbmRichHit.h:19
CbmRichMCbmQaReal::InitHistograms
void InitHistograms()
Initialize histograms.
Definition: CbmRichMCbmQaReal.cxx:177
CbmEvent::GetStartTime
Double_t GetStartTime() const
Definition: CbmEvent.h:131
rings
TClonesArray * rings
Definition: Analyze_matching.h:21
CbmRichMCbmQaReal::fDoWriteHistToFile
bool fDoWriteHistToFile
Definition: CbmRichMCbmQaReal.h:176