CbmRoot
CbmMcbm2019TimeWinEventBuilderAlgo.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 
11 #include "CbmEvent.h"
12 #include "CbmMuchBeamTimeDigi.h"
13 #include "CbmPsdDigi.h"
14 #include "CbmRichDigi.h"
15 #include "CbmStsDigi.h"
16 #include "CbmTofDigi.h"
17 #include "CbmTrdDigi.h"
18 #include "TimesliceMetaData.h"
19 
20 #include "CbmDigiManager.h"
21 
23 #include "FairLogger.h"
24 #include "FairRootManager.h"
25 #include "FairRunOnline.h"
26 
28 #include "TCanvas.h"
29 #include "TClonesArray.h"
30 #include "TH1.h"
31 #include "TH2.h"
32 #include "THttpServer.h"
33 
35 
36 // ---- Default constructor --------------------------------------------
38 
39 // ---- Destructor -----------------------------------------------------
41 
42 // ---- Init -----------------------------------------------------------
44  LOG(info)
45  << "CbmMcbm2019TimeWinEventBuilderAlgo::InitAlgo => Starting sequence";
46 
47  // Get a handle from the IO manager
48  FairRootManager* ioman = FairRootManager::Instance();
49 
50  // Get a pointer to the previous already existing data level
53  fDigiMan->Init();
54 
56  if (kFALSE == CheckDataAvailable(fRefDet)) {
57  LOG(fatal) << "No digi input for reference detector, stopping there!";
58  } // if( kFALSE == CheckDataAvailable( fRefDet ) )
59 
61  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
62  det != fvDets.end();
63  ++det) {
64  if (kFALSE == CheckDataAvailable(*det)) {
65  LOG(fatal)
66  << "No digi input for one of selection detector, stopping there!";
67  } // if( kFALSE == CheckDataAvailable( *det ) )
68  } // for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin(); det != fvDets.end(); ++det)
69 
72  dynamic_cast<TClonesArray*>(ioman->GetObject("TimesliceMetaData"));
74  LOG(fatal)
75  << "No TS metadata input found"
76  << " => Please check in the unpacking macro if the following line was "
77  "present!"
78  << std::endl
79  << "source->SetWriteOutputFlag(kTRUE); // For writing TS metadata";
80  } // if (!fTimeSliceMetaDataArray)
81 
82  if (fbFillHistos) { CreateHistograms(); } // if( fbFillHistos )
83 
84  LOG(info) << "CbmMcbm2019TimeWinEventBuilderAlgo::InitAlgo => Done";
85 
86  return kTRUE;
87 }
88 
89 // ---- ProcessTs ------------------------------------------------------
91  LOG_IF(info, fuNrTs % 1000 == 0) << "Begin of TS " << fuNrTs;
92 
93  InitTs();
94 
95  BuildEvents();
96 
98  if (nullptr != fCurrentEvent) {
100  // fCurrentEvent->SetStartTime( fPrevTime ); // Replace Seed time with time of first digi in event?
102  fEventVector.push_back(fCurrentEvent);
103  fuCurEv++;
104 
106  fCurrentEvent = nullptr;
107  } // if( nullptr != fCurrentEvent )
108 
109  LOG(debug) << "Found " << fEventVector.size() << " triggered events";
110 
111  if (fbFillHistos) { FillHistos(); } // if( fbFillHistos )
112 
113  fuNrTs++;
114 }
117  int counter = 0;
118  for (CbmEvent* event : fEventVector) {
119  LOG(debug) << "Event " << counter << " has " << event->GetNofData()
120  << " digis";
121  delete event;
122  counter++;
123  } // for( CbmEvent* event: fEventVector)
124 
125  fEventVector.clear();
126 }
127 // ---- Finish ---------------------------------------------------------
129  LOG(info) << "Total errors: " << fuErrors;
130 }
131 
132 // ---------------------------------------------------------------------
134  EventBuilderDetector& det) {
135  // Get a handle from the IO manager
136  FairRootManager* ioman = FairRootManager::Instance();
137 
138  if (ECbmModuleId::kT0 == det.detId) {
139  // T0 is not included in DigiManager
140  fT0DigiVec = ioman->InitObjectAs<std::vector<CbmTofDigi> const*>("T0Digi");
141  if (!fT0DigiVec) {
142  LOG(info) << "No T0 digi input found.";
143  return kFALSE;
144  } // if( ! fT0DigiVec )
145  } // if( ECbmModuleId::kT0 == det.detId )
146  else {
147  if (!fDigiMan->IsPresent(det.detId)) {
148  LOG(info) << "No " << det.sName << " digi input found.";
149  return kFALSE;
150  } // if( ! fDigiMan->IsPresent(ECbmModuleId::kSts) )
151  } // else of if( ECbmModuleId::kT0 == det.detId )
152 
153  return kTRUE;
154 }
155 // ---------------------------------------------------------------------
159  fRefDet.fuStartIndex = 0;
160  fRefDet.fuEndIndex = 0;
162  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
163  det != fvDets.end();
164  ++det) {
165  (*det).fuStartIndex = 0;
166  (*det).fuEndIndex = 0;
167  } // for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin(); det != fvDets.end(); ++det)
168 }
169 
172  switch (fRefDet.detId) {
173  case ECbmModuleId::kSts: {
174  LoopOnSeeds<CbmStsDigi>();
175  break;
176  } // case ECbmModuleId::kSts:
177  case ECbmModuleId::kMuch: {
178  LoopOnSeeds<CbmMuchBeamTimeDigi>();
179  break;
180  } // case ECbmModuleId::kMuch:
181  case ECbmModuleId::kTrd: {
182  LoopOnSeeds<CbmTrdDigi>();
183  break;
184  } // case ECbmModuleId::kTrd:
185  case ECbmModuleId::kTof: {
186  LoopOnSeeds<CbmTofDigi>();
187  break;
188  } // case ECbmModuleId::kTof:
189  case ECbmModuleId::kRich: {
190  LoopOnSeeds<CbmRichDigi>();
191  break;
192  } // case ECbmModuleId::kRich:
193  case ECbmModuleId::kPsd: {
194  LoopOnSeeds<CbmPsdDigi>();
195  break;
196  } // case ECbmModuleId::kPsd:
197  case ECbmModuleId::kT0: {
198  LoopOnSeeds<CbmTofDigi>();
199  break;
200  } // case ECbmModuleId::kT0:
201  default: {
202  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::BuildEvents => "
203  << "Trying to search event seeds with unsupported det: "
204  << fRefDet.sName;
205  break;
206  } // default:
207  } // switch( *det )
208 }
209 
210 template<class DigiSeed>
212  pTsMetaData =
213  dynamic_cast<TimesliceMetaData*>(fTimeSliceMetaDataArray->At(0));
214  if (nullptr == pTsMetaData)
215  LOG(fatal) << Form("CbmMcbm2019TimeWinEventBuilderAlgo::LoopOnSeeds => "
216  "No TS metadata found for TS %6u.",
217  fuNrTs);
218 
220  if ((0.0 < fdEarliestTimeWinBeg
223  LOG(warning) << "CbmMcbm2019TimeWinEventBuilderAlgo::LoopOnSeeds => "
224  << Form("Event window not fitting in TS overlap, risk of "
225  "incomplete events: %f %f %f %llu",
230  } // if end of event window does not fit in overlap for a seed at edge of TS core
231 
234  Double_t dSeedWindowBeg =
236  + (0.0 < fdEarliestTimeWinBeg ? 0.0 : -fdEarliestTimeWinBeg);
237  Double_t dSeedWindowEnd =
239  + (0.0 < fdEarliestTimeWinBeg ? 0.0 : -fdEarliestTimeWinBeg);
240  if (fbIgnoreTsOverlap) {
241  dSeedWindowBeg = pTsMetaData->GetStartTime();
242  dSeedWindowEnd = pTsMetaData->GetOverlapStartTime();
243  } // if( fbIgnoreTsOverlap )
244 
246  if (fT0DigiVec) {
248  UInt_t uNbRefDigis = fT0DigiVec->size();
250  for (UInt_t uDigi = 0; uDigi < uNbRefDigis; ++uDigi) {
251  LOG(debug) << Form("Checking seed %6u / %6u", uDigi, uNbRefDigis);
252 
253  Double_t dTime = fT0DigiVec->at(uDigi).GetTime();
254 
256  CheckSeed(dTime, uDigi);
257  } // for( UInt_t uDigi = 0; uDigi < uNbRefDigis; ++uDigi )
258  } // if ( fT0DigiVec )
259  else
260  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::LoopOnSeeds => "
261  << "T0 as reference detector but vector not found!";
262  } // if (ECbmModuleId::kT0 == fRefDet.detId)
263  else {
264  UInt_t uNbRefDigis = (0 < fDigiMan->GetNofDigis(fRefDet.detId)
266  : 0);
268  for (UInt_t uDigi = 0; uDigi < uNbRefDigis; ++uDigi) {
269  LOG(debug) << Form("Checking seed %6u / %6u", uDigi, uNbRefDigis);
270  const DigiSeed* pDigi = fDigiMan->Get<DigiSeed>(uDigi);
272  if (nullptr != pDigi) {
273  Double_t dTime = pDigi->GetTime();
274 
276  if (dTime < dSeedWindowBeg) {
277  continue;
278  } // if( dTime < dSeedWindowBeg )
279  else if (dSeedWindowEnd < dTime) {
280  break;
281  } // else if( dSeedWindowEnd < dTime )
282 
284  CheckSeed(dTime, uDigi);
285  } // if( nullptr != pDigi )
286  } // for( UInt_t uDigi = 0; uDigi < uNbRefDigis; ++uDigi )
287  } // else of if (ECbmModuleId::kT0 == fRefDet.detId) => Digi containers controlled by DigiManager
288 }
289 
291  UInt_t uSeedDigiIdx) {
294  if (nullptr != fCurrentEvent
296  || dSeedTime - fdPrevEvtTime < fRefDet.GetTimeWinRange())
297  && dSeedTime - fdPrevEvtTime < fdWidestTimeWinRange) {
299  switch (fOverMode) {
302  LOG(debug1) << "Reject seed due to overlap";
303  return;
304  break;
305  } // case EOverlapMode::NoOverlap:
308  break;
309  } // case EOverlapMode::MergeOverlap:
313  LOG(debug1) << "Reject seed because part of cluster of previous one";
314  return;
315  break;
316  } // case EOverlapMode::AllowOverlap:
317  } // switch( fOverMode )
318  } // if( prev Event exists and mode forbiden overlap present )
319  else {
322  if (nullptr != fCurrentEvent) {
324  // fCurrentEvent->SetStartTime( fPrevTime ); // Replace Seed time with time of first digi in event?
326  fEventVector.push_back(fCurrentEvent);
327  fuCurEv++;
328  } // if( nullptr != fCurrentEvent )
329  fCurrentEvent = new CbmEvent(fuCurEv, dSeedTime, 0.);
330  } // else of if( prev Event exists and mode forbiden overlap present )
331 
335  switch (fRefDet.detId) {
336  case ECbmModuleId::kSts: {
337  SearchMatches<CbmStsDigi>(dSeedTime, fRefDet);
338  break;
339  } // case ECbmModuleId::kSts:
340  case ECbmModuleId::kMuch: {
341  SearchMatches<CbmMuchBeamTimeDigi>(dSeedTime, fRefDet);
342  break;
343  } // case ECbmModuleId::kMuch:
344  case ECbmModuleId::kTrd: {
345  SearchMatches<CbmTrdDigi>(dSeedTime, fRefDet);
346  break;
347  } // case ECbmModuleId::kTrd:
348  case ECbmModuleId::kTof: {
349  SearchMatches<CbmTofDigi>(dSeedTime, fRefDet);
350  break;
351  } // case ECbmModuleId::kTof:
352  case ECbmModuleId::kRich: {
353  SearchMatches<CbmRichDigi>(dSeedTime, fRefDet);
354  break;
355  } // case ECbmModuleId::kRich:
356  case ECbmModuleId::kPsd: {
357  SearchMatches<CbmPsdDigi>(dSeedTime, fRefDet);
358  break;
359  } // case ECbmModuleId::kPsd:
360  case ECbmModuleId::kT0: {
361  SearchMatches<CbmTofDigi>(dSeedTime, fRefDet);
362  break;
363  } // case ECbmModuleId::kT0:
364  default: {
365  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::LoopOnSeeds => "
366  << "Trying to search matches with unsupported det: "
367  << fRefDet.sName << std::endl
368  << "You may want to add support for it in the method.";
369  break;
370  } // default:
371  } // switch( fRefDet )
372 
374  if (0 < fRefDet.fdTimeWinBeg) AddDigiToEvent(fRefDet, uSeedDigiIdx);
375  } // if( fdRefTimeWinBeg < fdRefTimeWinEnd )
376  else {
377  AddDigiToEvent(fRefDet, uSeedDigiIdx);
378  } // else of if( fdRefTimeWinBeg < fdRefTimeWinEnd )
379 
381  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
382  det != fvDets.end();
383  ++det) {
384  switch ((*det).detId) {
385  case ECbmModuleId::kSts: {
386  SearchMatches<CbmStsDigi>(dSeedTime, *det);
387  break;
388  } // case ECbmModuleId::kSts:
389  case ECbmModuleId::kMuch: {
390  SearchMatches<CbmMuchBeamTimeDigi>(dSeedTime, *det);
391  break;
392  } // case ECbmModuleId::kMuch:
393  case ECbmModuleId::kTrd: {
394  SearchMatches<CbmTrdDigi>(dSeedTime, *det);
395  break;
396  } // case ECbmModuleId::kTrd:
397  case ECbmModuleId::kTof: {
398  SearchMatches<CbmTofDigi>(dSeedTime, *det);
399  break;
400  } // case ECbmModuleId::kTof:
401  case ECbmModuleId::kRich: {
402  SearchMatches<CbmRichDigi>(dSeedTime, *det);
403  break;
404  } // case ECbmModuleId::kRich:
405  case ECbmModuleId::kPsd: {
406  SearchMatches<CbmPsdDigi>(dSeedTime, *det);
407  break;
408  } // case ECbmModuleId::kPsd:
409  case ECbmModuleId::kT0: {
410  SearchMatches<CbmTofDigi>(dSeedTime, *det);
411  break;
412  } // case ECbmModuleId::kT0:
413  default: {
414  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::LoopOnSeeds => "
415  << "Trying to search matches with unsupported det: "
416  << (*det).sName << std::endl
417  << "You may want to add support for it in the method.";
418  break;
419  } // default:
420  } // switch( *det )
421  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
422 
424  if (HasTrigger(fCurrentEvent)) {
425  fdPrevEvtTime = dSeedTime;
426 
431 
434 
436  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
437  det != fvDets.end();
438  ++det) {
439  (*det).fuStartIndex = (*det).fuEndIndex;
440  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
441  } // If no overlap or merge overlap
442  } // if( !HasTrigger( fCurrentEvent ) )
443  else {
444  LOG(debug1) << "Reject seed due to Trigger requirements";
445  delete fCurrentEvent;
446  fCurrentEvent = nullptr;
447  } // else of if( !HasTrigger( fCurrentEvent ) )
448 }
449 
450 template<class DigiCheck>
452  Double_t dSeedTime,
453  EventBuilderDetector& detMatch) {
455  UInt_t uLocalIndexStart = detMatch.fuStartIndex;
456  UInt_t uLocalIndexEnd = detMatch.fuStartIndex;
457 
459  if (ECbmModuleId::kT0 == detMatch.detId) {
460  if (fT0DigiVec) {
462  UInt_t uNbSelDigis = fT0DigiVec->size();
464  for (UInt_t uDigi = detMatch.fuStartIndex; uDigi < uNbSelDigis; ++uDigi) {
465  Double_t dTime = fT0DigiVec->at(uDigi).GetTime();
466 
467  Double_t dTimeDiff = dTime - dSeedTime;
468 
470  if (dTimeDiff < detMatch.fdTimeWinBeg) {
471  ++uLocalIndexStart;
472  continue;
473  } // if( dTimeDiff < detMatch.fdTimeWinBeg )
474  else if (detMatch.fdTimeWinEnd < dTimeDiff) {
477  uLocalIndexEnd = uDigi;
478  break;
479  } // else if( detMatch.fdTimeWinEnd < dTimeDiff ) of if( dTimeDiff < detMatch.fdTimeWinBeg )
480 
481  AddDigiToEvent(detMatch, uDigi);
482 
483  if (fdPrevEvtEndTime < dTime) fdPrevEvtEndTime = dTime;
484  } // for( UInt_t uDigi = 0; uDigi < uNbSelDigis; ++uDigi )
485 
487  if (uLocalIndexEnd < uLocalIndexStart) uLocalIndexEnd = uNbSelDigis;
488  } // if ( fT0DigiVec )
489  else
490  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::SearchMatches => "
491  << "T0 as selection detector but vector not found!";
492  } // if( ECbmModuleId::kT0 == detMatch.detId )
493  else {
494  UInt_t uNbSelDigis = (0 < fDigiMan->GetNofDigis(detMatch.detId)
495  ? fDigiMan->GetNofDigis(detMatch.detId)
496  : 0);
498  for (UInt_t uDigi = detMatch.fuStartIndex; uDigi < uNbSelDigis; ++uDigi) {
499  const DigiCheck* pDigi = fDigiMan->Get<DigiCheck>(uDigi);
501  if (nullptr != pDigi) {
502  Double_t dTime = pDigi->GetTime();
503  Double_t dTimeDiff = dTime - dSeedTime;
504 
505  LOG(debug4) << detMatch.sName
506  << Form(" => Checking match %6u / %6u, dt %f",
507  uDigi,
508  uNbSelDigis,
509  dTimeDiff);
510 
512  if (dTimeDiff < detMatch.fdTimeWinBeg) {
513  ++uLocalIndexStart;
514  continue;
515  } // if( dTimeDiff < detMatch.fdTimeWinBeg )
516  else if (detMatch.fdTimeWinEnd < dTimeDiff) {
519  uLocalIndexEnd = uDigi;
520  break;
521  } // else if( detMatch.fdTimeWinEnd < dTimeDiff ) of if( dTimeDiff < detMatch.fdTimeWinBeg )
522 
523  AddDigiToEvent(detMatch, uDigi);
524 
525  if (fdPrevEvtEndTime < dTime) fdPrevEvtEndTime = dTime;
526  } // if( nullptr != pDigi )
527  } // for( UInt_t uDigi = 0; uDigi < uNbSelDigis; ++uDigi )
528 
530  if (uLocalIndexEnd < uLocalIndexStart) uLocalIndexEnd = uNbSelDigis;
531  } // else of if( ECbmModuleId::kT0 == detMatch.detId ) => Digi containers controlled by DigiManager
532 
534  detMatch.fuStartIndex = uLocalIndexStart;
535  detMatch.fuEndIndex = uLocalIndexEnd;
536 }
537 
540  Int_t _entry) {
541  fCurrentEvent->AddData(det.dataType, _entry);
542 }
543 
546  if (kFALSE == CheckTriggerConditions(event, fRefDet)) {
547  return kFALSE;
548  } // if (kFALSE == CheckTriggerConditions(event, fRefDet) )
549 
551  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
552  det != fvDets.end();
553  ++det) {
554  if (kFALSE == CheckTriggerConditions(event, *det)) return kFALSE;
555  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
556 
558  return kTRUE;
559 }
560 
562  CbmEvent* event,
563  EventBuilderDetector& det) {
565  if (0 == det.fuTriggerMinDigis && det.fiTriggerMaxDigis < 0) {
566  return kTRUE;
567  } // if( 0 == det.fuTriggerMinDigis && det.fiTriggerMaxDigis < 0 )
568 
570  if (ECbmModuleId::kT0 == det.detId) {
572  if (!(fT0DigiVec)) {
573  LOG(warning) << "Event does not have digis storage for T0"
574  << " while the following trigger minimum are defined: "
575  << det.fuTriggerMinDigis << " " << det.fiTriggerMaxDigis;
576  return kFALSE;
577  } // if( !(fT0DigiVec) )
578  } // if( ECbmDataType::kT0Digi == det.detId )
579  else {
580  if (!fDigiMan->IsPresent(det.detId)) {
581  LOG(warning) << "Event does not have digis storage for " << det.sName
582  << " while the following trigger min/max are defined: "
583  << det.fuTriggerMinDigis << " " << det.fiTriggerMaxDigis;
584  return kFALSE;
585  } // if( !fDigiMan->IsPresent( det ) )
586  } // else of if( ECbmDataType::kT0Digi == det )
587 
589  Int_t iNbDigis = event->GetNofData(det.dataType);
590  if ((-1 != iNbDigis)
591  && (det.fuTriggerMinDigis <= static_cast<UInt_t>(iNbDigis))) {
592  return kTRUE;
593  } // if( ( -1 != iNbDigis ) && ( det.fuTriggerMinDigis <= static_cast< UInt_t >( iNbDigis ) )
594  else {
595  LOG(debug2) << "Event does not have enough digis: " << iNbDigis << " vs "
596  << det.fuTriggerMinDigis << " for " << det.sName;
597  return kFALSE;
598  } // else of if( ( -1 != iNbDigis ) && ( det.fuTriggerMinDigis <= static_cast< UInt_t >( iNbDigis ) )
599 
601  if (iNbDigis < det.fiTriggerMaxDigis) {
602  return kTRUE;
603  } // if( iNbDigis < det.fiTriggerMaxDigis )
604  else {
605  LOG(debug2) << "Event Has too many digis: " << iNbDigis << " vs "
606  << det.fiTriggerMaxDigis << " for " << det.sName;
607  return kFALSE;
608  } // else of if( iNbDigis < det.fiTriggerMaxDigis )
609 }
610 //----------------------------------------------------------------------
613  /* clang-format off */
614  fhEventTime = new TH1F("hEventTime",
615  "seed time of the events; Seed time [s]; Events",
616  60000, 0, 600);
617  fhEventDt = new TH1F( "fhEventDt",
618  "interval in seed time of consecutive events; Seed time [s]; Events",
619  2100, -100.5, 1999.5);
620  fhEventSize =
621  new TH1F("hEventSize",
622  "nb of all digis in the event; Nb Digis []; Events []",
623  10000, 0, 10000);
625  new TH2I("hNbDigiPerEvtTime",
626  "nb of all digis per event vs seed time of the events; Seed time "
627  "[s]; Nb Digis []; Events []",
628  600, 0, 600,
629  1000, 0, 10000);
630 
632  for (std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det) {
634  if( "Invalid" == (*det).sName )
635  {
636  fvhNbDigiPerEvtTimeDet.push_back( nullptr );
637  continue;
638  } // if( "Invalid" == (*det).sName )
639 
640  fvhNbDigiPerEvtTimeDet.push_back(
641  new TH2I( Form( "hNbDigiPerEvtTime%s", (*det).sName.data() ),
642  Form( "nb of %s digis per event vs seed time of the events; Seed time "
643  "[s]; Nb Digis []; Events []",
644  (*det).sName.data() ),
645  600, 0, 600,
646  4000, 0, 4000) );
647  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
648 
649  AddHistoToVector(fhEventTime, "evtbuild");
650  AddHistoToVector(fhEventDt, "evtbuild");
651  AddHistoToVector(fhEventSize, "evtbuild");
653  for (std::vector<TH2*>::iterator itHist = fvhNbDigiPerEvtTimeDet.begin();
654  itHist != fvhNbDigiPerEvtTimeDet.end();
655  ++itHist) {
656  if( nullptr != (*itHist) )
657  {
658  AddHistoToVector((*itHist), "evtbuild");
659  } // if( nullptr != (*itHist) )
660  } // for( std::vector<TH2*>::iterator itHist = fvhNbDigiPerEvtTimeDet.begin(); itHist != fvhNbDigiPerEvtTimeDet.end(); ++itHist )
661 
663  /* clang-format on */
664 }
666  Double_t dPreEvtTime = -1.0;
667  for (CbmEvent* evt : fEventVector) {
668  fhEventTime->Fill(evt->GetStartTime() * 1e-9);
669  if (0.0 <= dPreEvtTime) {
670  fhEventDt->Fill(evt->GetStartTime() - dPreEvtTime);
671  } // if( 0.0 <= dPreEvtTime )
672  fhEventSize->Fill(evt->GetNofData());
673  fhNbDigiPerEvtTime->Fill(evt->GetStartTime() * 1e-9, evt->GetNofData());
674 
676  for (UInt_t uDetIdx = 0; uDetIdx < fvDets.size(); ++uDetIdx) {
677  if (nullptr == fvhNbDigiPerEvtTimeDet[uDetIdx]) continue;
678 
679  fvhNbDigiPerEvtTimeDet[uDetIdx]->Fill(
680  evt->GetStartTime() * 1e-9, evt->GetNofData(fvDets[uDetIdx].dataType));
681  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
682 
683  dPreEvtTime = evt->GetStartTime();
684  } // for( CbmEvent * evt: fEventVector )
685 }
687  Bool_t /*bResetTime*/) {
688  fhEventTime->Reset();
689  fhEventDt->Reset();
690  fhEventSize->Reset();
691 
692  fhNbDigiPerEvtTime->Reset();
694  for (std::vector<TH2*>::iterator itHist = fvhNbDigiPerEvtTimeDet.begin();
695  itHist != fvhNbDigiPerEvtTimeDet.end();
696  ++itHist) {
697  (*itHist)->Reset();
698  } // for( std::vector<TH2*>::iterator itHist = fvhNbDigiPerEvtTimeDet.begin(); itHist != fvhNbDigiPerEvtTimeDet.end(); ++itHist )
699 
700  /*
701  if( kTRUE == bResetTime )
702  {
704  fdStartTime = -1.0;
705  } // if( kTRUE == bResetTime )
706 */
707 }
708 //----------------------------------------------------------------------
710  ECbmModuleId refDet,
711  ECbmDataType dataTypeIn,
712  std::string sNameIn,
713  UInt_t uTriggerMinDigisIn,
714  Int_t iTriggerMaxDigisIn,
715  Double_t fdTimeWinBegIn,
716  Double_t fdTimeWinEndIn) {
717 
720  dataTypeIn,
721  sNameIn,
722  uTriggerMinDigisIn,
723  iTriggerMaxDigisIn,
724  fdTimeWinBegIn,
725  fdTimeWinEndIn));
726 }
728  ECbmDataType dataTypeIn,
729  std::string sNameIn,
730  UInt_t uTriggerMinDigisIn,
731  Int_t iTriggerMaxDigisIn,
732  Double_t fdTimeWinBegIn,
733  Double_t fdTimeWinEndIn) {
734 
737  dataTypeIn,
738  sNameIn,
739  uTriggerMinDigisIn,
740  iTriggerMaxDigisIn,
741  fdTimeWinBegIn,
742  fdTimeWinEndIn));
743 }
744 //----------------------------------------------------------------------
746  ECbmModuleId refDet) {
747  switch (refDet) {
748  case ECbmModuleId::kSts: {
750  break;
751  } // case ECbmModuleId::kSts:
752  case ECbmModuleId::kMuch: {
754  break;
755  } // case ECbmModuleId::kMuch:
756  case ECbmModuleId::kTrd: {
758  break;
759  } // case ECbmModuleId::kTrd:
760  case ECbmModuleId::kTof: {
762  break;
763  } // case ECbmModuleId::kTof:
764  case ECbmModuleId::kRich: {
766  break;
767  } // case ECbmModuleId::kRich:
768  case ECbmModuleId::kPsd: {
770  break;
771  } // case ECbmModuleId::kPsd:
772  case ECbmModuleId::kT0: {
774  break;
775  } // case ECbmModuleId::kT0:
776  default: {
777  LOG(fatal)
778  << "CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector => "
779  << "Trying to change reference to unsupported det: " << refDet
780  << std::endl
781  << "This method is deprecated and will be removed soon, "
782  << "please use the full version of it.";
783  break;
784  } // default:
785  } // switch( refDet )
786 
787  LOG(warning)
788  << "CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector => "
789  << "Changing reference detector with deprecated method to: "
790  << fRefDet.sName << std::endl
791  << "This method is deprecated, does not set all parameters "
792  << "and will be removed soon, please use the full version of it.";
793 }
795  switch (selDet) {
796  case ECbmModuleId::kSts: {
798  break;
799  } // case ECbmModuleId::kSts:
800  case ECbmModuleId::kMuch: {
802  break;
803  } // case ECbmModuleId::kMuch:
804  case ECbmModuleId::kTrd: {
806  break;
807  } // case ECbmModuleId::kTrd:
808  case ECbmModuleId::kTof: {
810  break;
811  } // case ECbmModuleId::kTof:
812  case ECbmModuleId::kRich: {
814  break;
815  } // case ECbmModuleId::kRich:
816  case ECbmModuleId::kPsd: {
818  break;
819  } // case ECbmModuleId::kPsd:
820  case ECbmModuleId::kT0: {
822  break;
823  } // case ECbmModuleId::kT0:
824  default: {
825  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::AddDetector => "
826  << "Trying to change reference to unsupported det: " << selDet
827  << std::endl
828  << "This method is deprecated and will be removed soon, "
829  << "please use the full version of it.";
830  break;
831  } // default:
832  } // switch( selDet )
833 
834  LOG(warning)
835  << "CbmMcbm2019TimeWinEventBuilderAlgo::AddDetector => "
836  << "Changing reference detector with deprecated method for: " << selDet
837  << std::endl
838  << "This method is deprecated, does not set all parameters "
839  << "and will be removed soon, please use the full version of it.";
840 }
841 
844  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
845  det != fvDets.end();
846  ++det) {
847  if ((*det).detId == selDet) {
848  fvDets.erase(det);
849  return;
850  } // if( (*det).detId == selDet )
851  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
852  LOG(warning) << "CbmMcbm2019TimeWinEventBuilderAlgo::RemoveDetector => Doing "
853  "nothing, selection detector not in list!"
854  << selDet;
855 }
856 //----------------------------------------------------------------------
858  EventBuilderDetector refDetIn) {
860  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
861  det != fvDets.end();
862  ++det) {
863  if ((*det) == refDetIn) {
864  LOG(warning)
865  << "CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector => "
866  "Reference detector already in selection detector list!"
867  << refDetIn.sName;
868  LOG(warning)
869  << " => "
870  "It will be automatically removed from selection detector list!";
871  LOG(warning)
872  << " => "
873  "Please also remember to update the selection windows to store "
874  "clusters!";
875  RemoveDetector(refDetIn);
876  } // if( (*det) == refDetIn )
877  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
878 
879  if (fRefDet == refDetIn) {
880  LOG(warning)
881  << "CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector => "
882  "Doing nothing, identical reference detector already in use";
883  } // if( fRefDet == refDetIn )
884  else {
885  LOG(info) << "CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector => "
886  << "Replacing " << fRefDet.sName << " with " << refDetIn.sName
887  << " as reference detector";
888  LOG(warning)
889  << " => "
890  "You may want to use AddDetector after this command to add in "
891  "selection "
892  << refDetIn.sName;
893  LOG(warning)
894  << " => "
895  "Please also remember to update the selection windows!";
896  } // else of if( fRefDet == refDetIn )
897  fRefDet = refDetIn;
898 
903 }
905  EventBuilderDetector selDet) {
906  if (fRefDet == selDet) {
907  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::AddDetector => Cannot "
908  "add the reference detector as selection detector!"
909  << std::endl
910  << "=> Maybe first change the reference detector with "
911  "SetReferenceDetector?";
912  } // if( fRefDet == selDet )
913 
915  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
916  det != fvDets.end();
917  ++det) {
918  if ((*det) == selDet) {
919  LOG(warning) << "CbmMcbm2019TimeWinEventBuilderAlgo::AddDetector => "
920  "Doing nothing, selection detector already in list!"
921  << selDet.sName;
922  return;
923  } // if( (*det) == selDet )
924  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
925  fvDets.push_back(selDet);
926 
931 }
933  EventBuilderDetector selDet) {
935  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
936  det != fvDets.end();
937  ++det) {
938  if ((*det) == selDet) {
939  fvDets.erase(det);
940  return;
941  } // if( (*det) == selDet )
942  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
943  LOG(warning) << "CbmMcbm2019TimeWinEventBuilderAlgo::RemoveDetector => Doing "
944  "nothing, selection detector not in list!"
945  << selDet.sName;
946 }
947 //----------------------------------------------------------------------
949  ECbmModuleId selDet,
950  UInt_t uVal) {
952  if (fRefDet.detId == selDet) {
953  fRefDet.fuTriggerMinDigis = uVal;
954 
955  LOG(debug) << "Set Trigger min limit for " << fRefDet.sName << " to "
956  << uVal;
957 
958  return;
959  } // if( fRefDet == selDet )
960 
962  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
963  det != fvDets.end();
964  ++det) {
965  if ((*det).detId == selDet) {
966  (*det).fuTriggerMinDigis = uVal;
967 
968  LOG(debug) << "Set Trigger min limit for " << (*det).sName << " to "
969  << uVal;
970 
971  return;
972  } // if( (*det).detId == selDet )
973  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
974 
975  LOG(warning)
976  << "CbmMcbm2019TimeWinEventBuilderAlgo::SetTriggerMinNumber => "
977  "Doing nothing, detector neither reference nor in selection list!"
978  << selDet;
979 }
981  ECbmModuleId selDet,
982  Int_t iVal) {
984  if (fRefDet.detId == selDet) {
985  fRefDet.fiTriggerMaxDigis = iVal;
986 
987  LOG(debug) << "Set Trigger min limit for " << fRefDet.sName << " to "
988  << iVal;
989 
990  return;
991  } // if( fRefDet == selDet )
992 
994  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
995  det != fvDets.end();
996  ++det) {
997  if ((*det).detId == selDet) {
998  (*det).fiTriggerMaxDigis = iVal;
999 
1000  LOG(debug) << "Set Trigger min limit for " << (*det).sName << " to "
1001  << iVal;
1002 
1003  return;
1004  } // if( (*det).detId == selDet )
1005  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
1006 
1007  LOG(warning)
1008  << "CbmMcbm2019TimeWinEventBuilderAlgo::SetTriggerMaxNumber => "
1009  "Doing nothing, detector neither reference nor in selection list!"
1010  << selDet;
1011 }
1013  Double_t dWinBeg,
1014  Double_t dWinEnd) {
1016  if (dWinEnd <= dWinBeg)
1017  LOG(fatal) << "CbmMcbm2019TimeWinEventBuilderAlgo::SetTriggerWindow => "
1018  "Invalid time window: [ "
1019  << dWinBeg << ", " << dWinEnd << " ]";
1020 
1021  Bool_t bFound = kFALSE;
1023  if (fRefDet.detId == selDet) {
1024  fRefDet.fdTimeWinBeg = dWinBeg;
1025  fRefDet.fdTimeWinEnd = dWinEnd;
1026 
1027  bFound = kTRUE;
1028  } // if( fRefDet == selDet )
1029 
1031  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
1032  det != fvDets.end();
1033  ++det) {
1034  if ((*det).detId == selDet) {
1035  (*det).fdTimeWinBeg = dWinBeg;
1036  (*det).fdTimeWinEnd = dWinEnd;
1037 
1038  bFound = kTRUE;
1039  } // if( (*det).detId == selDet )
1040  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
1041 
1042  if (kFALSE == bFound) {
1043  LOG(warning)
1044  << "CbmMcbm2019TimeWinEventBuilderAlgo::SetTriggerWindow => "
1045  "Doing nothing, detector neither reference nor in selection list!"
1046  << selDet;
1047  } // if( kFALSE == bFound )
1048 
1053 }
1058 
1060  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
1061  det != fvDets.end();
1062  ++det) {
1063  fdEarliestTimeWinBeg = std::min(fdEarliestTimeWinBeg, (*det).fdTimeWinBeg);
1064  fdLatestTimeWinEnd = std::max(fdLatestTimeWinEnd, (*det).fdTimeWinEnd);
1065  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
1066 }
1070 
1072  for (std::vector<EventBuilderDetector>::iterator det = fvDets.begin();
1073  det != fvDets.end();
1074  ++det) {
1076  std::max(fdWidestTimeWinRange, (*det).fdTimeWinEnd - (*det).fdTimeWinBeg);
1077  } // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
1078 }
1079 //----------------------------------------------------------------------
1080 
CbmMcbm2019TimeWinEventBuilderAlgo::fvDets
std::vector< EventBuilderDetector > fvDets
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:220
CbmMcbm2019TimeWinEventBuilderAlgo::fuErrors
UInt_t fuErrors
Event Counter.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:273
EventBuilderDetector::GetTimeWinRange
Double_t GetTimeWinRange()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:69
CbmMcbm2019TimeWinEventBuilderAlgo::CbmMcbm2019TimeWinEventBuilderAlgo
CbmMcbm2019TimeWinEventBuilderAlgo()
CBM headers.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:37
CbmMcbm2019TimeWinEventBuilderAlgo::fhEventTime
TH1 * fhEventTime
Vector of pointers to canvases + optional folder name.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:261
CbmMcbm2019TimeWinEventBuilderAlgo::SearchMatches
void SearchMatches(Double_t dSeedTime, EventBuilderDetector &detMatch)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:451
EventBuilderDetector::sName
std::string sName
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:74
CbmMcbm2019TimeWinEventBuilderAlgo::UpdateWidestTimeWinRange
void UpdateWidestTimeWinRange()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:1067
CbmPsdDigi.h
kEventBuilderDetRich
static const EventBuilderDetector kEventBuilderDetRich
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:97
TimesliceMetaData::GetStartTime
ULong64_t GetStartTime() const
Definition: TimesliceMetaData.h:30
CbmMcbm2019TimeWinEventBuilderAlgo::fdWidestTimeWinRange
Double_t fdWidestTimeWinRange
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:230
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
kEventBuilderDetT0
static const EventBuilderDetector kEventBuilderDetT0
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:101
kEventBuilderDetMuch
static const EventBuilderDetector kEventBuilderDetMuch
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:91
CbmMcbm2019TimeWinEventBuilderAlgo::fCurrentEvent
CbmEvent * fCurrentEvent
Data ouptut.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:241
CbmMcbm2019TimeWinEventBuilderAlgo::fbIgnoreTsOverlap
Bool_t fbIgnoreTsOverlap
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:213
ECbmModuleId::kT0
@ kT0
ToF start Detector.
CbmMcbm2019TimeWinEventBuilderAlgo::fuNrTs
UInt_t fuNrTs
Error Counter.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:274
kEventBuilderDetTof
static const EventBuilderDetector kEventBuilderDetTof
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:95
TimesliceMetaData
Definition: TimesliceMetaData.h:11
CbmMcbm2019TimeWinEventBuilderAlgo::ResetHistograms
void ResetHistograms(Bool_t bResetTime=kTRUE)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:686
CbmEvent::AddData
void AddData(ECbmDataType type, UInt_t index)
Definition: CbmEvent.cxx:15
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
CbmMcbm2019TimeWinEventBuilderAlgo::LoopOnSeeds
void LoopOnSeeds()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:211
CbmMcbm2019TimeWinEventBuilderAlgo.h
CbmMcbm2019TimeWinEventBuilderAlgo::AddDigiToEvent
void AddDigiToEvent(EventBuilderDetector &det, Int_t uIdx)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:538
CbmTofDigi.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
EventBuilderDetector::fuEndIndex
UInt_t fuEndIndex
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:85
CbmMcbm2019TimeWinEventBuilderAlgo::InitAlgo
Bool_t InitAlgo()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:43
kEventBuilderDetTrd
static const EventBuilderDetector kEventBuilderDetTrd
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:93
CbmDigiManager::IsPresent
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
Definition: CbmDigiManager.cxx:112
CbmMcbm2019TimeWinEventBuilderAlgo::fhEventDt
TH1 * fhEventDt
histogram with the seed time of the events
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:262
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmMcbm2019TimeWinEventBuilderAlgo::fRefDet
EventBuilderDetector fRefDet
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:218
CbmRichDigi.h
CbmMcbm2019TimeWinEventBuilderAlgo::CreateHistograms
void CreateHistograms()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:611
CbmEvent.h
CbmTrdDigi.h
CbmStsDigi.h
CbmMcbm2019TimeWinEventBuilderAlgo::fT0DigiVec
const std::vector< CbmTofDigi > * fT0DigiVec
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:236
CbmMcbm2019TimeWinEventBuilderAlgo::Finish
void Finish()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:128
CbmMcbm2019TimeWinEventBuilderAlgo::SetTriggerWindow
void SetTriggerWindow(ECbmModuleId selDet, Double_t dWinBeg, Double_t dWinEnd)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:1012
CbmMcbm2019TimeWinEventBuilderAlgo::RemoveDetector
void RemoveDetector(ECbmModuleId selDet) __attribute__((deprecated))
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:842
CbmMcbm2019TimeWinEventBuilderAlgo::fdEarliestTimeWinBeg
Double_t fdEarliestTimeWinBeg
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:228
TimesliceMetaData::GetOverlapDuration
ULong64_t GetOverlapDuration() const
Definition: TimesliceMetaData.h:35
CbmMcbm2019TimeWinEventBuilderAlgo::fuCurEv
UInt_t fuCurEv
histograms with the nb of digis in each detector per event vs seed time of the events
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:272
CbmDigiManager::Get
const Digi * Get(Int_t index) const
Get a digi object.
Definition: CbmDigiManager.h:52
ECbmDataType
ECbmDataType
Definition: CbmDefs.h:76
CbmMcbm2019TimeWinEventBuilderAlgo::BuildEvents
void BuildEvents()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:170
CbmMcbm2019TimeWinEventBuilderAlgo::ProcessTs
void ProcessTs()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:90
CbmMcbm2019TimeWinEventBuilderAlgo::ClearEventVector
void ClearEventVector()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:115
CbmMcbm2019TimeWinEventBuilderAlgo::~CbmMcbm2019TimeWinEventBuilderAlgo
~CbmMcbm2019TimeWinEventBuilderAlgo()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:40
EventBuilderDetector::fuTriggerMinDigis
UInt_t fuTriggerMinDigis
Minimum number of T0 digis needed to generate a trigger, 0 means don't use for trigger generation.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:76
CbmMcbm2019TimeWinEventBuilderAlgo::fhEventSize
TH1 * fhEventSize
histogram with the interval in seed time of consecutive events
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:264
CbmMuchBeamTimeDigi.h
CbmMcbm2019TimeWinEventBuilderAlgo::UpdateTimeWinBoundariesExtrema
void UpdateTimeWinBoundariesExtrema()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:1054
ECbmModuleId::kRich
@ kRich
Ring-Imaging Cherenkov Detector.
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbm2019TimeWinEventBuilderAlgo::AddDetector
void AddDetector(ECbmModuleId selDet, ECbmDataType dataTypeIn, std::string sNameIn, UInt_t uTriggerMinDigisIn=0, Int_t iTriggerMaxDigisIn=-1, Double_t fdTimeWinBegIn=-100, Double_t fdTimeWinEndIn=100)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:727
CbmMcbm2019TimeWinEventBuilderAlgo::CheckSeed
void CheckSeed(Double_t dSeedTime, UInt_t uSeedDigiIdx)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:290
EventBuilderDetector::dataType
ECbmDataType dataType
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:73
EventBuilderDetector::fdTimeWinBeg
Double_t fdTimeWinBeg
Selection Window.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:80
CbmMcbm2019TimeWinEventBuilderAlgo::HasTrigger
Bool_t HasTrigger(CbmEvent *)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:544
EventBuilderDetector
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:37
CbmMcbm2019TimeWinEventBuilderAlgo::fTimeSliceMetaDataArray
TClonesArray * fTimeSliceMetaDataArray
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:237
CbmMcbm2019TimeWinEventBuilderAlgo::fdPrevEvtEndTime
Double_t fdPrevEvtEndTime
Save previous time information.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:276
kEventBuilderDetPsd
static const EventBuilderDetector kEventBuilderDetPsd
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:99
kEventBuilderDetSts
static const EventBuilderDetector kEventBuilderDetSts
Pre-defined detector types.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:89
CbmMcbm2019TimeWinEventBuilderAlgo::FillHistos
void FillHistos()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:665
EOverlapMode::AllowOverlap
@ AllowOverlap
ECbmModuleId::kTrd
@ kTrd
Transition Radiation Detector.
CbmMcbm2019TimeWinEventBuilderAlgo::fOverMode
EOverlapMode fOverMode
Event building mode and detectors selection.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:216
EventBuilderDetector::fdTimeWinEnd
Double_t fdTimeWinEnd
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:81
CbmMcbm2019TimeWinEventBuilderAlgo::fbFillHistos
Bool_t fbFillHistos
Ignore data in Overlap part of the TS.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:214
CbmMcbm2019TimeWinEventBuilderAlgo::fdLatestTimeWinEnd
Double_t fdLatestTimeWinEnd
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:229
counter
int counter
Definition: CbmMvdSensorDigiToHitTask.cxx:72
CbmMcbm2019TimeWinEventBuilderAlgo::fhNbDigiPerEvtTime
TH2 * fhNbDigiPerEvtTime
histogram with the nb of all digis in the event
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:266
CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector
void SetReferenceDetector(ECbmModuleId refDet, ECbmDataType dataTypeIn, std::string sNameIn, UInt_t uTriggerMinDigisIn=0, Int_t iTriggerMaxDigisIn=-1, Double_t fdTimeWinBegIn=-100, Double_t fdTimeWinEndIn=100)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:709
CbmDigiManager.h
CbmMcbm2019TimeWinEventBuilderAlgo::SetTriggerMinNumber
void SetTriggerMinNumber(ECbmModuleId selDet, UInt_t uVal)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:948
CbmMcbm2019TimeWinEventBuilderAlgo::CheckTriggerConditions
Bool_t CheckTriggerConditions(CbmEvent *event, EventBuilderDetector &det)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:561
CbmMcbm2019TimeWinEventBuilderAlgo::SetTriggerMaxNumber
void SetTriggerMaxNumber(ECbmModuleId selDet, Int_t iVal)
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:980
CbmMcbm2019TimeWinEventBuilderAlgo::fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:235
TimesliceMetaData::GetOverlapStartTime
ULong64_t GetOverlapStartTime() const
Definition: TimesliceMetaData.h:32
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
CbmMcbm2019TimeWinEventBuilderAlgo::pTsMetaData
const TimesliceMetaData * pTsMetaData
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:238
CbmMcbm2019TimeWinEventBuilderAlgo::fEventVector
std::vector< CbmEvent * > fEventVector
pointer to the event which is currently build
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:243
ECbmModuleId::kMuch
@ kMuch
Muon detection system.
ECbmModuleId::kPsd
@ kPsd
Projectile spectator detector.
CbmMcbm2019TimeWinEventBuilderAlgo::CheckDataAvailable
Bool_t CheckDataAvailable(EventBuilderDetector &det)
Internal methods.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:133
TimesliceMetaData.h
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmMcbm2019TimeWinEventBuilderAlgo::InitTs
void InitTs()
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.cxx:156
EOverlapMode::MergeOverlap
@ MergeOverlap
EventBuilderDetector::fuStartIndex
UInt_t fuStartIndex
Book-keeping variables.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:84
EOverlapMode::NoOverlap
@ NoOverlap
CbmMcbm2019TimeWinEventBuilderAlgo::fdPrevEvtTime
Double_t fdPrevEvtTime
Timeslice Counter.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:275
CbmMcbm2019TimeWinEventBuilderAlgo::fvhNbDigiPerEvtTimeDet
std::vector< TH2 * > fvhNbDigiPerEvtTimeDet
histogram with the nb of all digis per event vs seed time of the events
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:268
EventBuilderDetector::detId
ECbmModuleId detId
Settings.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:72
CbmMcbm2019TimeWinEventBuilderAlgo
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:106
CbmMcbm2019TimeWinEventBuilderAlgo::AddHistoToVector
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
For monitor algos.
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:167
CbmEvent::SetEndTime
void SetEndTime(Double_t endTime)
Definition: CbmEvent.h:137
EventBuilderDetector::fiTriggerMaxDigis
Int_t fiTriggerMaxDigis
Maximum number of digis per detector to generate an event, -1 means no cut, 0 means anti-coinc trigge...
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:78