All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorPropertiesServiceStandard.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // DetectorPropertiesServiceStandard.h
3 //
4 // Service interface for DetectorProperties functions
5 //
6 // jpaley@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 #ifndef DETECTORPROPERTIESSERVICESTANDARD_H
10 #define DETECTORPROPERTIESSERVICESTANDARD_H
11 
14 
15 #include "art/Framework/Principal/Run.h"
16 #include "art/Framework/Services/Registry/ActivityRegistry.h"
17 #include "art/Framework/Services/Registry/ServiceDeclarationMacros.h"
18 #include "art/Persistency/Provenance/ScheduleContext.h"
19 #include "fhiclcpp/ParameterSet.h"
20 #include "fhiclcpp/types/Atom.h"
21 #include "fhiclcpp/types/Comment.h"
22 #include "fhiclcpp/types/Name.h"
23 
24 /// General LArSoft Utilities
25 namespace detinfo {
26 
27  /**
28  * Configuration parameters
29  * -------------------------
30  *
31  * This service passes the whole configuration down to its service provider,
32  * but it also reacts to:
33  * - *InheritNumberTimeSamples* (boolean; default: false): if true, the
34  * configuration database in the ROOT input file is queried and if a
35  * configuration for this service is found, it's used instead of the
36  * one from the current FHiCL configuration
37  *
38  */
39 
41 
42  public:
43  // the following is currently not used for validation,
44  // but only for documentation
46 
47  // service-specific configuration
48  fhicl::Atom<bool> InheritNumberTimeSamples{
49  fhicl::Name("InheritNumberTimeSamples"),
50  fhicl::Comment(""),
51  false /* default value */
52  };
53 
54  // provider configuration
56 
57  }; // ServiceConfiguration_t
58 
59  // this enables art to print the configuration help:
60  using Parameters = art::ServiceTable<ServiceConfiguration_t>;
61 
62  DetectorPropertiesServiceStandard(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg);
63 
64  private:
66  getDataForJob(DetectorClocksData const& clockData) const override
67  {
68  return fProp.DataFor(clockData);
69  }
70 
72  getDataFor(art::Event const&, DetectorClocksData const& clockData) const override
73  {
74  return fProp.DataFor(clockData);
75  }
76 
77  void postOpenFile(const std::string& filename);
78 
80  fhicl::ParameterSet fPS; ///< Original parameter set.
81 
82  bool fInheritNumberTimeSamples; ///< Flag saying whether to inherit NumberTimeSamples
83 
84  bool isDetectorPropertiesServiceStandard(const fhicl::ParameterSet& ps) const;
85 
86  }; // class DetectorPropertiesService
87 } // namespace detinfo
88 
89 DECLARE_ART_SERVICE_INTERFACE_IMPL(detinfo::DetectorPropertiesServiceStandard,
91  SHARED)
92 #endif // DETECTORPROPERTIESSERVICESTANDARD_H
DetectorPropertiesData DataFor(detinfo::DetectorClocksData const &clock_data) const override
DetectorPropertiesData getDataForJob(DetectorClocksData const &clockData) const override
BEGIN_PROLOG could also be dds filename
DetectorPropertiesServiceStandard(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
art::ServiceTable< ServiceConfiguration_t > Parameters
BEGIN_PROLOG vertical distance to the surface Name
fhicl::ParameterSet fPS
Original parameter set.
bool isDetectorPropertiesServiceStandard(const fhicl::ParameterSet &ps) const
Contains all timing reference information for the detector.
bool fInheritNumberTimeSamples
Flag saying whether to inherit NumberTimeSamples.
detinfo::DetectorPropertiesStandard::Configuration_t ProviderConfiguration
void postOpenFile(const std::string &filename)
DetectorPropertiesData getDataFor(art::Event const &, DetectorClocksData const &clockData) const override