CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
DCUCCSDat Class Reference

#include <DCUCCSDat.h>

Inheritance diagram for DCUCCSDat:
IDataItem IDBObject

Public Member Functions

 DCUCCSDat ()
 
float getCCSTempHigh () const
 
float getCCSTempLow () const
 
float getM1DCUTemp () const
 
float getM1Vcc () const
 
float getM1VDD1 () const
 
float getM1VDD2 () const
 
float getM1Vinj () const
 
float getM2DCUTemp () const
 
float getM2Vcc () const
 
float getM2VDD1 () const
 
float getM2VDD2 () const
 
float getM2Vinj () const
 
std::string getTable () override
 
void setCCSTemp (float low, float high)
 
void setCCSTempHigh (float temp)
 
void setCCSTempLow (float temp)
 
void setDCUTemp (float t1, float t2)
 
void setM1 (float vdd1, float vdd2, float vinj, float vcc, float dcutemp)
 
void setM1DCUTemp (float temp)
 
void setM1Vcc (float temp)
 
void setM1VDD1 (float temp)
 
void setM1VDD2 (float temp)
 
void setM1Vinj (float temp)
 
void setM2 (float vdd1, float vdd2, float vinj, float vcc, float dcutemp)
 
void setM2DCUTemp (float temp)
 
void setM2Vcc (float temp)
 
void setM2VDD1 (float temp)
 
void setM2VDD2 (float temp)
 
void setM2Vinj (float temp)
 
void setVcc (float v1, float v2)
 
void setVDD (float m1vdd1, float m1vdd2, float m2vdd1, float m2vdd2)
 
void setVinj (float v1, float v2)
 
 ~DCUCCSDat () override
 
- Public Member Functions inherited from IDataItem
 IDataItem ()
 
- Public Member Functions inherited from IDBObject
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void setConnection (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
virtual ~IDBObject ()
 

Private Member Functions

void fetchData (std::map< EcalLogicID, DCUCCSDat > *fillVec, DCUIOV *iov) noexcept(false)
 
void prepareWrite () noexcept(false) override
 
void writeArrayDB (const std::map< EcalLogicID, DCUCCSDat > *data, DCUIOV *iov) noexcept(false)
 
void writeDB (const EcalLogicID *ecid, const DCUCCSDat *item, DCUIOV *iov) noexcept(false)
 

Private Attributes

float m_ccstemphigh
 
float m_ccstemplow
 
float m_m1_dcutemp
 
float m_m1_vcc
 
float m_m1_vdd1
 
float m_m1_vdd2
 
float m_m1_vinj
 
float m_m2_dcutemp
 
float m_m2_vcc
 
float m_m2_vdd1
 
float m_m2_vdd2
 
float m_m2_vinj
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Static Public Attributes inherited from IDBObject
static int const ECALDB_NROWS = 1024
 
- Protected Member Functions inherited from IDataItem
void checkPrepare () noexcept(false)
 
void createReadStatement () noexcept(false)
 
void setPrefetchRowCount (int ncount) noexcept(false)
 
void terminateReadStatement () noexcept(false)
 
void terminateWriteStatement () noexcept(false)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const noexcept(false)
 
- Protected Attributes inherited from IDataItem
oracle::occi::Statement * m_readStmt
 
oracle::occi::Statement * m_writeStmt
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Detailed Description

Definition at line 12 of file DCUCCSDat.h.

Constructor & Destructor Documentation

◆ DCUCCSDat()

DCUCCSDat::DCUCCSDat ( )

Definition at line 12 of file DCUCCSDat.cc.

12  {
13  m_env = nullptr;
14  m_conn = nullptr;
15  m_writeStmt = nullptr;
16  m_readStmt = nullptr;
17 
18  m_m1_vdd1 = 0;
19  m_m2_vdd1 = 0;
20  m_m1_vdd2 = 0;
21  m_m2_vdd2 = 0;
22  m_m1_vinj = 0;
23  m_m2_vinj = 0;
24  m_m1_vcc = 0;
25  m_m2_vcc = 0;
26  m_m1_dcutemp = 0;
27  m_m2_dcutemp = 0;
28  m_ccstemplow = 0;
29  m_ccstemphigh = 0;
30 }
float m_ccstemphigh
Definition: DCUCCSDat.h:103
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:23
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
float m_m2_vinj
Definition: DCUCCSDat.h:97
float m_m2_vcc
Definition: DCUCCSDat.h:99
float m_m1_dcutemp
Definition: DCUCCSDat.h:100
float m_m2_dcutemp
Definition: DCUCCSDat.h:101
float m_m2_vdd2
Definition: DCUCCSDat.h:95
float m_m1_vdd1
Definition: DCUCCSDat.h:92
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:24
float m_m1_vcc
Definition: DCUCCSDat.h:98
float m_m1_vinj
Definition: DCUCCSDat.h:96
float m_m1_vdd2
Definition: DCUCCSDat.h:94
float m_m2_vdd1
Definition: DCUCCSDat.h:93
float m_ccstemplow
Definition: DCUCCSDat.h:102

◆ ~DCUCCSDat()

DCUCCSDat::~DCUCCSDat ( )
override

Definition at line 32 of file DCUCCSDat.cc.

32 {}

Member Function Documentation

◆ fetchData()

void DCUCCSDat::fetchData ( std::map< EcalLogicID, DCUCCSDat > *  fillVec,
DCUIOV iov 
)
privatenoexcept

Definition at line 90 of file DCUCCSDat.cc.

References MillePedeFileConverter_cfg::e, AlCaHLTBitMon_ParallelJobs::p, setCCSTemp(), setDCUTemp(), setVcc(), setVDD(), and setVinj().

90  {
91  this->checkConnection();
92  fillMap->clear();
93 
94  iov->setConnection(m_env, m_conn);
95  int iovID = iov->fetchID();
96  if (!iovID) {
97  // throw(std::runtime_error("DCUCCSDat::writeDB: IOV not in DB"));
98  return;
99  }
100 
101  try {
102  m_readStmt->setSQL(
103  "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, "
104  "cv.maps_to, "
105  "d.m1_vdd1, d.m2_vdd1, d.m1_vdd2, d.m2_vdd2, "
106  "d.m1_vinj, d.m2_vinj, "
107  "d.m1_vcc, d.m2_vcc, "
108  "d.m1_dcutemp, d.m2_dcutemp, "
109  "d.ccstemplow, d.ccstemphigh "
110  "FROM channelview cv JOIN dcu_ccs_dat d "
111  "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
112  "WHERE d.iov_id = :iov_id");
113  m_readStmt->setInt(1, iovID);
114  ResultSet* rset = m_readStmt->executeQuery();
115 
116  std::pair<EcalLogicID, DCUCCSDat> p;
117  DCUCCSDat dat;
118  while (rset->next()) {
119  p.first = EcalLogicID(rset->getString(1), // name
120  rset->getInt(2), // logic_id
121  rset->getInt(3), // id1
122  rset->getInt(4), // id2
123  rset->getInt(5), // id3
124  rset->getString(6)); // maps_to
125 
126  dat.setVDD(rset->getFloat(7), rset->getFloat(9), rset->getFloat(8), rset->getFloat(10));
127  dat.setVinj(rset->getFloat(11), rset->getFloat(12));
128  dat.setVcc(rset->getFloat(13), rset->getFloat(14));
129  dat.setDCUTemp(rset->getFloat(15), rset->getFloat(16));
130  dat.setCCSTemp(rset->getFloat(17), rset->getFloat(18));
131  p.second = dat;
132  fillMap->insert(p);
133  }
134  } catch (SQLException& e) {
135  throw(std::runtime_error("DCUCCSDat::fetchData(): " + e.getMessage()));
136  }
137 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
void setVinj(float v1, float v2)
Definition: DCUCCSDat.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
void setVDD(float m1vdd1, float m1vdd2, float m2vdd1, float m2vdd2)
Definition: DCUCCSDat.h:25
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
void setCCSTemp(float low, float high)
Definition: DCUCCSDat.h:51
void setVcc(float v1, float v2)
Definition: DCUCCSDat.h:39
void setDCUTemp(float t1, float t2)
Definition: DCUCCSDat.h:45
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:24
int fetchID() noexcept(false) override
Definition: DCUIOV.cc:48
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23

◆ getCCSTempHigh()

float DCUCCSDat::getCCSTempHigh ( ) const
inline

Definition at line 80 of file DCUCCSDat.h.

References m_ccstemphigh.

Referenced by writeArrayDB().

80 { return m_ccstemphigh; }
float m_ccstemphigh
Definition: DCUCCSDat.h:103

◆ getCCSTempLow()

float DCUCCSDat::getCCSTempLow ( ) const
inline

Definition at line 79 of file DCUCCSDat.h.

References m_ccstemplow.

Referenced by writeArrayDB().

79 { return m_ccstemplow; }
float m_ccstemplow
Definition: DCUCCSDat.h:102

◆ getM1DCUTemp()

float DCUCCSDat::getM1DCUTemp ( ) const
inline

Definition at line 77 of file DCUCCSDat.h.

References m_m1_dcutemp.

Referenced by writeArrayDB().

77 { return m_m1_dcutemp; }
float m_m1_dcutemp
Definition: DCUCCSDat.h:100

◆ getM1Vcc()

float DCUCCSDat::getM1Vcc ( ) const
inline

Definition at line 75 of file DCUCCSDat.h.

References m_m1_vcc.

Referenced by writeArrayDB().

75 { return m_m1_vcc; }
float m_m1_vcc
Definition: DCUCCSDat.h:98

◆ getM1VDD1()

float DCUCCSDat::getM1VDD1 ( ) const
inline

Definition at line 69 of file DCUCCSDat.h.

References m_m1_vdd1.

Referenced by writeArrayDB().

69 { return m_m1_vdd1; }
float m_m1_vdd1
Definition: DCUCCSDat.h:92

◆ getM1VDD2()

float DCUCCSDat::getM1VDD2 ( ) const
inline

Definition at line 70 of file DCUCCSDat.h.

References m_m1_vdd2.

Referenced by writeArrayDB().

70 { return m_m1_vdd2; }
float m_m1_vdd2
Definition: DCUCCSDat.h:94

◆ getM1Vinj()

float DCUCCSDat::getM1Vinj ( ) const
inline

Definition at line 73 of file DCUCCSDat.h.

References m_m1_vinj.

Referenced by writeArrayDB().

73 { return m_m1_vinj; }
float m_m1_vinj
Definition: DCUCCSDat.h:96

◆ getM2DCUTemp()

float DCUCCSDat::getM2DCUTemp ( ) const
inline

Definition at line 78 of file DCUCCSDat.h.

References m_m2_dcutemp.

Referenced by writeArrayDB().

78 { return m_m2_dcutemp; }
float m_m2_dcutemp
Definition: DCUCCSDat.h:101

◆ getM2Vcc()

float DCUCCSDat::getM2Vcc ( ) const
inline

Definition at line 76 of file DCUCCSDat.h.

References m_m2_vcc.

Referenced by writeArrayDB().

76 { return m_m2_vcc; }
float m_m2_vcc
Definition: DCUCCSDat.h:99

◆ getM2VDD1()

float DCUCCSDat::getM2VDD1 ( ) const
inline

Definition at line 71 of file DCUCCSDat.h.

References m_m2_vdd1.

Referenced by writeArrayDB().

71 { return m_m2_vdd1; }
float m_m2_vdd1
Definition: DCUCCSDat.h:93

◆ getM2VDD2()

float DCUCCSDat::getM2VDD2 ( ) const
inline

Definition at line 72 of file DCUCCSDat.h.

References m_m2_vdd2.

Referenced by writeArrayDB().

72 { return m_m2_vdd2; }
float m_m2_vdd2
Definition: DCUCCSDat.h:95

◆ getM2Vinj()

float DCUCCSDat::getM2Vinj ( ) const
inline

Definition at line 74 of file DCUCCSDat.h.

References m_m2_vinj.

Referenced by writeArrayDB().

74 { return m_m2_vinj; }
float m_m2_vinj
Definition: DCUCCSDat.h:97

◆ getTable()

std::string DCUCCSDat::getTable ( )
inlineoverridevirtual

Implements IDataItem.

Definition at line 19 of file DCUCCSDat.h.

19 { return "DCU_CCS_DAT"; }

◆ prepareWrite()

void DCUCCSDat::prepareWrite ( )
overrideprivatevirtualnoexcept

Implements IDataItem.

Definition at line 34 of file DCUCCSDat.cc.

References MillePedeFileConverter_cfg::e.

34  {
35  this->checkConnection();
36 
37  try {
38  m_writeStmt = m_conn->createStatement();
39  m_writeStmt->setSQL(
40  "INSERT INTO dcu_ccs_dat (iov_id, logic_id, "
41  "m1_vdd1, m2_vdd1, m1_vdd2, m2_vdd2, m1_vinj, "
42  "m2_vinj, m1_vcc, m2_vcc, m1_dcutemp, m2_dcutemp, "
43  "ccstemplow, ccstemphigh) "
44  "VALUES (:iov_id, :logic_id, "
45  ":m1_vdd1, :m2_vdd1, :m1_vdd2, :m2_vdd2, :m1_vinj, "
46  ":m2_vinj, :m1_vcc, :m2_vcc, :m1_dcutemp, "
47  ":m2_dcutemp, :ccstemplow, :ccstemphigh)");
48  } catch (SQLException& e) {
49  throw(std::runtime_error("DCUCCSDat::prepareWrite(): " + e.getMessage()));
50  }
51 }
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:23
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36

◆ setCCSTemp()

void DCUCCSDat::setCCSTemp ( float  low,
float  high 
)
inline

Definition at line 51 of file DCUCCSDat.h.

References LaserClient_cfi::high, LaserClient_cfi::low, setCCSTempHigh(), and setCCSTempLow().

Referenced by fetchData().

51  {
54  }
void setCCSTempLow(float temp)
Definition: DCUCCSDat.h:49
void setCCSTempHigh(float temp)
Definition: DCUCCSDat.h:50

◆ setCCSTempHigh()

void DCUCCSDat::setCCSTempHigh ( float  temp)
inline

Definition at line 50 of file DCUCCSDat.h.

References m_ccstemphigh, and groupFilesInBlocks::temp.

Referenced by setCCSTemp().

◆ setCCSTempLow()

void DCUCCSDat::setCCSTempLow ( float  temp)
inline

Definition at line 49 of file DCUCCSDat.h.

References m_ccstemplow, and groupFilesInBlocks::temp.

Referenced by setCCSTemp().

◆ setDCUTemp()

void DCUCCSDat::setDCUTemp ( float  t1,
float  t2 
)
inline

Definition at line 45 of file DCUCCSDat.h.

References setM1DCUTemp(), setM2DCUTemp(), RandomServiceHelper::t1, and RandomServiceHelper::t2.

Referenced by fetchData().

45  {
48  }
void setM1DCUTemp(float temp)
Definition: DCUCCSDat.h:43
void setM2DCUTemp(float temp)
Definition: DCUCCSDat.h:44

◆ setM1()

void DCUCCSDat::setM1 ( float  vdd1,
float  vdd2,
float  vinj,
float  vcc,
float  dcutemp 
)
inline

Definition at line 55 of file DCUCCSDat.h.

References setM1DCUTemp(), setM1Vcc(), setM1VDD1(), setM1VDD2(), and setM1Vinj().

55  {
56  setM1VDD1(vdd1);
57  setM1VDD2(vdd2);
58  setM1Vinj(vinj);
59  setM1Vcc(vcc);
60  setM1DCUTemp(dcutemp);
61  }
void setM1DCUTemp(float temp)
Definition: DCUCCSDat.h:43
void setM1Vinj(float temp)
Definition: DCUCCSDat.h:31
void setM1Vcc(float temp)
Definition: DCUCCSDat.h:37
void setM1VDD2(float temp)
Definition: DCUCCSDat.h:23
void setM1VDD1(float temp)
Definition: DCUCCSDat.h:21

◆ setM1DCUTemp()

void DCUCCSDat::setM1DCUTemp ( float  temp)
inline

Definition at line 43 of file DCUCCSDat.h.

References m_m1_dcutemp, and groupFilesInBlocks::temp.

Referenced by setDCUTemp(), and setM1().

◆ setM1Vcc()

void DCUCCSDat::setM1Vcc ( float  temp)
inline

Definition at line 37 of file DCUCCSDat.h.

References m_m1_vcc, and groupFilesInBlocks::temp.

Referenced by setM1(), and setVcc().

37 { m_m1_vcc = temp; }
float m_m1_vcc
Definition: DCUCCSDat.h:98

◆ setM1VDD1()

void DCUCCSDat::setM1VDD1 ( float  temp)
inline

Definition at line 21 of file DCUCCSDat.h.

References m_m1_vdd1, and groupFilesInBlocks::temp.

Referenced by setM1(), and setVDD().

◆ setM1VDD2()

void DCUCCSDat::setM1VDD2 ( float  temp)
inline

Definition at line 23 of file DCUCCSDat.h.

References m_m1_vdd2, and groupFilesInBlocks::temp.

Referenced by setM1(), and setVDD().

◆ setM1Vinj()

void DCUCCSDat::setM1Vinj ( float  temp)
inline

Definition at line 31 of file DCUCCSDat.h.

References m_m1_vinj, and groupFilesInBlocks::temp.

Referenced by setM1(), and setVinj().

◆ setM2()

void DCUCCSDat::setM2 ( float  vdd1,
float  vdd2,
float  vinj,
float  vcc,
float  dcutemp 
)
inline

Definition at line 62 of file DCUCCSDat.h.

References setM2DCUTemp(), setM2Vcc(), setM2VDD1(), setM2VDD2(), and setM2Vinj().

62  {
63  setM2VDD1(vdd1);
64  setM2VDD2(vdd2);
65  setM2Vinj(vinj);
66  setM2Vcc(vcc);
67  setM2DCUTemp(dcutemp);
68  }
void setM2Vcc(float temp)
Definition: DCUCCSDat.h:38
void setM2VDD2(float temp)
Definition: DCUCCSDat.h:24
void setM2DCUTemp(float temp)
Definition: DCUCCSDat.h:44
void setM2Vinj(float temp)
Definition: DCUCCSDat.h:32
void setM2VDD1(float temp)
Definition: DCUCCSDat.h:22

◆ setM2DCUTemp()

void DCUCCSDat::setM2DCUTemp ( float  temp)
inline

Definition at line 44 of file DCUCCSDat.h.

References m_m2_dcutemp, and groupFilesInBlocks::temp.

Referenced by setDCUTemp(), and setM2().

◆ setM2Vcc()

void DCUCCSDat::setM2Vcc ( float  temp)
inline

Definition at line 38 of file DCUCCSDat.h.

References m_m2_vcc, and groupFilesInBlocks::temp.

Referenced by setM2(), and setVcc().

38 { m_m2_vcc = temp; }
float m_m2_vcc
Definition: DCUCCSDat.h:99

◆ setM2VDD1()

void DCUCCSDat::setM2VDD1 ( float  temp)
inline

Definition at line 22 of file DCUCCSDat.h.

References m_m2_vdd1, and groupFilesInBlocks::temp.

Referenced by setM2(), and setVDD().

◆ setM2VDD2()

void DCUCCSDat::setM2VDD2 ( float  temp)
inline

Definition at line 24 of file DCUCCSDat.h.

References m_m2_vdd2, and groupFilesInBlocks::temp.

Referenced by setM2(), and setVDD().

◆ setM2Vinj()

void DCUCCSDat::setM2Vinj ( float  temp)
inline

Definition at line 32 of file DCUCCSDat.h.

References m_m2_vinj, and groupFilesInBlocks::temp.

Referenced by setM2(), and setVinj().

◆ setVcc()

void DCUCCSDat::setVcc ( float  v1,
float  v2 
)
inline

Definition at line 39 of file DCUCCSDat.h.

References setM1Vcc(), and setM2Vcc().

Referenced by fetchData().

39  {
40  setM1Vcc(v1);
41  setM2Vcc(v2);
42  }
void setM2Vcc(float temp)
Definition: DCUCCSDat.h:38
void setM1Vcc(float temp)
Definition: DCUCCSDat.h:37

◆ setVDD()

void DCUCCSDat::setVDD ( float  m1vdd1,
float  m1vdd2,
float  m2vdd1,
float  m2vdd2 
)
inline

Definition at line 25 of file DCUCCSDat.h.

References setM1VDD1(), setM1VDD2(), setM2VDD1(), and setM2VDD2().

Referenced by fetchData().

25  {
26  setM1VDD1(m1vdd1);
27  setM1VDD2(m1vdd2);
28  setM2VDD1(m2vdd1);
29  setM2VDD2(m2vdd2);
30  }
void setM2VDD2(float temp)
Definition: DCUCCSDat.h:24
void setM1VDD2(float temp)
Definition: DCUCCSDat.h:23
void setM1VDD1(float temp)
Definition: DCUCCSDat.h:21
void setM2VDD1(float temp)
Definition: DCUCCSDat.h:22

◆ setVinj()

void DCUCCSDat::setVinj ( float  v1,
float  v2 
)
inline

Definition at line 33 of file DCUCCSDat.h.

References setM1Vinj(), and setM2Vinj().

Referenced by fetchData().

33  {
34  setM1Vinj(v1);
35  setM2Vinj(v2);
36  }
void setM1Vinj(float temp)
Definition: DCUCCSDat.h:31
void setM2Vinj(float temp)
Definition: DCUCCSDat.h:32

◆ writeArrayDB()

void DCUCCSDat::writeArrayDB ( const std::map< EcalLogicID, DCUCCSDat > *  data,
DCUIOV iov 
)
privatenoexcept

Definition at line 139 of file DCUCCSDat.cc.

References submitPVResolutionJobs::count, data, MillePedeFileConverter_cfg::e, getCCSTempHigh(), getCCSTempLow(), EcalLogicID::getLogicID(), getM1DCUTemp(), getM1Vcc(), getM1VDD1(), getM1VDD2(), getM1Vinj(), getM2DCUTemp(), getM2Vcc(), getM2VDD1(), getM2VDD2(), getM2Vinj(), AlCaHLTBitMon_ParallelJobs::p, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

139  {
140  this->checkConnection();
141  this->checkPrepare();
142 
143  int iovID = iov->fetchID();
144  if (!iovID) {
145  throw(std::runtime_error("DCUCCSDat::writeArrayDB: IOV not in DB"));
146  }
147 
148  int nrows = data->size();
149  int* ids = new int[nrows];
150  int* iovid_vec = new int[nrows];
151  float* x1 = new float[nrows];
152  float* x2 = new float[nrows];
153  float* x3 = new float[nrows];
154  float* x4 = new float[nrows];
155  float* x5 = new float[nrows];
156  float* x6 = new float[nrows];
157  float* x7 = new float[nrows];
158  float* x8 = new float[nrows];
159  float* x9 = new float[nrows];
160  float* xa = new float[nrows];
161  float* xb = new float[nrows];
162  float* xc = new float[nrows];
163 
164  ub2* ids_len = new ub2[nrows];
165  ub2* iov_len = new ub2[nrows];
166  ub2* x_len = new ub2[nrows];
167 
168  const EcalLogicID* channel;
169  const DCUCCSDat* dataitem;
170  int count = 0;
171  typedef map<EcalLogicID, DCUCCSDat>::const_iterator CI;
172  for (CI p = data->begin(); p != data->end(); ++p) {
173  channel = &(p->first);
174  int logicID = channel->getLogicID();
175  if (!logicID) {
176  throw(std::runtime_error("DCUCCSDat::writeArrayDB: Bad EcalLogicID"));
177  }
178  ids[count] = logicID;
179  iovid_vec[count] = iovID;
180 
181  dataitem = &(p->second);
182 
183  x1[count] = dataitem->getM1VDD1();
184  x2[count] = dataitem->getM2VDD1();
185  x3[count] = dataitem->getM1VDD2();
186  x4[count] = dataitem->getM2VDD2();
187  x5[count] = dataitem->getM1Vinj();
188  x6[count] = dataitem->getM2Vinj();
189  x7[count] = dataitem->getM1Vcc();
190  x8[count] = dataitem->getM2Vcc();
191  x9[count] = dataitem->getM1DCUTemp();
192  xa[count] = dataitem->getM2DCUTemp();
193  xb[count] = dataitem->getCCSTempLow();
194  xc[count] = dataitem->getCCSTempHigh();
195 
196  ids_len[count] = sizeof(ids[count]);
197  iov_len[count] = sizeof(iovid_vec[count]);
198 
199  x_len[count] = sizeof(x1[count]);
200 
201  count++;
202  }
203 
204  try {
205  m_writeStmt->setDataBuffer(1, (dvoid*)iovid_vec, OCCIINT, sizeof(iovid_vec[0]), iov_len);
206  m_writeStmt->setDataBuffer(2, (dvoid*)ids, OCCIINT, sizeof(ids[0]), ids_len);
207  m_writeStmt->setDataBuffer(3, (dvoid*)x1, OCCIFLOAT, sizeof(x1[0]), x_len);
208  m_writeStmt->setDataBuffer(3, (dvoid*)x2, OCCIFLOAT, sizeof(x1[0]), x_len);
209  m_writeStmt->setDataBuffer(3, (dvoid*)x3, OCCIFLOAT, sizeof(x1[0]), x_len);
210  m_writeStmt->setDataBuffer(3, (dvoid*)x4, OCCIFLOAT, sizeof(x1[0]), x_len);
211  m_writeStmt->setDataBuffer(3, (dvoid*)x5, OCCIFLOAT, sizeof(x1[0]), x_len);
212  m_writeStmt->setDataBuffer(3, (dvoid*)x6, OCCIFLOAT, sizeof(x1[0]), x_len);
213  m_writeStmt->setDataBuffer(3, (dvoid*)x7, OCCIFLOAT, sizeof(x1[0]), x_len);
214  m_writeStmt->setDataBuffer(3, (dvoid*)x8, OCCIFLOAT, sizeof(x1[0]), x_len);
215  m_writeStmt->setDataBuffer(3, (dvoid*)x9, OCCIFLOAT, sizeof(x1[0]), x_len);
216  m_writeStmt->setDataBuffer(3, (dvoid*)xa, OCCIFLOAT, sizeof(x1[0]), x_len);
217  m_writeStmt->setDataBuffer(3, (dvoid*)xb, OCCIFLOAT, sizeof(x1[0]), x_len);
218  m_writeStmt->setDataBuffer(3, (dvoid*)xc, OCCIFLOAT, sizeof(x1[0]), x_len);
219 
220  m_writeStmt->executeArrayUpdate(nrows);
221 
222  delete[] ids;
223  delete[] iovid_vec;
224  delete[] x1;
225  delete[] x2;
226  delete[] x3;
227  delete[] x4;
228  delete[] x5;
229  delete[] x6;
230  delete[] x7;
231  delete[] x8;
232  delete[] x9;
233  delete[] xa;
234  delete[] xb;
235  delete[] xc;
236 
237  delete[] ids_len;
238  delete[] iov_len;
239  delete[] x_len;
240 
241  } catch (SQLException& e) {
242  throw(std::runtime_error("DCUCCSDat::writeArrayDB(): " + e.getMessage()));
243  }
244 }
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:23
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
float getM2DCUTemp() const
Definition: DCUCCSDat.h:78
float getM2Vinj() const
Definition: DCUCCSDat.h:74
void checkPrepare() noexcept(false)
Definition: IDataItem.h:26
int getLogicID() const
Definition: EcalLogicID.cc:28
float getM2Vcc() const
Definition: DCUCCSDat.h:76
float getM1VDD2() const
Definition: DCUCCSDat.h:70
float getM2VDD2() const
Definition: DCUCCSDat.h:72
int fetchID() noexcept(false) override
Definition: DCUIOV.cc:48
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
float getM2VDD1() const
Definition: DCUCCSDat.h:71
float getCCSTempHigh() const
Definition: DCUCCSDat.h:80
float getCCSTempLow() const
Definition: DCUCCSDat.h:79
float getM1VDD1() const
Definition: DCUCCSDat.h:69
float getM1Vcc() const
Definition: DCUCCSDat.h:75
float getM1Vinj() const
Definition: DCUCCSDat.h:73
float getM1DCUTemp() const
Definition: DCUCCSDat.h:77

◆ writeDB()

void DCUCCSDat::writeDB ( const EcalLogicID ecid,
const DCUCCSDat item,
DCUIOV iov 
)
privatenoexcept

Definition at line 53 of file DCUCCSDat.cc.

References MillePedeFileConverter_cfg::e, and B2GTnPMonitor_cfi::item.

53  {
54  this->checkConnection();
55  this->checkPrepare();
56 
57  int iovID = iov->fetchID();
58  if (!iovID) {
59  throw(std::runtime_error("DCUCCSDat::writeDB: IOV not in DB"));
60  }
61 
62  int logicID = ecid->getLogicID();
63  if (!logicID) {
64  throw(std::runtime_error("DCUCCSDat::writeDB: Bad EcalLogicID"));
65  }
66 
67  try {
68  m_writeStmt->setInt(1, iovID);
69  m_writeStmt->setInt(2, logicID);
70 
71  m_writeStmt->setFloat(3, item->getM1VDD1());
72  m_writeStmt->setFloat(4, item->getM2VDD1());
73  m_writeStmt->setFloat(5, item->getM1VDD2());
74  m_writeStmt->setFloat(6, item->getM2VDD2());
75  m_writeStmt->setFloat(7, item->getM1Vinj());
76  m_writeStmt->setFloat(8, item->getM2Vinj());
77  m_writeStmt->setFloat(9, item->getM1Vcc());
78  m_writeStmt->setFloat(10, item->getM2Vcc());
79  m_writeStmt->setFloat(11, item->getM1DCUTemp());
80  m_writeStmt->setFloat(12, item->getM2DCUTemp());
81  m_writeStmt->setFloat(13, item->getCCSTempLow());
82  m_writeStmt->setFloat(14, item->getCCSTempHigh());
83 
84  m_writeStmt->executeUpdate();
85  } catch (SQLException& e) {
86  throw(std::runtime_error("DCUCCSDat::writeDB(): " + e.getMessage()));
87  }
88 }
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:23
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
void checkPrepare() noexcept(false)
Definition: IDataItem.h:26
int getLogicID() const
Definition: EcalLogicID.cc:28
int fetchID() noexcept(false) override
Definition: DCUIOV.cc:48

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 14 of file DCUCCSDat.h.

Member Data Documentation

◆ m_ccstemphigh

float DCUCCSDat::m_ccstemphigh
private

Definition at line 103 of file DCUCCSDat.h.

Referenced by getCCSTempHigh(), and setCCSTempHigh().

◆ m_ccstemplow

float DCUCCSDat::m_ccstemplow
private

Definition at line 102 of file DCUCCSDat.h.

Referenced by getCCSTempLow(), and setCCSTempLow().

◆ m_m1_dcutemp

float DCUCCSDat::m_m1_dcutemp
private

Definition at line 100 of file DCUCCSDat.h.

Referenced by getM1DCUTemp(), and setM1DCUTemp().

◆ m_m1_vcc

float DCUCCSDat::m_m1_vcc
private

Definition at line 98 of file DCUCCSDat.h.

Referenced by getM1Vcc(), and setM1Vcc().

◆ m_m1_vdd1

float DCUCCSDat::m_m1_vdd1
private

Definition at line 92 of file DCUCCSDat.h.

Referenced by getM1VDD1(), and setM1VDD1().

◆ m_m1_vdd2

float DCUCCSDat::m_m1_vdd2
private

Definition at line 94 of file DCUCCSDat.h.

Referenced by getM1VDD2(), and setM1VDD2().

◆ m_m1_vinj

float DCUCCSDat::m_m1_vinj
private

Definition at line 96 of file DCUCCSDat.h.

Referenced by getM1Vinj(), and setM1Vinj().

◆ m_m2_dcutemp

float DCUCCSDat::m_m2_dcutemp
private

Definition at line 101 of file DCUCCSDat.h.

Referenced by getM2DCUTemp(), and setM2DCUTemp().

◆ m_m2_vcc

float DCUCCSDat::m_m2_vcc
private

Definition at line 99 of file DCUCCSDat.h.

Referenced by getM2Vcc(), and setM2Vcc().

◆ m_m2_vdd1

float DCUCCSDat::m_m2_vdd1
private

Definition at line 93 of file DCUCCSDat.h.

Referenced by getM2VDD1(), and setM2VDD1().

◆ m_m2_vdd2

float DCUCCSDat::m_m2_vdd2
private

Definition at line 95 of file DCUCCSDat.h.

Referenced by getM2VDD2(), and setM2VDD2().

◆ m_m2_vinj

float DCUCCSDat::m_m2_vinj
private

Definition at line 97 of file DCUCCSDat.h.

Referenced by getM2Vinj(), and setM2Vinj().