Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
lardataalg
lardataalg
DetectorInfo
DetectorClocksStandard.cxx
Go to the documentation of this file.
1
#include "
lardataalg/DetectorInfo/DetectorClocksStandard.h
"
2
#include "
fhiclcpp/ParameterSet.h
"
3
4
#include "
larcorealg/CoreUtils/zip.h
"
5
6
#include <iostream>
7
8
//-------------------------------------------------------------------------
9
detinfo::DetectorClocksStandard::DetectorClocksStandard
(
fhicl::ParameterSet
const
& pset)
10
: fConfigName{
"G4RefTime"
,
11
"TriggerOffsetTPC"
,
12
"FramePeriod"
,
13
"ClockSpeedTPC"
,
14
"ClockSpeedOptical"
,
15
"ClockSpeedTrigger"
,
16
"ClockSpeedExternal"
,
17
"DefaultTrigTime"
,
18
"DefaultBeamTime"
}
19
,
fConfigValue
{pset.get<
double
>(
fConfigName
[
kG4RefTime
]),
20
pset.get<
double
>(
fConfigName
[
kTriggerOffsetTPC
]),
21
pset.get<
double
>(
fConfigName
[
kFramePeriod
]),
22
pset.get<
double
>(
fConfigName
[
kClockSpeedTPC
]),
23
pset.get<
double
>(
fConfigName
[
kClockSpeedOptical
]),
24
pset.get<
double
>(
fConfigName
[
kClockSpeedTrigger
]),
25
pset.get<
double
>(
fConfigName
[
kClockSpeedExternal
]),
26
pset.get<
double
>(
fConfigName
[
kDefaultTrigTime
]),
27
pset.get<
double
>(
fConfigName
[
kDefaultBeamTime
])}
28
,
fTrigModuleName
{pset.get<
std::string
>(
"TrigModuleName"
)}
29
,
fG4RefCorrTrigModuleName
{pset.get<
std::string
>(
"G4RefCorrTrigModuleName"
,
"baddefault"
)}
30
,
fTriggerOffsetTPC
{
fConfigValue
[
kTriggerOffsetTPC
]}
31
,
fTriggerTime
{
fConfigValue
[
detinfo::kDefaultTrigTime
]}
32
,
fBeamGateTime
{
fConfigValue
[
detinfo::kDefaultBeamTime
]}
33
,
fFramePeriod
{
fConfigValue
[
kFramePeriod
]}
34
,
fTPCClock
{
fTriggerTime
,
fFramePeriod
,
fConfigValue
[
kClockSpeedTPC
]}
35
{
36
SetTriggerTime
(
fConfigValue
[
detinfo::kDefaultTrigTime
],
fConfigValue
[
detinfo::kDefaultBeamTime
]);
37
}
38
39
void
40
detinfo::DetectorClocksStandard::ApplyParams
()
41
{
42
fFramePeriod
=
fConfigValue
[
kFramePeriod
];
43
fTriggerOffsetTPC
=
fConfigValue
[
kTriggerOffsetTPC
];
44
SetTriggerTime
(
fConfigValue
[
detinfo::kDefaultTrigTime
],
fConfigValue
[
detinfo::kDefaultBeamTime
]);
45
}
46
47
bool
48
detinfo::DetectorClocksStandard::IsRightConfig
(
const
fhicl::ParameterSet
&
ps
)
const
49
{
50
if
(ps.
has_key
(
"module_label"
)) {
return
false
; }
51
return
std::all_of(
fConfigName
.cbegin(),
fConfigName
.cend(), [&
ps
](
auto
const
& config_name) {
52
return
ps.
has_key
(config_name);
53
});
54
}
55
56
57
void
58
detinfo::DetectorClocksStandard::debugReport
()
const
59
{
60
std::cout <<
"fConfigValues contents: "
<<
std::endl
;
61
62
for
(
auto
const
& [
name
,
value
]:
util::zip
(
fConfigName
,
fConfigValue
))
63
std::cout <<
"\n "
<<
name
<<
" ... "
<<
value
;
64
std::cout <<
std::endl
;
65
66
DataForJob
().
debugReport
(std::cout);
67
std::cout.flush();
68
69
}
// detinfo::DetectorClocksStandard::debugReport()
70
detinfo::kDefaultTrigTime
Definition:
DetectorClocks.h:29
name
static QCString name
Definition:
declinfo.cpp:673
detinfo::DetectorClocksStandard::DataForJob
DetectorClocksData DataForJob() const override
Returns a complete detinfo::DetectorClocksData object.
Definition:
DetectorClocksStandard.h:171
detinfo::kFramePeriod
Definition:
DetectorClocks.h:24
zip.h
Definition of util::zip().
detinfo::kClockSpeedTPC
Definition:
DetectorClocks.h:25
detinfo::DetectorClocksStandard::IsRightConfig
bool IsRightConfig(const fhicl::ParameterSet &ps) const
Definition:
DetectorClocksStandard.cxx:48
detinfo::kDefaultBeamTime
Definition:
DetectorClocks.h:30
detinfo::DetectorClocksStandard::debugReport
void debugReport() const
Dumps the current configuration to screen.
Definition:
DetectorClocksStandard.cxx:58
string
std::string string
Definition:
nybbler.cc:12
detinfo::DetectorClocksStandard::fConfigName
std::vector< std::string > fConfigName
Definition:
DetectorClocksStandard.h:240
detinfo::kG4RefTime
Definition:
DetectorClocks.h:22
detinfo::kTriggerOffsetTPC
Definition:
DetectorClocks.h:23
ParameterSet.h
detinfo::DetectorClocksStandard::fTriggerTime
double fTriggerTime
Trigger time in [us].
Definition:
DetectorClocksStandard.h:250
detinfo::DetectorClocksStandard::fConfigValue
std::vector< double > fConfigValue
Definition:
DetectorClocksStandard.h:241
detinfo::DetectorClocksStandard::ApplyParams
void ApplyParams()
Internal function to apply loaded parameters to member attributes.
Definition:
DetectorClocksStandard.cxx:40
detinfo::kClockSpeedExternal
Definition:
DetectorClocks.h:28
detinfo::DetectorClocksStandard::fBeamGateTime
double fBeamGateTime
BeamGate time in [us].
Definition:
DetectorClocksStandard.h:253
detinfo::DetectorClocksStandard::fTriggerOffsetTPC
double fTriggerOffsetTPC
Time offset from trigger to TPC readout start.
Definition:
DetectorClocksStandard.h:247
fhicl::ParameterSet::has_key
bool has_key(std::string const &key) const
Definition:
ParameterSet.cc:247
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
detinfo::DetectorClocksStandard::fTPCClock
ElecClock fTPCClock
Definition:
DetectorClocksStandard.h:258
detinfo::kClockSpeedOptical
Definition:
DetectorClocks.h:26
detinfo::kClockSpeedTrigger
Definition:
DetectorClocks.h:27
detinfo::DetectorClocksStandard::SetTriggerTime
void SetTriggerTime(double const trig_time, double const beam_time)
Setter for trigger times.
Definition:
DetectorClocksStandard.h:223
detinfo::DetectorClocksStandard::fG4RefCorrTrigModuleName
std::string fG4RefCorrTrigModuleName
Definition:
DetectorClocksStandard.h:244
detinfo::DetectorClocksStandard::DetectorClocksStandard
DetectorClocksStandard(fhicl::ParameterSet const &pset)
Definition:
DetectorClocksStandard.cxx:9
util::zip
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition:
zip.h:295
detinfo::DetectorClocksStandard::fFramePeriod
double fFramePeriod
Frame period.
Definition:
DetectorClocksStandard.h:256
detinfo::DetectorClocksData::debugReport
void debugReport(Stream &out) const
Definition:
DetectorClocksData.h:577
submit_mcc.value
value
Definition:
submit_mcc.py:159
detinfo::DetectorClocksStandard::fTrigModuleName
std::string fTrigModuleName
Definition:
DetectorClocksStandard.h:243
DetectorClocksStandard.h
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11