DetectorClocks.h
Go to the documentation of this file.
1 /**
2  * \file lardataalg/DetectorInfo/DetectorClocks.h
3  *
4  * \brief pure virtual base interface for detector clocks
5  *
6  * \author jpaley@fnal.gov
7  *
8  */
9 #ifndef LARDATAALG_DETECTORINFO_DETECTORCLOCKS_H
10 #define LARDATAALG_DETECTORINFO_DETECTORCLOCKS_H
11 
14 
15 // C++ libraries
16 #include <string>
17 #include <vector>
18 
19 namespace detinfo {
20 
21  enum ConfigType_t {
32  };
33 
34  /** **************************************************************************
35  * @brief Class used for the conversion of times between different
36  * formats and references.
37  *
38  * `detinfo::DetectorClocks` is an abstract interface enclosing the set of
39  * supported queries. A concrete implementation of this interface needs to be
40  * provided in order to use this facility. LArSoft provides
41  * `detinfo::DetectorClocksStandard` as a simple, reasonable implementation.
42  * Initialization and configuration are designed by each implementation.
43  *
44  * The only use of this provider in LArSoft version 9 and newer is to provide
45  * an instance of `detinfo::DetectorClocksData` containing all the relevant
46  * information.
47  *
48  * Helper functions may be available to extract the necessary information
49  * from specific implementations of `detinfo::DetectorClocks`.
50  */
51 
53  public:
54  virtual ~DetectorClocks() = default;
55 
56  /// Returns a list of provider configuration names.
57  /// @see ConfigValues()
58  virtual std::vector<std::string> const& ConfigNames() const = 0;
59 
60  /// Returns a list of provider configuration values
61  /// (same order as `ConfigNames()`).
62  /// @see ConfigNames()
63  virtual std::vector<double> const& ConfigValues() const = 0;
64 
65  /**
66  * @brief Returns a complete `detinfo::DetectorClocksData` object.
67  *
68  * The returned timing information is based on information independent
69  * of the current input file, run or event.
70  * It is recommended that `DataFor()` is used instead whenever possible.
71  */
72  virtual DetectorClocksData DataForJob() const = 0;
73 
74  /**
75  * @brief Returns a complete `detinfo::DetectorClocksData` object.
76  * @param g4_ref_time start of simulation time in electronics time scale [ns]
77  * @param trigger_time the default hardware trigger time in electronics time
78  * @param beam_time the default beam gate opening time in electronics time
79  *
80  * The returned timing information reflects the current context, defined
81  * by the parameters passed to this method.
82  *
83  * If the information required by the parameters is not available, users
84  * will be forced to use `DataForJob()` instead.
85  *
86  * For more details on the definition of the parameters, see the
87  * documentation of `detinfo::DetectorClocksData` constructor.
88  */
89  virtual DetectorClocksData DataFor(double g4_ref_time,
90  double trigger_time,
91  double beam_time) const = 0;
92  }; // class DetectorClocks
93 
94 } // namespace detinfo
95 
96 #endif // LARDATAALG_DETECTORINFO_DETECTORCLOCKS_H
virtual DetectorClocksData DataForJob() const =0
Returns a complete detinfo::DetectorClocksData object.
timescale_traits< TriggerTimeCategory >::time_point_t trigger_time
A point in time on the trigger time scale.
virtual ~DetectorClocks()=default
General LArSoft Utilities.
virtual std::vector< std::string > const & ConfigNames() const =0
Class used for the conversion of times between different formats and references.
Contains all timing reference information for the detector.
Class def header for a class ElecClock.
virtual DetectorClocksData DataFor(double g4_ref_time, double trigger_time, double beam_time) const =0
Returns a complete detinfo::DetectorClocksData object.
virtual std::vector< double > const & ConfigValues() const =0