8#include <framework/dataobjects/EventT0.h>
10#include <framework/logging/Logger.h>
27 B2ASSERT(
"Not EventT0 available, but someone tried to access it. Check with hasEventT0() method before!",
hasEventT0());
31 if (fromTrackCreator) {
33 if (svdT0)
return svdT0->eventT0;
36 if (cdcT0)
return cdcT0->eventT0;
59 const std::string& algorithm)
73 if (detectorSet.
contains(eventT0Component.detectorSet)) {
88 std::vector<EventT0::EventT0Component> detectorT0s;
90 const auto lmdSelectDetector = [detector](
EventT0::EventT0Component const & c) {
return c.detectorSet.contains(detector);};
92 std::back_inserter(detectorT0s), lmdSelectDetector);
102 temporarySet += eventT0Component.detectorSet;
133 return std::make_optional(svdT0s.back());
144 return std::make_optional(cdcT0s.back());
155 return std::make_optional(topT0s.back());
168 return std::make_optional(*eclBestT0);
The DetectorSet class for sets of detector IDs in the form of EDetector values.
bool contains(const DetectorSet &set) const
Check whether this set contains another set.
EDetector
Enum for identifying the detector components (detector and subdetector).
std::vector< EventT0Component > m_temporaryEventT0List
Internal storage of the temporary event t0 list.
EventT0Component m_eventT0
Internal storage for the final event t0.
void clearTemporaries()
Clear the list of temporary event T0 estimations.
void setEventT0(double eventT0, double eventT0Uncertainty, const Const::DetectorSet &detector, const std::string &algorithm="")
Replace/set the final double T0 estimation.
std::optional< EventT0Component > getBestECLTemporaryEventT0() const
Return the best ECL-based EventT0 candidate if it exists.
std::optional< EventT0Component > getEventT0Component() const
Return the final event t0, if one is set. Else, return an empty optional.
std::optional< EventT0Component > getBestCDCTemporaryEventT0() const
Return the best CDC-based EventT0 candidate if it exists.
void clearEventT0()
Clear the final EventT0, this is needed in case some algorithm has set one for an itertive t0 finding...
bool hasEventT0() const
Check if a final event t0 is set.
double getEventT0(bool fromTrackCreator=false) const
Return the final event t0, if one is set.
void addTemporaryEventT0(const EventT0Component &eventT0)
Add another temporary double T0 estimation.
bool m_hasEventT0
Internal storage of the final eventT0 is set.
const std::vector< EventT0Component > & getTemporaryEventT0s() const
Return the list of all temporary event t0 estimations.
std::optional< EventT0Component > getBestTOPTemporaryEventT0() const
Return the best TOP-based EventT0 candidate if it exists.
std::optional< EventT0Component > getBestSVDTemporaryEventT0() const
Return the best SVD-based EventT0 candidate if it exists.
bool hasTemporaryEventT0(const Const::DetectorSet &detectorSet=Const::allDetectors) const
Check if one of the detectors in the given set has a temporary t0 estimation.
unsigned long getNumberOfTemporaryEventT0s() const
Return the number of stored event T0s.
Const::DetectorSet getTemporaryDetectors() const
Get the detectors that have determined temporary event T0s.
double getEventT0Uncertainty() const
Return the final event t0 uncertainty, if one is set. Else, return NAN.
Abstract base class for different kinds of events.
Structure for storing the extracted event t0s together with its detector and its uncertainty.