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__ <<
"]: "
73 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: "
74 <<
"Loading tag for B " << ( isBOn ?
"ON" :
"OFF" ) <<
": "
76 <<
" and IOV valid for run number: " <<
m_run << std::endl;
81 <<
", IOV valid for run number " <<
m_run <<
" starting from: " << currentIov.
since
82 <<
", with corresponding payload hash: " << currentIov.
payloadId
84 if( currentIov.
payloadId != this->tagInfo().lastPayloadToken ) {
85 std::ostringstream
ss;
86 ss <<
"Exporting payload with hash " << currentIov.
payloadId
87 <<
" corresponding to the calibrations for magnetic field "
88 << ( isBOn ?
"ON" :
"OFF" )
89 <<
" starting from run number: " <<
m_run;
90 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: "
91 << ss.str() << std::endl;
96 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: "
97 <<
"The payload with hash " << currentIov.
payloadId
98 <<
" corresponding to the calibrations for magnetic field "
99 << ( isBOn ?
"ON" :
"OFF" )
100 <<
" is still valid for run " <<
m_run
101 <<
" in the destination tag " << this->
tagInfo().
name
102 <<
".\nNo transfer needed." <<std::endl;
109 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: "
110 <<
"Destination Tag Info: name " << this->
tagInfo().
name
119 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: "
122 <<
" the run proposed for insertion " <<
m_run
123 <<
". No transfer needed." << std::endl;
128 edm::LogInfo(
"PopConBTransitionSourceHandler" ) <<
"[" <<
"PopConBTransitionSourceHandler::" << __func__ <<
"]: "
129 <<
"END." << std::endl;
146 #endif //PopConBTransitionSourceHandler_H
virtual void getNewObjects() overridefinal
std::string m_userTextLog
double m_currentThreshold
virtual ~PopConBTransitionSourceHandler()
void start(bool readOnly=true)
std::string m_tagForRunInfo
Transaction & transaction()
OldContainer m_to_transfer
void setParameters(const edm::ParameterSet &connectionPset)
cond::ValidityInterval lastInterval
IOVProxy readIov(const std::string &tag, bool full=false)
Iterator find(cond::Time_t time)
virtual void getObjectsForBTransition(bool isBOn)
cond::persistency::ConnectionPool m_connection
PopConBTransitionSourceHandler(edm::ParameterSet const &pset)
std::string lastPayloadToken
Session createReadOnlySession(const std::string &connectionString, const std::string &transactionId)
std::string m_connectionString
edm::ParameterSet m_connectionPset
virtual std::string id() const overridefinal
tuple size
Write out results.
cond::TagInfo_t const & tagInfo() const
std::shared_ptr< T > fetchPayload(const cond::Hash &payloadHash)