CMS 3D CMS Logo

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

#include <FEConfigBadTTDat.h>

Inheritance diagram for FEConfigBadTTDat:
IODConfig IDBObject

Public Member Functions

 FEConfigBadTTDat ()
 
int getFedId () const
 
int getId () const
 
int getStatus () const
 
std::string getTable () override
 
int getTCCId () const
 
int getTTId () const
 
void setFedId (int x)
 
void setId (int dac)
 
void setStatus (int dac)
 
void setTCCId (int dac)
 
void setTTId (int dac)
 
 ~FEConfigBadTTDat () 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< FEConfigBadTTDat > *fillMap, FEConfigBadTTInfo *iov) noexcept(false)
 
void prepareWrite () noexcept(false) override
 
void writeArrayDB (const std::vector< FEConfigBadTTDat > &data, FEConfigBadTTInfo *iov) noexcept(false)
 
void writeDB (const FEConfigBadTTDat *item, FEConfigBadTTInfo *iov) noexcept(false)
 

Private Attributes

int m_fed
 
int m_ID
 
int m_t1
 
int m_tcc
 
int m_tt
 

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 10 of file FEConfigBadTTDat.h.

Constructor & Destructor Documentation

◆ FEConfigBadTTDat()

FEConfigBadTTDat::FEConfigBadTTDat ( )

Definition at line 10 of file FEConfigBadTTDat.cc.

10  {
11  m_env = nullptr;
12  m_conn = nullptr;
13  m_writeStmt = nullptr;
14  m_readStmt = nullptr;
15 
16  m_tcc = 0;
17  m_fed = 0;
18  m_tt = 0;
19  m_t1 = 0;
20 }

◆ ~FEConfigBadTTDat()

FEConfigBadTTDat::~FEConfigBadTTDat ( )
override

Definition at line 22 of file FEConfigBadTTDat.cc.

22 {}

Member Function Documentation

◆ fetchData()

void FEConfigBadTTDat::fetchData ( std::vector< FEConfigBadTTDat > *  fillMap,
FEConfigBadTTInfo iov 
)
privatenoexcept

Definition at line 53 of file FEConfigBadTTDat.cc.

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

References MillePedeFileConverter_cfg::e, AlCaHLTBitMon_ParallelJobs::p, setFedId(), setStatus(), setTCCId(), and setTTId().

◆ getFedId()

int FEConfigBadTTDat::getFedId ( ) const
inline

Definition at line 23 of file FEConfigBadTTDat.h.

23 { return m_fed; }

References m_fed.

Referenced by writeArrayDB().

◆ getId()

int FEConfigBadTTDat::getId ( void  ) const
inline

Definition at line 20 of file FEConfigBadTTDat.h.

20 { return m_ID; }

References m_ID.

◆ getStatus()

int FEConfigBadTTDat::getStatus ( ) const
inline

Definition at line 32 of file FEConfigBadTTDat.h.

32 { return m_t1; }

References m_t1.

Referenced by popcon::EcalTPGBadTTHandler::getNewObjects(), and writeArrayDB().

◆ getTable()

std::string FEConfigBadTTDat::getTable ( )
inlineoverridevirtual

Implements IODConfig.

Definition at line 17 of file FEConfigBadTTDat.h.

17 { return "FE_CONFIG_BadTT_DAT"; }

◆ getTCCId()

int FEConfigBadTTDat::getTCCId ( ) const
inline

Definition at line 26 of file FEConfigBadTTDat.h.

26 { return m_tcc; }

References m_tcc.

Referenced by popcon::EcalTPGBadTTHandler::getNewObjects(), and writeArrayDB().

◆ getTTId()

int FEConfigBadTTDat::getTTId ( ) const
inline

Definition at line 29 of file FEConfigBadTTDat.h.

29 { return m_tt; }

References m_tt.

Referenced by popcon::EcalTPGBadTTHandler::getNewObjects(), and writeArrayDB().

◆ prepareWrite()

void FEConfigBadTTDat::prepareWrite ( )
overrideprivatevirtualnoexcept

Implements IODConfig.

Definition at line 24 of file FEConfigBadTTDat.cc.

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

References MillePedeFileConverter_cfg::e.

◆ setFedId()

void FEConfigBadTTDat::setFedId ( int  x)
inline

Definition at line 22 of file FEConfigBadTTDat.h.

22 { m_fed = x; }

References m_fed, and x.

Referenced by fetchData().

◆ setId()

void FEConfigBadTTDat::setId ( int  dac)
inline

Definition at line 19 of file FEConfigBadTTDat.h.

19 { m_ID = dac; }

References m_ID.

◆ setStatus()

void FEConfigBadTTDat::setStatus ( int  dac)
inline

Definition at line 31 of file FEConfigBadTTDat.h.

31 { m_t1 = dac; }

References m_t1.

Referenced by fetchData().

◆ setTCCId()

void FEConfigBadTTDat::setTCCId ( int  dac)
inline

Definition at line 25 of file FEConfigBadTTDat.h.

25 { m_tcc = dac; }

References m_tcc.

Referenced by fetchData().

◆ setTTId()

void FEConfigBadTTDat::setTTId ( int  dac)
inline

Definition at line 28 of file FEConfigBadTTDat.h.

28 { m_tt = dac; }

References m_tt.

Referenced by fetchData().

◆ writeArrayDB()

void FEConfigBadTTDat::writeArrayDB ( const std::vector< FEConfigBadTTDat > &  data,
FEConfigBadTTInfo iov 
)
privatenoexcept

Definition at line 86 of file FEConfigBadTTDat.cc.

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

References submitPVResolutionJobs::count, data, MillePedeFileConverter_cfg::e, getFedId(), getStatus(), getTCCId(), getTTId(), geometryCSVtoXML::xx, geometryCSVtoXML::yy, and geometryCSVtoXML::zz.

◆ writeDB()

void FEConfigBadTTDat::writeDB ( const FEConfigBadTTDat item,
FEConfigBadTTInfo iov 
)
privatenoexcept

Definition at line 37 of file FEConfigBadTTDat.cc.

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

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

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 12 of file FEConfigBadTTDat.h.

Member Data Documentation

◆ m_fed

int FEConfigBadTTDat::m_fed
private

Definition at line 45 of file FEConfigBadTTDat.h.

Referenced by getFedId(), and setFedId().

◆ m_ID

int FEConfigBadTTDat::m_ID
private

Definition at line 48 of file FEConfigBadTTDat.h.

Referenced by getId(), and setId().

◆ m_t1

int FEConfigBadTTDat::m_t1
private

Definition at line 47 of file FEConfigBadTTDat.h.

Referenced by getStatus(), and setStatus().

◆ m_tcc

int FEConfigBadTTDat::m_tcc
private

Definition at line 44 of file FEConfigBadTTDat.h.

Referenced by getTCCId(), and setTCCId().

◆ m_tt

int FEConfigBadTTDat::m_tt
private

Definition at line 46 of file FEConfigBadTTDat.h.

Referenced by getTTId(), and setTTId().

FEConfigBadTTDat::getTCCId
int getTCCId() const
Definition: FEConfigBadTTDat.h:26
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DDAxes::x
IODConfig::SQLException
oracle::occi::SQLException SQLException
Definition: IODConfig.h:20
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
FEConfigBadTTDat::m_tcc
int m_tcc
Definition: FEConfigBadTTDat.h:44
FEConfigBadTTDat::getFedId
int getFedId() const
Definition: FEConfigBadTTDat.h:23
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
FEConfigBadTTDat::setTCCId
void setTCCId(int dac)
Definition: FEConfigBadTTDat.h:25
FEConfigBadTTDat::m_t1
int m_t1
Definition: FEConfigBadTTDat.h:47
FEConfigBadTTDat::m_tt
int m_tt
Definition: FEConfigBadTTDat.h:46
FEConfigBadTTDat::getId
int getId() const
Definition: FEConfigBadTTDat.h:20
IDBObject::checkConnection
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
IODConfig::m_readStmt
Statement * m_readStmt
Definition: IODConfig.h:34
FEConfigBadTTDat::setFedId
void setFedId(int x)
Definition: FEConfigBadTTDat.h:22
FEConfigBadTTDat::getStatus
int getStatus() const
Definition: FEConfigBadTTDat.h:32
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
FEConfigBadTTDat::getTable
std::string getTable() override
Definition: FEConfigBadTTDat.h:17
FEConfigBadTTDat::m_fed
int m_fed
Definition: FEConfigBadTTDat.h:45
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
FEConfigBadTTInfo::fetchID
int fetchID() noexcept(false)
Definition: FEConfigBadTTInfo.cc:142
FEConfigBadTTDat::getTTId
int getTTId() const
Definition: FEConfigBadTTDat.h:29
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
FEConfigBadTTDat::setTTId
void setTTId(int dac)
Definition: FEConfigBadTTDat.h:28
FEConfigBadTTDat::setStatus
void setStatus(int dac)
Definition: FEConfigBadTTDat.h:31
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
FEConfigBadTTDat::m_ID
int m_ID
Definition: FEConfigBadTTDat.h:48
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
FEConfigBadTTDat
Definition: FEConfigBadTTDat.h:10