7 #include "TClonesArray.h"
8 #include "TParticlePDG.h"
21 #include <fairlogger/Logger.h>
26 if (fRunOnce ==
true) {
30 LOG(info) <<
"Event t0 times:";
34 LOG(info) << i <<
" : " << fEventTime.back();
38 LOG(debug) <<
"-I- FairGetEventTime: Initialization successful #Times: " << fEventTime.size();
45 auto lower = std::lower_bound(fEventTime.begin(), fEventTime.end(), simTime + 0.01);
46 int evtIndex = std::distance(fEventTime.begin(), lower) - 1;
47 double evtTime = -1.0;
49 evtTime = fEventTime.at(evtIndex);
50 LOG(debug) <<
"FairTimebasedMCSource::RetrieveData " << simTime <<
" lower " << *lower <<
" at index "
52 LOG(debug) <<
"GetEvent " << evtIndex <<
" time: " << evtTime << std::endl;
54 return std::make_pair(evtIndex, evtTime);
virtual Int_t ReadEvent(UInt_t=0)=0
virtual Source_Type GetSourceType()=0
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
std::pair< int, double > GetEvent(double simTime) const
Singleton which reads in the event times stored in the event headers of each event in the Init() and ...
virtual Int_t CheckMaxEventNo(Int_t=0)