105 strftime(timeStr, 50,
"%F %T", localtime(&unixTime));
107 LogInfo(
"PPS") <<
">> CTPPSRPAlignmentCorrectionsDataESSourceXML::setIntervalFor(" <<
key.name() <<
")";
109 LogInfo(
"PPS") <<
" event=" << iosv.
eventID() <<
", UNIX timestamp=" << unixTime <<
" (" << timeStr <<
")";
116 if (strcmp(
key.name(),
"CTPPSRPAlignmentCorrectionsDataRcd") == 0) {
121 if (strcmp(
key.name(),
"RPRealAlignmentRecord") == 0) {
126 if (strcmp(
key.name(),
"RPMisalignedAlignmentRecord") == 0) {
131 if (p_corr ==
nullptr)
132 throw cms::Exception(
"CTPPSRPAlignmentCorrectionsDataESSourceXML::setIntervalFor")
133 <<
"Unknown record " <<
key.name();
136 bool next_exists =
false;
140 for (
const auto &it : *p_seq) {
141 const auto &it_event_first = it.first.first().eventID();
142 const auto &it_event_last = it.first.last().eventID();
144 bool it_contained_lo = ((it_event_first.run() < event_curr.
run()) ||
145 ((it_event_first.run() == event_curr.
run()) &&
148 bool it_contained_up = ((it_event_last.run() > event_curr.
run()) ||
149 ((it_event_last.run() == event_curr.
run()) &&
152 if (it_contained_lo && it_contained_up) {
157 LogInfo(
"PPS") <<
" setting validity interval [" 165 bool it_in_future = ((it_event_first.run() > event_curr.
run()) ||
166 ((it_event_first.run() == event_curr.
run() &&
171 if (event_next_start > it_event_first)
172 event_next_start = it_event_first;
187 LogInfo(
"PPS") <<
" setting validity interval [" 190 <<
"] (empty alignment corrections)";
const IOVSyncValue & last() const
const IOVSyncValue & first() const
static RunNumber_t maxRunNumber()
Time sequence of alignment corrections. I/O methods have been factored out to: CondFormats/PPSObjects...
static const IOVSyncValue & endOfTime()
std::pair< Time_t, Time_t > ValidityInterval
LuminosityBlockNumber_t luminosityBlock() const
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
std::unique_ptr< CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon > ctppsRPAlignmentCorrectionsDataESSourceXMLCommon
static std::string iovValueToString(const edm::IOVSyncValue &)
Log< level::Info, false > LogInfo
const EventID & eventID() const
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
const Timestamp & time() const
unsigned int unixTime() const
Time in seconds since January 1, 1970.