Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecalib
dunecalib
CalibServices
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
17
#include "
dunecalib/CalibServices/LifetimeCalibServiceProtoDUNE.h
"
18
19
// Framework includes
20
#include "
art/Framework/Services/Registry/ServiceDefinitionMacros.h
"
21
#include "
messagefacility/MessageLogger/MessageLogger.h
"
22
#include "cetlib_except/exception.h"
23
24
//-----------------------------------------------
25
calib::LifetimeCalibServiceProtoDUNE::LifetimeCalibServiceProtoDUNE
(
fhicl::ParameterSet
const
& pset,
art::ActivityRegistry
&
reg
)
26
{
27
fProp
.reset(
new
calib::LifetimeCalibProtoDUNE
(pset));
28
29
reg.
sPreBeginRun
.watch(
this
, &
LifetimeCalibServiceProtoDUNE::preBeginRun
);
30
}
31
32
//----------------------------------------------
33
void
calib::LifetimeCalibServiceProtoDUNE::preBeginRun
(
const
art::Run
&
run
)
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
//------------------------------------------------
48
void
calib::LifetimeCalibServiceProtoDUNE::reconfigure
(
fhicl::ParameterSet
const
& pset)
49
{
50
fProp
->Configure(pset);
51
return
;
52
}
53
54
//------------------------------------------------
55
DEFINE_ART_SERVICE_INTERFACE_IMPL
(
calib::LifetimeCalibServiceProtoDUNE
,
calib::LifetimeCalibService
)
art::Timestamp::timeLow
constexpr std::uint32_t timeLow() const
Definition:
Timestamp.h:29
LifetimeCalibServiceProtoDUNE.h
art::Timestamp::timeHigh
constexpr std::uint32_t timeHigh() const
Definition:
Timestamp.h:34
calib::LifetimeCalibServiceProtoDUNE
Definition:
LifetimeCalibServiceProtoDUNE.h:23
filelisting.run
int run
Definition:
filelisting.py:13
calib::LifetimeCalibServiceProtoDUNE::reconfigure
virtual void reconfigure(fhicl::ParameterSet const &pset) override
Definition:
LifetimeCalibServiceProtoDUNE_service.cc:48
art::Run
Definition:
Run.h:17
MessageLogger.h
calib::LifetimeCalibService
Definition:
LifetimeCalibService.h:19
art::Timestamp
Definition:
Timestamp.h:10
calib::LifetimeCalibServiceProtoDUNE::preBeginRun
void preBeginRun(const art::Run &run)
Definition:
LifetimeCalibServiceProtoDUNE_service.cc:33
calib::LifetimeCalibServiceProtoDUNE::fProp
std::unique_ptr< calib::LifetimeCalibProtoDUNE > fProp
Definition:
LifetimeCalibServiceProtoDUNE.h:37
calib::LifetimeCalibServiceProtoDUNE::LifetimeCalibServiceProtoDUNE
LifetimeCalibServiceProtoDUNE(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
Definition:
LifetimeCalibServiceProtoDUNE_service.cc:25
art::ActivityRegistry::sPreBeginRun
GlobalSignal< detail::SignalResponseType::FIFO, void(Run const &)> sPreBeginRun
Definition:
ActivityRegistry.h:146
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
calib::LifetimeCalibProtoDUNE
Definition:
LifetimeCalibProtoDUNE.h:37
ServiceDefinitionMacros.h
cet::registry_via_id
Definition:
registry_via_id.h:19
art::DataViewImpl::beginTime
Timestamp const & beginTime() const
Definition:
DataViewImpl.cc:92
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_ART_SERVICE_INTERFACE_IMPL
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)
Definition:
ServiceDefinitionMacros.h:42
Generated by
1.8.11