CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
ODVfeToRejectDat Class Reference

#include <ODVfeToRejectDat.h>

Inheritance diagram for ODVfeToRejectDat:
IODConfig IDBObject

Public Member Functions

int getFedId () const
 
int getGain () const
 
int getId () const
 
int getStatus () const
 
std::string getTable () override
 
int getTTId () const
 
int getVfeId () const
 
 ODVfeToRejectDat ()
 
void setFedId (int dac)
 
void setGain (int dac)
 
void setId (int dac)
 
void setStatus (int dac)
 
void setTTId (int dac)
 
void setVfeId (int dac)
 
 ~ODVfeToRejectDat () override
 
- Public Member Functions inherited from IODConfig
std::string getConfigTag ()
 
void setConfigTag (std::string x)
 
- 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::vector< ODVfeToRejectDat > *fillMap, ODVfeToRejectInfo *iov) noexcept(false)
 
void prepareWrite () noexcept(false) override
 
void writeArrayDB (const std::vector< ODVfeToRejectDat > &data, ODVfeToRejectInfo *iov) noexcept(false)
 
void writeDB (const ODVfeToRejectDat *item, ODVfeToRejectInfo *iov) noexcept(false)
 

Private Attributes

int m_fed
 
int m_gain
 
int m_ID
 
int m_sta
 
int m_tt
 
int m_vfe
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Public Types inherited from IODConfig
typedef oracle::occi::Clob Clob
 
typedef oracle::occi::SQLException SQLException
 
typedef oracle::occi::Statement Statement
 
typedef oracle::occi::Stream Stream
 
- Public Attributes inherited from IODConfig
std::string m_config_tag
 
- Static Public Attributes inherited from IDBObject
static const int ECALDB_NROWS = 1024
 
- Protected Member Functions inherited from IODConfig
void checkPrepare () noexcept(false)
 
void createReadStatement () noexcept(false)
 
void populateClob (Clob &clob, std::string fname, unsigned int bufsize) noexcept(false)
 
unsigned char * readClob (Clob &clob, int size) 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 IODConfig
Statementm_readStmt
 
Statementm_writeStmt
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Detailed Description

Definition at line 11 of file ODVfeToRejectDat.h.

Constructor & Destructor Documentation

◆ ODVfeToRejectDat()

ODVfeToRejectDat::ODVfeToRejectDat ( )

Definition at line 10 of file ODVfeToRejectDat.cc.

10  {
11  m_env = nullptr;
12  m_conn = nullptr;
13  m_writeStmt = nullptr;
14  m_readStmt = nullptr;
15 
16  m_fed = 0;
17  m_tt = 0;
18  m_vfe = 0;
19  m_gain = 0;
20  m_sta = 0;
21 }

◆ ~ODVfeToRejectDat()

ODVfeToRejectDat::~ODVfeToRejectDat ( )
override

Definition at line 23 of file ODVfeToRejectDat.cc.

23 {}

Member Function Documentation

◆ fetchData()

void ODVfeToRejectDat::fetchData ( std::vector< ODVfeToRejectDat > *  fillMap,
ODVfeToRejectInfo iov 
)
privatenoexcept

Definition at line 55 of file ODVfeToRejectDat.cc.

55  {
56  this->checkConnection();
57 
58  iov->setConnection(m_env, m_conn);
59  int iovID = iov->fetchID();
60  if (!iovID) {
61  std::cout << "ID not in the DB" << endl;
62  return;
63  }
64 
65  try {
66  m_readStmt->setSQL("SELECT * FROM " + getTable() + " WHERE rec_id = :rec_id order by fed_id, tt_id, vfe_id ");
67  m_readStmt->setInt(1, iovID);
68  ResultSet* rset = m_readStmt->executeQuery();
69 
70  // std::vector< ODVfeToRejectDat > p;
71  ODVfeToRejectDat dat;
72  while (rset->next()) {
73  // dat.setId( rset->getInt(1) );
74  dat.setFedId(rset->getInt(2));
75  dat.setTTId(rset->getInt(3));
76  dat.setVfeId(rset->getInt(4));
77  dat.setGain(rset->getInt(5));
78  dat.setStatus(rset->getInt(6));
79 
80  p->push_back(dat);
81  }
82 
83  } catch (SQLException& e) {
84  throw(std::runtime_error("ODVfeToRejectDat::fetchData(): " + e.getMessage()));
85  }
86 }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, AlCaHLTBitMon_ParallelJobs::p, setFedId(), setGain(), setStatus(), setTTId(), and setVfeId().

◆ getFedId()

int ODVfeToRejectDat::getFedId ( ) const
inline

Definition at line 24 of file ODVfeToRejectDat.h.

24 { return m_fed; }

References m_fed.

Referenced by writeArrayDB().

◆ getGain()

int ODVfeToRejectDat::getGain ( ) const
inline

Definition at line 33 of file ODVfeToRejectDat.h.

33 { return m_gain; }

References m_gain.

Referenced by writeArrayDB().

◆ getId()

int ODVfeToRejectDat::getId ( void  ) const
inline

Definition at line 21 of file ODVfeToRejectDat.h.

21 { return m_ID; }

References m_ID.

◆ getStatus()

int ODVfeToRejectDat::getStatus ( ) const
inline

Definition at line 36 of file ODVfeToRejectDat.h.

36 { return m_sta; }

References m_sta.

Referenced by writeArrayDB().

◆ getTable()

std::string ODVfeToRejectDat::getTable ( )
inlineoverridevirtual

Implements IODConfig.

Definition at line 18 of file ODVfeToRejectDat.h.

18 { return "VFES_TO_REJECT_DAT"; }

◆ getTTId()

int ODVfeToRejectDat::getTTId ( ) const
inline

Definition at line 27 of file ODVfeToRejectDat.h.

27 { return m_tt; }

References m_tt.

Referenced by writeArrayDB().

◆ getVfeId()

int ODVfeToRejectDat::getVfeId ( ) const
inline

Definition at line 30 of file ODVfeToRejectDat.h.

30 { return m_vfe; }

References m_vfe.

Referenced by writeArrayDB().

◆ prepareWrite()

void ODVfeToRejectDat::prepareWrite ( )
overrideprivatevirtualnoexcept

Implements IODConfig.

Definition at line 25 of file ODVfeToRejectDat.cc.

25  {
26  this->checkConnection();
27 
28  try {
29  m_writeStmt = m_conn->createStatement();
30  m_writeStmt->setSQL("INSERT INTO " + getTable() +
31  " (rec_id, fed_id, tt_id, vfe_id, GAIN, STATUS ) "
32  "VALUES (:1, :2, :3, :4, :5 , :6 )");
33  } catch (SQLException& e) {
34  throw(std::runtime_error("ODVfeToRejectDat::prepareWrite(): " + e.getMessage()));
35  }
36 }

References MillePedeFileConverter_cfg::e.

◆ setFedId()

void ODVfeToRejectDat::setFedId ( int  dac)
inline

Definition at line 23 of file ODVfeToRejectDat.h.

23 { m_fed = dac; }

References m_fed.

Referenced by fetchData().

◆ setGain()

void ODVfeToRejectDat::setGain ( int  dac)
inline

Definition at line 32 of file ODVfeToRejectDat.h.

32 { m_gain = dac; }

References m_gain.

Referenced by fetchData().

◆ setId()

void ODVfeToRejectDat::setId ( int  dac)
inline

Definition at line 20 of file ODVfeToRejectDat.h.

20 { m_ID = dac; }

References m_ID.

◆ setStatus()

void ODVfeToRejectDat::setStatus ( int  dac)
inline

Definition at line 35 of file ODVfeToRejectDat.h.

35 { m_sta = dac; }

References m_sta.

Referenced by fetchData().

◆ setTTId()

void ODVfeToRejectDat::setTTId ( int  dac)
inline

Definition at line 26 of file ODVfeToRejectDat.h.

26 { m_tt = dac; }

References m_tt.

Referenced by fetchData().

◆ setVfeId()

void ODVfeToRejectDat::setVfeId ( int  dac)
inline

Definition at line 29 of file ODVfeToRejectDat.h.

29 { m_vfe = dac; }

References m_vfe.

Referenced by fetchData().

◆ writeArrayDB()

void ODVfeToRejectDat::writeArrayDB ( const std::vector< ODVfeToRejectDat > &  data,
ODVfeToRejectInfo iov 
)
privatenoexcept

Definition at line 90 of file ODVfeToRejectDat.cc.

90  {
91  this->checkConnection();
92 
93  int iovID = iov->fetchID();
94  if (!iovID) {
95  throw(std::runtime_error("ODDelays::writeArrayDB: ODFEDelaysInfo not in DB"));
96  }
97 
98  int nrows = data.size();
99  int* ids = new int[nrows];
100  int* xx = new int[nrows];
101  int* yy = new int[nrows];
102  int* zz = new int[nrows];
103  int* ww = new int[nrows];
104  int* st = new int[nrows];
105 
106  ub2* ids_len = new ub2[nrows];
107  ub2* x_len = new ub2[nrows];
108  ub2* y_len = new ub2[nrows];
109  ub2* z_len = new ub2[nrows];
110  ub2* w_len = new ub2[nrows];
111  ub2* st_len = new ub2[nrows];
112 
113  ODVfeToRejectDat dataitem;
114 
115  for (int count = 0; count != (int)data.size(); count++) {
116  dataitem = data[count];
117  ids[count] = iovID;
118  xx[count] = dataitem.getFedId();
119  yy[count] = dataitem.getTTId();
120  zz[count] = dataitem.getVfeId();
121  ww[count] = dataitem.getGain();
122  st[count] = dataitem.getStatus();
123 
124  ids_len[count] = sizeof(ids[count]);
125  x_len[count] = sizeof(xx[count]);
126  y_len[count] = sizeof(yy[count]);
127  z_len[count] = sizeof(zz[count]);
128  w_len[count] = sizeof(ww[count]);
129  st_len[count] = sizeof(st[count]);
130  }
131 
132  try {
133  m_writeStmt->setDataBuffer(1, (dvoid*)ids, OCCIINT, sizeof(ids[0]), ids_len);
134  m_writeStmt->setDataBuffer(2, (dvoid*)xx, OCCIINT, sizeof(xx[0]), x_len);
135  m_writeStmt->setDataBuffer(3, (dvoid*)yy, OCCIINT, sizeof(yy[0]), y_len);
136  m_writeStmt->setDataBuffer(4, (dvoid*)zz, OCCIINT, sizeof(zz[0]), z_len);
137  m_writeStmt->setDataBuffer(5, (dvoid*)ww, OCCIINT, sizeof(ww[0]), w_len);
138  m_writeStmt->setDataBuffer(6, (dvoid*)st, OCCIINT, sizeof(st[0]), st_len);
139 
140  m_writeStmt->executeArrayUpdate(nrows);
141 
142  delete[] ids;
143  delete[] xx;
144  delete[] yy;
145  delete[] zz;
146  delete[] ww;
147  delete[] st;
148 
149  delete[] ids_len;
150  delete[] x_len;
151  delete[] y_len;
152  delete[] z_len;
153  delete[] w_len;
154  delete[] st_len;
155 
156  } catch (SQLException& e) {
157  throw(std::runtime_error("ODVfeToRejectDat::writeArrayDB(): " + e.getMessage()));
158  }
159 }

References submitPVResolutionJobs::count, data, MillePedeFileConverter_cfg::e, getFedId(), getGain(), getStatus(), getTTId(), getVfeId(), createfilelist::int, geometryCSVtoXML::xx, geometryCSVtoXML::yy, and geometryCSVtoXML::zz.

◆ writeDB()

void ODVfeToRejectDat::writeDB ( const ODVfeToRejectDat item,
ODVfeToRejectInfo iov 
)
privatenoexcept

Definition at line 38 of file ODVfeToRejectDat.cc.

38  {
39  this->checkConnection();
40 
41  try {
42  m_writeStmt->setInt(1, item->getId());
43  m_writeStmt->setInt(2, item->getFedId());
44  m_writeStmt->setInt(3, item->getTTId());
45  m_writeStmt->setInt(4, item->getVfeId());
46  m_writeStmt->setInt(5, item->getGain());
47  m_writeStmt->setInt(6, item->getStatus());
48 
49  m_writeStmt->executeUpdate();
50  } catch (SQLException& e) {
51  throw(std::runtime_error("ODVfeToRejectDat::writeDB(): " + e.getMessage()));
52  }
53 }

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

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 13 of file ODVfeToRejectDat.h.

Member Data Documentation

◆ m_fed

int ODVfeToRejectDat::m_fed
private

Definition at line 49 of file ODVfeToRejectDat.h.

Referenced by getFedId(), and setFedId().

◆ m_gain

int ODVfeToRejectDat::m_gain
private

Definition at line 52 of file ODVfeToRejectDat.h.

Referenced by getGain(), and setGain().

◆ m_ID

int ODVfeToRejectDat::m_ID
private

Definition at line 54 of file ODVfeToRejectDat.h.

Referenced by getId(), and setId().

◆ m_sta

int ODVfeToRejectDat::m_sta
private

Definition at line 53 of file ODVfeToRejectDat.h.

Referenced by getStatus(), and setStatus().

◆ m_tt

int ODVfeToRejectDat::m_tt
private

Definition at line 50 of file ODVfeToRejectDat.h.

Referenced by getTTId(), and setTTId().

◆ m_vfe

int ODVfeToRejectDat::m_vfe
private

Definition at line 51 of file ODVfeToRejectDat.h.

Referenced by getVfeId(), and setVfeId().

geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
ODVfeToRejectDat::getVfeId
int getVfeId() const
Definition: ODVfeToRejectDat.h:30
ODVfeToRejectInfo::fetchID
int fetchID() noexcept(false)
Definition: ODVfeToRejectInfo.cc:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
ODVfeToRejectDat::m_vfe
int m_vfe
Definition: ODVfeToRejectDat.h:51
ODVfeToRejectDat::setStatus
void setStatus(int dac)
Definition: ODVfeToRejectDat.h:35
ODVfeToRejectDat::getFedId
int getFedId() const
Definition: ODVfeToRejectDat.h:24
IODConfig::SQLException
oracle::occi::SQLException SQLException
Definition: IODConfig.h:20
ODVfeToRejectDat
Definition: ODVfeToRejectDat.h:11
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
ODVfeToRejectDat::getTTId
int getTTId() const
Definition: ODVfeToRejectDat.h:27
ODVfeToRejectDat::m_ID
int m_ID
Definition: ODVfeToRejectDat.h:54
IDBObject::checkConnection
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
ODVfeToRejectDat::m_fed
int m_fed
Definition: ODVfeToRejectDat.h:49
IODConfig::m_readStmt
Statement * m_readStmt
Definition: IODConfig.h:34
ODVfeToRejectDat::m_tt
int m_tt
Definition: ODVfeToRejectDat.h:50
ODVfeToRejectDat::getStatus
int getStatus() const
Definition: ODVfeToRejectDat.h:36
ODVfeToRejectDat::m_gain
int m_gain
Definition: ODVfeToRejectDat.h:52
createfilelist.int
int
Definition: createfilelist.py:10
ODVfeToRejectDat::setFedId
void setFedId(int dac)
Definition: ODVfeToRejectDat.h:23
ODVfeToRejectDat::setVfeId
void setVfeId(int dac)
Definition: ODVfeToRejectDat.h:29
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
ODVfeToRejectDat::setTTId
void setTTId(int dac)
Definition: ODVfeToRejectDat.h:26
ODVfeToRejectDat::getGain
int getGain() const
Definition: ODVfeToRejectDat.h:33
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
IODConfig::m_writeStmt
Statement * m_writeStmt
Definition: IODConfig.h:33
ODVfeToRejectDat::getId
int getId() const
Definition: ODVfeToRejectDat.h:21
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
ODVfeToRejectDat::getTable
std::string getTable() override
Definition: ODVfeToRejectDat.h:18
ODVfeToRejectDat::m_sta
int m_sta
Definition: ODVfeToRejectDat.h:53
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
ODVfeToRejectDat::setGain
void setGain(int dac)
Definition: ODVfeToRejectDat.h:32
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37