9 using namespace oracle::occi;
33 throw(std::runtime_error)
42 throw(std::runtime_error)
49 throw(std::runtime_error)
51 fetchLastData(fillMap);
57 string query =
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
58 " d.value_number , '5' NOMINAL_VALUE , d.VALUE_TIMESTAMP "
59 "FROM "+ getEBAccount()+
".FWWIENERMARATHONCHANNEL_LV d "
60 " JOIN "+ getEBAccount()+
".LV_MAPPING h on "
61 " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and dpe_name='MEASUREMENTSENSEVOLTAGE' ";
63 m_readStmt->setSQL(query);
64 rset = m_readStmt->executeQuery();
67 throw(std::runtime_error(
"RunDCSLVDat::getBarrelRset(): " + e.getMessage() +
" " +
query));
74 string query =
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
75 " d.VALUE_NUMBER, '5' NOMINAL_VALUE , d.VALUE_TIMESTAMP "
76 "FROM "+ getEEAccount()+
".FWWIENERMARATHONCHANNEL_LV d "
77 " JOIN "+ getEEAccount()+
".EE_LV_MAPPING h on "
78 " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and dpe_name='MEASUREMENTSENSEVOLTAGE' ";
80 m_readStmt->setSQL(query);
81 rset = m_readStmt->executeQuery();
84 throw(std::runtime_error(
"RunDCSLVDat::getEndcapRset(): " + e.getMessage() +
" " +
query));
90 map< EcalLogicID, RunDCSLVDat >* fillMap) {
91 std::pair< EcalLogicID, RunDCSLVDat >
p;
104 dat.
setLV( rset->getFloat(7) );
106 Date sinceDate = rset->getDate(9);
109 if (p.first.getName() ==
"EB_LV_channel") {
110 setStatusForBarrel(dat, sinceTm);
112 setStatusForEndcaps(dat, sinceTm);
119 throw(std::runtime_error(
"RunDCSLVDat::fetchData(): "+e.getMessage()));
127 int t_now_gmt_micros = t_now_gmt.
microsTime();
128 return t_now_gmt_micros;
133 int t_now_gmt_micros = nowMicroseconds();
138 if (dat.
getLV()*1000 < minLV) {
143 int d= ((int)t_now_gmt_micros - (
int)sinceTm.
microsTime()) ;
144 if (d> maxDifference) {
153 int t_now_gmt_micros = nowMicroseconds();
158 if (dat.
getLV()*1000 < minLV) {
163 int d= ((int)t_now_gmt_micros - (
int)sinceTm.
microsTime()) ;
164 if (d> maxDifference) {
173 throw(std::runtime_error)
175 this->checkConnection();
180 std::pair< EcalLogicID, RunDCSLVDat >
p;
185 fillTheMap(rset, fillMap);
186 rset = getEndcapRset();
188 fillTheMap(rset, fillMap);
191 throw(std::runtime_error(
"RunDCSLVDat::fetchData(): "+e.getMessage()));
void setToCurrentGMTime()
oracle::occi::SQLException SQLException
uint64_t microsTime() const
void writeDB(const EcalLogicID *ecid, const RunDCSLVDat *item, RunIOV *iov)
float getLVNominal() const
void fetchLastData(std::map< EcalLogicID, RunDCSLVDat > *fillMap)
void fetchData(std::map< EcalLogicID, RunDCSLVDat > *fillMap, RunIOV *iov)
oracle::occi::ResultSet ResultSet
void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSLVDat > *)
void setStatusForEndcaps(RunDCSLVDat &, const Tm &)
static std::vector< std::string > checklist dat
ResultSet * getBarrelRset()
ResultSet * getEndcapRset()
void setLVNominal(float t)
Tm dateToTm(oracle::occi::Date &date) const
void setTimeStatus(int t)
void setStatusForBarrel(RunDCSLVDat &, const Tm &)