#include <TimingRawDecoderOffsetTool.h>
Definition at line 20 of file TimingRawDecoderOffsetTool_tool.cc.
27 const Name myname =
"TimingRawDecoderOffsetTool::ctor: ";
36 for (
Index kfmb=0; kfmb<nfmb; ++kfmb ) {
41 cout << myname <<
"WARNING: Missing scale values have been set to one." <<
endl;
44 cout << myname <<
"WARNING: Extra scale values will be ignored." <<
endl;
47 cout << myname <<
"Configuration:" <<
endl;
51 cout << myname <<
" FembScales: [";
54 if ( nfmb ) cout <<
", ";
55 cout << isca.first <<
":" << isca.second;
ChannelGroupService::Name Name
std::vector< double > DoubleVector
static constexpr double ps
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
QTextStream & endl(QTextStream &s)
TimingRawDecoderOffsetTool::~TimingRawDecoderOffsetTool |
( |
| ) |
|
|
overridedefault |
Offset TimingRawDecoderOffsetTool::offset |
( |
const Data & |
dat | ) |
const |
|
overridevirtual |
Implements TimeOffsetTool.
Definition at line 65 of file TimingRawDecoderOffsetTool_tool.cc.
66 const Name myname =
"TimingRawDecoderOffsetTool::offset: ";
70 unsigned long daqVal = dat.triggerClock;
74 double scale = haveScale ? isca->second : 1.0;
76 ifstream fin(ifname.c_str());
78 cout << myname <<
"Unable to find time offset file: " << ifname <<
endl;
81 unsigned long daqValFile = 0;
83 if ( daqVal == daqValFile ) {
84 cout << myname <<
"Input clock matches file clock." <<
endl;
86 cout << myname <<
"Input clock does not match file: " << daqVal <<
" != " << daqValFile <<
endl;
91 res.
value = scale*daqVal;
93 }
else if (
m_Unit ==
"ns" ) {
94 res.
value = scale*20*daqVal;
96 }
else if (
m_Unit ==
"tick" ) {
99 Index icha = dat.channel;
102 bool haveGroup =
true;
106 bool useFemb =
false;
107 if ( rdat.
phaseGroup() ==
"channel" ) igrp = icha;
108 else if ( rdat.
phaseGroup() ==
"all" ) igrp = 0;
109 else if ( rdat.
phaseGroup() ==
"wib" ) useWib =
true;
110 else if ( rdat.
phaseGroup() ==
"femb" ) useFemb =
true;
113 cout << myname <<
"WARNING: Invalid phase group: " << rdat.
phaseGroup() <<
endl;
117 if ( pchanMap.
get() != nullptr ) {
121 Index jfmb = 5*jcon + jwib;
122 Index kfmb = 20*kapa + jfmb;
123 Index kwib = 5*kapa + jfmb%5;
124 if ( useWib ) igrp = kwib;
125 if ( useFemb ) igrp = kfmb;
128 cout << myname <<
"WARNING: Channel map service not found." <<
endl;
133 if ( igrp + 1 > phases.size() ) {
134 cout << myname <<
"WARNING: Phases is too short: " << igrp <<
"/" << phases.size() <<
endl;
136 runPhase = phases[igrp];
140 if (
m_LogLevel >= 3 ) cout << myname <<
"Run phase is " << runPhase <<
endl;
142 if (
m_LogLevel >= 3 ) cout << myname <<
"Run data tool not found." <<
endl;
146 res.
value = scale*daqoff/25;
148 res.
value = daqoff/25;
150 res.
rem = (daqoff % 25)/25.0;
152 cout << myname <<
"Invalid unit: " <<
m_Unit << ifname <<
endl;
const IndexVector & phases() const
ChannelGroupService::Name Name
unsigned int APAFromOfflineChannel(unsigned int offlineChannel) const
Returns APA/crate.
bool havePhaseGroup() const
void checkCount(const ToolPtr &ptool, double vin, Count countExpected)
std::vector< Index > IndexVector
unsigned int WIBFromOfflineChannel(unsigned int offlineChannel) const
Returns WIB/slot.
unsigned int FEMBFromOfflineChannel(unsigned int offlineChannel) const
Returns FEMB/fiber.
std::string to_string(ModuleType const mt)
QTextStream & endl(QTextStream &s)
ScaleMap TimingRawDecoderOffsetTool::m_fembScales |
|
private |
Index TimingRawDecoderOffsetTool::m_LogLevel |
|
private |
const RunDataTool* TimingRawDecoderOffsetTool::m_pRunDataTool =nullptr |
|
private |
Name TimingRawDecoderOffsetTool::m_RunDataTool |
|
private |
Index TimingRawDecoderOffsetTool::m_TpcTickPhase |
|
private |
Name TimingRawDecoderOffsetTool::m_Unit |
|
private |
The documentation for this class was generated from the following files: