DetectorClocksServiceStandard.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // DetectorClocksServiceStandard.h
3 //
4 // Service interface for Detector Clock functions
5 //
6 // jpaley@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 #ifndef DETECTORCLOCKSSERVICESTANDARD_H
10 #define DETECTORCLOCKSSERVICESTANDARD_H
11 
17 #include "fhiclcpp/fwd.h"
18 
21 
22 namespace detinfo {
23 
24  /**
25  * @brief _art_ service managing `detinfo::DetectorClocksStandard`.
26  * @see detinfo::DetectorClocksStandard, detinfo::DetectorClocks
27  *
28  * This _art_ service manages LArSoft's service provider
29  * `detinfo::DetectorClocksStandard`, which implements
30  * `detinfo::DetectorClocks` interface.
31  *
32  * For information about functionality of the service, see the documentation
33  * of its interface, `detinfo::DetectorClocks`.
34  * For information of the configuration, see also
35  * `detinfo::DetectorClocksStandard`.
36  *
37  *
38  * Configuration
39  * ==============
40  *
41  * The configuration parameters are documented in the service provider
42  * implementation: `detinfo::DetectorClocksStandard`.
43  *
44  *
45  * Consistency check
46  * ==================
47  *
48  * This service manager honors the `InheritClockConfig` configuration option
49  * in the following way:
50  * -# if the past jobs (explicitly excluding the current job) had inconsistent
51  * configuration, an exception is thrown claiming an "historical
52  * disagreement"
53  * -# after the verification that the past configuration is consistent, the
54  * values from that configurations override the ones in the configuration
55  * of the current job; a value from the configuration of the current job
56  * is retained only if it was not present in the past (i.e. it is a new
57  * configuration parameter added since the input file was produced).
58  *
59  * The "past jobs" are the jobs that have produced the input file, and whose
60  * configuration is stored by _art_ in the input file itself. The check and
61  * reconfiguration is performed on each new input file.
62  *
63  *
64  * Timing specifics
65  * =================
66  *
67  * The trigger and beam gate times are set by this service before each event
68  * is processed.
69  * The logic is the following:
70  * -# if the event contains a raw trigger (`raw::Trigger`) data product with
71  * input tag `TriggerName()` (from the configuration), that data product
72  * is read and the trigger and beam gate times stored in it are imported
73  * in the current service provider configuration; if there are more than
74  * one `raw::Trigger` objects in the data product, an exception is thrown
75  * -# if no raw trigger is found with the specified label, the configuration
76  * of the service provider is updated using the default values of trigger
77  * and beam times specified in the service configuration
78  *
79  * The first set up happens on opening the first run in the first input file.
80  * Accessing this service before (e.g. during `beginJob()` phase) yields
81  * undefined behaviour.
82  *
83  */
85  public:
87 
88  private:
89  void preBeginRun(art::Run const& run);
90  void postOpenFile(std::string const& filename);
91 
93  DataForJob() const override
94  {
95  return fClocks.DataForJob();
96  }
97 
99  DataFor(art::Event const& e) const override;
100 
103  };
104 } // namespace detinfo
105 
108  SHARED)
109 
110 #endif // DETECTORCLOCKSSERVICESTANDARD_H
111 
DetectorClocksData DataForJob() const override
Returns a complete detinfo::DetectorClocksData object.
DetectorClocksData DataForJob() const override
std::string string
Definition: nybbler.cc:12
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
string filename
Definition: train.py:213
Definition: Run.h:17
const double e
General LArSoft Utilities.
art service managing detinfo::DetectorClocksStandard.
Contains all timing reference information for the detector.
Implementation of detinfo::DetectorClocks interface with fixed settings from configuration.
DetectorClocksData DataFor(art::Event const &e) const override
DetectorClocksServiceStandard(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)