All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIOVDetPedestalService_service.cc
Go to the documentation of this file.
1 #include "art/Framework/Services/Registry/ActivityRegistry.h"
2 #include "art/Framework/Services/Registry/ServiceDefinitionMacros.h"
3 #include "art/Framework/Principal/Event.h"
4 #include "art/Persistency/Provenance/ScheduleContext.h"
5 #include "fhiclcpp/ParameterSet.h"
8 
9 namespace lariov{
10 
11  /**
12  \class SIOVDetPedestalService
13  art service implementation of DetPedestalService. Implements
14  a detector pedestal 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  SIOVDetPedestalService(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  const DetPedestalProvider& DoGetPedestalProvider() const override {
31  return fProvider;
32  }
33 
35  };
36 }//end namespace lariov
37 
38 DECLARE_ART_SERVICE_INTERFACE_IMPL(lariov::SIOVDetPedestalService, lariov::DetPedestalService, LEGACY)
39 
40 
41 namespace lariov{
42 
43  SIOVDetPedestalService::SIOVDetPedestalService(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg)
44  : fProvider(pset.get<fhicl::ParameterSet>("DetPedestalRetrievalAlg"))
45  {
46  //register callback to update local database cache before each event is processed
47  //reg.sPreProcessEvent.watch(&SIOVDetPedestalService::PreProcessEvent, *this);
48  reg.sPreProcessEvent.watch(this, &SIOVDetPedestalService::PreProcessEvent);
49  }
50 
51 }//end namespace lariov
52 
53 DEFINE_ART_SERVICE_INTERFACE_IMPL(lariov::SIOVDetPedestalService, lariov::DetPedestalService)
void PreProcessEvent(const art::Event &evt, art::ScheduleContext)
Class def header for a class DetPedestalRetrievalAlg.
Retrieves channel information: pedestal and RMS.
SIOVDetPedestalService(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
TCEvent evt
Definition: DataStructs.cxx:8
const DetPedestalProvider & DoGetPedestalProvider() const override
void UpdateTimeStamp(DBTimeStamp_t ts)
Update event time stamp.