29 std::vector< std::pair<SiStripDetVOff*,cond::Time_t> >
newPayloads;
35 m_condDb( iConfig.getParameter< std::
string >(
"conditionDatabase") ),
36 m_localCondDbFile( iConfig.getParameter< std::
string >(
"condDbFile") ),
37 m_targetTag( iConfig.getParameter< std::
string >(
"targetTag") ),
38 maxTimeBeforeNewIOV_( iConfig.getUntrackedParameter< int >(
"maxTimeBeforeNewIOV", 24) ){
51 boost::shared_ptr<SiStripDetVOff> lastPayload;
53 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
54 <<
"Retrieve last IOV from " <<
m_condDb;
57 if ( m_condDb.find(
"sqlite")==0 && (!condDbSession.
existsDatabase()) ){
59 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
60 <<
"No information can be retrieved from " << m_condDb <<
" because the file is empty.\n"
61 <<
"Will assume all HV/LV's are off.";
65 if ( !lastPayloadHash.empty() ) {
69 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
70 <<
" ... last IOV: " << lastIov <<
" , " <<
"last Payload: " << lastPayloadHash;
79 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
80 <<
"Finished building " <<
newPayloads.size() <<
" new payloads.";
83 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
89 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
90 <<
"No HV/LV transition was found from PVSS query.";
91 bool forceNewIOV =
true;
100 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
101 <<
" ... No payload transfered.";
103 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
104 <<
" ... The last IOV is too old. Will start a new IOV from " <<
newPayloads[0].second
111 edm::LogWarning(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
120 iovEditor.
insert( payload.second, thePayloadHash );
125 edm::LogInfo(
"SiStripDetVOffHandler") <<
"[SiStripDetVOffHandler::" << __func__ <<
"] "
126 << newPayloads.size() <<
" payloads written to sqlite file.";
T getParameter(std::string const &) const
std::vector< std::pair< SiStripDetVOff *, cond::Time_t > > getModulesVOff()
#define DEFINE_FWK_MODULE(type)
boost::shared_ptr< T > fetchPayload(const cond::Hash &payloadHash)
void start(bool readOnly=true)
IOVEditor createIov(const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
void setDescription(const std::string &description)
Transaction & transaction()
void setParameters(const edm::ParameterSet &connectionPset)
U second(std::pair< T, U > const &p)
std::vector< std::pair< SiStripDetVOff *, cond::Time_t > > newPayloads
IOVProxy readIov(const std::string &tag, bool full=false)
unsigned long long Time_t
edm::Service< SiStripDetVOffBuilder > modHVBuilder
Session createSession(const std::string &connectionString, bool writeCapable=false)
cond::persistency::ConnectionPool m_connectionPool
IOVEditor editIov(const std::string &tag)
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
bool existsIov(const std::string &tag)
void setLastSiStripDetVOff(SiStripDetVOff *lastPayload, cond::Time_t lastTimeStamp)
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
SiStripDetVOffHandler SiStripO2ODetVOff
SiStripDetVOffHandler(const edm::ParameterSet &iConfig)
std::string m_localCondDbFile
virtual ~SiStripDetVOffHandler()
boost::posix_time::ptime to_boost(Time_t iValue)
virtual void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup)