#include <RunDCSLVDat.h>
Public Types | |
typedef oracle::occi::ResultSet | ResultSet |
Public Member Functions | |
std::string | getEBAccount () |
std::string | getEEAccount () |
float | getLV () const |
float | getLVNominal () const |
int | getStatus () const |
std::string | getTable () |
int | getTimeStatus () |
RunDCSLVDat () | |
void | setLV (float t) |
void | setLVNominal (float t) |
void | setStatus (int t) |
void | setTimeStatus (int t) |
~RunDCSLVDat () | |
Static Public Attributes | |
static const int | LVNOTNOMINAL = 1 |
static const int | LVOFF = 2 |
static const int | maxDifference = 30*60*1000000 |
static const int | maxLVDifferenceEB = 1000 |
static const int | maxLVDifferenceEE = 1000 |
static const int | minLV = 2000 |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunDCSLVDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | fetchLastData (std::map< EcalLogicID, RunDCSLVDat > *fillMap) throw (std::runtime_error) |
void | fillTheMap (ResultSet *, std::map< EcalLogicID, RunDCSLVDat > *) |
ResultSet * | getBarrelRset () |
ResultSet * | getEndcapRset () |
int | nowMicroseconds () |
void | prepareWrite () throw (std::runtime_error) |
void | setStatusForBarrel (RunDCSLVDat &, Tm) |
void | setStatusForEndcaps (RunDCSLVDat &, Tm) |
void | writeDB (const EcalLogicID *ecid, const RunDCSLVDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
float | m_lv |
float | m_lvnom |
int | m_status |
int | m_tstatus |
Friends | |
class | EcalCondDBInterface |
Definition at line 14 of file RunDCSLVDat.h.
Definition at line 16 of file RunDCSLVDat.h.
RunDCSLVDat::RunDCSLVDat | ( | ) |
Definition at line 11 of file RunDCSLVDat.cc.
References NULL.
RunDCSLVDat::~RunDCSLVDat | ( | ) |
Definition at line 26 of file RunDCSLVDat.cc.
{ }
void RunDCSLVDat::fetchData | ( | std::map< EcalLogicID, RunDCSLVDat > * | fillMap, |
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
void RunDCSLVDat::fetchLastData | ( | std::map< EcalLogicID, RunDCSLVDat > * | fillMap | ) | throw (std::runtime_error) [private] |
void RunDCSLVDat::fillTheMap | ( | ResultSet * | , |
std::map< EcalLogicID, RunDCSLVDat > * | |||
) | [private] |
ResultSet * RunDCSLVDat::getBarrelRset | ( | ) | [private] |
Definition at line 55 of file RunDCSLVDat.cc.
References alignCSCRings::e, NULL, and o2o::query.
{ ResultSet* rset = NULL; string query = "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " " d.value_number , '5' NOMINAL_VALUE , d.VALUE_TIMESTAMP " "FROM "+ getEBAccount()+".FWWIENERMARATHONCHANNEL_LV d " " JOIN "+ getEBAccount()+".LV_MAPPING h on " " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and dpe_name='MEASUREMENTSENSEVOLTAGE' "; try { m_readStmt->setSQL(query); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSLVDat::getBarrelRset(): " + e.getMessage() + " " + query)); } return rset; }
std::string RunDCSLVDat::getEBAccount | ( | ) | [inline] |
Definition at line 32 of file RunDCSLVDat.h.
{ return "CMS_ECAL_LV_PVSS_COND"; }
std::string RunDCSLVDat::getEEAccount | ( | ) | [inline] |
Definition at line 33 of file RunDCSLVDat.h.
{ return "CMS_ECAL_LV_PVSS_COND"; }
ResultSet * RunDCSLVDat::getEndcapRset | ( | ) | [private] |
Definition at line 72 of file RunDCSLVDat.cc.
References alignCSCRings::e, NULL, and o2o::query.
{ ResultSet* rset = NULL; string query = "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " " d.VALUE_NUMBER, '5' NOMINAL_VALUE , d.VALUE_TIMESTAMP " "FROM "+ getEEAccount()+".FWWIENERMARATHONCHANNEL_LV d " " JOIN "+ getEEAccount()+".EE_LV_MAPPING h on " " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and dpe_name='MEASUREMENTSENSEVOLTAGE' "; try { m_readStmt->setSQL(query); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSLVDat::getEndcapRset(): " + e.getMessage() + " " + query)); } return rset; }
float RunDCSLVDat::getLV | ( | ) | const [inline] |
Definition at line 37 of file RunDCSLVDat.h.
References m_lv.
Referenced by popcon::EcalDCSHandler::insertLVDataSetToOffline(), popcon::EcalDCSHandler::printLVDataSet(), setStatusForBarrel(), and setStatusForEndcaps().
{ return m_lv; }
float RunDCSLVDat::getLVNominal | ( | ) | const [inline] |
Definition at line 38 of file RunDCSLVDat.h.
References m_lvnom.
Referenced by popcon::EcalDCSHandler::insertLVDataSetToOffline(), popcon::EcalDCSHandler::printLVDataSet(), setStatusForBarrel(), and setStatusForEndcaps().
{ return m_lvnom; }
int RunDCSLVDat::getStatus | ( | void | ) | const [inline] |
Definition at line 39 of file RunDCSLVDat.h.
References m_status.
Referenced by popcon::EcalDCSHandler::printLVDataSet(), and popcon::EcalDCSHandler::updateLV().
{ return m_status; }
std::string RunDCSLVDat::getTable | ( | ) | [inline, virtual] |
int RunDCSLVDat::getTimeStatus | ( | ) | [inline] |
int RunDCSLVDat::nowMicroseconds | ( | ) | [private] |
Definition at line 123 of file RunDCSLVDat.cc.
References Tm::microsTime(), and Tm::setToCurrentGMTime().
{ Tm t_now_gmt; t_now_gmt.setToCurrentGMTime(); int t_now_gmt_micros = t_now_gmt.microsTime(); return t_now_gmt_micros; }
void RunDCSLVDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
void RunDCSLVDat::setLV | ( | float | t | ) | [inline] |
void RunDCSLVDat::setLVNominal | ( | float | t | ) | [inline] |
Definition at line 36 of file RunDCSLVDat.h.
References m_lvnom, and lumiQTWidget::t.
void RunDCSLVDat::setStatus | ( | int | t | ) | [inline] |
Definition at line 35 of file RunDCSLVDat.h.
References m_status, and lumiQTWidget::t.
Referenced by setStatusForBarrel(), and setStatusForEndcaps().
void RunDCSLVDat::setStatusForBarrel | ( | RunDCSLVDat & | dat, |
Tm | sinceTm | ||
) | [private] |
Definition at line 132 of file RunDCSLVDat.cc.
References getLV(), getLVNominal(), Tm::microsTime(), query::result, setStatus(), and setTimeStatus().
{ int t_now_gmt_micros = nowMicroseconds(); if (fabs(dat.getLV() - dat.getLVNominal())*1000 > maxLVDifferenceEB) { dat.setStatus(LVNOTNOMINAL); } if (dat.getLV()*1000 < minLV) { dat.setStatus(LVOFF); } int result=0; int d= ((int)t_now_gmt_micros - (int)sinceTm.microsTime()) ; if (d> maxDifference) { result= -d/1000000 ; } dat.setTimeStatus(result); }
void RunDCSLVDat::setStatusForEndcaps | ( | RunDCSLVDat & | dat, |
Tm | sinceTm | ||
) | [private] |
Definition at line 152 of file RunDCSLVDat.cc.
References getLV(), getLVNominal(), Tm::microsTime(), query::result, setStatus(), and setTimeStatus().
{ int t_now_gmt_micros = nowMicroseconds(); if (fabs(dat.getLV() - dat.getLVNominal())*1000 > maxLVDifferenceEE) { dat.setStatus(LVNOTNOMINAL); } if (dat.getLV()*1000 < minLV) { dat.setStatus(LVOFF); } int result=0; int d= ((int)t_now_gmt_micros - (int)sinceTm.microsTime()) ; if (d> maxDifference) { result= -d/1000000 ; } dat.setTimeStatus(result); }
void RunDCSLVDat::setTimeStatus | ( | int | t | ) | [inline] |
Definition at line 41 of file RunDCSLVDat.h.
References m_tstatus, and lumiQTWidget::t.
Referenced by setStatusForBarrel(), and setStatusForEndcaps().
void RunDCSLVDat::writeDB | ( | const EcalLogicID * | ecid, |
const RunDCSLVDat * | item, | ||
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 41 of file RunDCSLVDat.cc.
{ }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 26 of file RunDCSLVDat.h.
const int RunDCSLVDat::LVNOTNOMINAL = 1 [static] |
Definition at line 23 of file RunDCSLVDat.h.
Referenced by popcon::EcalDCSHandler::updateLV().
const int RunDCSLVDat::LVOFF = 2 [static] |
Definition at line 24 of file RunDCSLVDat.h.
Referenced by popcon::EcalDCSHandler::updateLV().
float RunDCSLVDat::m_lv [private] |
Definition at line 63 of file RunDCSLVDat.h.
float RunDCSLVDat::m_lvnom [private] |
Definition at line 64 of file RunDCSLVDat.h.
Referenced by getLVNominal(), and setLVNominal().
int RunDCSLVDat::m_status [private] |
Definition at line 65 of file RunDCSLVDat.h.
Referenced by getStatus(), and setStatus().
int RunDCSLVDat::m_tstatus [private] |
Definition at line 66 of file RunDCSLVDat.h.
Referenced by getTimeStatus(), and setTimeStatus().
const int RunDCSLVDat::maxDifference = 30*60*1000000 [static] |
Definition at line 18 of file RunDCSLVDat.h.
const int RunDCSLVDat::maxLVDifferenceEB = 1000 [static] |
Definition at line 19 of file RunDCSLVDat.h.
const int RunDCSLVDat::maxLVDifferenceEE = 1000 [static] |
Definition at line 20 of file RunDCSLVDat.h.
const int RunDCSLVDat::minLV = 2000 [static] |
Definition at line 21 of file RunDCSLVDat.h.