27 #include <boost/property_tree/json_parser.hpp> 28 #include <boost/property_tree/ptree.hpp> 30 namespace pt = boost::property_tree;
65 filename_ ( iConfig.getParameter<
edm::FileInPath>(
"calibrationFile" ).fullPath() ),
69 findingRecord<PPSTimingCalibrationRcd>();
100 std::unique_ptr<PPSTimingCalibration>
103 pt::ptree mother_node;
112 key.
db = (
int)strtol( par.first.data(),
nullptr, 10 );
115 key.
sampic = board.second.get<
int>(
"sampic" );
116 key.
channel = board.second.get<
int>(
"channel" );
117 double timeOffset = board.second.get<
double>(
"time_offset" );
118 double timePrecision = board.second.get<
double>(
"time_precision" );
124 std::vector<double>
values;
128 values.emplace_back( std::stod( param.second.data(),
nullptr ) );
134 return std::make_unique<PPSTimingCalibration>(
formula, params, time_info );
137 std::unique_ptr<PPSTimingCalibration>
140 pt::ptree mother_node;
149 key.
db = par.second.get<
int>(
"sector" );
152 key.
sampic = st.second.get<
int>(
"station" );
155 key.
channel = pl.second.get<
int>(
"plane" );
158 key.
cell = ch.second.get<
int>(
"channel" );
159 double timeOffset = ch.second.get<
double>(
"time_offset" );
160 double timePrecision = ch.second.get<
double>(
"time_precision" );
163 std::vector<double>
values;
165 values.emplace_back( std::stod( param.second.data(),
nullptr ) );
171 return std::make_unique<PPSTimingCalibration>(
formula, params, time_info );
179 ->setComment(
"file with SAMPIC calibrations, ADC and INL; if empty or corrupted, no calibration will be applied" );
181 ->
setComment(
"type of sub-detector for which the calibrations are provided" );
183 descriptions.
add(
"ppsTimingCalibrationESSource", desc );
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void setComment(std::string const &value)
std::map< Key, std::pair< double, double > > TimingMap
PPSTimingCalibrationESSource(const edm::ParameterSet &)
static const IOVSyncValue & endOfTime()
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
std::pair< Time_t, Time_t > ValidityInterval
EventSetup record for TOTEM/PPS timing calibration information.
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&...args)
std::unique_ptr< PPSTimingCalibration > parsePPSDiamondJsonFile() const
Extract calibration data from JSON file (PPS horizontal diamond)
Container::value_type value_type
std::map< Key, std::vector< double > > ParametersMap
static const IOVSyncValue & beginOfTime()
Helper structure for indexing calibration data.
edm::ESProducts< std::unique_ptr< PPSTimingCalibration > > produce(const PPSTimingCalibrationRcd &)
DetectorType subdetector_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const std::string filename_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
std::unique_ptr< PPSTimingCalibration > parseTotemUFSDJsonFile() const
Extract calibration data from JSON file (TOTEM vertical)
static void fillDescriptions(edm::ConfigurationDescriptions &)