#include <MonPulseShapeDat.h>
Definition at line 13 of file MonPulseShapeDat.h.
MonPulseShapeDat::MonPulseShapeDat |
( |
| ) |
|
Definition at line 12 of file MonPulseShapeDat.cc.
References NULL.
oracle::occi::Environment * m_env
oracle::occi::Statement * m_writeStmt
oracle::occi::Connection * m_conn
std::vector< float > m_samplesG1
std::vector< float > m_samplesG6
std::vector< float > m_samplesG12
oracle::occi::Statement * m_readStmt
MonPulseShapeDat::~MonPulseShapeDat |
( |
| ) |
|
Definition at line 92 of file MonPulseShapeDat.cc.
References alignCSCRings::e, edm::pset::fillMap(), i, o2o::iov, j, AlCaHLTBitMon_ParallelJobs::p, and setSamples().
107 m_readStmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
108 "d.g1_avg_sample_01, d.g1_avg_sample_02, d.g1_avg_sample_03, d.g1_avg_sample_04, d.g1_avg_sample_05, d.g1_avg_sample_06, d.g1_avg_sample_07, d.g1_avg_sample_08, d.g1_avg_sample_09, d.g1_avg_sample_10, "
109 "d.g6_avg_sample_01, d.g6_avg_sample_02, d.g6_avg_sample_03, d.g6_avg_sample_04, d.g6_avg_sample_05, d.g6_avg_sample_06, d.g6_avg_sample_07, d.g6_avg_sample_08, d.g6_avg_sample_09, d.g6_avg_sample_10, "
110 "d.g12_avg_sample_01, d.g12_avg_sample_02, d.g12_avg_sample_03, d.g12_avg_sample_04, d.g12_avg_sample_05, d.g12_avg_sample_06, d.g12_avg_sample_07, d.g12_avg_sample_08, d.g12_avg_sample_09, d.g12_avg_sample_10 "
111 "FROM channelview cv JOIN mon_pulse_shape_dat d "
112 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
113 "WHERE d.iov_id = :iov_id");
117 std::pair< EcalLogicID, MonPulseShapeDat >
p;
119 while(rset->next()) {
127 int gain[] = {1, 6, 12};
128 std::vector<float> samples(10);
129 for (
int i=0;
i<3;
i++) {
131 for (
int j=0;
j<10;
j++) {
132 samples.push_back( rset->getFloat(7+(10*
i)+
j) );
141 throw(std::runtime_error(
"MonPulseShapeDat::fetchData: "+e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
void setSamples(std::vector< float > &samples, int gain)
oracle::occi::Statement * m_readStmt
oracle::occi::ResultSet ResultSet
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
void fillMap(Registry *reg, regmap_type &fillme)
void checkConnection() const
std::vector<float> MonPulseShapeDat::getSamples |
( |
int |
gain | ) |
const |
throw | ( | std::runtime_error |
| ) | | |
|
inline |
Definition at line 40 of file MonPulseShapeDat.h.
References m_samplesG1, m_samplesG12, and m_samplesG6.
45 }
else if (gain == 6) {
47 }
else if (gain == 12) {
50 throw(std::runtime_error(
"MonPulseShapeDat::getSamples: Gain should be 1, 6 or 12"));
std::vector< float > m_samplesG1
std::vector< float > m_samplesG6
std::vector< float > m_samplesG12
std::string MonPulseShapeDat::getTable |
( |
| ) |
|
|
inlinevirtual |
void MonPulseShapeDat::prepareWrite |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
privatevirtual |
Implements IDataItem.
Definition at line 33 of file MonPulseShapeDat.cc.
References alignCSCRings::e.
40 m_writeStmt->setSQL(
"INSERT INTO mon_pulse_shape_dat (iov_id, logic_id, "
41 "g1_avg_sample_01, g1_avg_sample_02, g1_avg_sample_03, g1_avg_sample_04, g1_avg_sample_05, g1_avg_sample_06, g1_avg_sample_07, g1_avg_sample_08, g1_avg_sample_09, g1_avg_sample_10, "
42 "g6_avg_sample_01, g6_avg_sample_02, g6_avg_sample_03, g6_avg_sample_04, g6_avg_sample_05, g6_avg_sample_06, g6_avg_sample_07, g6_avg_sample_08, g6_avg_sample_09, g6_avg_sample_10, "
43 "g12_avg_sample_01, g12_avg_sample_02, g12_avg_sample_03, g12_avg_sample_04, g12_avg_sample_05, g12_avg_sample_06, g12_avg_sample_07, g12_avg_sample_08, g12_avg_sample_09, g12_avg_sample_10) "
44 "VALUES (:iov_id, :logic_id, "
45 ":g1_avg_sample_01, :g1_avg_sample_02, :g1_avg_sample_03, :g1_avg_sample_04, :g1_avg_sample_05, :g1_avg_sample_06, :g1_avg_sample_07, :g1_avg_sample_08, :g1_avg_sample_09, :g1_avg_sample_10,"
46 ":g6_avg_sample_01, :g6_avg_sample_02, :g6_avg_sample_03, :g6_avg_sample_04, :g6_avg_sample_05, :g6_avg_sample_06, :g6_avg_sample_07, :g6_avg_sample_08, :g6_avg_sample_09, :g6_avg_sample_10,"
47 ":g12_avg_sample_01, :g12_avg_sample_02, :g12_avg_sample_03, :g12_avg_sample_04, :g12_avg_sample_05, :g12_avg_sample_06, :g12_avg_sample_07, :g12_avg_sample_08, :g12_avg_sample_09, :g12_avg_sample_10)"
51 throw(std::runtime_error(
"MonPulseShapeDat::prepareWrite(): "+e.getMessage()));
oracle::occi::Statement * m_writeStmt
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
void checkConnection() const
void MonPulseShapeDat::setSamples |
( |
std::vector< float > & |
samples, |
|
|
int |
gain |
|
) |
| |
throw | ( | std::runtime_error |
| ) | | |
|
inline |
Definition at line 22 of file MonPulseShapeDat.h.
References m_samplesG1, m_samplesG12, and m_samplesG6.
Referenced by fetchData().
25 if (samples.size() != 10) {
26 throw(std::runtime_error(
"MonPulseShapeDat::setSamples: There should be 10 samples."));
31 }
else if (gain == 6) {
33 }
else if (gain == 12) {
36 throw(std::runtime_error(
"MonPulseShapeDat::setSamples: Gain should be 1, 6 or 12"));
std::vector< float > m_samplesG1
std::vector< float > m_samplesG6
std::vector< float > m_samplesG12
Definition at line 57 of file MonPulseShapeDat.cc.
References alignCSCRings::e, cppFunctionSkipper::exception, i, o2o::iov, and j.
64 if (!iovID) {
throw(std::runtime_error(
"MonPulseShapeDat::writeDB: IOV not in DB")); }
67 if (!logicID) {
throw(std::runtime_error(
"MonPulseShapeDat::writeDB: Bad EcalLogicID")); }
73 int gain[] = {1, 6, 12};
74 std::vector<float> samples;
75 for (
int i=0;
i<3;
i++) {
77 for (
int j=0;
j<10;
j++) {
84 throw(std::runtime_error(
"MonPulseShapeDat::writeDB: "+e.getMessage()));
86 throw(std::runtime_error(
"MonPulseShapeDat::writeDB: " +
string(e.what())));
oracle::occi::Statement * m_writeStmt
std::vector< float > getSamples(int gain) const
oracle::occi::SQLException SQLException
void checkConnection() const
std::vector<float> MonPulseShapeDat::m_samplesG1 |
|
private |
std::vector<float> MonPulseShapeDat::m_samplesG12 |
|
private |
std::vector<float> MonPulseShapeDat::m_samplesG6 |
|
private |