All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIOVPmtGainService_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 SIOVPmtGainService
13  art service implementation of PmtGainService. Implements
14  a pmt gain 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  SIOVPmtGainService(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  PmtGainProvider const& DoGetProvider() const override {
31  return fProvider;
32  }
33 
34  PmtGainProvider const* DoGetProviderPtr() const override {
35  return &fProvider;
36  }
37 
39  };
40 }//end namespace lariov
41 
42 DECLARE_ART_SERVICE_INTERFACE_IMPL(lariov::SIOVPmtGainService, lariov::PmtGainService, LEGACY)
43 
44 
45 namespace lariov{
46 
47  SIOVPmtGainService::SIOVPmtGainService(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg)
48  : fProvider(pset.get<fhicl::ParameterSet>("PmtGainProvider"))
49  {
50  //register callback to update local database cache before each event is processed
51  reg.sPreProcessEvent.watch(this, &SIOVPmtGainService::PreProcessEvent);
52  }
53 
54 }//end namespace lariov
55 
56 DEFINE_ART_SERVICE_INTERFACE_IMPL(lariov::SIOVPmtGainService, lariov::PmtGainService)
SIOVPmtGainService(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
PmtGainProvider const * DoGetProviderPtr() const override
Interface for experiment-specific service for pmt gain info.
Retrieves information: pmt gain.
void UpdateTimeStamp(DBTimeStamp_t ts)
Update event time stamp.
Class def header for a class SIOVPmtGainProvider.
TCEvent evt
Definition: DataStructs.cxx:8
void PreProcessEvent(const art::Event &evt, art::ScheduleContext)
PmtGainProvider const & DoGetProvider() const override
Returns a reference to the service provider.