All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Enumerations | Functions | Variables
detinfo Namespace Reference

General LArSoft Utilities. More...

Namespaces

 details
 
 timescales
 Namespace including different time scales as defined in LArSoft.
 

Classes

class  DetectorClocksService
 
class  DetectorClocksServiceStandard
 art service managing detinfo::DetectorClocksStandard. More...
 
class  DetectorPropertiesService
 
class  DetectorPropertiesServiceStandard
 
class  LArPropertiesService
 
class  LArPropertiesServiceStandard
 
class  DetectorClocks
 Class used for the conversion of times between different formats and references. More...
 
class  DetectorClocksData
 Contains all timing reference information for the detector. More...
 
class  DetectorClocksException
 
class  DetectorClocksStandard
 Implementation of detinfo::DetectorClocks interface with fixed settings from configuration. More...
 
class  DetectorProperties
 
class  DetectorPropertiesData
 
class  DetectorPropertiesStandard
 
class  DetectorClocksWithUnits
 A partial detinfo::DetectorClocksData supporting units. More...
 
class  DetectorTimings
 A class exposing an upgraded interface of detinfo::DetectorClocksData. More...
 
class  ElecClock
 Class representing the time measured by an electronics clock. More...
 
class  LArProperties
 
class  LArPropertiesStandard
 Properties related to liquid argon environment in the detector. More...
 
class  SubRun
 
class  RunHistory
 
class  SubRunStandard
 
class  RunHistoryStandard
 

Enumerations

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

Functions

int trigger_offset (DetectorClocksData const &data)
 
double sampling_rate (DetectorClocksData const &data)
 Returns the period of the TPC readout electronics clock. More...
 
template<typename Event >
detinfo::DetectorClocksData detectorClocksStandardDataFor (detinfo::DetectorClocksStandard const &detClocks, Event const &event)
 Returns DetectorClocksData tuned on the specified event. More...
 
template<typename Event >
std::optional< std::pair
< double, double > > 
trigger_times_for_event (art::InputTag const &triggerTag, Event const &event)
 Loads DetectorClocksStandard trigger times. More...
 
template<typename Event >
std::optional< double > g4ref_time_for_event (art::InputTag const &triggerTag, Event const &event)
 Loads DetectorClocksStandard G4Ref correction times. More...
 
detinfo::DetectorClocksWithUnits makeDetectorClocksWithUnits (detinfo::DetectorClocksData const &clockData)
 
detinfo::DetectorTimings makeDetectorTimings (detinfo::DetectorClocksData const &detClocks)
 
detinfo::DetectorTimings makeDetectorTimings (detinfo::DetectorClocksData const *detClocks)
 
detinfo::DetectorTimings makeDetectorTimings (detinfo::DetectorClocksWithUnits const &detClocksWU)
 

Variables

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

Detailed Description

General LArSoft Utilities.

Title: FlashHypothesis Creator Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: class that produces a flash hypothesis for a trajectory. Input: Trajectory (std::vector<TVector3> objects) Output: FlashHypotheses

Title: OpFlash Algorithims Author: Ben Jones, MIT (Edited by wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov and gleb..nosp@m.sine.nosp@m.v@duk.nosp@m.e.ed.nosp@m.u)

Description: These are the algorithms used by OpFlashFinder to produce flashes.

Title: SpacePointAlg_TimeSort class Author: wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov Inputs: std::vector<recob::Hit> (one for each plane) Outputs: std::vector<recob::SpacePoint>

Description: This space point algorithm tries to improve speed by (1) keeping hit collections distinct among planes; (2) sorting hit collections by time; and, (3) having a lookup table for (y,z) coordinate positions. The original use case for this code was with the TTHitFinder, which produces an incredibly large number of hits per plane, making some sorted space point alg more attractive.

This code is totally microboone specific, btw.

Enumeration Type Documentation

Enumerator
kG4RefTime 
kTriggerOffsetTPC 
kFramePeriod 
kClockSpeedTPC 
kClockSpeedOptical 
kClockSpeedTrigger 
kClockSpeedExternal 
kDefaultTrigTime 
kDefaultBeamTime 
kConfigTypeMax 

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 >
detinfo::DetectorClocksData detinfo::detectorClocksStandardDataFor ( detinfo::DetectorClocksStandard const &  detClocks,
Event const &  event 
)

Returns DetectorClocksData tuned on the specified event.

Template Parameters
Eventtype of framework event
Parameters
detClocksservice provider generating the data
eventevent to read information from
Returns
DetectorClocksData tuned on the specified event

This function takes care to extract all what is needed by DetectorClocksStandard service provider in order to provide data for the event.

Example:

{ config.get<fhicl::ParameterSet>("services.DetectorClocksService") };
for (gallery::Event event(inputFiles); !event.atEnd(); event.next()) {
auto const triggerTime = clockData.TriggerTime();
// etc...
} // for

Requirements

The implementation is effectively dependent on the framework managing the event, but it is not formally dependent on any implementation. Assumptions include everything that is required by other helper functions like detinfo::trigger_times_for_event() and detinfo::g4ref_time_for_event() (mostly, support for a call like Event::getByLabel(art::InputTag, Event::HandleT<T>)).

Definition at line 67 of file DetectorClocksStandardDataFor.h.

70  {
71 
72  auto const& config_values = detClocks.ConfigValues();
73  // Trigger times
74  double trig_time{config_values[kDefaultTrigTime]};
75  double beam_time{config_values[kDefaultBeamTime]};
76  if (auto times = trigger_times_for_event(detClocks.TrigModuleName(), event)) {
77  std::tie(trig_time, beam_time) = *times;
78  }
79 
80  double g4_ref_time{config_values[kG4RefTime]};
81  if (auto sim_trig_time = g4ref_time_for_event(detClocks.G4RefCorrTrigModuleName(), event)) {
82  g4_ref_time -= trig_time;
83  g4_ref_time += *sim_trig_time;
84  }
85  return detClocks.DataFor(g4_ref_time, trig_time, beam_time);
86  } // detinfo::detectorClocksStandardDataFor()
std::optional< double > g4ref_time_for_event(art::InputTag const &triggerTag, Event const &event)
Loads DetectorClocksStandard G4Ref correction times.
std::optional< std::pair< double, double > > trigger_times_for_event(art::InputTag const &triggerTag, Event const &event)
Loads DetectorClocksStandard trigger times.
template<typename Event >
std::optional<double> detinfo::g4ref_time_for_event ( art::InputTag const &  triggerTag,
Event const &  event 
)

Loads DetectorClocksStandard G4Ref correction times.

Template Parameters
Eventtype of event where trigger data might be stored
Parameters
triggerTagtag of the raw::Trigger collection data product to read
eventthe event the trigger objects are stored into
Returns
optional G4 reference time value, empty if not found
Exceptions
cet::exception(category "setDetectorClocksStandardTrigger") if trigger data product has more than one trigger

This function returns the simulation (G4) reference time from an event. It is assumed to match the trigger time (or, it is assumed that the trigger fired at the time the event was generated). The function attempts to read the information from a raw::Trigger collection data product with tag triggerTag in the event. The time is expected to be in microseconds on the electronics time scale. In case that data product does not exist, or it exists but empty, an empty result is quietly returned. If instead there are multiple trigger objects in the collection, no choice is made, and an exception is thrown.

Definition at line 105 of file DetectorClocksStandardTriggerLoader.h.

106  {
107  // fetch the trigger data product
108  using TriggerHandle_t = typename Event::template HandleT<std::vector<raw::Trigger>>;
109 
110  TriggerHandle_t triggerHandle;
111  if (!event.template getByLabel(triggerTag, triggerHandle)) return std::nullopt;
112 
113  // check that we do have a trigger
114  // (we have already checked whether the handle is valid above)
115  auto const& triggers = *triggerHandle;
116  if (triggers.empty()) return std::nullopt;
117 
118  // select which trigger to set (i.e., the only one!)
119  if (triggers.size() != 1) {
120  throw cet::exception("setDetectorClocksStandardTrigger")
121  << "Found " << triggers.size() << " trigger objects in '" << triggerTag.encode()
122  << "' (only one trigger per event is supported)\n";
123  }
124 
125  return std::make_optional(triggers.front().TriggerTime());
126  }
detinfo::DetectorClocksWithUnits detinfo::makeDetectorClocksWithUnits ( detinfo::DetectorClocksData const &  clockData)
inline

Transforms a detinfo::DetectorClocksData into a detinfo::DetectorClocksWithUnits.

Definition at line 144 of file DetectorTimings.h.

145  {
146  return detinfo::DetectorClocksWithUnits{clockData};
147  }
A partial detinfo::DetectorClocksData supporting units.
detinfo::DetectorTimings detinfo::makeDetectorTimings ( detinfo::DetectorClocksData const &  detClocks)
inline

Returns DetectorTimings object from specified detinfo::DetectorClocksData.

Definition at line 698 of file DetectorTimings.h.

699  {
700  return detinfo::DetectorTimings{detClocks};
701  }
A class exposing an upgraded interface of detinfo::DetectorClocksData.
detinfo::DetectorTimings detinfo::makeDetectorTimings ( detinfo::DetectorClocksData const *  detClocks)
inline

Returns DetectorTimings object from specified detinfo::DetectorClocksData.

Definition at line 706 of file DetectorTimings.h.

707  {
708  return makeDetectorTimings(*detClocks);
709  }
detinfo::DetectorTimings makeDetectorTimings(detinfo::DetectorClocksData const &detClocks)
detinfo::DetectorTimings detinfo::makeDetectorTimings ( detinfo::DetectorClocksWithUnits const &  detClocksWU)
inline

Returns DetectorTimings object from specified detinfo::DetectorClocksWithUnits.

Definition at line 714 of file DetectorTimings.h.

715  {
716  return static_cast<detinfo::DetectorTimings const&>(detClocksWU);
717  }
A class exposing an upgraded interface of detinfo::DetectorClocksData.
double detinfo::sampling_rate ( DetectorClocksData const &  data)
inline

Returns the period of the TPC readout electronics clock.

Returns
the period of the TPC readout electronics clock [s]
See Also
detinfo::DetectorClocks::TPCClock()

Definition at line 643 of file DetectorClocksData.h.

644  {
645  return data.TPCClock().TickPeriod() * 1.e3;
646  }
int detinfo::trigger_offset ( DetectorClocksData const &  data)
inline

Definition at line 632 of file DetectorClocksData.h.

633  {
634  return data.TPCClock().Ticks(data.TriggerOffsetTPC() * -1.);
635  }
template<typename Event >
std::optional<std::pair<double, double> > detinfo::trigger_times_for_event ( art::InputTag const &  triggerTag,
Event const &  event 
)

Loads DetectorClocksStandard trigger times.

Template Parameters
Eventtype of event where trigger data might be stored
Parameters
triggerTagtag of the raw::Trigger collection data product to read
eventthe event the trigger objects are stored into
Returns
optional pair of trigger and beam gate time, empty if not found
Exceptions
cet::exception(category "setDetectorClocksStandardTrigger") if trigger data product has more than one trigger

This function returns the relative trigger and beam gate times read from an event. It attempts to read the information from a raw::Trigger collection data product with tag triggerTag in the event. Times are expected to be in microseconds on the electronics time scale. In case that data product does not exist, or it exists but empty, an empty result is quietly returned. If instead there are multiple trigger objects in the collection, no choice is made, and an exception is thrown.

Definition at line 58 of file DetectorClocksStandardTriggerLoader.h.

59  {
60  // try to read the trigger from the event
61  // fetch the trigger data product
62  using TriggerHandle_t = typename Event::template HandleT<std::vector<raw::Trigger>>;
63 
64  TriggerHandle_t triggerHandle;
65  if (!event.template getByLabel(triggerTag, triggerHandle)) { return std::nullopt; }
66 
67  // check that we do have a trigger
68  // (we have already checked whether the handle is valid above)
69  auto const& triggers = *triggerHandle;
70  if (triggers.empty()) { return std::nullopt; }
71 
72  // select which trigger to set (i.e., the only one!)
73  if (triggers.size() != 1) {
74  throw cet::exception("setDetectorClocksStandardTrigger")
75  << "Found " << triggers.size() << " trigger objects in '" << triggerTag.encode()
76  << "' (only one trigger per event is supported)\n";
77  }
78 
79  auto const& trigger = triggers.front();
80  return std::make_optional(std::make_pair(trigger.TriggerTime(), trigger.BeamGateTime()));
81  }

Variable Documentation

detinfo::fPS {pset}

Definition at line 32 of file DetectorPropertiesServiceStandard.cc.

constexpr double detinfo::kDEFAULT_BEAM_TIME = 0.0

Default BeamGateTime in micro-second.

Definition at line 39 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_FRAME_PERIOD = 1.6e3

Default Frame period in micro-second.

Definition at line 15 of file ClockConstants.h.

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

Default Frequency in MHz.

Definition at line 12 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_FREQUENCY_EXTERNAL = 31.25

Default External clock speed in MHz.

Definition at line 27 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_FREQUENCY_OPTICAL = 64.

Default Optical clock speed in MHz.

Definition at line 18 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_FREQUENCY_TPC = 2.

Default TPC clock speed in MHz.

Definition at line 21 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_FREQUENCY_TRIGGER = 16.

Default Trigger clock speed in MHz.

Definition at line 24 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_MC_CLOCK_T0 = 0

Default G4 reference time in micro-second.

Definition at line 30 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_TRIG_OFFSET_TPC = -1600.

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

Definition at line 33 of file ClockConstants.h.

constexpr double detinfo::kDEFAULT_TRIG_TIME = 0.0

Default TriggerTime in micro-second.

Definition at line 36 of file ClockConstants.h.

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

Maximum time in microseconds.

Definition at line 9 of file ClockConstants.h.