CMS 3D CMS Logo

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

#include <MonRunDat.h>

Inheritance diagram for MonRunDat:
IDataItem IDBObject

Public Member Functions

MonRunOutcomeDef getMonRunOutcomeDef () const
 
int getNumEvents () const
 
std::string getRootfileName () const
 
std::string getTable ()
 
int getTaskList () const
 
int getTaskOutcome () const
 
 MonRunDat ()
 
void setMonRunOutcomeDef (const MonRunOutcomeDef &outcomeDef)
 
void setNumEvents (int num)
 
void setRootfileName (std::string name)
 
void setTaskList (int list)
 
void setTaskOutcome (int outcome)
 
 ~MonRunDat ()
 
- 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, MonRunDat > *fillMap, MonRunIOV *iov) throw (std::runtime_error)
 
void prepareWrite () throw (std::runtime_error)
 
void writeDB (const EcalLogicID *ecid, const MonRunDat *item, MonRunIOV *iov) throw (std::runtime_error)
 

Private Attributes

int m_numEvents
 
MonRunOutcomeDef m_outcomeDef
 
std::string m_rootfileName
 
int m_taskList
 
int m_taskOutcome
 

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 () throw (std::runtime_error)
 
void createReadStatement () throw (std::runtime_error)
 
void setPrefetchRowCount (int ncount) throw (std::runtime_error)
 
void terminateReadStatement () throw (std::runtime_error)
 
void terminateWriteStatement () throw (std::runtime_error)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const throw (std::runtime_error)
 
- 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 MonRunDat.h.

Constructor & Destructor Documentation

MonRunDat::MonRunDat ( )

Definition at line 12 of file MonRunDat.cc.

References NULL.

13 {
14  m_env = NULL;
15  m_conn = NULL;
16  m_writeStmt = NULL;
17  m_readStmt = NULL;
18 
19  m_numEvents = 0;
21  m_rootfileName = "";
22  m_taskList = 0;
23  m_taskOutcome = 0;
24 }
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
int m_taskList
Definition: MonRunDat.h:50
int m_numEvents
Definition: MonRunDat.h:47
MonRunOutcomeDef m_outcomeDef
Definition: MonRunDat.h:48
std::string m_rootfileName
Definition: MonRunDat.h:49
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:29
int m_taskOutcome
Definition: MonRunDat.h:51
MonRunDat::~MonRunDat ( )

Definition at line 28 of file MonRunDat.cc.

29 {
30 }

Member Function Documentation

void MonRunDat::fetchData ( std::map< EcalLogicID, MonRunDat > *  fillMap,
MonRunIOV iov 
)
throw (std::runtime_error
)
private

Definition at line 86 of file MonRunDat.cc.

References alignCSCRings::e, o2o::iov, AlCaHLTBitMon_ParallelJobs::p, MonRunOutcomeDef::setByID(), IDBObject::setConnection(), setMonRunOutcomeDef(), setNumEvents(), setRootfileName(), setTaskList(), and setTaskOutcome().

88 {
89  this->checkConnection();
90  fillMap->clear();
91 
92  iov->setConnection(m_env, m_conn);
93  int iovID = iov->fetchID();
94  if (!iovID) {
95  // throw(std::runtime_error("MonRunDat::writeDB: IOV not in DB"));
96  return;
97  }
98 
99  try {
100 
101  m_readStmt->setSQL("SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
102  "d.num_events, d.run_outcome_id, d.rootfile_name, d.task_list, d.task_outcome "
103  "FROM channelview cv JOIN mon_run_dat d "
104  "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
105  "WHERE d.iov_id = :iov_id");
106  m_readStmt->setInt(1, iovID);
107  ResultSet* rset = m_readStmt->executeQuery();
108 
109  std::pair< EcalLogicID, MonRunDat > p;
110  MonRunDat dat;
111  MonRunOutcomeDef outcomeDef;
112  outcomeDef.setConnection(m_env, m_conn);
113  while(rset->next()) {
114  p.first = EcalLogicID( rset->getString(1), // name
115  rset->getInt(2), // logic_id
116  rset->getInt(3), // id1
117  rset->getInt(4), // id2
118  rset->getInt(5), // id3
119  rset->getString(6)); // maps_to
120 
121  dat.setNumEvents( rset->getInt(7) );
122  outcomeDef.setByID( rset->getInt(8) );
123  dat.setMonRunOutcomeDef( outcomeDef );
124  dat.setRootfileName( rset->getString(9) );
125  dat.setTaskList( rset->getInt(10) );
126  dat.setTaskOutcome( rset->getInt(11) );
127 
128  p.second = dat;
129  fillMap->insert(p);
130  }
131  } catch (SQLException &e) {
132  throw(std::runtime_error("MonRunDat::fetchData(): "+e.getMessage()));
133  }
134 }
void setTaskList(int list)
Definition: MonRunDat.h:30
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
void setNumEvents(int num)
Definition: MonRunDat.h:21
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void setMonRunOutcomeDef(const MonRunOutcomeDef &outcomeDef)
Definition: MonRunDat.h:24
void setByID(int id)
int fetchID()
Definition: MonRunIOV.cc:118
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
void setRootfileName(std::string name)
Definition: MonRunDat.h:27
void setTaskOutcome(int outcome)
Definition: MonRunDat.h:33
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:29
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void checkConnection() const
Definition: IDBObject.h:41
MonRunOutcomeDef MonRunDat::getMonRunOutcomeDef ( ) const
inline

Definition at line 25 of file MonRunDat.h.

References m_outcomeDef.

25 { return m_outcomeDef; }
MonRunOutcomeDef m_outcomeDef
Definition: MonRunDat.h:48
int MonRunDat::getNumEvents ( ) const
inline

Definition at line 22 of file MonRunDat.h.

References m_numEvents.

22 { return m_numEvents; }
int m_numEvents
Definition: MonRunDat.h:47
std::string MonRunDat::getRootfileName ( ) const
inline

Definition at line 28 of file MonRunDat.h.

References m_rootfileName.

28 { return m_rootfileName; }
std::string m_rootfileName
Definition: MonRunDat.h:49
std::string MonRunDat::getTable ( )
inlinevirtual

Implements IDataItem.

Definition at line 19 of file MonRunDat.h.

19 { return "MON_RUN_DAT"; }
int MonRunDat::getTaskList ( ) const
inline

Definition at line 31 of file MonRunDat.h.

References m_taskList.

31 { return m_taskList; }
int m_taskList
Definition: MonRunDat.h:50
int MonRunDat::getTaskOutcome ( ) const
inline

Definition at line 34 of file MonRunDat.h.

References m_taskOutcome.

34 { return m_taskOutcome; }
int m_taskOutcome
Definition: MonRunDat.h:51
void MonRunDat::prepareWrite ( )
throw (std::runtime_error
)
privatevirtual

Implements IDataItem.

Definition at line 34 of file MonRunDat.cc.

References alignCSCRings::e.

36 {
37  this->checkConnection();
38 
39  try {
40  m_writeStmt = m_conn->createStatement();
41  m_writeStmt->setSQL("INSERT INTO mon_run_dat (iov_id, logic_id, "
42  "num_events, run_outcome_id, rootfile_name, task_list, task_outcome) "
43  "VALUES (:iov_id, :logic_id, "
44  ":num_events, :run_outcome_id, :rootfile_name, :task_list, :task_outcome) ");
45  } catch (SQLException &e) {
46  throw(std::runtime_error("MonRunDat::prepareWrite(): "+e.getMessage()));
47  }
48 }
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:28
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
void checkConnection() const
Definition: IDBObject.h:41
void MonRunDat::setMonRunOutcomeDef ( const MonRunOutcomeDef outcomeDef)
inline

Definition at line 24 of file MonRunDat.h.

References m_outcomeDef.

Referenced by fetchData(), and ecaldqm::SummaryWriter::run().

24 { m_outcomeDef = outcomeDef; }
MonRunOutcomeDef m_outcomeDef
Definition: MonRunDat.h:48
void MonRunDat::setNumEvents ( int  num)
inline

Definition at line 21 of file MonRunDat.h.

References m_numEvents, and pileupDistInMC::num.

Referenced by fetchData(), and ecaldqm::SummaryWriter::run().

21 { m_numEvents = num; }
int m_numEvents
Definition: MonRunDat.h:47
void MonRunDat::setRootfileName ( std::string  name)
inline

Definition at line 27 of file MonRunDat.h.

References m_rootfileName, and mergeVDriftHistosByStation::name.

Referenced by fetchData().

void MonRunDat::setTaskList ( int  list)
inline

Definition at line 30 of file MonRunDat.h.

References list(), and m_taskList.

Referenced by fetchData(), and ecaldqm::SummaryWriter::run().

30 { m_taskList = list; }
int m_taskList
Definition: MonRunDat.h:50
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 and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void MonRunDat::setTaskOutcome ( int  outcome)
inline

Definition at line 33 of file MonRunDat.h.

References m_taskOutcome.

Referenced by fetchData(), and ecaldqm::SummaryWriter::run().

33 { m_taskOutcome = outcome; }
int m_taskOutcome
Definition: MonRunDat.h:51
void MonRunDat::writeDB ( const EcalLogicID ecid,
const MonRunDat item,
MonRunIOV iov 
)
throw (std::runtime_error
)
private

Definition at line 52 of file MonRunDat.cc.

References alignCSCRings::e, MonRunOutcomeDef::fetchID(), o2o::iov, and IDBObject::setConnection().

54 {
55  this->checkConnection();
56  this->checkPrepare();
57 
58  int iovID = iov->fetchID();
59  if (!iovID) { throw(std::runtime_error("MonRunDat::writeDB: IOV not in DB")); }
60 
61  MonRunOutcomeDef monRunOutcomeDef = item->getMonRunOutcomeDef(); // XXX object copy every row!
62  monRunOutcomeDef.setConnection(m_env, m_conn);
63  int outcomeID = monRunOutcomeDef.fetchID();
64  if (!outcomeID) { throw(std::runtime_error("MonRunDat::writeDB: Outcome Definition not in DB")); }
65 
66  int logicID = ecid->getLogicID();
67  if (!logicID) { throw(std::runtime_error("MonRunDat::writeDB: Bad EcalLogicID")); }
68 
69  try {
70  m_writeStmt->setInt(1, iovID);
71  m_writeStmt->setInt(2, logicID);
72  m_writeStmt->setInt(3, item->getNumEvents());
73  m_writeStmt->setInt(4, outcomeID);
74  m_writeStmt->setString(5, item->getRootfileName());
75  m_writeStmt->setInt(6, item->getTaskList());
76  m_writeStmt->setInt(7, item->getTaskOutcome());
77 
78  m_writeStmt->executeUpdate();
79  } catch (SQLException &e) {
80  throw(std::runtime_error("MonRunDat::writeDB(): "+e.getMessage()));
81  }
82 }
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
int getTaskList() const
Definition: MonRunDat.h:31
int getNumEvents() const
Definition: MonRunDat.h:22
int getTaskOutcome() const
Definition: MonRunDat.h:34
int fetchID()
Definition: MonRunIOV.cc:118
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
MonRunOutcomeDef getMonRunOutcomeDef() const
Definition: MonRunDat.h:25
int getLogicID() const
Definition: EcalLogicID.cc:41
void checkPrepare()
Definition: IDataItem.h:31
std::string getRootfileName() const
Definition: MonRunDat.h:28
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void checkConnection() const
Definition: IDBObject.h:41

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 14 of file MonRunDat.h.

Member Data Documentation

int MonRunDat::m_numEvents
private

Definition at line 47 of file MonRunDat.h.

Referenced by getNumEvents(), and setNumEvents().

MonRunOutcomeDef MonRunDat::m_outcomeDef
private

Definition at line 48 of file MonRunDat.h.

Referenced by getMonRunOutcomeDef(), and setMonRunOutcomeDef().

std::string MonRunDat::m_rootfileName
private

Definition at line 49 of file MonRunDat.h.

Referenced by getRootfileName(), and setRootfileName().

int MonRunDat::m_taskList
private

Definition at line 50 of file MonRunDat.h.

Referenced by getTaskList(), and setTaskList().

int MonRunDat::m_taskOutcome
private

Definition at line 51 of file MonRunDat.h.

Referenced by getTaskOutcome(), and setTaskOutcome().