All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
14 
15 #include "art/Framework/Principal/Event.h"
16 #include "art/Framework/Principal/Run.h"
17 #include "art/Framework/Services/Registry/ActivityRegistry.h"
18 #include "art/Framework/Services/Registry/ServiceDeclarationMacros.h"
19 #include "art/Persistency/Provenance/ScheduleContext.h"
20 
21 namespace fhicl {
22  class ParameterSet;
23 }
24 
25 namespace detinfo {
26 
27  /**
28  * @brief _art_ service managing `detinfo::DetectorClocksStandard`.
29  * @see detinfo::DetectorClocksStandard, detinfo::DetectorClocks
30  *
31  * This _art_ service manages LArSoft's service provider
32  * `detinfo::DetectorClocksStandard`, which implements
33  * `detinfo::DetectorClocks` interface.
34  *
35  * For information about functionality of the service, see the documentation
36  * of its interface, `detinfo::DetectorClocks`.
37  * For information of the configuration, see also
38  * `detinfo::DetectorClocksStandard`.
39  *
40  *
41  * Configuration
42  * ==============
43  *
44  * The configuration parameters are documented in the service provider
45  * implementation: `detinfo::DetectorClocksStandard`.
46  *
47  *
48  * Consistency check
49  * ==================
50  *
51  * This service manager honors the `InheritClockConfig` configuration option
52  * in the following way:
53  * -# if the past jobs (explicitly excluding the current job) had inconsistent
54  * configuration, an exception is thrown claiming an "historical
55  * disagreement"
56  * -# after the verification that the past configuration is consistent, the
57  * values from that configurations override the ones in the configuration
58  * of the current job; a value from the configuration of the current job
59  * is retained only if it was not present in the past (i.e. it is a new
60  * configuration parameter added since the input file was produced).
61  *
62  * The "past jobs" are the jobs that have produced the input file, and whose
63  * configuration is stored by _art_ in the input file itself. The check and
64  * reconfiguration is performed on each new input file.
65  *
66  *
67  * Timing specifics
68  * =================
69  *
70  * The trigger and beam gate times are set by this service before each event
71  * is processed.
72  * The logic is the following:
73  * -# if the event contains a raw trigger (`raw::Trigger`) data product with
74  * input tag `TriggerName()` (from the configuration), that data product
75  * is read and the trigger and beam gate times stored in it are imported
76  * in the current service provider configuration; if there are more than
77  * one `raw::Trigger` objects in the data product, an exception is thrown
78  * -# if no raw trigger is found with the specified label, the configuration
79  * of the service provider is updated using the default values of trigger
80  * and beam times specified in the service configuration
81  *
82  * The first set up happens on opening the first run in the first input file.
83  * Accessing this service before (e.g. during `beginJob()` phase) yields
84  * undefined behaviour.
85  *
86  */
88  public:
89  DetectorClocksServiceStandard(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg);
90 
91  private:
92  void preBeginRun(art::Run const& run);
93  void postOpenFile(std::string const& filename);
94 
96  DataForJob() const override
97  {
98  return fClocks.DataForJob();
99  }
100 
102  DataFor(art::Event const& e) const override;
103 
106  };
107 } // namespace detinfo
108 
109 DECLARE_ART_SERVICE_INTERFACE_IMPL(detinfo::DetectorClocksServiceStandard,
111  SHARED)
112 
113 #endif // DETECTORCLOCKSSERVICESTANDARD_H
114 
BEGIN_PROLOG could also be dds filename
void postOpenFile(std::string const &filename)
art service managing detinfo::DetectorClocksStandard.
DetectorClocksData DataForJob() const override
Returns a complete detinfo::DetectorClocksData object.
DetectorClocksData DataFor(art::Event const &e) const override
Contains all timing reference information for the detector.
Implementation of detinfo::DetectorClocks interface with fixed settings from configuration.
do i e
DetectorClocksServiceStandard(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
DetectorClocksData DataForJob() const override