#include <ITimingDat.h>
|
template<class DATT , class IOVT > |
void | fetchData (std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false) |
|
void | prepareWrite () noexcept(false) override |
|
template<class DATT , class IOVT > |
void | writeArrayDB (const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false) |
|
template<class DATT , class IOVT > |
void | writeDB (const EcalLogicID *ecid, const DATT *item, IOVT *iov) noexcept(false) |
|
Definition at line 17 of file ITimingDat.h.
◆ ResultSet
◆ SQLException
◆ ITimingDat()
ITimingDat::ITimingDat |
( |
| ) |
|
|
inline |
◆ ~ITimingDat()
ITimingDat::~ITimingDat |
( |
| ) |
|
|
inlineoverride |
◆ fetchData()
template<class DATT , class IOVT >
void ITimingDat::fetchData |
( |
std::map< EcalLogicID, DATT > * |
fillMap, |
|
|
IOVT * |
iov |
|
) |
| |
|
inlineprivatenoexcept |
Definition at line 181 of file ITimingDat.h.
186 int iovID = iov->fetchID();
194 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
195 "d.timing_mean, d.timing_rms, d.task_status "
196 "FROM channelview cv JOIN " +
199 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
200 "WHERE d.iov_id = :iov_id");
204 std::pair<EcalLogicID, DATT>
p;
206 while (rset->next()) {
214 dat.setTimingMean(rset->getFloat(7));
215 dat.setTimingRMS(rset->getFloat(8));
216 dat.setTaskStatus(rset->getInt(9));
223 throw(std::runtime_error(
"ITimingDat::fetchData(): " +
e.getMessage()));
References IDBObject::checkConnection(), MillePedeFileConverter_cfg::e, getTable(), IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, and AlCaHLTBitMon_ParallelJobs::p.
◆ getTable()
std::string ITimingDat::getTable |
( |
| ) |
|
|
inlineoverridevirtual |
Implements IDataItem.
Reimplemented in MonTimingLaserBlueCrystalDat, MonTimingCrystalDat, MonTimingLaserBlueTTDat, MonTimingLaserGreenCrystalDat, MonTimingLaserGreenTTDat, MonTimingLaserIRedCrystalDat, MonTimingLaserIRedTTDat, MonTimingLaserRedCrystalDat, MonTimingLaserRedTTDat, MonTimingLed1CrystalDat, MonTimingLed1TTDat, MonTimingLed2CrystalDat, MonTimingLed2TTDat, and MonTimingTTDat.
Definition at line 37 of file ITimingDat.h.
References m_table_name.
Referenced by fetchData(), and prepareWrite().
◆ getTaskStatus()
bool ITimingDat::getTaskStatus |
( |
| ) |
const |
|
inline |
◆ getTimingMean()
float ITimingDat::getTimingMean |
( |
| ) |
const |
|
inline |
◆ getTimingRMS()
float ITimingDat::getTimingRMS |
( |
| ) |
const |
|
inline |
◆ prepareWrite()
void ITimingDat::prepareWrite |
( |
| ) |
|
|
inlineoverrideprivatevirtualnoexcept |
Implements IDataItem.
Definition at line 50 of file ITimingDat.h.
56 " (iov_id, logic_id, "
57 "timing_mean, timing_rms , task_status ) "
58 "VALUES (:iov_id, :logic_id, "
59 ":timing_mean, :timing_rms, :task_status )");
61 throw(std::runtime_error(
"ITimingDat::prepareWrite(): " +
e.getMessage()));
References IDBObject::checkConnection(), MillePedeFileConverter_cfg::e, getTable(), IDBObject::m_conn, and IDataItem::m_writeStmt.
◆ setTable()
void ITimingDat::setTable |
( |
std::string |
x | ) |
|
|
inline |
◆ setTaskStatus()
void ITimingDat::setTaskStatus |
( |
bool |
status | ) |
|
|
inline |
◆ setTimingMean()
void ITimingDat::setTimingMean |
( |
float |
mean | ) |
|
|
inline |
◆ setTimingRMS()
void ITimingDat::setTimingRMS |
( |
float |
rms | ) |
|
|
inline |
◆ writeArrayDB()
template<class DATT , class IOVT >
void ITimingDat::writeArrayDB |
( |
const std::map< EcalLogicID, DATT > * |
data, |
|
|
IOVT * |
iov |
|
) |
| |
|
inlineprivatenoexcept |
Definition at line 95 of file ITimingDat.h.
96 using oracle::occi::OCCIFLOAT;
97 using oracle::occi::OCCIINT;
102 int iovID = iov->fetchID();
104 throw(std::runtime_error(
"ITimingDat::writeArrayDB: IOV not in DB"));
107 int nrows =
data->size();
108 int* ids =
new int[nrows];
109 int* iovid_vec =
new int[nrows];
110 float*
xx =
new float[nrows];
111 float*
yy =
new float[nrows];
112 int* st =
new int[nrows];
114 ub2* ids_len =
new ub2[nrows];
115 ub2* iov_len =
new ub2[nrows];
116 ub2* x_len =
new ub2[nrows];
117 ub2* y_len =
new ub2[nrows];
118 ub2* st_len =
new ub2[nrows];
121 const DATT* dataitem;
124 typedef typename std::map<EcalLogicID, DATT>::const_iterator CI;
125 for (CI
p =
data->begin();
p !=
data->end(); ++
p) {
126 channel = &(
p->first);
129 throw(std::runtime_error(
"ITimingDat::writeArrayDB: Bad EcalLogicID"));
131 ids[
count] = logicID;
132 iovid_vec[
count] = iovID;
134 dataitem = &(
p->second);
136 float x = dataitem->getTimingMean();
137 float y = dataitem->getTimingRMS();
138 int statu = dataitem->getTaskStatus();
155 m_writeStmt->setDataBuffer(1, (dvoid*)iovid_vec, OCCIINT,
sizeof(iovid_vec[0]), iov_len);
156 m_writeStmt->setDataBuffer(2, (dvoid*)ids, OCCIINT,
sizeof(ids[0]), ids_len);
157 m_writeStmt->setDataBuffer(3, (dvoid*)
xx, OCCIFLOAT,
sizeof(
xx[0]), x_len);
158 m_writeStmt->setDataBuffer(4, (dvoid*)
yy, OCCIFLOAT,
sizeof(
yy[0]), y_len);
159 m_writeStmt->setDataBuffer(5, (dvoid*)st, OCCIINT,
sizeof(st[0]), st_len);
176 throw(std::runtime_error(
"ITimingDat::writeArrayDB(): " +
e.getMessage()));
References IDBObject::checkConnection(), IDataItem::checkPrepare(), KineDebug3::count(), data, MillePedeFileConverter_cfg::e, EcalLogicID::getLogicID(), IDataItem::m_writeStmt, AlCaHLTBitMon_ParallelJobs::p, x, geometryCSVtoXML::xx, y, and geometryCSVtoXML::yy.
◆ writeDB()
template<class DATT , class IOVT >
void ITimingDat::writeDB |
( |
const EcalLogicID * |
ecid, |
|
|
const DATT * |
item, |
|
|
IOVT * |
iov |
|
) |
| |
|
inlineprivatenoexcept |
◆ EcalCondDBInterface
◆ m_table_name
std::string ITimingDat::m_table_name |
|
private |
◆ m_taskStatus
bool ITimingDat::m_taskStatus |
|
private |
◆ m_timingMean
float ITimingDat::m_timingMean |
|
private |
◆ m_timingRMS
float ITimingDat::m_timingRMS |
|
private |