#include <RunDCSHVDat.h>
Public Types | |
typedef oracle::occi::ResultSet | ResultSet |
Public Member Functions | |
std::string | getEBAccount () |
std::string | getEEAccount () |
float | getHV () const |
float | getHVNominal () const |
int | getStatus () const |
std::string | getTable () |
int | getTimeStatus () |
RunDCSHVDat () | |
void | setHV (float t) |
void | setHVNominal (float t) |
void | setStatus (int t) |
void | setTimeStatus (int t) |
~RunDCSHVDat () | |
Static Public Attributes | |
static const int | HVNOTNOMINAL = 1 |
static const int | HVOFF = 2 |
static const int | maxDifference = 30*60*1000000 |
static const int | maxHVDifferenceEB = 300 |
static const int | maxHVDifferenceEE = 5000 |
static const int | minHV = 10000 |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunDCSHVDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | fetchHistoricalData (std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > > *fillMap, Tm timeStart) throw (std::runtime_error) |
void | fetchLastData (std::map< EcalLogicID, RunDCSHVDat > *fillMap) throw (std::runtime_error) |
void | fillTheMap (ResultSet *, std::map< EcalLogicID, RunDCSHVDat > *) |
void | fillTheMapByTime (ResultSet *rset, std::list< DataReducer< RunDCSHVDat >::MyData< RunDCSHVDat > > *my_data_list) |
ResultSet * | getBarrelRset () |
ResultSet * | getBarrelRset (Tm timeStart) |
ResultSet * | getEndcapAnodeRset () |
ResultSet * | getEndcapAnodeRset (Tm timestart) |
ResultSet * | getEndcapDynodeRset (Tm timestart) |
ResultSet * | getEndcapDynodeRset () |
int | nowMicroseconds () |
void | prepareWrite () throw (std::runtime_error) |
void | setStatusForBarrel (RunDCSHVDat &, Tm) |
void | setStatusForEndcaps (RunDCSHVDat &, Tm) |
void | writeDB (const EcalLogicID *ecid, const RunDCSHVDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
float | m_hv |
float | m_hvnom |
int | m_status |
int | m_tstatus |
Friends | |
class | EcalCondDBInterface |
Definition at line 15 of file RunDCSHVDat.h.
Definition at line 17 of file RunDCSHVDat.h.
RunDCSHVDat::RunDCSHVDat | ( | ) |
Definition at line 15 of file RunDCSHVDat.cc.
References NULL.
RunDCSHVDat::~RunDCSHVDat | ( | ) |
Definition at line 30 of file RunDCSHVDat.cc.
{ }
void RunDCSHVDat::fetchData | ( | std::map< EcalLogicID, RunDCSHVDat > * | fillMap, |
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
void RunDCSHVDat::fetchHistoricalData | ( | std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > > * | fillMap, |
Tm | timeStart | ||
) | throw (std::runtime_error) [private] |
Definition at line 381 of file RunDCSHVDat.cc.
References alignCSCRings::e, edm::pset::fillMap(), DataReducer< T >::getReducedDataList(), AlCaHLTBitMon_ParallelJobs::p, and DataReducer< T >::setDataList().
{ this->checkConnection(); fillMap->clear(); std::list< DataReducer<RunDCSHVDat>::MyData<RunDCSHVDat> > my_data_list; try { std::pair< EcalLogicID, RunDCSHVDat > p; RunDCSHVDat dat; ResultSet* rset1 = getBarrelRset(timeStart); fillTheMapByTime(rset1, &my_data_list); ResultSet* rset2 = getEndcapAnodeRset(timeStart); fillTheMapByTime(rset2, &my_data_list); ResultSet* rset3 = getEndcapDynodeRset(timeStart); fillTheMapByTime(rset3, &my_data_list); DataReducer<RunDCSHVDat> my_dr; my_dr.setDataList(my_data_list); my_dr.getReducedDataList(fillMap); } catch (SQLException &e) { throw(std::runtime_error("RunDCSHVDat::fetchData(): "+e.getMessage())); } }
void RunDCSHVDat::fetchLastData | ( | std::map< EcalLogicID, RunDCSHVDat > * | fillMap | ) | throw (std::runtime_error) [private] |
void RunDCSHVDat::fillTheMap | ( | ResultSet * | , |
std::map< EcalLogicID, RunDCSHVDat > * | |||
) | [private] |
void RunDCSHVDat::fillTheMapByTime | ( | ResultSet * | rset, |
std::list< DataReducer< RunDCSHVDat >::MyData< RunDCSHVDat > > * | my_data_list | ||
) | [private] |
Definition at line 244 of file RunDCSHVDat.cc.
References prof2calltree::count, gather_cfg::cout, alignCSCRings::e, getHV(), EcalLogicID::getID1(), EcalLogicID::getID2(), EcalLogicID::getName(), AlCaHLTBitMon_ParallelJobs::p, createTree::pp, setHV(), setHVNominal(), setStatus(), Tm::setToString(), and Tm::str().
{ // std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > >* fillMap) { // method for historic queries RunDCSHVDat dat; DateHandler dh(m_env, m_conn); try { int count=-1; while(rset->next()) { EcalLogicID ec = EcalLogicID( rset->getString(1), // name rset->getInt(2), // logic_id rset->getInt(3), // id1 rset->getInt(4), // id2 rset->getInt(5), // id3 rset->getString(6)); // maps_to dat.setHV( rset->getFloat(7) ); dat.setHVNominal( rset->getFloat(8) ); // Date sinceDate = rset->getDate(9); // Tm sinceTm = dh.dateToTm( sinceDate ); // Date sinceDate = rset->getDate(9); Timestamp ora_timestamp = rset->getTimestamp(9); Tm sinceTm; // YYYY-MM-DD HH:MM:SS sinceTm.setToString(ora_timestamp.toText("yyyy-mm-dd hh24:mi:ss",0)); dat.setStatus(0); if (ec.getName() == "EB_HV_channel") { setStatusForBarrel(dat, sinceTm); } else { setStatusForEndcaps(dat, sinceTm); } std::pair< EcalLogicID, RunDCSHVDat > d; d.first=ec; d.second=dat; std::pair< Tm, std::pair< EcalLogicID, RunDCSHVDat > > p; p.first=sinceTm; p.second = d; DataReducer<RunDCSHVDat>::MyData<RunDCSHVDat> pp; pp.m_iData=p; my_data_list->push_back(pp); count++; if(count<100) std::cout<<"DCS DB : size:"<< my_data_list->size()<<" Tm " <<sinceTm.str()<<" "<<ec.getID1()<<" "<<ec.getID2()<<" "<<dat.getHV()<<std::endl; } std::cout<<"DCS DB : size:"<< my_data_list->size()<<std::endl; } catch (SQLException &e) { throw(std::runtime_error("RunDCSHVDat::fetchData(): "+e.getMessage())); } }
ResultSet * RunDCSHVDat::getBarrelRset | ( | ) | [private] |
Definition at line 153 of file RunDCSHVDat.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, h.nominal_value , d.CHANGE_DATE " "FROM "+ getEBAccount()+".FWCAENCHANNEL_LV d " " JOIN "+ getEBAccount()+".HV_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='ACTUAL_VMON' "; try { m_readStmt->setSQL(query); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSHVDat::getBarrelRset(): " + e.getMessage() + " " + query)); } return rset; }
Definition at line 61 of file RunDCSHVDat.cc.
References alignCSCRings::e, NULL, o2o::query, and DateHandler::tmToDate().
{ DateHandler dh(m_env, m_conn); ResultSet* rset = NULL; string query="SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " " d.actual_vmon, h.nominal_value , d.change_date " " FROM "+ getEBAccount()+".FWCAENCHANNEL d " " JOIN "+ getEBAccount()+".HV_MAPPING h on h.DPID = d.DPID " " join "+ getEBAccount()+".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name " " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date " ; try { m_readStmt->setSQL(query); m_readStmt->setDate(1, dh.tmToDate(timeStart)); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSHVDat::getBarrelRset(): " + e.getMessage() + " " + query)); } return rset; }
std::string RunDCSHVDat::getEBAccount | ( | ) | [inline] |
Definition at line 33 of file RunDCSHVDat.h.
{ return "CMS_ECAL_HV_PVSS_COND"; }
std::string RunDCSHVDat::getEEAccount | ( | ) | [inline] |
Definition at line 34 of file RunDCSHVDat.h.
{ return "CMS_EE_HV_PVSS_COND"; }
Definition at line 85 of file RunDCSHVDat.cc.
References alignCSCRings::e, NULL, o2o::query, and DateHandler::tmToDate().
{ DateHandler dh(m_env, m_conn); ResultSet* rset = NULL; string query="SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " " d.actual_vmon, '800' nominal_value , d.change_date " " FROM "+ getEEAccount()+".FWCAENCHANNEL d " " JOIN "+ getEEAccount()+".EE_HVA_MAPPING h on h.DPID = d.DPID " " join "+ getEEAccount()+".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name " " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date " ; try { m_readStmt->setSQL(query); m_readStmt->setDate(1, dh.tmToDate(timeStart)); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSHVDat::getBarrelRset(): " + e.getMessage() + " " + query)); } return rset; }
ResultSet * RunDCSHVDat::getEndcapAnodeRset | ( | ) | [private] |
Definition at line 170 of file RunDCSHVDat.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, '800' NOMINAL_VALUE , d.CHANGE_DATE " "FROM "+ getEEAccount()+".FWCAENCHANNEL_LV d " " JOIN "+ getEEAccount()+".EE_HVA_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='ACTUAL_VMON' "; try { m_readStmt->setSQL(query); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSHVDat::getEndcapAnodeRset(): " + e.getMessage() + " " + query)); } return rset; }
ResultSet * RunDCSHVDat::getEndcapDynodeRset | ( | ) | [private] |
Definition at line 187 of file RunDCSHVDat.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, '600' NOMINAL_VALUE , d.CHANGE_DATE " "FROM "+ getEEAccount()+".FWCAENCHANNEL_LV d " " JOIN "+ getEEAccount()+".EE_HVD_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='ACTUAL_VMON' "; try { m_readStmt->setSQL(query); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSHVDat::getEndcapDynodeRset(): " + e.getMessage() + " " + query)); } return rset; }
Definition at line 109 of file RunDCSHVDat.cc.
References alignCSCRings::e, NULL, o2o::query, and DateHandler::tmToDate().
{ DateHandler dh(m_env, m_conn); ResultSet* rset = NULL; string query="SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " " d.actual_vmon, '600' nominal_value , d.change_date " " FROM "+ getEEAccount()+".FWCAENCHANNEL d " " JOIN "+ getEEAccount()+".EE_HVD_MAPPING h on h.DPID = d.DPID " " join "+ getEEAccount()+".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name " " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date " ; try { m_readStmt->setSQL(query); m_readStmt->setDate(1, dh.tmToDate(timeStart)); rset = m_readStmt->executeQuery(); } catch (SQLException e) { throw(std::runtime_error("RunDCSHVDat::getBarrelRset(): " + e.getMessage() + " " + query)); } return rset; }
float RunDCSHVDat::getHV | ( | ) | const [inline] |
Definition at line 38 of file RunDCSHVDat.h.
References m_hv.
Referenced by fillTheMapByTime(), popcon::EcalDCSHandler::insertHVDataSetToOffline(), popcon::EcalDCSHandler::printHVDataSet(), setStatusForBarrel(), and setStatusForEndcaps().
{ return m_hv; }
float RunDCSHVDat::getHVNominal | ( | ) | const [inline] |
Definition at line 39 of file RunDCSHVDat.h.
References m_hvnom.
Referenced by popcon::EcalDCSHandler::insertHVDataSetToOffline(), popcon::EcalDCSHandler::printHVDataSet(), setStatusForBarrel(), and setStatusForEndcaps().
{ return m_hvnom; }
int RunDCSHVDat::getStatus | ( | void | ) | const [inline] |
Definition at line 40 of file RunDCSHVDat.h.
References m_status.
Referenced by popcon::EcalDCSHandler::printHVDataSet(), and popcon::EcalDCSHandler::updateHV().
{ return m_status; }
std::string RunDCSHVDat::getTable | ( | ) | [inline, virtual] |
int RunDCSHVDat::getTimeStatus | ( | ) | [inline] |
int RunDCSHVDat::nowMicroseconds | ( | ) | [private] |
Definition at line 305 of file RunDCSHVDat.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 RunDCSHVDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
void RunDCSHVDat::setHV | ( | float | t | ) | [inline] |
Definition at line 35 of file RunDCSHVDat.h.
References m_hv, and lumiQTWidget::t.
Referenced by RunDCSMagnetDat::fillTheMap(), and fillTheMapByTime().
void RunDCSHVDat::setHVNominal | ( | float | t | ) | [inline] |
Definition at line 37 of file RunDCSHVDat.h.
References m_hvnom, and lumiQTWidget::t.
Referenced by RunDCSMagnetDat::fillTheMap(), and fillTheMapByTime().
void RunDCSHVDat::setStatus | ( | int | t | ) | [inline] |
Definition at line 36 of file RunDCSHVDat.h.
References m_status, and lumiQTWidget::t.
Referenced by RunDCSMagnetDat::fillTheMap(), fillTheMapByTime(), setStatusForBarrel(), and setStatusForEndcaps().
void RunDCSHVDat::setStatusForBarrel | ( | RunDCSHVDat & | dat, |
Tm | sinceTm | ||
) | [private] |
Definition at line 315 of file RunDCSHVDat.cc.
References getHV(), getHVNominal(), Tm::microsTime(), query::result, setStatus(), and setTimeStatus().
{ int t_now_gmt_micros = nowMicroseconds(); float hv_diff=dat.getHV() - dat.getHVNominal(); if(hv_diff<0) hv_diff=-hv_diff; if (hv_diff*1000 > maxHVDifferenceEB) { dat.setStatus(HVNOTNOMINAL); } if (dat.getHV()*1000 < minHV) { dat.setStatus(HVOFF); } int result=0; long long d= (t_now_gmt_micros - sinceTm.microsTime()) ; if (d> maxDifference) { result= -d/1000000 ; } dat.setTimeStatus(result); }
void RunDCSHVDat::setStatusForEndcaps | ( | RunDCSHVDat & | dat, |
Tm | sinceTm | ||
) | [private] |
Definition at line 337 of file RunDCSHVDat.cc.
References getHV(), getHVNominal(), Tm::microsTime(), query::result, setStatus(), and setTimeStatus().
{ int t_now_gmt_micros = nowMicroseconds(); if (fabs(dat.getHV() - dat.getHVNominal())*1000 > maxHVDifferenceEE) { dat.setStatus(HVNOTNOMINAL); } if (dat.getHV()*1000 < minHV) { dat.setStatus(HVOFF); } int result=0; long long d= (t_now_gmt_micros - sinceTm.microsTime()) ; if (d> maxDifference) { result= -d/1000000 ; } dat.setTimeStatus(result); }
void RunDCSHVDat::setTimeStatus | ( | int | t | ) | [inline] |
Definition at line 42 of file RunDCSHVDat.h.
References m_tstatus, and lumiQTWidget::t.
Referenced by setStatusForBarrel(), and setStatusForEndcaps().
void RunDCSHVDat::writeDB | ( | const EcalLogicID * | ecid, |
const RunDCSHVDat * | item, | ||
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 45 of file RunDCSHVDat.cc.
{ }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 27 of file RunDCSHVDat.h.
const int RunDCSHVDat::HVNOTNOMINAL = 1 [static] |
Definition at line 24 of file RunDCSHVDat.h.
Referenced by popcon::EcalDCSHandler::updateHV().
const int RunDCSHVDat::HVOFF = 2 [static] |
Definition at line 25 of file RunDCSHVDat.h.
Referenced by popcon::EcalDCSHandler::updateHV().
float RunDCSHVDat::m_hv [private] |
Definition at line 77 of file RunDCSHVDat.h.
float RunDCSHVDat::m_hvnom [private] |
Definition at line 78 of file RunDCSHVDat.h.
Referenced by getHVNominal(), and setHVNominal().
int RunDCSHVDat::m_status [private] |
Definition at line 79 of file RunDCSHVDat.h.
Referenced by getStatus(), and setStatus().
int RunDCSHVDat::m_tstatus [private] |
Definition at line 80 of file RunDCSHVDat.h.
Referenced by getTimeStatus(), and setTimeStatus().
const int RunDCSHVDat::maxDifference = 30*60*1000000 [static] |
Definition at line 19 of file RunDCSHVDat.h.
const int RunDCSHVDat::maxHVDifferenceEB = 300 [static] |
Definition at line 20 of file RunDCSHVDat.h.
const int RunDCSHVDat::maxHVDifferenceEE = 5000 [static] |
Definition at line 21 of file RunDCSHVDat.h.
const int RunDCSHVDat::minHV = 10000 [static] |
Definition at line 22 of file RunDCSHVDat.h.