27 #include <boost/property_tree/json_parser.hpp>
28 #include <boost/property_tree/ptree.hpp>
30 namespace pt = boost::property_tree;
61 : filename_(iConfig.getParameter<
edm::FileInPath>(
"calibrationFile").
fullPath()),
62 subdetector_((
DetectorType)iConfig.getParameter<unsigned
int>(
"subDetector")) {
64 findingRecord<PPSTimingCalibrationRcd>();
92 pt::ptree mother_node;
101 key.db = (
int)strtol(par.first.data(),
nullptr, 10);
104 key.sampic = board.second.get<
int>(
"sampic");
105 key.channel = board.second.get<
int>(
"channel");
106 double timeOffset = board.second.get<
double>(
"time_offset");
107 double timePrecision = board.second.get<
double>(
"time_precision");
113 std::vector<double>
values;
117 values.emplace_back(std::stod(param.second.data(),
nullptr));
123 return std::make_unique<PPSTimingCalibration>(
formula,
params, time_info);
127 pt::ptree mother_node;
136 key.db = par.second.get<
int>(
"sector");
139 key.sampic = st.second.get<
int>(
"station");
142 key.channel = pl.second.get<
int>(
"plane");
145 key.cell = ch.second.get<
int>(
"channel");
146 double timeOffset = ch.second.get<
double>(
"time_offset");
147 double timePrecision = ch.second.get<
double>(
"time_precision");
150 std::vector<double>
values;
152 values.emplace_back(std::stod(param.second.data(),
nullptr));
158 return std::make_unique<PPSTimingCalibration>(
formula,
params, time_info);
164 ->setComment(
"file with SAMPIC calibrations, ADC and INL; if empty or corrupted, no calibration will be applied");
166 ->
setComment(
"type of sub-detector for which the calibrations are provided");
168 descriptions.
add(
"ppsTimingCalibrationESSource", desc);