LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
detinfo Namespace Reference

General LArSoft Utilities. More...

Classes

class  DetectorClocks
 Conversion of times between different formats and references. More...
 
class  DetectorClocksException
 
class  DetectorClocksService
 
class  DetectorClocksServiceStandard
 art service managing detinfo::DetectorClocksStandard. More...
 
class  DetectorClocksStandard
 Implementation of detinfo::DetectorClocks interface with fixed settings from configuration. More...
 
class  DetectorProperties
 
class  DetectorPropertiesService
 
class  DetectorPropertiesServiceStandard
 "Standard" implementation of DetectorProperties service More...
 
class  DetectorPropertiesStandard
 
class  ElecClock
 Class representing the time measured by an electronics clock. More...
 
class  LArProperties
 
class  LArPropertiesService
 
class  LArPropertiesServiceStandard
 
class  LArPropertiesStandard
 Properties related to liquid argon environment in the detector. More...
 
class  RunHistory
 
class  RunHistoryStandard
 
class  SubRun
 
class  SubRunStandard
 

Enumerations

enum  InheritConfigType_t {
  kG4RefTime =0, kTriggerOffsetTPC, kFramePeriod, kClockSpeedTPC,
  kClockSpeedOptical, kClockSpeedTrigger, kClockSpeedExternal, kDefaultTrigTime,
  kDefaultBeamTime, kInheritConfigTypeMax
}
 
enum  RunType_t {
  kUnknownRunType =0, kProductionRun, kCommissioningRun, kTestRun,
  kPedestalRun, kCalibrationRun, kNRunType
}
 

Functions

void setDetectorClocksStandardTriggersFromRawTrigger (detinfo::DetectorClocksStandard &detClocks, raw::Trigger const &trigger)
 Loads DetectorClocksStandard trigger times from a raw::Trigger. More...
 
template<typename Event >
bool setDetectorClocksStandardTriggersFromEvent (detinfo::DetectorClocksStandard &detClocks, Event const &event)
 Loads DetectorClocksStandard trigger times from a raw::Trigger. More...
 
template<typename Event >
bool setDetectorClocksStandardTrigger (detinfo::DetectorClocksStandard &detClocks, Event const &event)
 Loads DetectorClocksStandard trigger times. More...
 

Variables

const double kTIME_MAX = std::numeric_limits<double>::max()
 Maximum time in microseconds. More...
 
const double kDEFAULT_FREQUENCY = 1.e-6
 Default Frequency in MHz. More...
 
const double kDEFAULT_FRAME_PERIOD = 1.6e3
 Default Frame period in micro-second. More...
 
const double kDEFAULT_FREQUENCY_OPTICAL = 64.
 Default Optical clock speed in MHz. More...
 
const double kDEFAULT_FREQUENCY_TPC = 2.
 Default TPC clock speed in MHz. More...
 
const double kDEFAULT_FREQUENCY_TRIGGER = 16.
 Default Trigger clock speed in MHz. More...
 
const double kDEFAULT_FREQUENCY_EXTERNAL = 31.25
 Default External clock speed in MHz. More...
 
const double kDEFAULT_MC_CLOCK_T0 = 0
 Default G4 reference time in micro-second. More...
 
const double kDEFAULT_TRIG_OFFSET_TPC = -1600.
 Default TPC readout start time offset from trigger in micro-second. More...
 
const double kDEFAULT_TRIG_TIME = 0.0
 Default TriggerTime in micro-second. More...
 
const double kDEFAULT_BEAM_TIME = 0.0
 Default BeamGateTime in micro-second. More...
 

Detailed Description

General LArSoft Utilities.

Enumeration Type Documentation

Enumerator
kG4RefTime 
kTriggerOffsetTPC 
kFramePeriod 
kClockSpeedTPC 
kClockSpeedOptical 
kClockSpeedTrigger 
kClockSpeedExternal 
kDefaultTrigTime 
kDefaultBeamTime 
kInheritConfigTypeMax 

Definition at line 21 of file DetectorClocks.h.

Enumerator
kUnknownRunType 
kProductionRun 
kCommissioningRun 
kTestRun 
kPedestalRun 
kCalibrationRun 
kNRunType 

Definition at line 15 of file RunHistory.h.

Function Documentation

template<typename Event >
bool detinfo::setDetectorClocksStandardTrigger ( detinfo::DetectorClocksStandard detClocks,
Event const &  event 
)

Loads DetectorClocksStandard trigger times.

Template Parameters
Eventtype of event where trigger data might be stored
Parameters
detClocksthe instance of detinfo::DetectorClocksStandard to set
eventthe event the trigger objects are stored into
Returns
whether the times were set from a trigger object
Exceptions
cet::exceptionif trigger data product has more than one trigger

This function sets the trigger and beam gate times of detClocks. First, it attempts to read the settings from the event (see setDetectorClocksStandardTriggersFromEvent()). If that fails "nicely", then sets them with the default values from the configuration.

A "nice" failure is where there is no trigger object in the event. Other types of failure include when there are more than one trigger objects in the event, in which case no choice is made, and an exception is thrown.

Definition at line 135 of file DetectorClocksStandardTriggerLoader.h.

References detinfo::DetectorClocksStandard::SetDefaultTriggerTime(), and setDetectorClocksStandardTriggersFromEvent().

Referenced by detinfo::DetectorClocksServiceStandard::preProcessEvent(), and setDetectorClocksStandardTriggersFromEvent().

136  {
137  //
138  // try to read the trigger from the event
139  //
141  return true;
142 
143  //
144  // if there was no trigger candidate, set it default
145  //
146  detClocks.SetDefaultTriggerTime();
147  return false;
148 
149  } // setDetectorClocksStandardTrigger
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.
Event finding and building.
template<typename Event >
bool detinfo::setDetectorClocksStandardTriggersFromEvent ( detinfo::DetectorClocksStandard detClocks,
Event const &  event 
)

Loads DetectorClocksStandard trigger times from a raw::Trigger.

Template Parameters
Eventtype of event where trigger data might be stored
Parameters
detClocksthe instance of detinfo::DetectorClocksStandard to set
eventthe event the trigger objects are stored into
Returns
whether the times were set
Exceptions
cet::exceptionif trigger data product has more than one trigger

The input tag stored in detClocks (detinfo::DetectorClocksStandard::TrigModuleName()) is used to read a raw::Trigger collection.

If the event has no such trigger data product, or if that data product is empty, false is returned and detClocks is unchanged.

If the trigger data product is found and there are more than one triggers in there, an exception is thrown: we support only the case where the trigger to be used is unequivocal.

Definition at line 73 of file DetectorClocksStandardTriggerLoader.h.

References art::InputTag::encode(), setDetectorClocksStandardTrigger(), setDetectorClocksStandardTriggersFromRawTrigger(), and detinfo::DetectorClocksStandard::TrigModuleName().

Referenced by setDetectorClocksStandardTrigger(), and setDetectorClocksStandardTriggersFromRawTrigger().

74  {
75  //
76  // fetch the trigger data product
77  //
78  using TriggerHandle_t
79  = typename Event::template HandleT<std::vector<raw::Trigger>>;
80 
81  art::InputTag const triggerTag = detClocks.TrigModuleName();
82  TriggerHandle_t triggerHandle;
83  if (!event.template getByLabel(triggerTag, triggerHandle)) return false;
84 
85  //
86  // check that we do have a trigger
87  // (we have already checked whether the handle is valid above)
88  //
89 
90  auto const& triggers = *triggerHandle;
91  if (triggers.empty()) return false;
92 
93  //
94  // select which trigger to set (i.e., the only one!)
95  //
96  if (triggers.size() != 1) {
97  throw cet::exception("setDetectorClocksStandardTrigger")
98  << "Found " << triggers.size()
99  << " trigger objects in '" << triggerTag.encode()
100  << "' (only one trigger per event is supported)\n";
101  }
102 
103  //
104  // set the timings from the first and only trigger into the service
105  //
107  (detClocks, triggers.front());
108 
109  // all done
110  return true;
111 
112  } // setDetectorClocksStandardTriggersFromEvent()
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.
std::string encode() const
Definition: InputTag.cc:36
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Event finding and building.
void detinfo::setDetectorClocksStandardTriggersFromRawTrigger ( detinfo::DetectorClocksStandard detClocks,
raw::Trigger const &  trigger 
)
inline

Loads DetectorClocksStandard trigger times from a raw::Trigger.

Parameters
detClocksthe instance of detinfo::DetectorClocksStandard to set
triggerthe trigger object to extract timings from

The times are stored unconditionally and directly, with no time scale conversion.

Definition at line 48 of file DetectorClocksStandardTriggerLoader.h.

References raw::Trigger::BeamGateTime(), setDetectorClocksStandardTriggersFromEvent(), detinfo::DetectorClocksStandard::SetTriggerTime(), and raw::Trigger::TriggerTime().

Referenced by setDetectorClocksStandardTriggersFromEvent().

49  { detClocks.SetTriggerTime(trigger.TriggerTime(), trigger.BeamGateTime()); }
virtual void SetTriggerTime(double trig_time, double beam_time)
Setter for trigger times.

Variable Documentation

const double detinfo::kDEFAULT_BEAM_TIME = 0.0

Default BeamGateTime in micro-second.

Definition at line 41 of file ClockConstants.h.

const double detinfo::kDEFAULT_FRAME_PERIOD = 1.6e3

Default Frame period in micro-second.

Definition at line 17 of file ClockConstants.h.

const double detinfo::kDEFAULT_FREQUENCY = 1.e-6

Default Frequency in MHz.

Definition at line 14 of file ClockConstants.h.

const double detinfo::kDEFAULT_FREQUENCY_EXTERNAL = 31.25

Default External clock speed in MHz.

Definition at line 29 of file ClockConstants.h.

const double detinfo::kDEFAULT_FREQUENCY_OPTICAL = 64.

Default Optical clock speed in MHz.

Definition at line 20 of file ClockConstants.h.

const double detinfo::kDEFAULT_FREQUENCY_TPC = 2.

Default TPC clock speed in MHz.

Definition at line 23 of file ClockConstants.h.

const double detinfo::kDEFAULT_FREQUENCY_TRIGGER = 16.

Default Trigger clock speed in MHz.

Definition at line 26 of file ClockConstants.h.

const double detinfo::kDEFAULT_MC_CLOCK_T0 = 0

Default G4 reference time in micro-second.

Definition at line 32 of file ClockConstants.h.

const double detinfo::kDEFAULT_TRIG_OFFSET_TPC = -1600.

Default TPC readout start time offset from trigger in micro-second.

Definition at line 35 of file ClockConstants.h.

const double detinfo::kDEFAULT_TRIG_TIME = 0.0

Default TriggerTime in micro-second.

Definition at line 38 of file ClockConstants.h.

const double detinfo::kTIME_MAX = std::numeric_limits<double>::max()

Maximum time in microseconds.

Definition at line 11 of file ClockConstants.h.