CMS 3D CMS Logo

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

#include <RunTTErrorsDat.h>

Inheritance diagram for RunTTErrorsDat:
IDataItem IDBObject

Public Member Functions

uint64_t getErrorBits () const
 
std::string getTable ()
 
 RunTTErrorsDat ()
 
void setErrorBits (uint64_t bits)
 
 ~RunTTErrorsDat ()
 
- 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, RunTTErrorsDat > *fillMap, RunIOV *iov) noexcept(false)
 
void prepareWrite () noexcept(false)
 
void writeDB (const EcalLogicID *ecid, const RunTTErrorsDat *item, RunIOV *iov) noexcept(false)
 

Private Attributes

uint64_t m_errorBits
 

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 RunTTErrorsDat.h.

Constructor & Destructor Documentation

RunTTErrorsDat::RunTTErrorsDat ( )

Definition at line 12 of file RunTTErrorsDat.cc.

References NULL.

13 {
14  m_env = NULL;
15  m_conn = NULL;
16  m_writeStmt = NULL;
17  m_readStmt = NULL;
18 
19  m_errorBits = 0;
20 }
uint64_t m_errorBits
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:28
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
#define NULL
Definition: scimark2.h:8
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:29
RunTTErrorsDat::~RunTTErrorsDat ( )

Definition at line 24 of file RunTTErrorsDat.cc.

25 {
26 }

Member Function Documentation

void RunTTErrorsDat::fetchData ( std::map< EcalLogicID, RunTTErrorsDat > *  fillMap,
RunIOV iov 
)
privatenoexcept

Definition at line 73 of file RunTTErrorsDat.cc.

References MillePedeFileConverter_cfg::e, AlCaHLTBitMon_ParallelJobs::p, and setErrorBits().

Referenced by getErrorBits().

75 {
76  this->checkConnection();
77  fillMap->clear();
78 
79  iov->setConnection(m_env, m_conn);
80  int iovID = iov->fetchID();
81  if (!iovID) {
82  // throw(std::runtime_error("RunTTErrorsDat::writeDB: IOV not in DB"));
83  return;
84  }
85 
86  try {
87 
88  /* Using TO_CHAR because OCCI does not support 64-bit integers well */
89  m_readStmt->setSQL("SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
90  "to_char(d.error_bits) "
91  "FROM channelview cv JOIN run_tt_errors_dat d "
92  "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
93  "WHERE d.iov_id = :iov_id");
94  m_readStmt->setInt(1, iovID);
95  ResultSet* rset = m_readStmt->executeQuery();
96 
97  std::pair< EcalLogicID, RunTTErrorsDat > p;
98  RunTTErrorsDat dat;
99  while(rset->next()) {
100  p.first = EcalLogicID( rset->getString(1), // name
101  rset->getInt(2), // logic_id
102  rset->getInt(3), // id1
103  rset->getInt(4), // id2
104  rset->getInt(5), // id3
105  rset->getString(6)); // maps_to
106 
107  dat.setErrorBits( boost::lexical_cast<uint64_t>(rset->getString(7)) );
108 
109  p.second = dat;
110  fillMap->insert(p);
111  }
112 
113  } catch (SQLException &e) {
114  throw(std::runtime_error("RunTTErrorsDat::fetchData(): "+e.getMessage()));
115  }
116 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void setErrorBits(uint64_t bits)
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
int fetchID() noexcept(false)
Definition: RunIOV.cc:103
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:29
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
uint64_t RunTTErrorsDat::getErrorBits ( ) const
inline

Definition at line 22 of file RunTTErrorsDat.h.

References fetchData(), m_errorBits, noexcept, prepareWrite(), and writeDB().

22 { return m_errorBits; }
uint64_t m_errorBits
std::string RunTTErrorsDat::getTable ( )
inlinevirtual

Implements IDataItem.

Definition at line 19 of file RunTTErrorsDat.h.

19 { return "RUN_TT_ERRORS_DAT"; }
void RunTTErrorsDat::prepareWrite ( )
privatevirtualnoexcept

Implements IDataItem.

Definition at line 30 of file RunTTErrorsDat.cc.

References MillePedeFileConverter_cfg::e.

Referenced by getErrorBits().

32 {
33  this->checkConnection();
34 
35  try {
36  m_writeStmt = m_conn->createStatement();
37  /* Using TO_NUMBER because OCCI does not support 64-bit integers well */
38  m_writeStmt->setSQL("INSERT INTO run_tt_errors_dat (iov_id, logic_id, "
39  "error_bits) "
40  "VALUES (:iov_id, :logic_id, "
41  "to_number(:error_bits))");
42  } catch (SQLException &e) {
43  throw(std::runtime_error("RunTTErrorsDat::prepareWrite(): "+e.getMessage()));
44  }
45 }
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:28
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
void RunTTErrorsDat::setErrorBits ( uint64_t  bits)
inline

Definition at line 21 of file RunTTErrorsDat.h.

References bits, and m_errorBits.

Referenced by fetchData().

21 { m_errorBits = bits; }
uint64_t m_errorBits
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
void RunTTErrorsDat::writeDB ( const EcalLogicID ecid,
const RunTTErrorsDat item,
RunIOV iov 
)
privatenoexcept

Definition at line 49 of file RunTTErrorsDat.cc.

References MillePedeFileConverter_cfg::e.

Referenced by getErrorBits().

51 {
52  this->checkConnection();
53  this->checkPrepare();
54 
55  int iovID = iov->fetchID();
56  if (!iovID) { throw(std::runtime_error("RunTTErrorsDat::writeDB: IOV not in DB")); }
57 
58  int logicID = ecid->getLogicID();
59  if (!logicID) { throw(std::runtime_error("RunTTErrorsDat::writeDB: Bad EcalLogicID")); }
60 
61  try {
62  m_writeStmt->setInt(1, iovID);
63  m_writeStmt->setInt(2, logicID);
64  m_writeStmt->setString(3, ( std::to_string(item->getErrorBits()) ).c_str());
65  m_writeStmt->executeUpdate();
66  } catch (SQLException &e) {
67  throw(std::runtime_error("RunTTErrorsDat::writeDB(): "+e.getMessage()));
68  }
69 }
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:28
void checkPrepare() noexcept(false)
Definition: IDataItem.h:31
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
int getLogicID() const
Definition: EcalLogicID.cc:41
int fetchID() noexcept(false)
Definition: RunIOV.cc:103
uint64_t getErrorBits() const

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 14 of file RunTTErrorsDat.h.

Member Data Documentation

uint64_t RunTTErrorsDat::m_errorBits
private

Definition at line 35 of file RunTTErrorsDat.h.

Referenced by getErrorBits(), and setErrorBits().