20 std::optional<DigiEventSelector> selector)
const
22 xpu::push_timer(
"EventBuilder");
27 auto& events = result.first;
28 events.resize(triggers.size());
30 std::transform(triggers.begin(), triggers.end(), events.begin(),
31 [&ts, &result,
this](
const double& trigger) { return BuildEvent(ts, result.second, trigger); });
34 if (selector.has_value()) {
35 auto notSelected = [&](
DigiEvent& ev) {
return !((*selector)(ev)); };
36 auto removeIt = std::remove_if(events.begin(), events.end(), notSelected);
37 events.erase(removeIt, events.end());
54 monitor.
time = xpu::pop_timer();
62 event.
fTime = trigger;
67 auto system = entry.first;
68 const double tMin = trigger + entry.second.first;
69 const double tMax = trigger + entry.second.second;
129 std::stringstream out;
130 out <<
"--- Using EventBuilder with event windows:";
132 out <<
"\n " << std::left << std::setw(5) <<
::ToString(entry.first) <<
": ";
133 out <<
" [" << std::right << std::setw(5) << entry.second.first;
134 out <<
", " << std::right << std::setw(5) << entry.second.second <<
"] ns";
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kTrd2d
TRD-FASP Detector (FIXME)
@ kMuch
Muon detection system.
@ kFsd
Forward spectator detector.
@ kRich
Ring-Imaging Cherenkov Detector.
std::map< ECbmModuleId, std::pair< double, double > > fWindows
Key: detector; value: [tmin, tmax].
DigiEvent BuildEvent(const DigiData &ts, EventBuilderMonitorData &monitor, double trigger) const
Build a single event from a trigger time.
std::pair< std::vector< DigiEvent >, EventBuilderMonitorData > resultType
EventBuilderConfig fConfig
Configuration / parameters.
resultType operator()(const DigiData &ts, const std::vector< double > triggers, std::optional< DigiEventSelector > selector) const
Execution.
static Vector CopyRange(const Vector &source, double tMin, double tMax)
Copy data objects in a given time interval from the source to the target vector.
std::string ToString() const
Info to string.
Collection of digis from all detector systems.
PODVector< CbmRichDigi > fRich
Unpacked RICH digis.
PODVector< CbmTrdDigi > fTrd
Unpacked TRD digis.
PODVector< CbmStsDigi > fSts
Unpacked STS digis.
PODVector< CbmTrdDigi > fTrd2d
Unpacked TRD2D digis.
PODVector< CbmFsdDigi > fFsd
Unpacked FSD digis.
PODVector< CbmTofDigi > fTof
Unpacked TOF digis.
PODVector< CbmPsdDigi > fPsd
Unpacked PSD digis.
PODVector< CbmMuchDigi > fMuch
Unpacked MUCH digis.
PODVector< CbmBmonDigi > fBmon
Unpacked Bmon digis.
size_t TotalSizeBytes() const
Get the total number of bytes used by all digis.
Event data with event number and trigger time.
double fTime
Event trigger time [ns].
size_t nDigisInEvents
Number of digis collected into events.
size_t nDigis
Full number of digis in input source.
Monitoring data for event building.
size_t numTriggers
Number of input triggers.
EventBuilderDetectorMonitorData much
Monitoring data for MUCH.
EventBuilderDetectorMonitorData rich
Monitoring data for RICH.
size_t numEvents
Number of built and selected events.
EventBuilderDetectorMonitorData sts
Monitoring data for STS.
EventBuilderDetectorMonitorData tof
Monitoring data for TOF.
EventBuilderDetectorMonitorData bmon
Monitoring data for Bmon.
EventBuilderDetectorMonitorData trd2d
Monitoring data for TRD2D.
xpu::timings time
Time for event building.
EventBuilderDetectorMonitorData fsd
Monitoring data for FSD.
EventBuilderDetectorMonitorData trd
Monitoring data for TRD.
EventBuilderDetectorMonitorData psd
Monitoring data for PSD.