1 #ifndef PopConBTransitionSourceHandler_H 2 #define PopConBTransitionSourceHandler_H 17 m_run( pset.getParameter<
edm::
ParameterSet>(
"BTransition" ).getParameter<unsigned long long>(
"runNumber" ) ),
24 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler:" << __func__ <<
"]: " 25 <<
"Initialising Connection Pool" << std::endl;
38 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 42 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 44 <<
" and IOV valid for run number: " <<
m_run << std::endl;
49 <<
", IOV valid for run number " <<
m_run <<
" starting from: " << currentIov.
since 50 <<
", with corresponding payload hash: " << currentIov.
payloadId 53 double current_default = -1;
54 double avg_current = current_default;
56 LogDebug(
"PopConBTransitionSourceHandler" ) <<
"Comparing value of magnet current: " << avg_current <<
" A for run: " <<
m_run 59 if( avg_current != current_default && avg_current <=
m_currentThreshold ) isBOn =
false;
60 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 61 <<
"The magnet was " << ( isBOn ?
"ON" :
"OFF" )
62 <<
" during run " <<
m_run << std::endl;
69 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 74 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 75 <<
"Loading tag for B " << ( isBOn ?
"ON" :
"OFF" ) <<
": " 77 <<
" and IOV valid for run number: " <<
m_run << std::endl;
82 <<
", IOV valid for run number " <<
m_run <<
" starting from: " << currentIov.
since 83 <<
", with corresponding payload hash: " << currentIov.
payloadId 86 if( currentIov.
payloadId != this->tagInfo().lastPayloadToken ) {
87 std::ostringstream ss;
88 ss <<
"Adding iov with since "<<
m_run<<
" pointing to hash " << currentIov.
payloadId 89 <<
" corresponding to the calibrations for magnetic field " 90 << ( isBOn ?
"ON" :
"OFF" );
91 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 92 << ss.str() << std::endl;
98 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 99 <<
"The payload with hash " << currentIov.
payloadId 100 <<
" corresponding to the calibrations for magnetic field " 101 << ( isBOn ?
"ON" :
"OFF" )
102 <<
" is still valid for run " <<
m_run 103 <<
" in the destination tag " << destTag
104 <<
".\nNo transfer needed." <<std::endl;
111 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 112 <<
"Destination Tag Info: name " << this->
tagInfo().
name 121 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 124 <<
" the run proposed for insertion " <<
m_run 125 <<
". No transfer needed." << std::endl;
130 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: " 131 <<
"END." << std::endl;
148 #endif //PopConBTransitionSourceHandler_H
std::string m_userTextLog
double m_currentThreshold
virtual void getNewObjects() override final
virtual ~PopConBTransitionSourceHandler()
void start(bool readOnly=true)
std::string m_tagForRunInfo
Transaction & transaction()
void setParameters(const edm::ParameterSet &connectionPset)
cond::ValidityInterval lastInterval
IOVProxy readIov(const std::string &tag, bool full=false)
virtual std::string id() const override final
Iterator find(cond::Time_t time)
void start(bool readOnly=true)
Session createSession(const std::string &connectionString, bool writeCapable=false)
virtual void getObjectsForBTransition(bool isBOn)
cond::persistency::ConnectionPool m_connection
PopConBTransitionSourceHandler(edm::ParameterSet const &pset)
IOVEditor editIov(const std::string &tag)
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
std::string lastPayloadToken
Session createReadOnlySession(const std::string &connectionString, const std::string &transactionId)
std::string m_connectionString
edm::ParameterSet m_connectionPset
cond::TagInfo_t const & tagInfo() const
std::shared_ptr< T > fetchPayload(const cond::Hash &payloadHash)