10#include <analysis/dataobjects/Particle.h>
11#include <analysis/VariableManager/Manager.h>
12#include <framework/dataobjects/EventT0.h>
13#include <framework/datastore/StoreObjPtr.h>
14#include <framework/gearbox/Const.h>
29 std::optional<EventT0::EventT0Component> getKLMEventT0Component()
31 StoreObjPtr<EventT0> eventT0;
32 if (!eventT0.isValid())
35 const std::vector<EventT0::EventT0Component> klmT0s = eventT0->getTemporaryEventT0s(Const::KLM);
42 double klmEventT0(
const Particle*)
44 const std::optional<EventT0::EventT0Component> klmT0 = getKLMEventT0Component();
46 return std::numeric_limits<double>::quiet_NaN();
47 return klmT0->eventT0;
51 double klmEventT0Uncertainty(
const Particle*)
53 const std::optional<EventT0::EventT0Component> klmT0 = getKLMEventT0Component();
55 return std::numeric_limits<double>::quiet_NaN();
56 return klmT0->eventT0Uncertainty;
59 VARIABLE_GROUP(
"KLM event T0 calibration");
60 REGISTER_VARIABLE(
"klmEventT0", klmEventT0, R
"DOC(
61**[Calibration][Eventbased]** Returns the event time measured with the KLM: the KLM entry that ``KLMEventT0Estimator``
62adds to the ``EventT0`` object, alongside the values of the other detectors.
63Available on cDST only. Requires a KLM module in the path, for example ``KLMEventT0Estimator``; NaN if
64``KLMEventT0Estimator`` did not run.
66 REGISTER_VARIABLE(
"klmEventT0Uncertainty", klmEventT0Uncertainty, R
"DOC(
67**[Calibration][Eventbased]** Returns the uncertainty of :b2:var:`klmEventT0`, propagated from the calibrated per-hit
68time resolution. Requires a KLM module in the path, as :b2:var:`klmEventT0` does; NaN if :b2:var:`klmEventT0` is NaN.
Abstract base class for different kinds of events.