CbmRoot
CbmMcbm2018EventBuilder.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
9 
10 #include "FairLogger.h"
11 #include "FairRootManager.h"
12 #include "FairRunOnline.h"
13 
14 #include "TClonesArray.h"
15 #include "TH1.h"
16 #include "TH2.h"
17 #include "THttpServer.h"
18 #include <TFile.h>
19 
20 #include "CbmMuchBeamTimeDigi.h"
21 #include "CbmMuchDigi.h"
22 #include "CbmPsdDigi.h"
23 #include "CbmRichDigi.h"
24 #include "CbmStsDigi.h"
25 #include "CbmTofDigi.h"
26 #include "CbmTrdDigi.h"
27 
28 #include <iomanip>
29 using std::fixed;
30 using std::make_pair;
31 using std::setprecision;
32 
33 #include "CbmDigiManager.h"
34 
35 // ---- Default constructor -------------------------------------------
37  : FairTask("CbmMcbm2018EventBuilder") {}
38 
39 // ---- Destructor ----------------------------------------------------
41 
42 // ---- Initialisation ----------------------------------------------
44  // Load all necessary parameter containers from the runtime data base
45  /*
46  FairRunAna* ana = FairRunAna::Instance();
47  FairRuntimeDb* rtdb=ana->GetRuntimeDb();
48 
49  <CbmMcbm2018EventBuilderDataMember> = (<ClassPointer>*)
50  (rtdb->getContainer("<ContainerName>"));
51  */
52 }
53 
54 // ---- Init ----------------------------------------------------------
56 
57  // Get a handle from the IO manager
58  FairRootManager* ioman = FairRootManager::Instance();
59 
60  // Get a pointer to the previous already existing data level
63  fDigiMan->Init();
64 
65  // T0 is not included in DigiManager
66  fT0DigiVec = ioman->InitObjectAs<std::vector<CbmTofDigi> const*>("T0Digi");
67  if (!fT0DigiVec) {
68  fT0DigiArr = static_cast<TClonesArray*>(ioman->GetObject("T0Digi"));
69  if (!fT0DigiArr) { LOG(info) << "No T0 digi input."; }
70  }
71 
73  LOG(info) << "No STS digi input.";
74  }
75 
77  LOG(info) << "No MUCH digi input.";
78  }
79 
81  LOG(info) << "No TRD digi input.";
82  }
83 
85  LOG(info) << "No TOF digi input.";
86  }
87 
89  LOG(info) << "No RICH digi input.";
90  }
91 
93  LOG(info) << "No PSD digi input.";
94  }
95 
96  // Register output array (CbmEvent)
97  fEvents = new TClonesArray("CbmEvent", 100);
98  ioman->Register(
99  "CbmEvent", "Cbm Event", fEvents, IsOutputBranchPersistent("CbmEvent"));
100 
101  if (!fEvents) LOG(fatal) << "Output branch was not created";
102 
103 
104  if (fFillHistos) {
105  fDiffTime = new TH1F(
106  "fDiffTime",
107  "Time difference between two consecutive digis;time diff [ns];Counts",
108  420,
109  -100.5,
110  1999.5);
111  fhEventTime = new TH1F("hEventTime",
112  "seed time of the events; Seed time [s]; Events",
113  60000,
114  0,
115  600);
116  fhEventDt = new TH1F(
117  "fhEventDt",
118  "interval in seed time of consecutive events; Seed time [s]; Events",
119  2100,
120  -100.5,
121  1999.5);
122  fhEventSize =
123  new TH1F("hEventSize",
124  "nb of all digis in the event; Nb Digis []; Events []",
125  10000,
126  0,
127  10000);
129  new TH2I("hNbDigiPerEvtTime",
130  "nb of all digis per event vs seed time of the events; Seed "
131  "time [s]; Nb Digis []; Events []",
132  600,
133  0,
134  600,
135  1000,
136  0,
137  10000);
138 
140  new TH2I("hNbDigiPerEvtTimeT0",
141  "nb of T0 digis per event vs seed time of the events; Seed "
142  "time [s]; Nb Digis []; Events []",
143  600,
144  0,
145  600,
146  4000,
147  0,
148  4000);
150  new TH2I("hNbDigiPerEvtTimeSts",
151  "nb of STS digis per event vs seed time of the events; Seed "
152  "time [s]; Nb Digis []; Events []",
153  600,
154  0,
155  600,
156  4000,
157  0,
158  4000);
160  new TH2I("hNbDigiPerEvtTimeMuch",
161  "nb of MUCH digis per event vs seed time of the events; Seed "
162  "time [s]; Nb Digis []; Events []",
163  600,
164  0,
165  600,
166  4000,
167  0,
168  4000);
170  new TH2I("hNbDigiPerEvtTimeTrd",
171  "nb of TRD digis per event vs seed time of the events; Seed "
172  "time [s]; Nb Digis []; Events []",
173  600,
174  0,
175  600,
176  4000,
177  0,
178  4000);
180  new TH2I("hNbDigiPerEvtTimeTof",
181  "nb of TOF digis per event vs seed time of the events; Seed "
182  "time [s]; Nb Digis []; Events []",
183  600,
184  0,
185  600,
186  4000,
187  0,
188  4000);
190  new TH2I("hNbDigiPerEvtTimeRich",
191  "nb of RICH digis per event vs seed time of the events; Seed "
192  "time [s]; Nb Digis []; Events []",
193  600,
194  0,
195  600,
196  4000,
197  0,
198  4000);
200  new TH2I("hNbDigiPerEvtTimePsd",
201  "nb of PSD digis per event vs seed time of the events; Seed "
202  "time [s]; Nb Digis []; Events []",
203  600,
204  0,
205  600,
206  4000,
207  0,
208  4000);
209  } // if( fFillHistos )
210 
211  return kSUCCESS;
212 }
213 
214 // ---- ReInit -------------------------------------------------------
215 InitStatus CbmMcbm2018EventBuilder::ReInit() { return kSUCCESS; }
216 
217 // ---- Exec ----------------------------------------------------------
218 void CbmMcbm2018EventBuilder::Exec(Option_t* /*option*/) {
219 
220  LOG_IF(info, fNrTs % 1000 == 0) << "Begin of TS " << fNrTs;
221 
222  InitSorter();
223 
224  BuildEvents();
225 
226  LOG(debug) << "Found " << fEventVector.size() << " events";
227 
229 
230  if (fFillHistos) { FillHisto(); } // if( fFillHistos )
231 
232  LOG(debug) << "Found " << fEventVector.size() << " triggered events";
233 
234  FillOutput();
235 
236  fNrTs++;
237 }
238 
240  // Fill the first entry of each TClonesarray to the std::set
241  // The sorting should be done using the time of the digi which
242  // can be received using the GetTime() function of CbmDigi
243 
244  Int_t nrT0Digis {0};
245  if (fT0DigiVec)
246  nrT0Digis = fT0DigiVec->size();
247  else if (fT0DigiArr)
248  nrT0Digis = fT0DigiArr->GetEntriesFast();
249  Int_t nrStsDigis = fDigiMan->GetNofDigis(ECbmModuleId::kSts);
250  Int_t nrMuchDigis = fDigiMan->GetNofDigis(ECbmModuleId::kMuch);
251  Int_t nrTrdDigis = fDigiMan->GetNofDigis(ECbmModuleId::kTrd);
252  Int_t nrTofDigis = fDigiMan->GetNofDigis(ECbmModuleId::kTof);
253  Int_t nrRichDigis = fDigiMan->GetNofDigis(ECbmModuleId::kRich);
254  Int_t nrPsdDigis = fDigiMan->GetNofDigis(ECbmModuleId::kPsd);
255 
256  LOG(debug) << "T0Digis: " << nrT0Digis;
257  LOG(debug) << "StsDigis: " << nrStsDigis;
258  LOG(debug) << "MuchDigis: " << nrMuchDigis;
259  LOG(debug) << "TrdDigis: " << nrTrdDigis;
260  LOG(debug) << "TofDigis: " << nrTofDigis;
261  LOG(debug) << "RichDigis: " << nrRichDigis;
262  LOG(debug) << "PsdDigis: " << nrPsdDigis;
263 
264  // CbmDigi* digi = nullptr;
265 
266  if (nrT0Digis > 0) { AddDigiToSorter<CbmTofDigi>(ECbmModuleId::kHodo, 0); }
267  if (nrStsDigis > 0) { AddDigiToSorter<CbmStsDigi>(ECbmModuleId::kSts, 0); }
268  if (nrMuchDigis > 0) {
269  if (fbUseBaseMuchDigi) {
270  AddDigiToSorter<CbmMuchDigi>(ECbmModuleId::kMuch, 0);
271  } // if( fbUseBaseMuchDigi )
272  else {
273  AddDigiToSorter<CbmMuchBeamTimeDigi>(ECbmModuleId::kMuch, 0);
274  } // else of if( fbUseBaseMuchDigi )
275  }
276  if (nrTrdDigis > 0) { AddDigiToSorter<CbmTrdDigi>(ECbmModuleId::kTrd, 0); }
277  if (nrTofDigis > 0) { AddDigiToSorter<CbmTofDigi>(ECbmModuleId::kTof, 0); }
278  if (nrRichDigis > 0) { AddDigiToSorter<CbmRichDigi>(ECbmModuleId::kRich, 0); }
279  if (nrPsdDigis > 0) { AddDigiToSorter<CbmPsdDigi>(ECbmModuleId::kPsd, 0); }
280  for (const auto& data : fSorter) {
281  LOG(debug) << "Array, Entry(" << data.second.first << ", "
282  << data.second.second << "): " << fixed << setprecision(15)
283  << data.first << " ns";
284  }
285 
286  // Get the first element of the set from which one gets the first
287  // element of the tuple (digi) from which one gets the smallest time
288  // of all digis of the new TS
289  if (fSorter.size() > 0) {
290  fPrevTime = fSorter.begin()->first;
292  }
293 }
294 
296  // Create a first CbmEvent
298 
299  while (fSorter.size() > 0) {
300 
301  // Extract the needed information from the first element of the set
302  // The first element is the one with the smallest time
303  auto it = fSorter.begin();
304  Double_t time = it->first;
305  ECbmModuleId system = it->second.first;
306  Int_t entry = it->second.second;
307 
308  // Decide if the digi belongs to the current event or if
309  // it starts a new event
310  if (!IsDigiInEvent(time)) {
312  fEventVector.push_back(fCurrentEvent);
313  // Create then next CbmEvent
314  fStartTimeEvent = time;
316  }
317  AddDigiToEvent(system, entry);
318 
319  if (fFillHistos) fVect.emplace_back(make_pair(system, entry));
320 
321  // Remove the first element from the set and insert the next digi
322  // from the same system
323  fSorter.erase(fSorter.begin());
324 
325  switch (system) {
326  case ECbmModuleId::kSts: {
327  AddDigiToSorter<CbmStsDigi>(system, ++entry);
328  break;
329  } // case ECbmModuleId::kSts
330  case ECbmModuleId::kMuch: {
331  if (fbUseBaseMuchDigi) {
332  AddDigiToSorter<CbmMuchDigi>(system, ++entry);
333  } // if( fbUseBaseMuchDigi )
334  else {
335  AddDigiToSorter<CbmMuchBeamTimeDigi>(system, ++entry);
336  } // else of if( fbUseBaseMuchDigi )
337  break;
338  } // case ECbmModuleId::kMuch
339  case ECbmModuleId::kTrd: {
340  AddDigiToSorter<CbmTrdDigi>(system, ++entry);
341  break;
342  } // case ECbmModuleId::kTrd
343  case ECbmModuleId::kTof: {
344  AddDigiToSorter<CbmTofDigi>(system, ++entry);
345  break;
346  } // case ECbmModuleId::kTof
347  case ECbmModuleId::kRich: {
348  AddDigiToSorter<CbmRichDigi>(system, ++entry);
349  break;
350  } // case ECbmModuleId::kRich
351  case ECbmModuleId::kPsd: {
352  AddDigiToSorter<CbmPsdDigi>(system, ++entry);
353  break;
354  } // case ECbmModuleId::kPsd
355  case ECbmModuleId::kHodo: {
356  AddDigiToSorter<CbmTofDigi>(system, ++entry);
357  break;
358  } // case ECbmModuleId::kHodo
359  default: {
360  break;
361  } // default:
362  } //? system
363 
364  if (fFillHistos) fDiffTime->Fill(time - fPrevTime);
365 
366  fPrevTime = time;
367  }
369  fEventVector.push_back(fCurrentEvent);
370 }
371 
373  // here the different possibilities have to be implemented
375  return ((time - fStartTimeEvent < fFixedTimeWindow) ? kTRUE : kFALSE);
376  } else {
377  return ((time - fPrevTime < fMaximumTimeGap) ? kTRUE : kFALSE);
378  }
379 }
380 
382  Bool_t hasTrigger {kTRUE};
383  if (hasTrigger && (fT0DigiVec || fT0DigiArr) && fTriggerMinT0Digis > 0) {
384  hasTrigger =
385  hasTrigger
386  && (event->GetNofData(ECbmDataType::kT0Digi) >= fTriggerMinT0Digis);
387  }
388  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kSts)
389  && fTriggerMinStsDigis > 0) {
390  hasTrigger =
391  hasTrigger
392  && (event->GetNofData(ECbmDataType::kStsDigi) >= fTriggerMinStsDigis);
393  }
394  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kMuch)
395  && fTriggerMinMuchDigis > 0) {
396  hasTrigger =
397  hasTrigger
398  && (event->GetNofData(ECbmDataType::kMuchDigi) >= fTriggerMinMuchDigis);
399  }
400  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kTrd)
401  && fTriggerMinTrdDigis > 0) {
402  hasTrigger =
403  hasTrigger
404  && (event->GetNofData(ECbmDataType::kTrdDigi) >= fTriggerMinTrdDigis);
405  }
406  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kTof)
407  && fTriggerMinTofDigis > 0) {
408  hasTrigger =
409  hasTrigger
410  && (event->GetNofData(ECbmDataType::kTofDigi) >= fTriggerMinTofDigis);
411  }
412  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kRich)
413  && fTriggerMinRichDigis > 0) {
414  hasTrigger =
415  hasTrigger
416  && (event->GetNofData(ECbmDataType::kRichDigi) >= fTriggerMinRichDigis);
417  }
418  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kPsd)
419  && fTriggerMinPsdDigis > 0) {
420  hasTrigger =
421  hasTrigger
422  && (event->GetNofData(ECbmDataType::kPsdDigi) >= fTriggerMinPsdDigis);
423  }
424 
425  if (hasTrigger && (fT0DigiVec || fT0DigiArr) && fTriggerMaxT0Digis >= 0) {
426  hasTrigger =
427  hasTrigger
428  && (event->GetNofData(ECbmDataType::kT0Digi) < fTriggerMaxT0Digis);
429  }
430  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kSts)
431  && fTriggerMaxStsDigis >= 0) {
432  hasTrigger =
433  hasTrigger
434  && (event->GetNofData(ECbmDataType::kStsDigi) < fTriggerMaxStsDigis);
435  }
436  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kMuch)
437  && fTriggerMaxMuchDigis >= 0) {
438  hasTrigger =
439  hasTrigger
440  && (event->GetNofData(ECbmDataType::kMuchDigi) < fTriggerMaxMuchDigis);
441  }
442  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kTrd)
443  && fTriggerMaxTrdDigis >= 0) {
444  hasTrigger =
445  hasTrigger
446  && (event->GetNofData(ECbmDataType::kTrdDigi) < fTriggerMaxTrdDigis);
447  }
448  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kTof)
449  && fTriggerMaxTofDigis >= 0) {
450  hasTrigger =
451  hasTrigger
452  && (event->GetNofData(ECbmDataType::kTofDigi) < fTriggerMaxTofDigis);
453  }
454  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kRich)
455  && fTriggerMaxRichDigis >= 0) {
456  hasTrigger =
457  hasTrigger
458  && (event->GetNofData(ECbmDataType::kRichDigi) < fTriggerMaxRichDigis);
459  }
460  if (hasTrigger && fDigiMan->IsPresent(ECbmModuleId::kPsd)
461  && fTriggerMaxPsdDigis >= 0) {
462  hasTrigger =
463  hasTrigger
464  && (event->GetNofData(ECbmDataType::kPsdDigi) < fTriggerMaxPsdDigis);
465  }
466 
467  return hasTrigger;
468 }
469 
471  /*
472  fPrevTime = 0.;
473 
474  ECbmModuleId prevSystem{ECbmModuleId::kNofSystems};
475  Int_t prevEntry{-1};
476 
477 
478  for ( const auto& _pair: fVect) {
479  ECbmModuleId _system = _pair.first;
480  Int_t _entry = _pair.second;
481  CbmDigi* digi = static_cast<CbmDigi*>(fLinkArray[_system]->At(_entry));
482  Double_t difftime = digi->GetTime() - fPrevTime;
483  fDiffTime->Fill(difftime);
484  if (difftime < 0.) {
485  fErrors++;
486  LOG(info) << fixed << setprecision(15)
487  << "DiffTime: " << difftime *1.e-9
488  << " Previous digi(" << prevSystem << ", "
489  << prevEntry << "): "
490  << fPrevTime * 1.e-9 << ", Current digi("
491  << _system << ", " <<_entry << "): "
492  << digi->GetTime() * 1.e-9;
493  }
494 
495  fPrevTime = digi->GetTime();
496  prevSystem = _system;
497  prevEntry = _entry;
498  }
499  */
500  fVect.clear();
501 
502  Double_t dPreEvtTime = -1.0;
503  for (CbmEvent* evt : fEventVector) {
504  fhEventTime->Fill(evt->GetStartTime() * 1e-9);
505  if (0.0 <= dPreEvtTime) {
506  fhEventDt->Fill(evt->GetStartTime() - dPreEvtTime);
507  } // if( 0.0 <= dPreEvtTime )
508  fhEventSize->Fill(evt->GetNofData());
509  fhNbDigiPerEvtTime->Fill(evt->GetStartTime() * 1e-9, evt->GetNofData());
510 
511  fhNbDigiPerEvtTimeT0->Fill(evt->GetStartTime() * 1e-9,
512  evt->GetNofData(ECbmDataType::kT0Digi));
513  fhNbDigiPerEvtTimeSts->Fill(evt->GetStartTime() * 1e-9,
514  evt->GetNofData(ECbmDataType::kStsDigi));
515  fhNbDigiPerEvtTimeMuch->Fill(evt->GetStartTime() * 1e-9,
516  evt->GetNofData(ECbmDataType::kMuchDigi));
517  fhNbDigiPerEvtTimeTrd->Fill(evt->GetStartTime() * 1e-9,
518  evt->GetNofData(ECbmDataType::kTrdDigi));
519  fhNbDigiPerEvtTimeTof->Fill(evt->GetStartTime() * 1e-9,
520  evt->GetNofData(ECbmDataType::kTofDigi));
521  fhNbDigiPerEvtTimeRich->Fill(evt->GetStartTime() * 1e-9,
522  evt->GetNofData(ECbmDataType::kRichDigi));
523  fhNbDigiPerEvtTimePsd->Fill(evt->GetStartTime() * 1e-9,
524  evt->GetNofData(ECbmDataType::kPsdDigi));
525 
526  dPreEvtTime = evt->GetStartTime();
527  } // for( CbmEvent * evt: fEventVector )
528 }
529 
531  for (auto it = fEventVector.begin(); it != fEventVector.end();
532  /*increased in the loop*/) {
533  if (!HasTrigger((*it))) {
534  delete (*it);
535  it = fEventVector.erase(it);
536  } else {
537  ++it;
538  }
539  }
540 }
541 
543  // Clear TClonesArray before usage.
544  fEvents->Delete();
545 
546  // Move CbmEvent from temporary vector to TClonesArray
547  for (auto event : fEventVector) {
548  LOG(debug) << "Vector: " << event->ToString();
549  new ((*fEvents)[fEvents->GetEntriesFast()]) CbmEvent(std::move(*event));
550  LOG(debug) << "TClonesArray: "
551  << static_cast<CbmEvent*>(
552  fEvents->At(fEvents->GetEntriesFast() - 1))
553  ->ToString();
554  }
555 
556  // Clear event vector after usage
557  // Need to delete the object the pointer points to first
558  int counter = 0;
559  for (auto event : fEventVector) {
560  LOG(debug) << "Event " << counter << " has " << event->GetNofData()
561  << " digis";
562  delete event;
563  counter++;
564  }
565 
566  fEventVector.clear();
567 }
568 
570  Int_t _entry) {
571  // Fill digi index into event
572  switch (_system) {
573  case ECbmModuleId::kMvd:
575  break;
576  case ECbmModuleId::kSts:
578  break;
579  case ECbmModuleId::kRich:
581  break;
582  case ECbmModuleId::kMuch:
584  break;
585  case ECbmModuleId::kTrd:
587  break;
588  case ECbmModuleId::kTof:
590  break;
591  case ECbmModuleId::kPsd:
593  break;
594  case ECbmModuleId::kHodo:
596  break;
597  default: break;
598  }
599 }
600 
601 template<class Digi>
603  Int_t _entry) {
604  LOG(debug) << "Entry: " << _entry;
605 
606  Double_t time = -1.;
607 
608  switch (_system) {
609  case ECbmModuleId::kSts:
610  case ECbmModuleId::kMuch:
611  case ECbmModuleId::kTrd:
612  case ECbmModuleId::kTof:
613  case ECbmModuleId::kRich:
614  case ECbmModuleId::kPsd: {
615  const Digi* pDigi = fDigiMan->Get<Digi>(_entry);
616 
618  if (nullptr != pDigi) {
619  time = pDigi->GetTime();
620  fSorter.emplace(make_pair(time, make_pair(_system, _entry)));
621  } // if( nullptr != pDigi )
622  break;
623  } // Digi containers controlled by DigiManager
624  case ECbmModuleId::kHodo: {
625  // CbmTofDigi * pDigi;
626  if (fT0DigiVec) {
627  if (static_cast<UInt_t>(_entry) < fT0DigiVec->size()) {
628  time = fT0DigiVec->at(_entry).GetTime();
629  fSorter.emplace(make_pair(time, make_pair(_system, _entry)));
630  } // if( _entry < fT0DigiVec->size() )
631  } // if ( fT0DigiVec )
632  else if (fT0DigiArr) {
633  if (_entry < fT0DigiArr->GetEntriesFast()) {
634  time = dynamic_cast<CbmTofDigi*>(fT0DigiArr->At(_entry))->GetTime();
635  fSorter.emplace(make_pair(time, make_pair(_system, _entry)));
636  } // if( _entry < fT0DigiArr->GetEntriesFast() )
637  } // else if ( fT0DigiArr )
638  else
639  return;
640  break;
641  } // case ECbmModuleId::kHodo
642  default: {
643  return;
644  break;
645  } // default:
646  } //? system
647 }
648 
649 // ---- Finish --------------------------------------------------------
651  if (fFillHistos) {
652  TFile* old = gFile;
653  TFile* outfile = TFile::Open(fOutFileName, "RECREATE");
654 
655  fDiffTime->Write();
656 
657  fhEventTime->Write();
658  fhEventDt->Write();
659  fhEventSize->Write();
660  fhNbDigiPerEvtTime->Write();
661 
662  fhNbDigiPerEvtTimeT0->Write();
663  fhNbDigiPerEvtTimeSts->Write();
664  fhNbDigiPerEvtTimeMuch->Write();
665  fhNbDigiPerEvtTimeTrd->Write();
666  fhNbDigiPerEvtTimeTof->Write();
667  fhNbDigiPerEvtTimeRich->Write();
668  fhNbDigiPerEvtTimePsd->Write();
669 
670  outfile->Close();
671  delete outfile;
672 
673  gFile = old;
674  }
675  LOG(info) << "Total errors: " << fErrors;
676 }
677 
678 
CbmMcbm2018EventBuilder::fPrevTime
Double_t fPrevTime
Timeslice Counter.
Definition: CbmMcbm2018EventBuilder.h:139
EventBuilderAlgo::FixedTimeWindow
@ FixedTimeWindow
CbmMuchDigi.h
CbmMcbm2018EventBuilder::fTriggerMaxStsDigis
Int_t fTriggerMaxStsDigis
Definition: CbmMcbm2018EventBuilder.h:210
CbmMcbm2018EventBuilder::fFixedTimeWindow
Double_t fFixedTimeWindow
Definition: CbmMcbm2018EventBuilder.h:187
CbmMcbm2018EventBuilder::fCurrentEvent
CbmEvent * fCurrentEvent
Definition: CbmMcbm2018EventBuilder.h:155
ECbmDataType::kRichDigi
@ kRichDigi
CbmMcbm2018EventBuilder::FillOutput
void FillOutput()
Definition: CbmMcbm2018EventBuilder.cxx:542
ECbmDataType::kStsDigi
@ kStsDigi
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTimeTrd
TH2 * fhNbDigiPerEvtTimeTrd
histogram with the nb of MUCH digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:174
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTimeMuch
TH2 * fhNbDigiPerEvtTimeMuch
histogram with the nb of STS digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:172
ECbmDataType::kMvdDigi
@ kMvdDigi
CbmPsdDigi.h
CbmMcbm2018EventBuilder::fTriggerMinRichDigis
Int_t fTriggerMinRichDigis
Definition: CbmMcbm2018EventBuilder.h:204
CbmMcbm2018EventBuilder::IsDigiInEvent
Bool_t IsDigiInEvent(Double_t)
Definition: CbmMcbm2018EventBuilder.cxx:372
CbmMcbm2018EventBuilder.h
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
CbmMcbm2018EventBuilder::Init
virtual InitStatus Init()
Definition: CbmMcbm2018EventBuilder.cxx:55
CbmMcbm2018EventBuilder::fhEventDt
TH1 * fhEventDt
histogram with the seed time of the events
Definition: CbmMcbm2018EventBuilder.h:162
CbmMcbm2018EventBuilder::InitSorter
void InitSorter()
Definition: CbmMcbm2018EventBuilder.cxx:239
CbmMcbm2018EventBuilder::AddDigiToSorter
void AddDigiToSorter(ECbmModuleId, Int_t)
Definition: CbmMcbm2018EventBuilder.cxx:602
CbmMcbm2018EventBuilder::fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmMcbm2018EventBuilder.h:142
CbmMcbm2018EventBuilder::fT0DigiVec
const std::vector< CbmTofDigi > * fT0DigiVec
Definition: CbmMcbm2018EventBuilder.h:143
CbmMcbm2018EventBuilder::CbmMcbm2018EventBuilder
CbmMcbm2018EventBuilder()
Definition: CbmMcbm2018EventBuilder.cxx:36
CbmMcbm2018EventBuilder::HasTrigger
Bool_t HasTrigger(CbmEvent *)
Definition: CbmMcbm2018EventBuilder.cxx:381
CbmMcbm2018EventBuilder::DefineGoodEvents
void DefineGoodEvents()
Definition: CbmMcbm2018EventBuilder.cxx:530
ECbmDataType::kTofDigi
@ kTofDigi
CbmMcbm2018EventBuilder::fTriggerMinTofDigis
Int_t fTriggerMinTofDigis
Definition: CbmMcbm2018EventBuilder.h:202
CbmEvent::AddData
void AddData(ECbmDataType type, UInt_t index)
Definition: CbmEvent.cxx:15
CbmMcbm2018EventBuilder::fCurEv
Int_t fCurEv
Definition: CbmMcbm2018EventBuilder.h:136
ECbmModuleId::kMvd
@ kMvd
Micro-Vertex Detector.
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmDigiManager::GetNofDigis
static Int_t GetNofDigis(ECbmModuleId systemId)
Definition: CbmDigiManager.cxx:62
CbmDigiManager::UseMuchBeamTimeDigi
void UseMuchBeamTimeDigi(Bool_t choice=kTRUE)
Use CbmMuchBeamTimeDigi instead of CbmMuchDigi for MUCH.
Definition: CbmDigiManager.h:130
CbmMcbm2018EventBuilder::fFillHistos
Bool_t fFillHistos
histogram with the nb of PSD digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:182
CbmTofDigi.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmMcbm2018EventBuilder::SetParContainers
virtual void SetParContainers()
Definition: CbmMcbm2018EventBuilder.cxx:43
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTimeSts
TH2 * fhNbDigiPerEvtTimeSts
histogram with the nb of T0 digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:170
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTimeT0
TH2 * fhNbDigiPerEvtTimeT0
histogram with the nb of all digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:168
CbmDigiManager::IsPresent
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
Definition: CbmDigiManager.cxx:112
CbmMcbm2018EventBuilder::Exec
virtual void Exec(Option_t *)
Definition: CbmMcbm2018EventBuilder.cxx:218
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
CbmMcbm2018EventBuilder::ReInit
virtual InitStatus ReInit()
Definition: CbmMcbm2018EventBuilder.cxx:215
CbmRichDigi.h
CbmTrdDigi.h
CbmStsDigi.h
ECbmDataType::kT0Digi
@ kT0Digi
ECbmModuleId::kHodo
@ kHodo
Hodoscope (for test beam times)
CbmMcbm2018EventBuilder::fTriggerMaxTrdDigis
Int_t fTriggerMaxTrdDigis
Definition: CbmMcbm2018EventBuilder.h:214
CbmDigiManager::Get
const Digi * Get(Int_t index) const
Get a digi object.
Definition: CbmDigiManager.h:52
ECbmDataType::kPsdDigi
@ kPsdDigi
CbmMcbm2018EventBuilder::fMaximumTimeGap
Double_t fMaximumTimeGap
Definition: CbmMcbm2018EventBuilder.h:191
CbmMcbm2018EventBuilder::fVect
std::vector< std::pair< ECbmModuleId, Int_t > > fVect
for digi sorting
Definition: CbmMcbm2018EventBuilder.h:153
CbmMcbm2018EventBuilder::fNrTs
Int_t fNrTs
Error Counter.
Definition: CbmMcbm2018EventBuilder.h:138
CbmMcbm2018EventBuilder::fOutFileName
TString fOutFileName
Definition: CbmMcbm2018EventBuilder.h:223
CbmMuchBeamTimeDigi.h
CbmMcbm2018EventBuilder::fErrors
Int_t fErrors
Event Counter.
Definition: CbmMcbm2018EventBuilder.h:137
CbmMcbm2018EventBuilder::fTriggerMinStsDigis
Int_t fTriggerMinStsDigis
Definition: CbmMcbm2018EventBuilder.h:196
ECbmModuleId::kRich
@ kRich
Ring-Imaging Cherenkov Detector.
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTimePsd
TH2 * fhNbDigiPerEvtTimePsd
histogram with the nb of RICH digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:180
CbmMcbm2018EventBuilder::fEventVector
std::vector< CbmEvent * > fEventVector
pointer to the event which is currently build
Definition: CbmMcbm2018EventBuilder.h:157
CbmMcbm2018EventBuilder::fTriggerMaxT0Digis
Int_t fTriggerMaxT0Digis
Definition: CbmMcbm2018EventBuilder.h:208
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbm2018EventBuilder::BuildEvents
void BuildEvents()
Definition: CbmMcbm2018EventBuilder.cxx:295
CbmMcbm2018EventBuilder
Definition: CbmMcbm2018EventBuilder.h:48
CbmMcbm2018EventBuilder::fEvents
TClonesArray * fEvents
input container of TO digis
Definition: CbmMcbm2018EventBuilder.h:145
ECbmDataType::kTrdDigi
@ kTrdDigi
CbmMcbm2018EventBuilder::FillHisto
void FillHisto()
Definition: CbmMcbm2018EventBuilder.cxx:470
CbmTofDigi
Data class for expanded digital TOF information.
Definition: CbmTofDigi.h:38
CbmMcbm2018EventBuilder::fStartTimeEvent
Double_t fStartTimeEvent
Definition: CbmMcbm2018EventBuilder.h:189
CbmMcbm2018EventBuilder::~CbmMcbm2018EventBuilder
~CbmMcbm2018EventBuilder()
Definition: CbmMcbm2018EventBuilder.cxx:40
CbmMcbm2018EventBuilder::fhEventSize
TH1 * fhEventSize
histogram with the interval in seed time of consecutive events
Definition: CbmMcbm2018EventBuilder.h:164
CbmMcbm2018EventBuilder::fTriggerMaxPsdDigis
Int_t fTriggerMaxPsdDigis
Definition: CbmMcbm2018EventBuilder.h:220
ECbmModuleId::kTrd
@ kTrd
Transition Radiation Detector.
CbmMcbm2018EventBuilder::fhEventTime
TH1 * fhEventTime
histogram with the time difference between two consecutive digis
Definition: CbmMcbm2018EventBuilder.h:161
CbmMcbm2018EventBuilder::fTriggerMinT0Digis
Int_t fTriggerMinT0Digis
Definition: CbmMcbm2018EventBuilder.h:194
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTimeRich
TH2 * fhNbDigiPerEvtTimeRich
histogram with the nb of TOF digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:178
counter
int counter
Definition: CbmMvdSensorDigiToHitTask.cxx:72
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTimeTof
TH2 * fhNbDigiPerEvtTimeTof
histogram with the nb of TRD digis per event vs seed time of the events
Definition: CbmMcbm2018EventBuilder.h:176
CbmDigiManager.h
CbmMcbm2018EventBuilder::fDiffTime
TH1 * fDiffTime
vector with all created events
Definition: CbmMcbm2018EventBuilder.h:159
CbmMcbm2018EventBuilder::fTriggerMaxTofDigis
Int_t fTriggerMaxTofDigis
Definition: CbmMcbm2018EventBuilder.h:216
CbmMcbm2018EventBuilder::fTriggerMinPsdDigis
Int_t fTriggerMinPsdDigis
Definition: CbmMcbm2018EventBuilder.h:206
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
CbmMcbm2018EventBuilder::Finish
virtual void Finish()
Definition: CbmMcbm2018EventBuilder.cxx:650
CbmMcbm2018EventBuilder::fTriggerMinTrdDigis
Int_t fTriggerMinTrdDigis
Definition: CbmMcbm2018EventBuilder.h:200
ECbmModuleId::kMuch
@ kMuch
Muon detection system.
CbmMcbm2018EventBuilder::fEventBuilderAlgo
EventBuilderAlgo fEventBuilderAlgo
Switch ON/OFF filling of histograms.
Definition: CbmMcbm2018EventBuilder.h:185
ECbmModuleId::kPsd
@ kPsd
Projectile spectator detector.
CbmMcbm2018EventBuilder::fbUseBaseMuchDigi
Bool_t fbUseBaseMuchDigi
Save previous time information.
Definition: CbmMcbm2018EventBuilder.h:141
CbmMcbm2018EventBuilder::fSorter
std::multimap< Double_t, digituple > fSorter
array with pointers to input containers
Definition: CbmMcbm2018EventBuilder.h:151
CbmMcbm2018EventBuilder::fTriggerMaxMuchDigis
Int_t fTriggerMaxMuchDigis
Definition: CbmMcbm2018EventBuilder.h:212
CbmMcbm2018EventBuilder::fTriggerMinMuchDigis
Int_t fTriggerMinMuchDigis
Definition: CbmMcbm2018EventBuilder.h:198
CbmMcbm2018EventBuilder::fT0DigiArr
TClonesArray * fT0DigiArr
Definition: CbmMcbm2018EventBuilder.h:144
CbmMcbm2018EventBuilder::fTriggerMaxRichDigis
Int_t fTriggerMaxRichDigis
Definition: CbmMcbm2018EventBuilder.h:218
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
Cbm::ToString
std::string ToString(const T &value)
Definition: CbmUtils.h:16
CbmMcbm2018EventBuilder::fhNbDigiPerEvtTime
TH2 * fhNbDigiPerEvtTime
histogram with the nb of all digis in the event
Definition: CbmMcbm2018EventBuilder.h:166
CbmMcbm2018EventBuilder::AddDigiToEvent
void AddDigiToEvent(ECbmModuleId, Int_t)
Definition: CbmMcbm2018EventBuilder.cxx:569
ECbmDataType::kMuchDigi
@ kMuchDigi
CbmEvent::SetEndTime
void SetEndTime(Double_t endTime)
Definition: CbmEvent.h:137