13 using namespace oracle::occi;
37 throw(std::runtime_error)
46 throw(std::runtime_error)
53 throw(std::runtime_error)
55 fetchLastData(fillMap);
66 string query=
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
67 " d.actual_vmon, h.nominal_value , d.change_date "
68 " FROM "+ getEBAccount()+
".FWCAENCHANNEL d "
69 " JOIN "+ getEBAccount()+
".HV_MAPPING h on h.DPID = d.DPID "
70 " join "+ getEBAccount()+
".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name "
71 " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date " ;
73 m_readStmt->setSQL(query);
75 m_readStmt->setDate(1, dh.
tmToDate(timeStart));
77 rset = m_readStmt->executeQuery();
80 throw(std::runtime_error(
"RunDCSHVDat::getBarrelRset(): " + e.getMessage() +
" " +
query));
90 string query=
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
91 " d.actual_vmon, '800' nominal_value , d.change_date "
92 " FROM "+ getEEAccount()+
".FWCAENCHANNEL d "
93 " JOIN "+ getEEAccount()+
".EE_HVA_MAPPING h on h.DPID = d.DPID "
94 " join "+ getEEAccount()+
".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name "
95 " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date " ;
97 m_readStmt->setSQL(query);
99 m_readStmt->setDate(1, dh.
tmToDate(timeStart));
101 rset = m_readStmt->executeQuery();
104 throw(std::runtime_error(
"RunDCSHVDat::getBarrelRset(): " + e.getMessage() +
" " +
query));
114 string query=
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
115 " d.actual_vmon, '600' nominal_value , d.change_date "
116 " FROM "+ getEEAccount()+
".FWCAENCHANNEL d "
117 " JOIN "+ getEEAccount()+
".EE_HVD_MAPPING h on h.DPID = d.DPID "
118 " join "+ getEEAccount()+
".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name "
119 " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date " ;
121 m_readStmt->setSQL(query);
123 m_readStmt->setDate(1, dh.
tmToDate(timeStart));
125 rset = m_readStmt->executeQuery();
128 throw(std::runtime_error(
"RunDCSHVDat::getBarrelRset(): " + e.getMessage() +
" " +
query));
155 string query =
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
156 " d.VALUE_NUMBER, h.nominal_value , d.CHANGE_DATE "
157 "FROM "+ getEBAccount()+
".FWCAENCHANNEL_LV d "
158 " JOIN "+ getEBAccount()+
".HV_MAPPING h on "
159 " 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' ";
161 m_readStmt->setSQL(query);
162 rset = m_readStmt->executeQuery();
165 throw(std::runtime_error(
"RunDCSHVDat::getBarrelRset(): " + e.getMessage() +
" " +
query));
172 string query =
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
173 " d.value_number, '800' NOMINAL_VALUE , d.CHANGE_DATE "
174 "FROM "+ getEEAccount()+
".FWCAENCHANNEL_LV d "
175 " JOIN "+ getEEAccount()+
".EE_HVA_MAPPING h on "
176 " 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' ";
178 m_readStmt->setSQL(query);
179 rset = m_readStmt->executeQuery();
182 throw(std::runtime_error(
"RunDCSHVDat::getEndcapAnodeRset(): " + e.getMessage() +
" " +
query));
189 string query =
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
190 " d.value_number, '600' NOMINAL_VALUE , d.CHANGE_DATE "
191 "FROM "+ getEEAccount()+
".FWCAENCHANNEL_LV d "
192 " JOIN "+ getEEAccount()+
".EE_HVD_MAPPING h on "
193 " 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' ";
195 m_readStmt->setSQL(query);
196 rset = m_readStmt->executeQuery();
199 throw(std::runtime_error(
"RunDCSHVDat::getEndcapDynodeRset(): " + e.getMessage() +
" " +
query));
205 map< EcalLogicID, RunDCSHVDat >* fillMap) {
209 std::pair< EcalLogicID, RunDCSHVDat >
p;
214 while(rset->next()) {
222 dat.
setHV( rset->getFloat(7) );
224 Date sinceDate = rset->getDate(9);
227 if (p.first.getName() ==
"EB_HV_channel") {
228 setStatusForBarrel(dat, sinceTm);
230 setStatusForEndcaps(dat, sinceTm);
237 throw(std::runtime_error(
"RunDCSHVDat::fetchData(): "+e.getMessage()));
257 while(rset->next()) {
266 dat.
setHV( rset->getFloat(7) );
271 Timestamp ora_timestamp = rset->getTimestamp(9);
273 sinceTm.
setToString(ora_timestamp.toText(
"yyyy-mm-dd hh24:mi:ss",0));
276 if (ec.
getName() ==
"EB_HV_channel") {
277 setStatusForBarrel(dat, sinceTm);
279 setStatusForEndcaps(dat, sinceTm);
282 std::pair< EcalLogicID, RunDCSHVDat > d;
285 std::pair< Tm, std::pair< EcalLogicID, RunDCSHVDat > >
p;
292 my_data_list->push_back(pp);
294 if(count<100)
std::cout<<
"DCS DB : size:"<< my_data_list->size()<<
" Tm " <<sinceTm.
str()<<
" "<<ec.
getID1()<<
" "<<ec.
getID2()<<
" "<<dat.
getHV()<<std::endl;
296 std::cout<<
"DCS DB : size:"<< my_data_list->size()<<std::endl;
301 throw(std::runtime_error(
"RunDCSHVDat::fetchData(): "+e.getMessage()));
309 int t_now_gmt_micros = t_now_gmt.
microsTime();
310 return t_now_gmt_micros;
316 int t_now_gmt_micros = nowMicroseconds();
319 if(hv_diff<0) hv_diff=-hv_diff;
320 if (hv_diff*1000 > maxHVDifferenceEB) {
323 if (dat.
getHV()*1000 < minHV) {
328 long long d= (t_now_gmt_micros - sinceTm.
microsTime()) ;
329 if (d> maxDifference) {
338 int t_now_gmt_micros = nowMicroseconds();
343 if (dat.
getHV()*1000 < minHV) {
348 long long d= (t_now_gmt_micros - sinceTm.
microsTime()) ;
349 if (d> maxDifference) {
356 throw(std::runtime_error)
358 this->checkConnection();
363 std::pair< EcalLogicID, RunDCSHVDat >
p;
368 fillTheMap(rset, fillMap);
369 rset = getEndcapAnodeRset();
371 fillTheMap(rset, fillMap);
372 rset = getEndcapDynodeRset();
374 fillTheMap(rset, fillMap);
377 throw(std::runtime_error(
"RunDCSHVDat::fetchData(): "+e.getMessage()));
382 throw(std::runtime_error)
384 this->checkConnection();
388 std::list< DataReducer<RunDCSHVDat>::MyData<
RunDCSHVDat> > my_data_list;
393 std::pair< EcalLogicID, RunDCSHVDat >
p;
396 ResultSet* rset1 = getBarrelRset(timeStart);
397 fillTheMapByTime(rset1, &my_data_list);
399 ResultSet* rset2 = getEndcapAnodeRset(timeStart);
400 fillTheMapByTime(rset2, &my_data_list);
402 ResultSet* rset3 = getEndcapDynodeRset(timeStart);
403 fillTheMapByTime(rset3, &my_data_list);
413 throw(std::runtime_error(
"RunDCSHVDat::fetchData(): "+e.getMessage()));
void setDataList(std::list< MyData< T > > _list)
oracle::occi::ResultSet ResultSet
float getHVNominal() const
void setStatusForEndcaps(RunDCSHVDat &, const Tm &)
ResultSet * getEndcapDynodeRset()
ResultSet * getEndcapAnodeRset()
void fetchData(std::map< EcalLogicID, RunDCSHVDat > *fillMap, RunIOV *iov)
ResultSet * getBarrelRset()
void setToCurrentGMTime()
oracle::occi::SQLException SQLException
void setStatusForBarrel(RunDCSHVDat &, const Tm &)
uint64_t microsTime() const
std::string getName() const
void fetchLastData(std::map< EcalLogicID, RunDCSHVDat > *fillMap)
void setToString(const std::string s)
oracle::occi::Date tmToDate(const Tm &inTm) const
void getReducedDataList(std::list< std::pair< Tm, DataMap > > *my_new_list)
void setTimeStatus(int t)
void setHVNominal(float t)
void fillTheMapByTime(ResultSet *rset, std::list< DataReducer< RunDCSHVDat >::MyData< RunDCSHVDat > > *my_data_list)
void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSHVDat > *)
void writeDB(const EcalLogicID *ecid, const RunDCSHVDat *item, RunIOV *iov)
void fetchHistoricalData(std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > > *fillMap, const Tm &timeStart)
Tm dateToTm(oracle::occi::Date &date) const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run