CMS 3D CMS Logo

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 () override
 
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 () 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, MonRunDat > *fillMap, MonRunIOV *iov) noexcept(false)
 
void prepareWrite () noexcept(false) override
 
void writeDB (const EcalLogicID *ecid, const MonRunDat *item, MonRunIOV *iov) noexcept(false)
 

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 const int 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 MonRunDat.h.

Constructor & Destructor Documentation

◆ MonRunDat()

MonRunDat::MonRunDat ( )

Definition at line 12 of file MonRunDat.cc.

12  {
13  m_env = nullptr;
14  m_conn = nullptr;
15  m_writeStmt = nullptr;
16  m_readStmt = nullptr;
17 
18  m_numEvents = 0;
20  m_rootfileName = "";
21  m_taskList = 0;
22  m_taskOutcome = 0;
23 }

◆ ~MonRunDat()

MonRunDat::~MonRunDat ( )
override

Definition at line 25 of file MonRunDat.cc.

25 {}

Member Function Documentation

◆ fetchData()

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

Definition at line 78 of file MonRunDat.cc.

78  {
79  this->checkConnection();
80  fillMap->clear();
81 
82  iov->setConnection(m_env, m_conn);
83  int iovID = iov->fetchID();
84  if (!iovID) {
85  // throw(std::runtime_error("MonRunDat::writeDB: IOV not in DB"));
86  return;
87  }
88 
89  try {
90  m_readStmt->setSQL(
91  "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
92  "d.num_events, d.run_outcome_id, d.rootfile_name, d.task_list, d.task_outcome "
93  "FROM channelview cv JOIN mon_run_dat d "
94  "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
95  "WHERE d.iov_id = :iov_id");
96  m_readStmt->setInt(1, iovID);
97  ResultSet* rset = m_readStmt->executeQuery();
98 
99  std::pair<EcalLogicID, MonRunDat> p;
100  MonRunDat dat;
101  MonRunOutcomeDef outcomeDef;
102  outcomeDef.setConnection(m_env, m_conn);
103  while (rset->next()) {
104  p.first = EcalLogicID(rset->getString(1), // name
105  rset->getInt(2), // logic_id
106  rset->getInt(3), // id1
107  rset->getInt(4), // id2
108  rset->getInt(5), // id3
109  rset->getString(6)); // maps_to
110 
111  dat.setNumEvents(rset->getInt(7));
112  outcomeDef.setByID(rset->getInt(8));
113  dat.setMonRunOutcomeDef(outcomeDef);
114  dat.setRootfileName(rset->getString(9));
115  dat.setTaskList(rset->getInt(10));
116  dat.setTaskOutcome(rset->getInt(11));
117 
118  p.second = dat;
119  fillMap->insert(p);
120  }
121  } catch (SQLException& e) {
122  throw(std::runtime_error("MonRunDat::fetchData(): " + e.getMessage()));
123  }
124 }

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

◆ getMonRunOutcomeDef()

MonRunOutcomeDef MonRunDat::getMonRunOutcomeDef ( ) const
inline

Definition at line 25 of file MonRunDat.h.

25 { return m_outcomeDef; }

References m_outcomeDef.

◆ getNumEvents()

int MonRunDat::getNumEvents ( ) const
inline

Definition at line 22 of file MonRunDat.h.

22 { return m_numEvents; }

References m_numEvents.

◆ getRootfileName()

std::string MonRunDat::getRootfileName ( ) const
inline

Definition at line 28 of file MonRunDat.h.

28 { return m_rootfileName; }

References m_rootfileName.

◆ getTable()

std::string MonRunDat::getTable ( )
inlineoverridevirtual

Implements IDataItem.

Definition at line 19 of file MonRunDat.h.

19 { return "MON_RUN_DAT"; }

◆ getTaskList()

int MonRunDat::getTaskList ( ) const
inline

Definition at line 31 of file MonRunDat.h.

31 { return m_taskList; }

References m_taskList.

◆ getTaskOutcome()

int MonRunDat::getTaskOutcome ( ) const
inline

Definition at line 34 of file MonRunDat.h.

34 { return m_taskOutcome; }

References m_taskOutcome.

◆ prepareWrite()

void MonRunDat::prepareWrite ( )
overrideprivatevirtualnoexcept

Implements IDataItem.

Definition at line 27 of file MonRunDat.cc.

27  {
28  this->checkConnection();
29 
30  try {
31  m_writeStmt = m_conn->createStatement();
32  m_writeStmt->setSQL(
33  "INSERT INTO mon_run_dat (iov_id, logic_id, "
34  "num_events, run_outcome_id, rootfile_name, task_list, task_outcome) "
35  "VALUES (:iov_id, :logic_id, "
36  ":num_events, :run_outcome_id, :rootfile_name, :task_list, :task_outcome) ");
37  } catch (SQLException& e) {
38  throw(std::runtime_error("MonRunDat::prepareWrite(): " + e.getMessage()));
39  }
40 }

References MillePedeFileConverter_cfg::e.

◆ setMonRunOutcomeDef()

void MonRunDat::setMonRunOutcomeDef ( const MonRunOutcomeDef outcomeDef)
inline

Definition at line 24 of file MonRunDat.h.

24 { m_outcomeDef = outcomeDef; }

References m_outcomeDef.

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

◆ setNumEvents()

void MonRunDat::setNumEvents ( int  num)
inline

Definition at line 21 of file MonRunDat.h.

21 { m_numEvents = num; }

References m_numEvents, and EgammaValidation_cff::num.

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

◆ setRootfileName()

void MonRunDat::setRootfileName ( std::string  name)
inline

Definition at line 27 of file MonRunDat.h.

27 { m_rootfileName = name; }

References m_rootfileName, and Skims_PA_cff::name.

Referenced by fetchData().

◆ setTaskList()

void MonRunDat::setTaskList ( int  list)
inline

Definition at line 30 of file MonRunDat.h.

30 { m_taskList = list; }

References list(), and m_taskList.

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

◆ setTaskOutcome()

void MonRunDat::setTaskOutcome ( int  outcome)
inline

Definition at line 33 of file MonRunDat.h.

33 { m_taskOutcome = outcome; }

References m_taskOutcome.

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

◆ writeDB()

void MonRunDat::writeDB ( const EcalLogicID ecid,
const MonRunDat item,
MonRunIOV iov 
)
privatenoexcept

Definition at line 42 of file MonRunDat.cc.

42  {
43  this->checkConnection();
44  this->checkPrepare();
45 
46  int iovID = iov->fetchID();
47  if (!iovID) {
48  throw(std::runtime_error("MonRunDat::writeDB: IOV not in DB"));
49  }
50 
51  MonRunOutcomeDef monRunOutcomeDef = item->getMonRunOutcomeDef(); // XXX object copy every row!
52  monRunOutcomeDef.setConnection(m_env, m_conn);
53  int outcomeID = monRunOutcomeDef.fetchID();
54  if (!outcomeID) {
55  throw(std::runtime_error("MonRunDat::writeDB: Outcome Definition not in DB"));
56  }
57 
58  int logicID = ecid->getLogicID();
59  if (!logicID) {
60  throw(std::runtime_error("MonRunDat::writeDB: Bad EcalLogicID"));
61  }
62 
63  try {
64  m_writeStmt->setInt(1, iovID);
65  m_writeStmt->setInt(2, logicID);
66  m_writeStmt->setInt(3, item->getNumEvents());
67  m_writeStmt->setInt(4, outcomeID);
68  m_writeStmt->setString(5, item->getRootfileName());
69  m_writeStmt->setInt(6, item->getTaskList());
70  m_writeStmt->setInt(7, item->getTaskOutcome());
71 
72  m_writeStmt->executeUpdate();
73  } catch (SQLException& e) {
74  throw(std::runtime_error("MonRunDat::writeDB(): " + e.getMessage()));
75  }
76 }

References MillePedeFileConverter_cfg::e, MonRunOutcomeDef::fetchID(), B2GTnPMonitor_cfi::item, and IDBObject::setConnection().

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 14 of file MonRunDat.h.

Member Data Documentation

◆ m_numEvents

int MonRunDat::m_numEvents
private

Definition at line 44 of file MonRunDat.h.

Referenced by getNumEvents(), and setNumEvents().

◆ m_outcomeDef

MonRunOutcomeDef MonRunDat::m_outcomeDef
private

Definition at line 45 of file MonRunDat.h.

Referenced by getMonRunOutcomeDef(), and setMonRunOutcomeDef().

◆ m_rootfileName

std::string MonRunDat::m_rootfileName
private

Definition at line 46 of file MonRunDat.h.

Referenced by getRootfileName(), and setRootfileName().

◆ m_taskList

int MonRunDat::m_taskList
private

Definition at line 47 of file MonRunDat.h.

Referenced by getTaskList(), and setTaskList().

◆ m_taskOutcome

int MonRunDat::m_taskOutcome
private

Definition at line 48 of file MonRunDat.h.

Referenced by getTaskOutcome(), and setTaskOutcome().

MonRunIOV::fetchID
int fetchID() noexcept(false) override
Definition: MonRunIOV.cc:72
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MonRunDat::setMonRunOutcomeDef
void setMonRunOutcomeDef(const MonRunOutcomeDef &outcomeDef)
Definition: MonRunDat.h:24
MonRunDat::m_taskOutcome
int m_taskOutcome
Definition: MonRunDat.h:48
IDataItem::checkPrepare
void checkPrepare() noexcept(false)
Definition: IDataItem.h:26
MonRunOutcomeDef::fetchID
int fetchID() noexcept(false) override
Definition: MonRunOutcomeDef.cc:30
EcalLogicID::getLogicID
int getLogicID() const
Definition: EcalLogicID.cc:28
IDataItem::m_readStmt
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:24
MonRunDat
Definition: MonRunDat.h:12
MonRunDat::setTaskOutcome
void setTaskOutcome(int outcome)
Definition: MonRunDat.h:33
IDataItem::m_writeStmt
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:23
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
EcalLogicID
Definition: EcalLogicID.h:7
IDBObject::checkConnection
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
MonRunDat::m_taskList
int m_taskList
Definition: MonRunDat.h:47
MonRunDat::setRootfileName
void setRootfileName(std::string name)
Definition: MonRunDat.h:27
MonRunDat::m_rootfileName
std::string m_rootfileName
Definition: MonRunDat.h:46
MonRunDat::m_outcomeDef
MonRunOutcomeDef m_outcomeDef
Definition: MonRunDat.h:45
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
MonRunOutcomeDef::setByID
void setByID(int id) noexcept(false) override
Definition: MonRunOutcomeDef.cc:60
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
MonRunDat::m_numEvents
int m_numEvents
Definition: MonRunDat.h:44
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MonRunDat::setTaskList
void setTaskList(int list)
Definition: MonRunDat.h:30
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
list
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
MonRunDat::setNumEvents
void setNumEvents(int num)
Definition: MonRunDat.h:21
MonRunOutcomeDef
Definition: MonRunOutcomeDef.h:12
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37