DetectorPropertiesServiceProtoDUNEsp.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // DetectorPropertiesServiceProtoDUNEsp.h
3 //
4 // Service interface for DetectorProperties functions
5 //
6 // jpaley@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 #ifndef DETECTORPROPERTIESSERVICEPROTODUNESP_H
10 #define DETECTORPROPERTIESSERVICEPROTODUNESP_H
11 #include "fhiclcpp/ParameterSet.h"
12 #include "fhiclcpp/types/Atom.h"
17 
19 //#include "lardataalg/DetectorInfo/DetectorPropertiesStandard.h"
22 
23 
25 
26 
27 ///General LArSoft Utilities
28 namespace spdp{
29 
30  /**
31  * Configuration parameters
32  * -------------------------
33  *
34  * This service passes the whole configuration down to its service provider,
35  * but it also reacts to:
36  * - *InheritNumberTimeSamples* (boolean; default: false): if true, the
37  * configuration database in the ROOT input file is queried and if a
38  * configuration for this service is found, it's used instead of the
39  * one from the current FHiCL configuration
40  */
41 
43  public:
44 
45  // the following is currently not used for validation,
46  // but only for documentation
48 
49  // service-specific configuration
51  fhicl::Name("InheritNumberTimeSamples"),
52  fhicl::Comment(""),
53  false /* default value */
54  };
55 
56  // provider configuration
58 
59  }; // ServiceConfiguration_t
60 
61 
62  // this enables art to print the configuration help:
64 
67  void reconfigure(fhicl::ParameterSet const& pset);
69  void postOpenFile(const std::string& filename);
70  void preOpenFile(const std::string& filename);
71  void preBeginRun(const art::Run& run);
72 
73  private:
74  std::unique_ptr<spdp::DetectorPropertiesProtoDUNEsp> fProp;
75  fhicl::ParameterSet fPS; ///< Original parameter set.
76  bool isNewRun;
77  bool fInheritNumberTimeSamples; ///< Flag saying whether to inherit NumberTimeSamples
78 
80 
82  getDataForJob(detinfo::DetectorClocksData const& clockData) const override
83  {
84  return fProp->DataFor(clockData);
85  }
86 
88  getDataFor(art::Event const&, detinfo::DetectorClocksData const& clockData) const override
89  {
90  return fProp->DataFor(clockData);
91  }
92 
93  }; // class DetectorPropertiesService
94 } //namespace detinfo
96 #endif // DETECTORPROPERTIESSERVICESTANDARD_H
std::string string
Definition: nybbler.cc:12
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
ChannelGroupService::Name Name
string filename
Definition: train.py:213
detinfo::DetectorPropertiesData DataFor(const detinfo::DetectorClocksData &clockData) const override
Definition: Run.h:17
bool fInheritNumberTimeSamples
Flag saying whether to inherit NumberTimeSamples.
detinfo::DetectorPropertiesData getDataFor(art::Event const &, detinfo::DetectorClocksData const &clockData) const override
fhicl::ParameterSet fPS
Original parameter set.
DetectorPropertiesServiceProtoDUNEsp(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
General LArSoft Utilities.
void preProcessEvent(const art::Event &evt, art::ScheduleContext)
static constexpr double ps
Definition: Units.h:99
#define Comment
Contains all timing reference information for the detector.
bool isDetectorPropertiesServiceProtoDUNEsp(const fhicl::ParameterSet &ps) const
TCEvent evt
Definition: DataStructs.cxx:7
void preOpenFile(const std::string &filename)
detinfo::DetectorPropertiesData getDataForJob(detinfo::DetectorClocksData const &clockData) const override
std::unique_ptr< spdp::DetectorPropertiesProtoDUNEsp > fProp