LifetimeCalibServiceProtoDUNE_service.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file LifetimeCalibProtoDUNE_service.cc
3 //
4 // \brief implementation of class for storing/accessing lifetime corrections for ProtoDUNE
5 //
6 // \author wwu@fnal.gov
7 // \date May 19, 2020
8 //
9 ////////////////////////////////////////////////////////////////////////
10 
11 // C++ language includes
12 #include <iostream>
13 
14 #include "TTimeStamp.h"
15 
16 // LArSoft includes
18 
19 // Framework includes
22 #include "cetlib_except/exception.h"
23 
24 //-----------------------------------------------
26 {
27  fProp.reset(new calib::LifetimeCalibProtoDUNE(pset));
28 
30 }
31 
32 //----------------------------------------------
34 {
35  art::Timestamp ts = run.beginTime();
36  TTimeStamp tts(ts.timeHigh(), ts.timeLow());
37  uint64_t runtime = tts.AsDouble();
38 
39  std::cout << "db: runtime " << runtime << std::endl;
40  // one can also consider using event time through "sPreProcessEvent" by define a "preProcessEvent" function, for exmaple.
41 
42  fProp->Update(runtime);
43 
44  //fProp->Update(run.id().run());
45 }
46 
47 //------------------------------------------------
49 {
50  fProp->Configure(pset);
51  return;
52 }
53 
54 //------------------------------------------------
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
virtual void reconfigure(fhicl::ParameterSet const &pset) override
Definition: Run.h:17
std::unique_ptr< calib::LifetimeCalibProtoDUNE > fProp
LifetimeCalibServiceProtoDUNE(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
GlobalSignal< detail::SignalResponseType::FIFO, void(Run const &)> sPreBeginRun
Timestamp const & beginTime() const
Definition: DataViewImpl.cc:92
QTextStream & endl(QTextStream &s)
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)