22 #ifndef LARDATA_DETECTORINFO_DETECTORCLOCKSSTANDARDTRIGGERLOADER_H 23 #define LARDATA_DETECTORINFO_DETECTORCLOCKSSTANDARDTRIGGERLOADER_H 31 #include "cetlib_except/exception.h" 71 template <
typename Event>
79 =
typename Event::template HandleT<std::vector<raw::Trigger>>;
82 TriggerHandle_t triggerHandle;
83 if (!event.template getByLabel(triggerTag, triggerHandle))
return false;
90 auto const& triggers = *triggerHandle;
91 if (triggers.empty())
return false;
96 if (triggers.size() != 1) {
98 <<
"Found " << triggers.size()
99 <<
" trigger objects in '" << triggerTag.
encode()
100 <<
"' (only one trigger per event is supported)\n";
107 (detClocks, triggers.front());
133 template <
typename Event>
154 #endif // LARDATA_DETECTORINFO_DETECTORCLOCKSSTANDARDTRIGGERLOADER_H bool setDetectorClocksStandardTrigger(detinfo::DetectorClocksStandard &detClocks, Event const &event)
Loads DetectorClocksStandard trigger times.
void setDetectorClocksStandardTriggersFromRawTrigger(detinfo::DetectorClocksStandard &detClocks, raw::Trigger const &trigger)
Loads DetectorClocksStandard trigger times from a raw::Trigger.
std::string TrigModuleName() const
Returns the input tag of the trigger data product.
virtual void SetTriggerTime(double trig_time, double beam_time)
Setter for trigger times.
double TriggerTime() const
Trigger time w.r.t. electronics clock T0 in us.
double BeamGateTime() const
BeamGate time w.r.t. electronics clock T0 in us.
General LArSoft Utilities.
void SetDefaultTriggerTime()
Sets trigger and beam gate time from default configuration values.
bool setDetectorClocksStandardTriggersFromEvent(detinfo::DetectorClocksStandard &detClocks, Event const &event)
Loads DetectorClocksStandard trigger times from a raw::Trigger.
Implementation of detinfo::DetectorClocks interface with fixed settings from configuration.
cet::coded_exception< error, detail::translate > exception
Event finding and building.