#include <MonPulseShapeDat.h>
Definition at line 13 of file MonPulseShapeDat.h.
MonPulseShapeDat::MonPulseShapeDat |
( |
| ) |
|
Definition at line 12 of file MonPulseShapeDat.cc.
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 |
( |
| ) |
|
|
override |
Definition at line 86 of file MonPulseShapeDat.cc.
References dat, alignCSCRings::e, mps_fire::i, dqmiolumiharvest::j, AlCaHLTBitMon_ParallelJobs::p, and setSamples().
99 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
100 "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, "
101 "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, "
102 "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, "
103 "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, "
104 "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, "
105 "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 "
106 "FROM channelview cv JOIN mon_pulse_shape_dat d "
107 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
108 "WHERE d.iov_id = :iov_id");
112 std::pair<EcalLogicID, MonPulseShapeDat>
p;
114 while (rset->next()) {
122 int gain[] = {1, 6, 12};
123 std::vector<float> samples(10);
124 for (
int i = 0;
i < 3;
i++) {
126 for (
int j = 0;
j < 10;
j++) {
127 samples.push_back(rset->getFloat(7 + (10 *
i) +
j));
135 }
catch (SQLException&
e) {
136 throw(std::runtime_error(
"MonPulseShapeDat::fetchData: " + e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void setSamples(std::vector< float > &samples, int gain) noexcept(false)
int fetchID() noexcept(false) override
oracle::occi::Statement * m_readStmt
static std::vector< std::string > checklist dat
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
std::vector<float> MonPulseShapeDat::getSamples |
( |
int |
gain | ) |
const |
|
inlinenoexcept |
Definition at line 38 of file MonPulseShapeDat.h.
References m_samplesG1, m_samplesG12, and m_samplesG6.
41 }
else if (gain == 6) {
43 }
else if (gain == 12) {
46 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 |
( |
| ) |
|
|
inlineoverridevirtual |
void MonPulseShapeDat::prepareWrite |
( |
| ) |
|
|
overrideprivatevirtualnoexcept |
Implements IDataItem.
Definition at line 25 of file MonPulseShapeDat.cc.
References alignCSCRings::e.
31 "INSERT INTO mon_pulse_shape_dat (iov_id, logic_id, "
32 "g1_avg_sample_01, g1_avg_sample_02, g1_avg_sample_03, g1_avg_sample_04, g1_avg_sample_05, g1_avg_sample_06, "
33 "g1_avg_sample_07, g1_avg_sample_08, g1_avg_sample_09, g1_avg_sample_10, "
34 "g6_avg_sample_01, g6_avg_sample_02, g6_avg_sample_03, g6_avg_sample_04, g6_avg_sample_05, g6_avg_sample_06, "
35 "g6_avg_sample_07, g6_avg_sample_08, g6_avg_sample_09, g6_avg_sample_10, "
36 "g12_avg_sample_01, g12_avg_sample_02, g12_avg_sample_03, g12_avg_sample_04, g12_avg_sample_05, "
37 "g12_avg_sample_06, g12_avg_sample_07, g12_avg_sample_08, g12_avg_sample_09, g12_avg_sample_10) "
38 "VALUES (:iov_id, :logic_id, "
39 ":g1_avg_sample_01, :g1_avg_sample_02, :g1_avg_sample_03, :g1_avg_sample_04, :g1_avg_sample_05, "
40 ":g1_avg_sample_06, :g1_avg_sample_07, :g1_avg_sample_08, :g1_avg_sample_09, :g1_avg_sample_10,"
41 ":g6_avg_sample_01, :g6_avg_sample_02, :g6_avg_sample_03, :g6_avg_sample_04, :g6_avg_sample_05, "
42 ":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, "
44 ":g12_avg_sample_06, :g12_avg_sample_07, :g12_avg_sample_08, :g12_avg_sample_09, :g12_avg_sample_10)");
46 }
catch (SQLException&
e) {
47 throw(std::runtime_error(
"MonPulseShapeDat::prepareWrite(): " + e.getMessage()));
oracle::occi::Statement * m_writeStmt
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void MonPulseShapeDat::setSamples |
( |
std::vector< float > & |
samples, |
|
|
int |
gain |
|
) |
| |
|
inlinenoexcept |
Definition at line 22 of file MonPulseShapeDat.h.
References m_samplesG1, m_samplesG12, and m_samplesG6.
Referenced by fetchData(), and ecaldqm::TestPulseWriter::run().
23 if (samples.size() != 10) {
24 throw(std::runtime_error(
"MonPulseShapeDat::setSamples: There should be 10 samples."));
29 }
else if (gain == 6) {
31 }
else if (gain == 12) {
34 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 51 of file MonPulseShapeDat.cc.
References alignCSCRings::e, cppFunctionSkipper::exception, mps_fire::i, B2GTnPMonitor_cfi::item, and dqmiolumiharvest::j.
57 throw(std::runtime_error(
"MonPulseShapeDat::writeDB: IOV not in DB"));
62 throw(std::runtime_error(
"MonPulseShapeDat::writeDB: Bad EcalLogicID"));
69 int gain[] = {1, 6, 12};
70 std::vector<float> samples;
71 for (
int i = 0;
i < 3;
i++) {
73 for (
int j = 0;
j < 10;
j++) {
79 }
catch (SQLException&
e) {
80 throw(std::runtime_error(
"MonPulseShapeDat::writeDB: " + e.getMessage()));
82 throw(std::runtime_error(
"MonPulseShapeDat::writeDB: " +
string(e.what())));
oracle::occi::Statement * m_writeStmt
void checkConnection() const noexcept(false)
void checkPrepare() noexcept(false)
int fetchID() noexcept(false) override
std::vector< float > getSamples(int gain) const noexcept(false)
std::vector<float> MonPulseShapeDat::m_samplesG1 |
|
private |
std::vector<float> MonPulseShapeDat::m_samplesG12 |
|
private |
std::vector<float> MonPulseShapeDat::m_samplesG6 |
|
private |