CbmRoot
|
Constructs CbmDigiEvents out of CbmDigiTimeslices. More...
#include <EventBuilder.h>
Public Types | |
typedef std::pair< std::vector< DigiEvent >, EventBuilderMonitorData > | resultType |
Public Member Functions | |
EventBuilder (const EventBuilderConfig &config) | |
Constructor. | |
virtual | ~EventBuilder () |
Destructor. | |
resultType | operator() (const DigiData &ts, const std::vector< double > triggers, std::optional< DigiEventSelector > selector) const |
Execution. | |
std::string | ToString () const |
Info to string. | |
Private Member Functions | |
DigiEvent | BuildEvent (const DigiData &ts, EventBuilderMonitorData &monitor, double trigger) const |
Build a single event from a trigger time. | |
Static Private Member Functions | |
template<typename Vector > | |
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. | |
Private Attributes | |
EventBuilderConfig | fConfig |
Configuration / parameters. | |
Constructs CbmDigiEvents out of CbmDigiTimeslices.
Events are constructed by copying digi data from the source (CbmDigiTimeslice). Digis are selected in trigger windows, the sizes of which relative to a trigger time are configurable. For each trigger time, an event is generated. The time intervals may overlap, resulting in digis being attributed to multiple events.
The source digi vectors (in CbmDigiTimeslice) must be sorted w.r.t. time, otherwise the behaviour is undefined.
The trigger vector must be sorted.
Definition at line 72 of file EventBuilder.h.
std::pair<std::vector<DigiEvent>, EventBuilderMonitorData> cbm::algo::evbuild::EventBuilder::resultType |
Definition at line 75 of file EventBuilder.h.
|
inline |
Constructor.
Definition at line 78 of file EventBuilder.h.
|
inlinevirtual |
Destructor.
Definition at line 82 of file EventBuilder.h.
|
private |
Build a single event from a trigger time.
ts | Digi source (timeslice) |
monitor | Monitoring data |
trigger | Trigger time |
Definition at line 59 of file EventBuilder.cxx.
References cbm::algo::evbuild::EventBuilderMonitorData::bmon, CopyRange(), cbm::algo::DigiData::fBmon, fConfig, cbm::algo::DigiData::fFsd, cbm::algo::DigiData::fMuch, cbm::algo::DigiData::fPsd, cbm::algo::DigiData::fRich, cbm::algo::evbuild::EventBuilderMonitorData::fsd, cbm::algo::DigiData::fSts, cbm::algo::DigiEvent::fTime, cbm::algo::DigiData::fTof, cbm::algo::DigiData::fTrd, cbm::algo::DigiData::fTrd2d, cbm::algo::evbuild::EventBuilderConfig::fWindows, kBmon, kFsd, kMuch, kPsd, kRich, kSts, kTof, kTrd, kTrd2d, cbm::algo::evbuild::EventBuilderMonitorData::much, cbm::algo::evbuild::EventBuilderDetectorMonitorData::nDigisInEvents, cbm::algo::evbuild::EventBuilderMonitorData::psd, cbm::algo::evbuild::EventBuilderMonitorData::rich, cbm::algo::evbuild::EventBuilderMonitorData::sts, cbm::algo::evbuild::EventBuilderMonitorData::tof, cbm::algo::evbuild::EventBuilderMonitorData::trd, and cbm::algo::evbuild::EventBuilderMonitorData::trd2d.
|
inlinestaticprivate |
Copy data objects in a given time interval from the source to the target vector.
source | Source data vector |
tMin | Minimal time |
tMax | Maximal time |
The Data class specialisation must implement the method double GetTime(), which is used to check whether the Data object falls into the specified time interval.
The source vector must be ordered w.r.t. GetTime(), otherwise the behaviour is undefined.
TODO: The current implementation searches, for each trigger, the entire source vector. This can surely be optimised when the contract that the trigger vector be sorted is properly exploited, e.g., by starting the search for the first digi in the trigger window from the start of the previous trigger window. This, however, requires bookkeeping hardly to be realised without changing the state of the class. I leave this for the future and for bright specialists.
Definition at line 127 of file EventBuilder.h.
Referenced by BuildEvent().
EventBuilder::resultType cbm::algo::evbuild::EventBuilder::operator() | ( | const DigiData & | ts, |
const std::vector< double > | triggers, | ||
std::optional< DigiEventSelector > | selector ) const |
Execution.
ts | Digi source (timeslice) |
triggers | List of trigger times |
selector | Optional event selector |
Definition at line 19 of file EventBuilder.cxx.
References cbm::algo::evbuild::EventBuilderMonitorData::bmon, cbm::algo::DigiData::fBmon, cbm::algo::DigiData::fFsd, cbm::algo::DigiData::fMuch, cbm::algo::DigiData::fPsd, cbm::algo::DigiData::fRich, cbm::algo::evbuild::EventBuilderMonitorData::fsd, cbm::algo::DigiData::fSts, cbm::algo::DigiData::fTof, cbm::algo::DigiData::fTrd, cbm::algo::DigiData::fTrd2d, cbm::algo::evbuild::EventBuilderMonitorData::much, cbm::algo::evbuild::EventBuilderDetectorMonitorData::nDigis, cbm::algo::evbuild::EventBuilderMonitorData::numEvents, cbm::algo::evbuild::EventBuilderMonitorData::numTriggers, cbm::algo::evbuild::EventBuilderMonitorData::psd, cbm::algo::evbuild::EventBuilderMonitorData::rich, cbm::algo::evbuild::EventBuilderMonitorData::sts, cbm::algo::evbuild::EventBuilderMonitorData::time, cbm::algo::evbuild::EventBuilderMonitorData::tof, cbm::algo::DigiData::TotalSizeBytes(), cbm::algo::evbuild::EventBuilderMonitorData::trd, and cbm::algo::evbuild::EventBuilderMonitorData::trd2d.
std::string cbm::algo::evbuild::EventBuilder::ToString | ( | ) | const |
Info to string.
Definition at line 127 of file EventBuilder.cxx.
References fConfig, cbm::algo::evbuild::EventBuilderConfig::fWindows, and ToString().
Referenced by cbm::algo::evbuild::EventbuildChain::Status(), and ToString().
|
private |
Configuration / parameters.
Definition at line 139 of file EventBuilder.h.
Referenced by BuildEvent(), and ToString().