All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIOVElectronicsCalibService_service.cc
Go to the documentation of this file.
1 #include "art/Framework/Services/Registry/ActivityRegistry.h"
2 #include "art/Framework/Principal/Event.h"
3 #include "art/Framework/Services/Registry/ServiceDefinitionMacros.h"
4 #include "art/Persistency/Provenance/ScheduleContext.h"
5 #include "fhiclcpp/ParameterSet.h"
8 
9 namespace lariov{
10 
11  /**
12  \class SIOVElectronicsCalibService
13  art service implementation of ElectronicsCalibService. Implements
14  an electronics calibration retrieval service for database scheme in which
15  all elements in a database folder share a common interval of validity
16  */
18 
19  public:
20 
21  SIOVElectronicsCalibService(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg);
23 
24  void PreProcessEvent(const art::Event& evt, art::ScheduleContext) {
25  fProvider.UpdateTimeStamp(evt.time().value());
26  }
27 
28  private:
29 
30  ElectronicsCalibProvider const& DoGetProvider() const override {
31  return fProvider;
32  }
33 
34  ElectronicsCalibProvider const* DoGetProviderPtr() const override {
35  return &fProvider;
36  }
37 
39  };
40 }//end namespace lariov
41 
42 DECLARE_ART_SERVICE_INTERFACE_IMPL(lariov::SIOVElectronicsCalibService, lariov::ElectronicsCalibService, LEGACY)
43 
44 
45 namespace lariov{
46 
47  SIOVElectronicsCalibService::SIOVElectronicsCalibService(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg)
48  : fProvider(pset.get<fhicl::ParameterSet>("ElectronicsCalibProvider"))
49  {
50  //register callback to update local database cache before each event is processed
51  reg.sPreProcessEvent.watch(this, &SIOVElectronicsCalibService::PreProcessEvent);
52  }
53 
54 }//end namespace lariov
55 
Class def header for a class SIOVElectronicsCalibProvider.
SIOVElectronicsCalibService(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
Retrieves information: electronics calibrations, specifically gain and shaping time.
Interface for experiment-specific service for pmt gain info.
ElectronicsCalibProvider const * DoGetProviderPtr() const override
void UpdateTimeStamp(DBTimeStamp_t ts)
Update event time stamp.
ElectronicsCalibProvider const & DoGetProvider() const override
Returns a reference to the service provider.
TCEvent evt
Definition: DataStructs.cxx:8
void PreProcessEvent(const art::Event &evt, art::ScheduleContext)