1 #ifndef PopConBTransitionSourceHandler_H 2 #define PopConBTransitionSourceHandler_H 19 .getUntrackedParameter<double>(
"currentThreshold", 18000.)),
28 <<
"PopConBTransitionSourceHandler:" << __func__ <<
"]: " 29 <<
"Initialising Connection Pool" << std::endl;
46 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 47 <<
"Loading tag for RunInfo " <<
m_tagForRunInfo <<
" and IOV valid for run number: " <<
m_run << std::endl;
50 LogDebug(
"PopConBTransitionSourceHandler")
52 <<
", IOV valid for run number " <<
m_run <<
" starting from: " << currentIov.
since 53 <<
", with corresponding payload hash: " << currentIov.
payloadId << std::endl;
55 double current_default = -1;
56 double avg_current = current_default;
58 LogDebug(
"PopConBTransitionSourceHandler")
59 <<
"Comparing value of magnet current: " << avg_current <<
" A for run: " <<
m_run 66 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 67 <<
"The magnet was " << (isBOn ?
"ON" :
"OFF") <<
" during run " <<
m_run << std::endl;
78 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 80 <<
" and IOV valid for run number: " <<
m_run << std::endl;
83 LogDebug(
"PopConBTransitionSourceHandler")
85 <<
" with size: " << iov.
loadedSize() <<
", IOV valid for run number " <<
m_run 86 <<
" starting from: " << currentIov.
since <<
", with corresponding payload hash: " << currentIov.
payloadId 89 if (currentIov.
payloadId != this->tagInfo().lastInterval.payloadId) {
90 std::ostringstream
ss;
91 ss <<
"Adding iov with since " <<
m_run <<
" pointing to hash " << currentIov.
payloadId 92 <<
" corresponding to the calibrations for magnetic field " << (isBOn ?
"ON" :
"OFF");
95 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " <<
ss.str() << std::endl;
98 editor = session.
editIov(destTag);
101 editor.
setDescription(
"Tag created by PopConBTransitionSourceHandler");
109 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 110 <<
"The payload with hash " << currentIov.
payloadId 111 <<
" corresponding to the calibrations for magnetic field " << (isBOn ?
"ON" :
"OFF")
112 <<
" is still valid for run " <<
m_run <<
" in the destination tag " << destTag <<
".\nNo transfer needed." 122 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 133 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 136 <<
" the run proposed for insertion " <<
m_run <<
". No transfer needed." << std::endl;
142 <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 143 <<
"END." << std::endl;
160 #endif //PopConBTransitionSourceHandler_H
std::string m_userTextLog
double m_currentThreshold
std::string m_tagForRunInfo
IOVEditor createIov(const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
std::unique_ptr< T > fetchPayload(const cond::Hash &payloadHash)
void setDescription(const std::string &description)
Transaction & transaction()
void setParameters(const edm::ParameterSet &connectionPset)
cond::TagInfo_t const & tagInfo() const
std::string id() const final
cond::Iov_t getInterval(cond::Time_t time)
virtual void getObjectsForBTransition(bool isBOn)
cond::persistency::ConnectionPool m_connection
cond::Tag_t tagInfo() const
PopConBTransitionSourceHandler(edm::ParameterSet const &pset)
IOVProxy readIov(const std::string &tag)
IOVEditor editIov(const std::string &tag)
Log< level::Info, false > LogInfo
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
~PopConBTransitionSourceHandler() override
bool existsIov(const std::string &tag)
void getNewObjects() final
cond::persistency::Session & dbSession() const
std::string m_connectionString
edm::ParameterSet m_connectionPset