|
|
#include <RunDCSHVDat.h>
|
void | fetchData (std::map< EcalLogicID, RunDCSHVDat > *fillMap, RunIOV *iov) noexcept(false) |
|
void | fetchHistoricalData (std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > > *fillMap, const Tm &timeStart) noexcept(false) |
|
void | fetchLastData (std::map< EcalLogicID, RunDCSHVDat > *fillMap) noexcept(false) |
|
void | fillTheMap (ResultSet *, std::map< EcalLogicID, RunDCSHVDat > *) |
|
void | fillTheMapByTime (ResultSet *rset, std::list< DataReducer< RunDCSHVDat >::MyData< RunDCSHVDat > > *my_data_list) |
|
ResultSet * | getBarrelRset () |
|
ResultSet * | getBarrelRset (const Tm &timeStart) |
|
ResultSet * | getEndcapAnodeRset () |
|
ResultSet * | getEndcapAnodeRset (const Tm ×tart) |
|
ResultSet * | getEndcapDynodeRset () |
|
ResultSet * | getEndcapDynodeRset (const Tm ×tart) |
|
int | nowMicroseconds () |
|
void | prepareWrite () noexcept(false) override |
|
void | setStatusForBarrel (RunDCSHVDat &, const Tm &) |
|
void | setStatusForEndcaps (RunDCSHVDat &, const Tm &) |
|
void | writeDB (const EcalLogicID *ecid, const RunDCSHVDat *item, RunIOV *iov) noexcept(false) |
|
Definition at line 15 of file RunDCSHVDat.h.
◆ ResultSet
◆ RunDCSHVDat()
RunDCSHVDat::RunDCSHVDat |
( |
| ) |
|
◆ ~RunDCSHVDat()
RunDCSHVDat::~RunDCSHVDat |
( |
| ) |
|
|
override |
◆ fetchData()
◆ fetchHistoricalData()
void RunDCSHVDat::fetchHistoricalData |
( |
std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > > * |
fillMap, |
|
|
const Tm & |
timeStart |
|
) |
| |
|
privatenoexcept |
◆ fetchLastData()
◆ fillTheMap()
◆ fillTheMapByTime()
Definition at line 278 of file RunDCSHVDat.cc.
289 while (rset->next()) {
297 dat.
setHV(rset->getFloat(7));
302 Timestamp ora_timestamp = rset->getTimestamp(9);
304 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
305 sinceTm.
setToString(ora_timestamp.toText(
"yyyy-mm-dd hh24:mi:ss", 0));
308 unsigned int month = 0;
309 unsigned int day = 0;
310 unsigned int hour = 0;
311 unsigned int minute = 0;
314 ora_timestamp.getDate(year, month,
day);
315 ora_timestamp.getTime(hour, minute,
second, fs);
316 const std::tm
tt = {.tm_sec = static_cast<int>(
second),
317 .tm_min = static_cast<int>(minute),
318 .tm_hour = static_cast<int>(hour),
319 .tm_mday = static_cast<int>(
day),
320 .tm_mon = static_cast<int>(month),
321 .tm_year = year - 1900,
327 char tt_str[30] = {0};
328 if (std::strftime(tt_str,
sizeof(tt_str),
"%F %T", &
tt)) {
331 throw std::runtime_error(
"RunDCSHVDat::fillTheMapByTime: failed to generate the date string");
336 if (ec.
getName() ==
"EB_HV_channel") {
342 std::pair<EcalLogicID, RunDCSHVDat>
d;
345 std::pair<Tm, std::pair<EcalLogicID, RunDCSHVDat> >
p;
352 my_data_list->push_back(
pp);
355 std::cout <<
"DCS DB : size:" << my_data_list->size() <<
" Tm " << sinceTm.
str() <<
" " << ec.
getID1() <<
" "
358 std::cout <<
"DCS DB : size:" << my_data_list->size() << std::endl;
360 }
catch (SQLException&
e) {
361 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
362 throw(std::runtime_error(
std::string(
"RunDCSHVDat::fetchData(): ") +
e.getMessage()));
364 throw(std::runtime_error(
std::string(
"RunDCSHVDat::fetchData(): error code ") + std::to_string(
e.getErrorCode())));
References submitPVResolutionJobs::count, gather_cfg::cout, ztail::d, util.getRunInfo::day(), cuy::dh, MillePedeFileConverter_cfg::e, getHV(), EcalLogicID::getID1(), EcalLogicID::getID2(), EcalLogicID::getName(), AlCaHLTBitMon_ParallelJobs::p, createTree::pp, edm::second(), setHV(), setHVNominal(), setStatus(), Tm::setToString(), Tm::str(), AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::tt.
◆ getBarrelRset() [1/2]
Definition at line 159 of file RunDCSHVDat.cc.
162 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
163 " d.VALUE_NUMBER, h.nominal_value , d.CHANGE_DATE "
166 ".FWCAENCHANNEL_LV d "
170 " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and "
171 "DPE_NAME='ACTUAL_VMON' ";
175 }
catch (SQLException&
e) {
176 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
177 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): ") +
e.getMessage() +
" " +
query));
179 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): error code ") +
180 std::to_string(
e.getErrorCode()) +
" " +
query));
References MillePedeFileConverter_cfg::e, contentValuesFiles::query, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getBarrelRset() [2/2]
ResultSet * RunDCSHVDat::getBarrelRset |
( |
const Tm & |
timeStart | ) |
|
|
private |
Definition at line 38 of file RunDCSHVDat.cc.
43 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
44 " d.actual_vmon, h.nominal_value , d.change_date "
50 ".HV_MAPPING h on h.DPID = d.DPID "
53 ".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name "
54 " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date ";
61 }
catch (SQLException&
e) {
62 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
63 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): ") +
e.getMessage() +
" " +
query));
65 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): error code ") +
66 std::to_string(
e.getErrorCode()) +
" " +
query));
References cuy::dh, MillePedeFileConverter_cfg::e, contentValuesFiles::query, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getEBAccount()
std::string RunDCSHVDat::getEBAccount |
( |
| ) |
|
|
inline |
Definition at line 33 of file RunDCSHVDat.h.
33 {
return "CMS_ECAL_HV_PVSS_COND"; }
◆ getEEAccount()
std::string RunDCSHVDat::getEEAccount |
( |
| ) |
|
|
inline |
Definition at line 34 of file RunDCSHVDat.h.
34 {
return "CMS_EE_HV_PVSS_COND"; }
◆ getEndcapAnodeRset() [1/2]
ResultSet * RunDCSHVDat::getEndcapAnodeRset |
( |
| ) |
|
|
private |
Definition at line 186 of file RunDCSHVDat.cc.
189 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
190 " d.value_number, '800' NOMINAL_VALUE , d.CHANGE_DATE "
193 ".FWCAENCHANNEL_LV d "
196 ".EE_HVA_MAPPING h on "
197 " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and "
198 "dpe_name='ACTUAL_VMON' ";
202 }
catch (SQLException&
e) {
203 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
204 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getEndcapAnodeRset(): ") +
e.getMessage() +
" " +
query));
206 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getEndcapAnodeRset(): error code ") +
207 std::to_string(
e.getErrorCode()) +
" " +
query));
References MillePedeFileConverter_cfg::e, contentValuesFiles::query, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getEndcapAnodeRset() [2/2]
ResultSet * RunDCSHVDat::getEndcapAnodeRset |
( |
const Tm & |
timestart | ) |
|
|
private |
Definition at line 72 of file RunDCSHVDat.cc.
77 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
78 " d.actual_vmon, '800' nominal_value , d.change_date "
84 ".EE_HVA_MAPPING h on h.DPID = d.DPID "
87 ".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name "
88 " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date ";
95 }
catch (SQLException&
e) {
96 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
97 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): ") +
e.getMessage() +
" " +
query));
99 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): error code ") +
100 std::to_string(
e.getErrorCode()) +
" " +
query));
References cuy::dh, MillePedeFileConverter_cfg::e, contentValuesFiles::query, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getEndcapDynodeRset() [1/2]
ResultSet * RunDCSHVDat::getEndcapDynodeRset |
( |
| ) |
|
|
private |
Definition at line 213 of file RunDCSHVDat.cc.
216 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
217 " d.value_number, '600' NOMINAL_VALUE , d.CHANGE_DATE "
220 ".FWCAENCHANNEL_LV d "
223 ".EE_HVD_MAPPING h on "
224 " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and "
225 "dpe_name='ACTUAL_VMON' ";
229 }
catch (SQLException&
e) {
230 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
231 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getEndcapDynodeRset(): ") +
e.getMessage() +
" " +
query));
233 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getEndcapDynodeRset(): error code ") +
234 std::to_string(
e.getErrorCode()) +
" " +
query));
References MillePedeFileConverter_cfg::e, contentValuesFiles::query, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getEndcapDynodeRset() [2/2]
ResultSet * RunDCSHVDat::getEndcapDynodeRset |
( |
const Tm & |
timestart | ) |
|
|
private |
Definition at line 106 of file RunDCSHVDat.cc.
111 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
112 " d.actual_vmon, '600' nominal_value , d.change_date "
118 ".EE_HVD_MAPPING h on h.DPID = d.DPID "
121 ".CHANNELVIEW cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name "
122 " AND d.change_date> :1 AND d.actual_vmon is not null order by change_date ";
129 }
catch (SQLException&
e) {
130 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
131 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): ") +
e.getMessage() +
" " +
query));
133 throw(std::runtime_error(
std::string(
"RunDCSHVDat::getBarrelRset(): error code ") +
134 std::to_string(
e.getErrorCode()) +
" " +
query));
References cuy::dh, MillePedeFileConverter_cfg::e, contentValuesFiles::query, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getHV()
float RunDCSHVDat::getHV |
( |
| ) |
const |
|
inline |
◆ getHVNominal()
float RunDCSHVDat::getHVNominal |
( |
| ) |
const |
|
inline |
◆ getStatus()
int RunDCSHVDat::getStatus |
( |
| ) |
const |
|
inline |
◆ getTable()
std::string RunDCSHVDat::getTable |
( |
| ) |
|
|
inlineoverridevirtual |
◆ getTimeStatus()
int RunDCSHVDat::getTimeStatus |
( |
| ) |
|
|
inline |
◆ nowMicroseconds()
int RunDCSHVDat::nowMicroseconds |
( |
| ) |
|
|
private |
◆ prepareWrite()
void RunDCSHVDat::prepareWrite |
( |
| ) |
|
|
overrideprivatevirtualnoexcept |
◆ setHV()
void RunDCSHVDat::setHV |
( |
float |
t | ) |
|
|
inline |
◆ setHVNominal()
void RunDCSHVDat::setHVNominal |
( |
float |
t | ) |
|
|
inline |
◆ setStatus()
void RunDCSHVDat::setStatus |
( |
int |
t | ) |
|
|
inline |
◆ setStatusForBarrel()
void RunDCSHVDat::setStatusForBarrel |
( |
RunDCSHVDat & |
dat, |
|
|
const Tm & |
sinceTm |
|
) |
| |
|
private |
◆ setStatusForEndcaps()
void RunDCSHVDat::setStatusForEndcaps |
( |
RunDCSHVDat & |
dat, |
|
|
const Tm & |
sinceTm |
|
) |
| |
|
private |
◆ setTimeStatus()
void RunDCSHVDat::setTimeStatus |
( |
int |
t | ) |
|
|
inline |
◆ writeDB()
◆ EcalCondDBInterface
◆ HVNOTNOMINAL
const int RunDCSHVDat::HVNOTNOMINAL = 1 |
|
static |
◆ HVOFF
const int RunDCSHVDat::HVOFF = 2 |
|
static |
◆ m_hv
◆ m_hvnom
float RunDCSHVDat::m_hvnom |
|
private |
◆ m_status
int RunDCSHVDat::m_status |
|
private |
◆ m_tstatus
int RunDCSHVDat::m_tstatus |
|
private |
◆ maxDifference
const int RunDCSHVDat::maxDifference = 30 * 60 * 1000000 |
|
static |
◆ maxHVDifferenceEB
const int RunDCSHVDat::maxHVDifferenceEB = 300 |
|
static |
◆ maxHVDifferenceEE
const int RunDCSHVDat::maxHVDifferenceEE = 5000 |
|
static |
◆ minHV
const int RunDCSHVDat::minHV = 10000 |
|
static |
void setDataList(std::list< MyData< T > > _list)
static const int HVNOTNOMINAL
std::string getName() const
ResultSet * getEndcapAnodeRset()
U second(std::pair< T, U > const &p)
oracle::occi::Statement * m_readStmt
oracle::occi::Statement * m_writeStmt
oracle::occi::Connection * m_conn
void setStatusForBarrel(RunDCSHVDat &, const Tm &)
ResultSet * getBarrelRset()
void setToCurrentGMTime()
std::string getEBAccount()
static const int maxHVDifferenceEE
void checkConnection() const noexcept(false)
void getReducedDataList(std::list< std::pair< Tm, DataMap > > *my_new_list)
uint64_t microsTime() const
void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSHVDat > *)
void fetchLastData(std::map< EcalLogicID, RunDCSHVDat > *fillMap) noexcept(false)
void setTimeStatus(int t)
void setToString(const std::string s) noexcept(false)
oracle::occi::Environment * m_env
oracle::occi::ResultSet ResultSet
void setHVNominal(float t)
float getHVNominal() const
ResultSet * getEndcapDynodeRset()
std::string getEEAccount()
void fillTheMapByTime(ResultSet *rset, std::list< DataReducer< RunDCSHVDat >::MyData< RunDCSHVDat > > *my_data_list)
static const int maxDifference
static const int maxHVDifferenceEB
void setStatusForEndcaps(RunDCSHVDat &, const Tm &)