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
EcalCondDBInterface Class Reference

#include <EcalCondDBInterface.h>

Inheritance diagram for EcalCondDBInterface:
EcalDBConnection EcalTPGDBApp

Public Member Functions

void dummy ()
 
 EcalCondDBInterface (std::string host, std::string sid, std::string user, std::string pass, int port=1521)
 
 EcalCondDBInterface (std::string sid, std::string user, std::string pass)
 
CaliIOV fetchCaliIOV (CaliTag *tag, Tm evenTm) throw (std::runtime_error)
 
template<class DATT , class ICONF >
void fetchConfigDataSet (std::vector< DATT > *fillMap, ICONF *iconf) throw (std::runtime_error)
 
template<class ICONF >
void fetchConfigSet (ICONF *iconf) throw (std::runtime_error)
 
template<class DATT , class IOVT >
void fetchDataSet (std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) throw (std::runtime_error)
 
template<class DATT , class IOVT >
void fetchDataSetWithMap (std::map< EcalLogicID, DATT > *fillMap, IOVT *iov, std::string mapping_name) throw (std::runtime_error)
 
template<class DATT >
void fetchDCSDataSet (std::list< std::pair< Tm, std::map< EcalLogicID, DATT > > > *fillMap, Tm t) throw (std::runtime_error)
 
DCSPTMTempList fetchDCSPTMTempList (EcalLogicID ecid) throw (std::runtime_error)
 
DCSPTMTempList fetchDCSPTMTempList (EcalLogicID ecid, Tm start, Tm end) throw (std::runtime_error)
 
DCUIOV fetchDCUIOV (DCUTag *tag, Tm evenTm) throw (std::runtime_error)
 
std::list< ODDelaysDatfetchFEDelaysForRun (RunIOV *iov) throw (std::runtime_error)
 
RunList fetchGlobalRunListByLocation (RunTag tag, int min_run, int max_run, const LocationDef locDef) throw (std::runtime_error)
 
template<class ICONF >
void fetchLastConfigSet (ICONF *iconf) throw (std::runtime_error)
 
RunIOV fetchLMFLastRun () const
 
LMFRunIOV fetchLMFRunIOV (RunTag *runtag, LMFRunTag *lmftag, run_t run, subrun_t lmfrun) throw (std::runtime_error)
 
bool fetchLMFRunIOV (const LMFSeqDat &, LMFRunIOV &, int lmr, int type, int color) const
 
MonRunIOV fetchMonRunIOV (RunTag *runtag, MonRunTag *montag, run_t run, subrun_t monrun) throw (std::runtime_error)
 
MonRunList fetchMonRunList (RunTag tag, MonRunTag monruntag) throw (std::runtime_error)
 
MonRunList fetchMonRunList (RunTag tag, MonRunTag monruntag, int min_run, int max_run) throw (std::runtime_error)
 
MonRunList fetchMonRunListLastNRuns (RunTag tag, MonRunTag monruntag, int max_run, int n_runs) throw (std::runtime_error)
 
RunList fetchNonEmptyGlobalRunList (RunTag tag, int min_run, int max_run) throw (std::runtime_error)
 
RunList fetchNonEmptyRunList (RunTag tag, int min_run, int max_run) throw (std::runtime_error)
 
RunIOV fetchRunIOV (RunTag *tag, run_t run) throw (std::runtime_error)
 
RunIOV fetchRunIOV (std::string location, run_t run) throw (std::runtime_error)
 
RunIOV fetchRunIOV (std::string location, const Tm &t) throw (std::runtime_error)
 
RunList fetchRunList (RunTag tag) throw (std::runtime_error)
 
RunList fetchRunList (RunTag tag, int min_run, int max_run) throw (std::runtime_error)
 
RunList fetchRunListByLocation (RunTag tag, int min_run, int max_run, const LocationDef locDef) throw (std::runtime_error)
 
RunList fetchRunListLastNRuns (RunTag tag, int max_run, int n_runs) throw (std::runtime_error)
 
template<class DATT , class IOVT >
void fetchValidDataSet (std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, RunTag *tag, run_t run=(unsigned int)-1) throw (std::runtime_error)
 
template<class DATT , class IOVT >
void fetchValidDataSet (std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, std::string location, run_t run=(unsigned int)-1) throw (std::runtime_error)
 
DateHandlergetDateHandler ()
 
std::map< int, int > getDetId2LogicIdMap ()
 
int getDetIdFromLogicId (int logic_id)
 
EcalLogicID getEcalLogicID (std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="") throw (std::runtime_error)
 
EcalLogicID getEcalLogicID (int logicID) throw (std::runtime_error)
 
std::map< int, int > getEcalLogicID2LmrMap ()
 
std::vector< EcalLogicIDgetEcalLogicIDForLMPN (int lmr_logic_id)
 
std::vector< EcalLogicIDgetEcalLogicIDForLMPN (const EcalLogicID &lmr_logic_id)
 
std::vector< EcalLogicIDgetEcalLogicIDForLMR (int lmr_logic_id)
 
std::vector< EcalLogicIDgetEcalLogicIDForLMR (const EcalLogicID &lmr_logic_id)
 
std::vector< EcalLogicIDgetEcalLogicIDMappedTo (int logic_id, std::string maps_to)
 
std::vector< EcalLogicIDgetEcalLogicIDSet (std::string name, int fromId1=EcalLogicID::NULLID, int toId1=EcalLogicID::NULLID, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="") throw (std::runtime_error)
 
std::vector< EcalLogicIDgetEcalLogicIDSetOrdered (std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID) throw (std::runtime_error)
 
std::map< int, int > getLogicId2DetIdMap ()
 
int getLogicIdFromDetId (int det_id)
 
template<class DATT , class ICONF >
void insertConfigDataArraySet (const std::vector< DATT > data, ICONF *iconf) throw (std::runtime_error)
 
template<class DATT , class ICONF >
void insertConfigDataSet (const std::vector< DATT > data, ICONF *iconf) throw (std::runtime_error)
 
template<class ICONF >
void insertConfigSet (ICONF *iconf) throw (std::runtime_error)
 
template<class DATT , class IOVT >
void insertDataArraySet (const std::map< EcalLogicID, DATT > *data, IOVT *iov) throw (std::runtime_error)
 
template<class DATT , class IOVT >
void insertDataSet (const std::map< EcalLogicID, DATT > *data, IOVT *iov) throw (std::runtime_error)
 
template<class DATT , class IOVT >
void insertDataSetVector (std::vector< EcalLogicID > ecid, std::vector< IOVT > run_iov, std::vector< DATT > data) throw (std::runtime_error)
 
void insertDCUIOV (DCUIOV *iov) throw (std::runtime_error)
 
void insertLmfDat (LMFDat *dat) throw (std::runtime_error)
 
void insertLmfDat (std::list< LMFDat * > dat) throw (std::runtime_error)
 
void insertLmfIOV (LMFIOV *iov) throw (std::runtime_error)
 
void insertLmfLmrSubIOV (LMFLmrSubIOV *iov) throw (std::runtime_error)
 
void insertLmfRunIOV (LMFRunIOV *iov) throw (std::runtime_error)
 
void insertLmfSeq (LMFSeqDat *iov) throw (std::runtime_error)
 
void insertMonRunIOV (MonRunIOV *iov) throw (std::runtime_error)
 
void insertRunIOV (RunIOV *iov) throw (std::runtime_error)
 
void updateRunConfig (ODRunConfigInfo *od) throw (std::runtime_error)
 
void updateRunIOV (RunIOV *iov) throw (std::runtime_error)
 
void updateRunIOVEndTime (RunIOV *iov) throw (std::runtime_error)
 
void updateRunIOVStartTime (RunIOV *iov) throw (std::runtime_error)
 
virtual ~EcalCondDBInterface () throw (std::runtime_error)
 
- Public Member Functions inherited from EcalDBConnection
void commit ()
 
oracle::occi::Statement * createStatement ()
 
 EcalDBConnection (std::string host, std::string sid, std::string user, std::string pass, int port=1521) throw (std::runtime_error)
 
 EcalDBConnection (std::string sid, std::string user, std::string pass) throw (std::runtime_error)
 
oracle::occi::Clob getClobLocator ()
 
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void rollback ()
 
void terminateStatement (oracle::occi::Statement *stmt)
 
virtual ~EcalDBConnection () throw (std::runtime_error)
 

Private Member Functions

 EcalCondDBInterface ()
 
 EcalCondDBInterface (const EcalCondDBInterface &copy)
 
void fillLogicId2DetIdMaps ()
 

Private Attributes

std::map< int, int > _detId2LogicId
 
std::map< int, int > _logicId2DetId
 
DateHandlerdh
 

Additional Inherited Members

- Protected Attributes inherited from EcalDBConnection
oracle::occi::Connection * conn
 
oracle::occi::Environment * env
 
std::string host
 
std::string pass
 
int port
 
std::string sid
 
oracle::occi::Statement * stmt
 
std::string user
 

Detailed Description

Definition at line 39 of file EcalCondDBInterface.h.

Constructor & Destructor Documentation

EcalCondDBInterface::EcalCondDBInterface ( std::string  host,
std::string  sid,
std::string  user,
std::string  pass,
int  port = 1521 
)
inline

Constructor, makes connection to DB without TNS_ADMIN === Parameters === host: DB host machine sid: DB SID (name) user: User to connect pass: Password for user port: port number to connect, default 1521

Definition at line 55 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, dh, and EcalDBConnection::env.

61  {
62  // call the parent constructor
63 
64  // create a DateHandler
65  dh = new DateHandler(env, conn);
66  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
EcalDBConnection(std::string host, std::string sid, std::string user, std::string pass, int port=1521)
EcalCondDBInterface::EcalCondDBInterface ( std::string  sid,
std::string  user,
std::string  pass 
)
inline

Constructor, makes connection to DB with TNS_ADMIN === Parameters === sid: DB SID (name) user: User to connect pass: Password for user

Definition at line 77 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, dh, and EcalDBConnection::env.

81  {
82  // call the parent constructor
83 
84  // create a DateHandler
85  dh = new DateHandler(env, conn);
86  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
EcalDBConnection(std::string host, std::string sid, std::string user, std::string pass, int port=1521)
virtual EcalCondDBInterface::~EcalCondDBInterface ( )
throw (std::runtime_error
)
inlinevirtual

Destructor

Definition at line 92 of file EcalCondDBInterface.h.

References dh.

94  {
95  // call the parent destructor
96 
97  // destroy the DateHandler
98  delete(dh);
99  }
EcalCondDBInterface::EcalCondDBInterface ( )
private
EcalCondDBInterface::EcalCondDBInterface ( const EcalCondDBInterface copy)
private

Member Function Documentation

void EcalCondDBInterface::dummy ( )

Definition at line 920 of file EcalCondDBInterface.cc.

921 {
922 }
CaliIOV EcalCondDBInterface::fetchCaliIOV ( CaliTag tag,
Tm  evenTm 
)
throw (std::runtime_error
)

Return a Calibration IOV object

Definition at line 792 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, CaliIOV::setByTm(), IDBObject::setConnection(), and GlobalPosition_Frontier_DevDB_cff::tag.

794 {
795  CaliIOV caliiov;
796  caliiov.setConnection(env, conn);
797  caliiov.setByTm(tag, eventTm);
798  return caliiov;
799 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void setByTm(CaliTag *tag, Tm time)
Definition: CaliIOV.cc:215
template<class DATT , class ICONF >
void EcalCondDBInterface::fetchConfigDataSet ( std::vector< DATT > *  fillMap,
ICONF *  iconf 
)
throw (std::runtime_error
)
inline

Definition at line 558 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, EcalDBConnection::env, and edm::pset::fillMap().

560  {
561 
562  DATT datiface;
563  datiface.setConnection(env, conn);
564  datiface.createReadStatement();
565  datiface.setPrefetchRowCount(1024);
566  datiface.fetchData( fillMap, iconf );
567  datiface.terminateReadStatement();
568 
569  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
template<class ICONF >
void EcalCondDBInterface::fetchConfigSet ( ICONF *  iconf)
throw (std::runtime_error
)
inline

Definition at line 449 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, and EcalDBConnection::env.

Referenced by EcalTPGDBApp::readFromConfDB_TPGPedestals().

451  {
452 
453  iconf->clear();
454  iconf->setConnection(env, conn);
455  iconf->createReadStatement();
456  iconf->fetchData(iconf);
457  iconf->terminateReadStatement();
458 
459  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
template<class DATT , class IOVT >
void EcalCondDBInterface::fetchDataSet ( std::map< EcalLogicID, DATT > *  fillMap,
IOVT *  iov 
)
throw (std::runtime_error
)
inline

Definition at line 581 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, EcalDBConnection::env, edm::pset::fillMap(), and o2o::iov.

Referenced by EcalTPGParamBuilder::analyze(), EcalEndcapMonitorClient::endRunDb(), EcalBarrelMonitorClient::endRunDb(), EcalTPGDBApp::readFromCondDB_Pedestals(), and EcalTPGDBApp::readFromConfDB_TPGPedestals().

583  {
584  fillMap->clear();
585 
586  DATT datiface;
587  datiface.setConnection(env, conn);
588  datiface.createReadStatement();
589  datiface.setPrefetchRowCount(1024);
590  datiface.fetchData( fillMap, iov );
591  datiface.terminateReadStatement();
592 
593  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple iov
Definition: o2o.py:307
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
template<class DATT , class IOVT >
void EcalCondDBInterface::fetchDataSetWithMap ( std::map< EcalLogicID, DATT > *  fillMap,
IOVT *  iov,
std::string  mapping_name 
)
throw (std::runtime_error
)
inline

Definition at line 625 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, EcalDBConnection::env, edm::pset::fillMap(), and o2o::iov.

627  {
628  fillMap->clear();
629 
630  DATT datiface;
631  datiface.setConnection(env, conn);
632  datiface.createReadStatement();
633  datiface.setPrefetchRowCount(1024);
634  datiface.fetchData( fillMap, iov , mapping_name);
635  datiface.terminateReadStatement();
636 
637  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple iov
Definition: o2o.py:307
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
template<class DATT >
void EcalCondDBInterface::fetchDCSDataSet ( std::list< std::pair< Tm, std::map< EcalLogicID, DATT > > > *  fillMap,
Tm  t 
)
throw (std::runtime_error
)
inline

Definition at line 602 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, EcalDBConnection::env, edm::pset::fillMap(), and lumiQTWidget::t.

604  {
605  fillMap->clear();
606 
607  DATT datiface;
608  datiface.setConnection(env, conn);
609  datiface.createReadStatement();
610  datiface.setPrefetchRowCount(1024);
611  datiface.fetchHistoricalData( fillMap, t );
612  datiface.terminateReadStatement();
613 
614  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
DCSPTMTempList EcalCondDBInterface::fetchDCSPTMTempList ( EcalLogicID  ecid)
throw (std::runtime_error
)

Return a PTM Temp List

Definition at line 801 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, DCSPTMTempList::fetchValuesForECID(), alignCSCRings::r, and IDBObject::setConnection().

803 {
805  r.setConnection(env, conn);
806  r.fetchValuesForECID(ecid);
807  return r;
808 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fetchValuesForECID(EcalLogicID ecid)
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
DCSPTMTempList EcalCondDBInterface::fetchDCSPTMTempList ( EcalLogicID  ecid,
Tm  start,
Tm  end 
)
throw (std::runtime_error
)

Definition at line 810 of file EcalCondDBInterface.cc.

References results_mgr::conn, end, web.browse_db::env, DCSPTMTempList::fetchValuesForECIDAndTime(), alignCSCRings::r, IDBObject::setConnection(), and errorMatrix2Lands_multiChannel::start.

812 {
814  r.setConnection(env, conn);
815  r.fetchValuesForECIDAndTime(ecid, start, end);
816  return r;
817 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fetchValuesForECIDAndTime(EcalLogicID ecid, Tm start, Tm end)
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
DCUIOV EcalCondDBInterface::fetchDCUIOV ( DCUTag tag,
Tm  evenTm 
)
throw (std::runtime_error
)

Return a DCU IOV object

Definition at line 737 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, DCUIOV::setByTm(), IDBObject::setConnection(), and GlobalPosition_Frontier_DevDB_cff::tag.

739 {
740  DCUIOV dcuiov;
741  dcuiov.setConnection(env, conn);
742  dcuiov.setByTm(tag, eventTm);
743  return dcuiov;
744 }
void setByTm(DCUTag *tag, Tm time)
Definition: DCUIOV.cc:214
oracle::occi::Environment * env
Definition: DCUIOV.h:13
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
std::list< ODDelaysDat > EcalCondDBInterface::fetchFEDelaysForRun ( RunIOV iov)
throw (std::runtime_error
)

Return run Fe Config Dat objects for a given run

Definition at line 107 of file EcalCondDBInterface.cc.

References results_mgr::conn, alignCSCRings::e, web.browse_db::env, RunFEConfigDat::fetchData(), ODDelaysDat::fetchData(), ODFEDAQConfig::fetchData(), edm::pset::fillMap(), ODFEDAQConfig::getDelayId(), i, o2o::iov, run_regression::ret, IDBObject::setConnection(), ODFEDAQConfig::setId(), and groupFilesInBlocks::temp.

109 {
110  std::list<ODDelaysDat> ret;
111  RunFEConfigDat d;
112  std::map<EcalLogicID, RunFEConfigDat > fillMap;
113  try {
114  d.setConnection(env, conn);
115  d.fetchData(&fillMap, iov);
116  } catch (std::runtime_error &e) {
117  throw e;
118  }
119  std::map<EcalLogicID, RunFEConfigDat >::const_iterator i = fillMap.begin();
120  std::map<EcalLogicID, RunFEConfigDat >::const_iterator e = fillMap.end();
121  while (i != e) {
122  ODFEDAQConfig feDaqConfig;
124  temp.setId(i->second.getConfigId());
125  feDaqConfig.setConnection(env, conn);
126  feDaqConfig.fetchData(&temp);
127  std::vector<ODDelaysDat> delays;
128  ODDelaysDat temp2;
129  temp2.setConnection(env, conn);
130  temp2.fetchData(&delays, temp.getDelayId());
131  std::vector<ODDelaysDat>::const_iterator di = delays.begin();
132  std::vector<ODDelaysDat>::const_iterator de = delays.end();
133  while (di != de) {
134  ret.push_back(*di++);
135  }
136  i++;
137  }
138  return ret;
139 }
int i
Definition: DBlmapReader.cc:9
void setId(int id)
Definition: ODFEDAQConfig.h:18
int getDelayId() const
Definition: ODFEDAQConfig.h:29
oracle::occi::Environment * env
void fetchData(ODFEDAQConfig *result)
oracle::occi::Connection * conn
void fetchData(std::map< EcalLogicID, RunFEConfigDat > *fillMap, RunIOV *iov)
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
void fetchData(std::vector< ODDelaysDat > *fillMap, int id)
Definition: ODDelaysDat.cc:73
RunList EcalCondDBInterface::fetchGlobalRunListByLocation ( RunTag  tag,
int  min_run,
int  max_run,
const LocationDef  locDef 
)
throw (std::runtime_error
)

Definition at line 862 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, RunList::fetchGlobalRunsByLocation(), alignCSCRings::r, IDBObject::setConnection(), RunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

863  {
864  RunList r;
865  r.setConnection(env, conn);
866  r.setRunTag(tag);
867  r.fetchGlobalRunsByLocation( min_run, max_run, locDef);
868  return r;
869 }
void setRunTag(RunTag tag)
Definition: RunList.cc:22
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fetchGlobalRunsByLocation(int min_run, int max_run, const LocationDef locDef)
Definition: RunList.cc:354
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
template<class ICONF >
void EcalCondDBInterface::fetchLastConfigSet ( ICONF *  iconf)
throw (std::runtime_error
)
inline

Definition at line 465 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, and EcalDBConnection::env.

467  {
468 
469  iconf->clear();
470  iconf->setConnection(env, conn);
471  iconf->createReadStatement();
472  iconf->fetchLastData(iconf);
473  iconf->terminateReadStatement();
474 
475  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
RunIOV EcalCondDBInterface::fetchLMFLastRun ( ) const

Definition at line 746 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and LMFSeqDat::fetchLastRun().

746  {
747  LMFSeqDat seq(env, conn);
748  return seq.fetchLastRun();
749 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
LMFRunIOV EcalCondDBInterface::fetchLMFRunIOV ( RunTag runtag,
LMFRunTag lmftag,
run_t  run,
subrun_t  lmfrun 
)
throw (std::runtime_error
)

Return a laser monitoring farm run object

Definition at line 751 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, DTTTrigCorrFirst::run, and IDBObject::setConnection().

753 {
754  RunIOV runiov = fetchRunIOV(runtag, run);
755  LMFRunIOV lmfiov;
756  lmfiov.setConnection(env, conn);
757  // lmfiov.setByRun(lmftag, &runiov, subrun);
758  return lmfiov;
759 }
oracle::occi::Environment * env
RunIOV fetchRunIOV(RunTag *tag, run_t run)
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
Definition: RunIOV.h:13
bool EcalCondDBInterface::fetchLMFRunIOV ( const LMFSeqDat seq,
LMFRunIOV iov,
int  lmr,
int  type,
int  color 
) const

Definition at line 761 of file EcalCondDBInterface.cc.

References results_mgr::conn, gather_cfg::cout, web.browse_db::env, LMFRunIOV::fetchBySequence(), LMFRunIOV::fetchLastBeforeSequence(), LMFUnique::getID(), ntuplemaker::iovlist, run_regression::ret, alignCSCRings::s, and IDBObject::setConnection().

762  {
763  bool ret = false;
764  iov.setConnection(env, conn);
765  std::list<LMFRunIOV> iovlist = iov.fetchBySequence(seq, lmr, type, color);
766  int s = iovlist.size();
767  if (s > 0) {
768  iov = iovlist.front();
769  ret = true;
770  if (s > 1) {
771  // should not happen
772  std::cout << "################################" << std::endl;
773  std::cout << "################################" << std::endl;
774  std::cout << "WARNING: More than one LMFRUNIOV" << std::endl;
775  std::cout << " Found for seq " << seq.getID() << std::endl;
776  std::cout << " lmr " << lmr << " type " << type << std::endl;
777  std::cout << " and color " << color << std::endl;
778  std::cout << "################################" << std::endl;
779  std::cout << "################################" << std::endl;
780  }
781  } else {
782  // find the most recent data
783  iovlist = iov.fetchLastBeforeSequence(seq, lmr, type, color);
784  s = iovlist.size();
785  if (s == 1) {
786  iov = iovlist.front();
787  }
788  }
789  return ret;
790 }
type
Definition: HCALResponse.h:22
int getID() const
Definition: LMFUnique.h:52
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:347
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple cout
Definition: gather_cfg.py:121
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
std::list< LMFRunIOV > fetchLastBeforeSequence(const LMFSeqDat &s, int lmr, int type, int color)
Definition: LMFRunIOV.cc:382
MonRunIOV EcalCondDBInterface::fetchMonRunIOV ( RunTag runtag,
MonRunTag montag,
run_t  run,
subrun_t  monrun 
)
throw (std::runtime_error
)

Return a monitoring run object

Definition at line 725 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, DTTTrigCorrFirst::run, MonRunIOV::setByRun(), and IDBObject::setConnection().

Referenced by EcalPedOffset::writeDb(), EcalEndcapMonitorClient::writeDb(), and EcalBarrelMonitorClient::writeDb().

727 {
728  RunIOV runiov = fetchRunIOV(runtag, run);
729  MonRunIOV moniov;
730  moniov.setConnection(env, conn);
731  moniov.setByRun(montag, &runiov, subrun);
732  return moniov;
733 }
oracle::occi::Environment * env
RunIOV fetchRunIOV(RunTag *tag, run_t run)
oracle::occi::Connection * conn
void setByRun(MonRunTag *montag, RunIOV *runiov, subrun_t subrun)
Definition: MonRunIOV.cc:292
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
Definition: RunIOV.h:13
MonRunList EcalCondDBInterface::fetchMonRunList ( RunTag  tag,
MonRunTag  monruntag 
)
throw (std::runtime_error
)

Definition at line 885 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, MonRunList::fetchRuns(), alignCSCRings::r, IDBObject::setConnection(), MonRunList::setMonRunTag(), MonRunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

887 {
888  MonRunList r;
889  r.setConnection(env, conn);
890  r.setRunTag(tag);
891  r.setMonRunTag(monrunTag);
892  r.fetchRuns();
893  return r;
894 }
void fetchRuns()
Definition: MonRunList.cc:52
oracle::occi::Environment * env
void setRunTag(RunTag tag)
Definition: MonRunList.cc:23
oracle::occi::Connection * conn
void setMonRunTag(MonRunTag tag)
Definition: MonRunList.cc:29
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
MonRunList EcalCondDBInterface::fetchMonRunList ( RunTag  tag,
MonRunTag  monruntag,
int  min_run,
int  max_run 
)
throw (std::runtime_error
)

Definition at line 896 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, MonRunList::fetchRuns(), alignCSCRings::r, IDBObject::setConnection(), MonRunList::setMonRunTag(), MonRunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

898 {
899  MonRunList r;
900  r.setConnection(env, conn);
901  r.setRunTag(tag);
902  r.setMonRunTag(monrunTag);
903  r.fetchRuns(min_run, max_run);
904  return r;
905 }
void fetchRuns()
Definition: MonRunList.cc:52
oracle::occi::Environment * env
void setRunTag(RunTag tag)
Definition: MonRunList.cc:23
oracle::occi::Connection * conn
void setMonRunTag(MonRunTag tag)
Definition: MonRunList.cc:29
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
MonRunList EcalCondDBInterface::fetchMonRunListLastNRuns ( RunTag  tag,
MonRunTag  monruntag,
int  max_run,
int  n_runs 
)
throw (std::runtime_error
)

Definition at line 907 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, MonRunList::fetchLastNRuns(), alignCSCRings::r, IDBObject::setConnection(), MonRunList::setMonRunTag(), MonRunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by EcalTPGDBApp::readFromCondDB_Pedestals().

909 {
910  MonRunList r;
911  r.setConnection(env, conn);
912  r.setRunTag(tag);
913  r.setMonRunTag(monrunTag);
914  r.fetchLastNRuns(max_run, n_runs );
915  return r;
916 }
oracle::occi::Environment * env
void setRunTag(RunTag tag)
Definition: MonRunList.cc:23
oracle::occi::Connection * conn
void fetchLastNRuns(int max_run, int n_runs)
Definition: MonRunList.cc:259
void setMonRunTag(MonRunTag tag)
Definition: MonRunList.cc:29
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
RunList EcalCondDBInterface::fetchNonEmptyGlobalRunList ( RunTag  tag,
int  min_run,
int  max_run 
)
throw (std::runtime_error
)

Definition at line 845 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, RunList::fetchNonEmptyGlobalRuns(), alignCSCRings::r, IDBObject::setConnection(), RunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

845  {
846  RunList r;
847  r.setConnection(env, conn);
848  r.setRunTag(tag);
849  r.fetchNonEmptyGlobalRuns( min_run, max_run);
850  return r;
851 }
void setRunTag(RunTag tag)
Definition: RunList.cc:22
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void fetchNonEmptyGlobalRuns()
Definition: RunList.cc:46
RunList EcalCondDBInterface::fetchNonEmptyRunList ( RunTag  tag,
int  min_run,
int  max_run 
)
throw (std::runtime_error
)

Definition at line 837 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, RunList::fetchNonEmptyRuns(), alignCSCRings::r, IDBObject::setConnection(), RunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

837  {
838  RunList r;
839  r.setConnection(env, conn);
840  r.setRunTag(tag);
841  r.fetchNonEmptyRuns( min_run, max_run);
842  return r;
843 }
void setRunTag(RunTag tag)
Definition: RunList.cc:22
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fetchNonEmptyRuns()
Definition: RunList.cc:40
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
RunIOV EcalCondDBInterface::fetchRunIOV ( RunTag tag,
run_t  run 
)
throw (std::runtime_error
)

Return a run IOV object for a given tag

Definition at line 667 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, o2o::iov, DTTTrigCorrFirst::run, RunIOV::setByRun(), IDBObject::setConnection(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by EcalBarrelMonitorClient::beginRunDb(), EcalEndcapMonitorClient::beginRunDb(), and EcalPedOffset::writeDb().

669 {
670  RunIOV iov;
671  iov.setConnection(env, conn);
672  iov.setByRun(tag, run);
673  return iov;
674 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setByRun(RunTag *tag, run_t run)
Definition: RunIOV.cc:376
tuple iov
Definition: o2o.py:307
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
Definition: RunIOV.h:13
RunIOV EcalCondDBInterface::fetchRunIOV ( std::string  location,
run_t  run 
)
throw (std::runtime_error
)

Return a run IOV object for a given location. It is not guarunteed that a run is unique for a location only, so an exception is thrown if more than one result exists.

Definition at line 678 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, o2o::iov, DTTTrigCorrFirst::run, RunIOV::setByRun(), and IDBObject::setConnection().

680 {
681  RunIOV iov;
682  iov.setConnection(env, conn);
683  iov.setByRun(location, run);
684  return iov;
685 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setByRun(RunTag *tag, run_t run)
Definition: RunIOV.cc:376
tuple iov
Definition: o2o.py:307
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
Definition: RunIOV.h:13
RunIOV EcalCondDBInterface::fetchRunIOV ( std::string  location,
const Tm t 
)
throw (std::runtime_error
)

Definition at line 687 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, o2o::iov, RunIOV::setByTime(), IDBObject::setConnection(), and lumiQTWidget::t.

689 {
690  RunIOV iov;
691  iov.setConnection(env, conn);
692  iov.setByTime(location, t);
693  return iov;
694 }
void setByTime(std::string location, const Tm &t)
Definition: RunIOV.cc:417
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple iov
Definition: o2o.py:307
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
Definition: RunIOV.h:13
RunList EcalCondDBInterface::fetchRunList ( RunTag  tag)
throw (std::runtime_error
)

Return a Run List

Definition at line 819 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, RunList::fetchRuns(), alignCSCRings::r, IDBObject::setConnection(), RunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

821 {
822  RunList r;
823  r.setConnection(env, conn);
824  r.setRunTag(tag);
825  r.fetchRuns();
826  return r;
827 }
void setRunTag(RunTag tag)
Definition: RunList.cc:22
oracle::occi::Environment * env
void fetchRuns()
Definition: RunList.cc:64
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
RunList EcalCondDBInterface::fetchRunList ( RunTag  tag,
int  min_run,
int  max_run 
)
throw (std::runtime_error
)

Definition at line 829 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, RunList::fetchRuns(), alignCSCRings::r, IDBObject::setConnection(), RunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

829  {
830  RunList r;
831  r.setConnection(env, conn);
832  r.setRunTag(tag);
833  r.fetchRuns( min_run, max_run);
834  return r;
835 }
void setRunTag(RunTag tag)
Definition: RunList.cc:22
oracle::occi::Environment * env
void fetchRuns()
Definition: RunList.cc:64
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
RunList EcalCondDBInterface::fetchRunListByLocation ( RunTag  tag,
int  min_run,
int  max_run,
const LocationDef  locDef 
)
throw (std::runtime_error
)

Definition at line 853 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, RunList::fetchRunsByLocation(), alignCSCRings::r, IDBObject::setConnection(), RunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

854  {
855  RunList r;
856  r.setConnection(env, conn);
857  r.setRunTag(tag);
858  r.fetchRunsByLocation( min_run, max_run, locDef);
859  return r;
860 }
void setRunTag(RunTag tag)
Definition: RunList.cc:22
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fetchRunsByLocation(int min_run, int max_run, const LocationDef locDef)
Definition: RunList.cc:265
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
RunList EcalCondDBInterface::fetchRunListLastNRuns ( RunTag  tag,
int  max_run,
int  n_runs 
)
throw (std::runtime_error
)

Definition at line 871 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, RunList::fetchLastNRuns(), alignCSCRings::r, IDBObject::setConnection(), RunList::setRunTag(), and GlobalPosition_Frontier_DevDB_cff::tag.

872  {
873  RunList r;
874  r.setConnection(env, conn);
875  r.setRunTag(tag);
876  r.fetchLastNRuns( max_run, n_runs);
877  return r;
878 }
void setRunTag(RunTag tag)
Definition: RunList.cc:22
void fetchLastNRuns(int max_run, int n_runs)
Definition: RunList.cc:191
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
template<class DATT , class IOVT >
void EcalCondDBInterface::fetchValidDataSet ( std::map< EcalLogicID, DATT > *  fillMap,
IOVT *  fillIOV,
RunTag tag,
run_t  run = (unsigned int)-1 
)
throw (std::runtime_error
)
inline

Definition at line 647 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, EcalDBConnection::env, DTTTrigCorrFirst::run, and GlobalPosition_Frontier_DevDB_cff::tag.

651  {
652  fillMap->clear();
653  DATT datiface;
654  fillIOV->setConnection(env, conn);
655  fillIOV->setByRecentData(datiface.getTable(), tag, run);
656  datiface.setConnection(env, conn);
657  datiface.createReadStatement();
658  datiface.setPrefetchRowCount(1024);
659  datiface.fetchData( fillMap, fillIOV );
660  datiface.terminateReadStatement();
661  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
template<class DATT , class IOVT >
void EcalCondDBInterface::fetchValidDataSet ( std::map< EcalLogicID, DATT > *  fillMap,
IOVT *  fillIOV,
std::string  location,
run_t  run = (unsigned int)-1 
)
throw (std::runtime_error
)
inline

Definition at line 671 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, EcalDBConnection::env, and DTTTrigCorrFirst::run.

675  {
676  fillMap->clear();
677  DATT datiface;
678  fillIOV->setConnection(env, conn);
679  fillIOV->setByRecentData(datiface.getTable(), location, run);
680  datiface.setConnection(env, conn);
681  datiface.createReadStatement();
682  datiface.setPrefetchRowCount(1024);
683  datiface.fetchData( fillMap, fillIOV );
684  datiface.terminateReadStatement();
685  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
void EcalCondDBInterface::fillLogicId2DetIdMaps ( )
private

Private method: fill a private map used to associate logicIds to DetIds

Definition at line 29 of file EcalCondDBInterface.cc.

References EcalLogicID::NULLID.

Referenced by getDetId2LogicIdMap(), getDetIdFromLogicId(), getLogicId2DetIdMap(), and getLogicIdFromDetId().

29  {
30  // retrieve the lists of logic_ids, to build the detids
31  std::vector<EcalLogicID> crystals_EB =
32  getEcalLogicIDSetOrdered( "EB_crystal_angle",
33  -85,85,1,360,
35  "EB_crystal_number", 4 );
36  std::vector<EcalLogicID> crystals_EE =
37  getEcalLogicIDSetOrdered( "EE_crystal_number",
38  -1,1,1,100,
39  1,100,
40  "EE_crystal_number", 4 );
41  // fill the barrel map
42  std::vector<EcalLogicID>::const_iterator ieb = crystals_EB.begin();
43  std::vector<EcalLogicID>::const_iterator eeb = crystals_EB.end();
44  while (ieb != eeb) {
45  int iEta = ieb->getID1();
46  int iPhi = ieb->getID2();
47  EBDetId ebdetid(iEta,iPhi);
48  _logicId2DetId[ieb->getLogicID()] = ebdetid;
49  _detId2LogicId[ebdetid] = ieb->getLogicID();
50  ieb++;
51  }
52 
53  // fill the endcap map
54  std::vector<EcalLogicID>::const_iterator iee = crystals_EE.begin();
55  std::vector<EcalLogicID>::const_iterator eee = crystals_EE.end();
56 
57  while (iee != eee) {
58  int iSide = iee->getID1();
59  int iX = iee->getID2();
60  int iY = iee->getID3();
61  EEDetId eedetidpos(iX,iY,iSide);
62  _logicId2DetId[iee->getLogicID()] = eedetidpos;
63  _detId2LogicId[eedetidpos] = iee->getLogicID();
64  iee++;
65  }
66 
67 }
std::map< int, int > _detId2LogicId
std::map< int, int > _logicId2DetId
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID)
static const int NULLID
Definition: EcalLogicID.h:43
DateHandler* EcalCondDBInterface::getDateHandler ( )
inline

Return a date handler associated with this connection

Definition at line 105 of file EcalCondDBInterface.h.

References dh.

106  {
107  return dh;
108  }
std::map<int, int> EcalCondDBInterface::getDetId2LogicIdMap ( )
inline

Definition at line 716 of file EcalCondDBInterface.h.

References _detId2LogicId, _logicId2DetId, and fillLogicId2DetIdMaps().

716  {
717  if (_logicId2DetId.size() == 0) {
719  }
720  return _detId2LogicId;
721  }
std::map< int, int > _detId2LogicId
std::map< int, int > _logicId2DetId
int EcalCondDBInterface::getDetIdFromLogicId ( int  logic_id)
inline

Definition at line 687 of file EcalCondDBInterface.h.

References _logicId2DetId, cond::rpcobgas::detid, and fillLogicId2DetIdMaps().

687  {
688  int detid = -1;
689  if (_logicId2DetId.size() == 0) {
691  }
692  if (_logicId2DetId.find(logic_id) != _logicId2DetId.end()) {
693  detid = _logicId2DetId[logic_id];
694  }
695  return detid;
696  }
std::map< int, int > _logicId2DetId
EcalLogicID EcalCondDBInterface::getEcalLogicID ( std::string  name,
int  id1 = EcalLogicID::NULLID,
int  id2 = EcalLogicID::NULLID,
int  id3 = EcalLogicID::NULLID,
std::string  mapsTo = "" 
)
throw (std::runtime_error
)

Look up the "human readable" ids and return an EcalLogicID object which contains the "database readable" logic_id === Parameters === name: name of the channel type you are specifying id1, id2, id3: ids of the channel type mapsTo: name of the channel type you are mapping to

Referenced by EcalTPGParamBuilder::analyze(), popcon::EcalLaserHandler::dumpBarrelPayload(), popcon::EcalLaserHandler::dumpEndcapPayload(), and EcalPedOffset::writeDb().

EcalLogicID EcalCondDBInterface::getEcalLogicID ( int  logicID)
throw (std::runtime_error
)

Look up the database logic_id and return the EcalLogicID object which contains the "human readable" ids === Parameters === logicID: DB logic_id

Definition at line 70 of file EcalCondDBInterface.cc.

References alignCSCRings::e, lumiQueryAPI::msg, mergeVDriftHistosByStation::name, and EcalLogicID::NULLID.

72 {
73 
74  string sql = "SELECT name, logic_id, id1, id2, id3, maps_to FROM channelView WHERE logic_id = :logicID AND name=maps_to";
75 
76  int id1, id2, id3;
77  string name, mapsTo;
78 
79  try {
80  stmt->setSQL(sql);
81  stmt->setInt(1, logicID);
82  ResultSet* rset = stmt->executeQuery();
83 
84  if (rset->next()) {
85  name = rset->getString(1);
86  logicID = rset->getInt(2);
87  id1 = rset->getInt(3);
88  if (rset->isNull(3)) { id1 = EcalLogicID::NULLID; }
89  id2 = rset->getInt(4);
90  if (rset->isNull(4)) { id2 = EcalLogicID::NULLID; }
91  id3 = rset->getInt(5);
92  if (rset->isNull(5)) { id3 = EcalLogicID::NULLID; }
93  mapsTo = rset->getString(6);
94  } else {
95  stringstream msg;
96  msg << "ERROR: Cannot build EcalLogicID for logic_id " << logicID;
97  throw(std::runtime_error(msg.str()));
98  }
99 
100  } catch (SQLException &e) {
101  throw(std::runtime_error("ERROR: Failed to retrive ids: " + e.getMessage() ));
102  }
103 
104  return EcalLogicID( name, logicID, id1, id2, id3, mapsTo );
105 }
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
static const int NULLID
Definition: EcalLogicID.h:43
oracle::occi::Statement * stmt
std::map< int, int > EcalCondDBInterface::getEcalLogicID2LmrMap ( )

Definition at line 295 of file EcalCondDBInterface.cc.

References i, EcalLogicID::NULLID, and run_regression::ret.

295  {
296  std::map<int, int> ret;
297  std::vector<EcalLogicID> crystals_EB =
298  getEcalLogicIDSetOrdered( "EB_crystal_number",
299  1,36,1,1700,
301  "EB_crystal_number", EcalLogicID::NULLID);
302  std::vector<EcalLogicID> crystals_EE =
303  getEcalLogicIDSetOrdered( "EE_crystal_number",
304  -1,1,1,100,
305  1,100,
306  "EE_crystal_number", EcalLogicID::NULLID);
307  std::vector<EcalLogicID> EB_lmr =
308  getEcalLogicIDSetOrdered( "EB_crystal_number",
309  1,36,1,1700,
311  "ECAL_LMR", EcalLogicID::NULLID);
312  std::vector<EcalLogicID> EE_lmr =
313  getEcalLogicIDSetOrdered( "EE_crystal_number",
314  -1,1,1,100,
315  1,100,
316  "ECAL_LMR", EcalLogicID::NULLID);
317  unsigned int neb = crystals_EB.size();
318  unsigned int nee = crystals_EE.size();
319  if (neb != EB_lmr.size()) {
320  throw(std::runtime_error("ERROR: EB Vectors size do not agree"));
321  }
322  if (nee != EE_lmr.size()) {
323  throw(std::runtime_error("ERROR: EE Vectors size do not agree"));
324  }
325  for (unsigned int i = 0; i < neb; i++) {
326  ret[crystals_EB[i].getLogicID()] = EB_lmr[i].getLogicID() % 100;
327  }
328  for (unsigned int i = 0; i < nee; i++) {
329  ret[crystals_EE[i].getLogicID()] = EE_lmr[i].getLogicID() % 100;
330  }
331  return ret;
332 }
int i
Definition: DBlmapReader.cc:9
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID)
static const int NULLID
Definition: EcalLogicID.h:43
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDForLMPN ( int  lmr_logic_id)

Definition at line 389 of file EcalCondDBInterface.cc.

389  {
390  if ((lmr / 1000000000) == 2) {
391  return getEcalLogicIDMappedTo(lmr, "EE_LM_PN");
392  } else {
393  return getEcalLogicIDMappedTo(lmr, "EB_LM_PN");
394  }
395 }
std::vector< EcalLogicID > getEcalLogicIDMappedTo(int logic_id, std::string maps_to)
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDForLMPN ( const EcalLogicID lmr_logic_id)

Definition at line 397 of file EcalCondDBInterface.cc.

References EcalLogicID::getLogicID().

397  {
398  return getEcalLogicIDForLMR(lmr.getLogicID());
399 }
std::vector< EcalLogicID > getEcalLogicIDForLMR(int lmr_logic_id)
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDForLMR ( int  lmr_logic_id)

Definition at line 381 of file EcalCondDBInterface.cc.

381  {
382  return getEcalLogicIDMappedTo(lmr, "ECAL_LMR");
383 }
std::vector< EcalLogicID > getEcalLogicIDMappedTo(int logic_id, std::string maps_to)
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDForLMR ( const EcalLogicID lmr_logic_id)

Definition at line 385 of file EcalCondDBInterface.cc.

References EcalLogicID::getLogicID().

385  {
386  return getEcalLogicIDForLMR(lmr.getLogicID());
387 }
std::vector< EcalLogicID > getEcalLogicIDForLMR(int lmr_logic_id)
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDMappedTo ( int  logic_id,
std::string  maps_to 
)

Build various reverse maps Map an LMR, or a Ex_LM_PN into the set of components

Definition at line 334 of file EcalCondDBInterface.cc.

References IDBObject::ECALDB_NROWS, mergeVDriftHistosByStation::name, EcalLogicID::NULLID, and run_regression::ret.

334  {
335  std::string name = "EB_crystal_angle";
336  std::string sql = "SELECT LOGIC_ID, ID1, ID2, ID3 "
337  "FROM CHANNELVIEW WHERE NAME = 'EB_crystal_angle' AND LOGIC_ID IN "
338  "(SELECT LOGIC_ID FROM CHANNELVIEW WHERE NAME = 'EB_crystal_number' AND "
339  "ID1*10000+ID2 IN (SELECT DISTINCT ID1*10000+ID2 FROM CHANNELVIEW "
340  "WHERE LOGIC_ID = :1 AND NAME = 'EB_crystal_number' AND MAPS_TO = :2) "
341  "AND NAME = MAPS_TO)";
342  if ((lmr_logic_id / 1000000000) == 2) {
343  name = "EE_crystal_number";
344  sql = "SELECT LOGIC_ID, ID1, ID2, ID3 "
345  "FROM CHANNELVIEW WHERE NAME = 'EE_crystal_number' AND LOGIC_ID IN "
346  "(SELECT LOGIC_ID FROM CHANNELVIEW WHERE NAME = 'EE_crystal_number' AND "
347  "ID1*10000000+ID2*10000+ID3 IN (SELECT DISTINCT "
348  "ID1*10000000+ID2*10000+ID3 FROM CHANNELVIEW "
349  "WHERE LOGIC_ID = :1 AND NAME = 'EE_crystal_number' AND MAPS_TO = :2) "
350  "AND NAME = MAPS_TO) AND NAME = MAPS_TO";
351  }
352  std::vector<EcalLogicID> ret;
353  try {
354  stmt->setSQL(sql.c_str());
355  stmt->setInt(1, lmr_logic_id);
356  stmt->setString(2, maps_to);
357  stmt->setPrefetchRowCount(IDBObject::ECALDB_NROWS);
358 
359  ResultSet* rset = stmt->executeQuery();
360 
361  while (rset->next()) {
362  int logic_id = rset->getInt(1);
363  int id1 = rset->getInt(2);
364  if (rset->isNull(2)) { id1 = EcalLogicID::NULLID; }
365  int id2 = rset->getInt(3);
366  if (rset->isNull(3)) { id2 = EcalLogicID::NULLID; }
367  int id3 = rset->getInt(4);
368  if (rset->isNull(4)) { id3 = EcalLogicID::NULLID; }
369 
370  EcalLogicID ecid = EcalLogicID( name, logic_id, id1, id2, id3, maps_to );
371  ret.push_back(ecid);
372  }
373  stmt->setPrefetchRowCount(0);
374  }
375  catch (SQLException &e) {
376  throw(std::runtime_error("ERROR: Failure while getting EcalLogicID set: " + e.getMessage() ));
377  }
378  return ret;
379 }
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
static int const ECALDB_NROWS
Definition: IDBObject.h:18
static const int NULLID
Definition: EcalLogicID.h:43
oracle::occi::Statement * stmt
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDSet ( std::string  name,
int  fromId1 = EcalLogicID::NULLID,
int  toId1 = EcalLogicID::NULLID,
int  fromId2 = EcalLogicID::NULLID,
int  toId2 = EcalLogicID::NULLID,
int  fromId3 = EcalLogicID::NULLID,
int  toId3 = EcalLogicID::NULLID,
std::string  mapsTo = "" 
)
throw (std::runtime_error
)

Get a set of EcalLogicID in one transaction === Parameters === name: name of the channel type you are specifying fromId1, toId1: Range of id1 in the DB to retrieve fromId2, toId2: Range of id2 in the DB to retrieve fromId3, toId3: Range of id3 in the DB to retrieve string mapsTo: channel type name these ids map to

Definition at line 203 of file EcalCondDBInterface.cc.

References IDBObject::ECALDB_NROWS, Capri::details::from(), i, mergeVDriftHistosByStation::name, EcalLogicID::NULLID, and query::result.

209 {
210  if (mapsTo == "") {
211  mapsTo = name;
212  }
213 
214  int idArray[] = { fromId1, toId1, fromId2, toId2, fromId3, toId3 };
215  int from, to;
216 
217  stringstream ss;
218  ss << "SELECT name, logic_id, id1, id2, id3, maps_to FROM channelView WHERE name = :name AND ";
219 
220  // loop through the three ids
221  for (int i=1; i<=3; i++) {
222  from = idArray[2*(i-1)];
223  to = idArray[2*(i-1) + 1];
224 
225  // check the id arguments in pairs
226  if ((from == EcalLogicID::NULLID && to != EcalLogicID::NULLID) || // one is null
227  (from != EcalLogicID::NULLID && to == EcalLogicID::NULLID) || // but not the other
228  (from > to)) { // negative interval
229  throw(std::runtime_error("ERROR: Bad arguments for getEcalLogicIDSet"));
230  }
231 
232  // build the sql
233  if (from == EcalLogicID::NULLID && to == EcalLogicID::NULLID) {
234  ss << "id" << i << " IS NULL AND ";
235  } else {
236  ss << "id" << i << " >= :id" << i << "from AND " <<
237  "id" << i << " <= :id" << i << "to AND ";
238  }
239  }
240  ss << "maps_to = :maps_to ORDER BY id1, id2, id3";
241 
242  std::vector<EcalLogicID> result;
243 
244  try {
245  stmt->setSQL(ss.str());
246 
247  // bind the parameters
248  int j = 1; // parameter number counter
249  stmt->setString(j, name);
250  j++;
251 
252  for (int i=0; i<3; i++) {
253  from = idArray[2*i];
254  to = idArray[2*i + 1];
255  if (from != EcalLogicID::NULLID) {
256  stmt->setInt(j, from);
257  j++;
258  stmt->setInt(j, to);
259  j++;
260  }
261  }
262 
263  stmt->setString(j, mapsTo);
264 
265 
266  stmt->setPrefetchRowCount(IDBObject::ECALDB_NROWS);
267 
268  ResultSet* rset = stmt->executeQuery();
269 
270  int id1, id2, id3, logicId;
271 
272  while (rset->next()) {
273  name = rset->getString(1);
274  logicId = rset->getInt(2);
275  id1 = rset->getInt(3);
276  if (rset->isNull(3)) { id1 = EcalLogicID::NULLID; }
277  id2 = rset->getInt(4);
278  if (rset->isNull(4)) { id2 = EcalLogicID::NULLID; }
279  id3 = rset->getInt(5);
280  if (rset->isNull(5)) { id3 = EcalLogicID::NULLID; }
281  mapsTo = rset->getString(6);
282 
283  EcalLogicID ecid = EcalLogicID( name, logicId, id1, id2, id3, mapsTo );
284  result.push_back(ecid);
285  }
286  stmt->setPrefetchRowCount(0);
287 
288  } catch (SQLException &e) {
289  throw(std::runtime_error("ERROR: Failure while getting EcalLogicID set: " + e.getMessage() ));
290  }
291 
292  return result;
293 }
int i
Definition: DBlmapReader.cc:9
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
static std::string from(" from ")
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
static int const ECALDB_NROWS
Definition: IDBObject.h:18
static const int NULLID
Definition: EcalLogicID.h:43
oracle::occi::Statement * stmt
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDSetOrdered ( std::string  name,
int  fromId1,
int  toId1,
int  fromId2 = EcalLogicID::NULLID,
int  toId2 = EcalLogicID::NULLID,
int  fromId3 = EcalLogicID::NULLID,
int  toId3 = EcalLogicID::NULLID,
std::string  mapsTo = "",
int  orderedBy = EcalLogicID::NULLID 
)
throw (std::runtime_error
)

Definition at line 401 of file EcalCondDBInterface.cc.

References IDBObject::ECALDB_NROWS, Capri::details::from(), i, mergeVDriftHistosByStation::name, EcalLogicID::NULLID, and query::result.

Referenced by EcalTPGParamBuilder::analyze().

409 {
410  if (mapsTo == "") {
411  mapsTo = name;
412  }
413 
414  int idArray[] = { fromId1, toId1, fromId2, toId2, fromId3, toId3 };
415  int from, to;
416 
417  stringstream ss;
418  ss << "SELECT name, logic_id, id1, id2, id3, maps_to FROM channelView WHERE name = :name AND ";
419 
420  // loop through the three ids
421  for (int i=1; i<=3; i++) {
422  from = idArray[2*(i-1)];
423  to = idArray[2*(i-1) + 1];
424 
425  // check the id arguments in pairs
426  if ((from == EcalLogicID::NULLID && to != EcalLogicID::NULLID) || // one is null
427  (from != EcalLogicID::NULLID && to == EcalLogicID::NULLID) || // but not the other
428  (from > to)) { // negative interval
429  throw(std::runtime_error("ERROR: Bad arguments for getEcalLogicIDSet"));
430  }
431 
432  // build the sql
433  if (from == EcalLogicID::NULLID && to == EcalLogicID::NULLID) {
434  ss << "id" << i << " IS NULL AND ";
435  } else {
436  ss << "id" << i << " >= :id" << i << "from AND " <<
437  "id" << i << " <= :id" << i << "to AND ";
438  }
439  }
440  ss << "maps_to = :maps_to ";
441 
442  if(orderedBy==EcalLogicID::NULLID){
443  ss<<" ORDER BY id1, id2, id3";
444  } else if(orderedBy==1 || orderedBy==12 || orderedBy==123){
445  ss<<" ORDER BY id1, id2, id3 ";
446  } else if (orderedBy==213 || orderedBy==21 ){
447  ss<<" ORDER BY id2, id1, id3 ";
448  } else if (orderedBy==231|| orderedBy==23){
449  ss<<" ORDER BY id2, id3, id1 ";
450  } else if (orderedBy==321|| orderedBy==32){
451  ss<<" ORDER BY id3, id2, id1 ";
452  } else if (orderedBy==312|| orderedBy==31){
453  ss<<" ORDER BY id3, id1, id2 ";
454  } else if (orderedBy==132|| orderedBy==13){
455  ss<<" ORDER BY id1, id3, id2 ";
456  } else if (orderedBy==1234 ){
457  ss<<" ORDER BY id1, id2, id3, logic_id ";
458  } else if (orderedBy==4) {
459  ss<<" ORDER BY logic_id ";
460  } else {
461  ss<<" ORDER BY id1, id2, id3";
462  }
463 
464  std::vector<EcalLogicID> result;
465 
466  try {
467  stmt->setSQL(ss.str());
468 
469  // bind the parameters
470  int j = 1; // parameter number counter
471  stmt->setString(j, name);
472  j++;
473 
474  for (int i=0; i<3; i++) {
475  from = idArray[2*i];
476  to = idArray[2*i + 1];
477  if (from != EcalLogicID::NULLID) {
478  stmt->setInt(j, from);
479  j++;
480  stmt->setInt(j, to);
481  j++;
482  }
483  }
484 
485  stmt->setString(j, mapsTo);
486 
487 
488  stmt->setPrefetchRowCount(IDBObject::ECALDB_NROWS);
489 
490  ResultSet* rset = stmt->executeQuery();
491 
492  int id1, id2, id3, logicId;
493 
494  while (rset->next()) {
495  name = rset->getString(1);
496  logicId = rset->getInt(2);
497  id1 = rset->getInt(3);
498  if (rset->isNull(3)) { id1 = EcalLogicID::NULLID; }
499  id2 = rset->getInt(4);
500  if (rset->isNull(4)) { id2 = EcalLogicID::NULLID; }
501  id3 = rset->getInt(5);
502  if (rset->isNull(5)) { id3 = EcalLogicID::NULLID; }
503  mapsTo = rset->getString(6);
504 
505  EcalLogicID ecid = EcalLogicID( name, logicId, id1, id2, id3, mapsTo );
506  result.push_back(ecid);
507  }
508  stmt->setPrefetchRowCount(0);
509 
510  } catch (SQLException &e) {
511  throw(std::runtime_error("ERROR: Failure while getting EcalLogicID set: " + e.getMessage() ));
512  }
513 
514  return result;
515 }
int i
Definition: DBlmapReader.cc:9
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
static std::string from(" from ")
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
static int const ECALDB_NROWS
Definition: IDBObject.h:18
static const int NULLID
Definition: EcalLogicID.h:43
oracle::occi::Statement * stmt
std::map<int, int> EcalCondDBInterface::getLogicId2DetIdMap ( )
inline

Definition at line 709 of file EcalCondDBInterface.h.

References _logicId2DetId, and fillLogicId2DetIdMaps().

709  {
710  if (_logicId2DetId.size() == 0) {
712  }
713  return _logicId2DetId;
714  }
std::map< int, int > _logicId2DetId
int EcalCondDBInterface::getLogicIdFromDetId ( int  det_id)
inline

Definition at line 698 of file EcalCondDBInterface.h.

References _detId2LogicId, _logicId2DetId, and fillLogicId2DetIdMaps().

698  {
699  int logic_id = -1;
700  if (_logicId2DetId.size() == 0) {
702  }
703  if (_detId2LogicId.find(det_id) != _detId2LogicId.end()) {
704  logic_id = _detId2LogicId[det_id];
705  }
706  return logic_id;
707  }
std::map< int, int > _detId2LogicId
std::map< int, int > _logicId2DetId
template<class DATT , class ICONF >
void EcalCondDBInterface::insertConfigDataArraySet ( const std::vector< DATT >  data,
ICONF *  iconf 
)
throw (std::runtime_error
)
inline

Definition at line 522 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, gather_cfg::cout, data, alignCSCRings::e, and EcalDBConnection::env.

Referenced by EcalDccWeightBuilder::writeWeightToDB().

524  {
525  try {
526  iconf->setConnection(env, conn);
527  // if it has not yet been written then write
528  if(iconf->getId()==0){
529  std::cout<<"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
530  iconf->fetchID();
531  }
532  if(iconf->getId()==0){
533  std::cout<<"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
534  iconf->writeDB();
535  }
536 
537  DATT dataIface;
538  dataIface.setConnection(env, conn);
539  dataIface.prepareWrite();
540 
541  dataIface.writeArrayDB(data, iconf);
542  conn->commit();
543 
544  dataIface.terminateWriteStatement();
545 
546  } catch (std::runtime_error &e) {
547  conn->rollback();
548  throw(e);
549  } catch (...) {
550  conn->rollback();
551  throw(std::runtime_error("EcalCondDBInterface::insertConfigDataArraySet: Unknown exception caught"));
552  }
553  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
template<class DATT , class ICONF >
void EcalCondDBInterface::insertConfigDataSet ( const std::vector< DATT >  data,
ICONF *  iconf 
)
throw (std::runtime_error
)
inline

Definition at line 483 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, gather_cfg::cout, data, alignCSCRings::e, EcalDBConnection::env, and AlCaHLTBitMon_ParallelJobs::p.

485  {
486  try {
487  iconf->setConnection(env, conn);
488  // if it has not yet been written then write
489  if(iconf->getId()==0){
490  std::cout<<"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
491  iconf->fetchID();
492  }
493  if(iconf->getId()==0){
494  std::cout<<"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
495  iconf->writeDB();
496  }
497 
498  DATT dataIface;
499  dataIface.setConnection(env, conn);
500  dataIface.prepareWrite();
501 
502  const DATT* dataitem;
503 
504  for (int p = 0; p != data->size(); ++p) {
505  dataitem = data[p];
506  dataIface.writeDB( dataitem, iconf);
507  }
508  conn->commit();
509  dataIface.terminateWriteStatement();
510  } catch (std::runtime_error &e) {
511  conn->rollback();
512  throw(e);
513  } catch (...) {
514  conn->rollback();
515  throw(std::runtime_error("EcalCondDBInterface::insertConfigDataSet: Unknown exception caught"));
516  }
517  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
template<class ICONF >
void EcalCondDBInterface::insertConfigSet ( ICONF *  iconf)
throw (std::runtime_error
)
inline

Definition at line 425 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, gather_cfg::cout, alignCSCRings::e, and EcalDBConnection::env.

Referenced by EcalTPGDBApp::writeToConfDB_Delay(), EcalTPGDBApp::writeToConfDB_Spike(), EcalTPGDBApp::writeToConfDB_TPGFgr(), EcalTPGDBApp::writeToConfDB_TPGLinearCoef(), EcalTPGDBApp::writeToConfDB_TPGLUT(), EcalTPGDBApp::writeToConfDB_TPGMain(), EcalTPGDBApp::writeToConfDB_TPGPedestals(), EcalTPGDBApp::writeToConfDB_TPGSliding(), EcalTPGDBApp::writeToConfDB_TPGWeight(), and EcalDccWeightBuilder::writeWeightToDB().

427  {
428  try {
429  iconf->setConnection(env, conn);
430  iconf->prepareWrite();
431  // if it has not yet been written then write
432  iconf->writeDB();
433  std::cout<< "iconf inserted with ID="<<iconf->getId()<<std::endl;
434  conn->commit();
435  iconf->terminateWriteStatement();
436  } catch (std::runtime_error &e) {
437  conn->rollback();
438  throw(e);
439  } catch (...) {
440  conn->rollback();
441  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
442  }
443  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple cout
Definition: gather_cfg.py:121
template<class DATT , class IOVT >
void EcalCondDBInterface::insertDataArraySet ( const std::map< EcalLogicID, DATT > *  data,
IOVT *  iov 
)
throw (std::runtime_error
)
inline

Definition at line 348 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, gather_cfg::cout, data, alignCSCRings::e, EcalDBConnection::env, and o2o::iov.

Referenced by EcalTPGDBApp::writeToConfDB_Delay(), EcalTPGDBApp::writeToConfDB_Spike(), EcalTPGDBApp::writeToConfDB_TPGFgr(), EcalTPGDBApp::writeToConfDB_TPGLinearCoef(), EcalTPGDBApp::writeToConfDB_TPGLUT(), EcalTPGDBApp::writeToConfDB_TPGPedestals(), EcalTPGDBApp::writeToConfDB_TPGSliding(), and EcalTPGDBApp::writeToConfDB_TPGWeight().

350  {
351  try {
352  iov->setConnection(env, conn);
353  if(iov->getID()==0){
354  std::cout<<"IOV was not set we retrieve it from DB"<<std::endl;
355  iov->fetchID();
356  }
357  if(iov->getID()==0){
358  std::cout<<"IOV was not written we write it"<<std::endl;
359  iov->writeDB();
360  }
361 
362  std::cout<<"id="<<iov->getID()<<std::endl;
363 
364  DATT dataIface;
365  dataIface.setConnection(env, conn);
366  dataIface.prepareWrite();
367 
368  dataIface.writeArrayDB(data, iov);
369  conn->commit();
370 
371  dataIface.terminateWriteStatement();
372 
373  } catch (std::runtime_error &e) {
374  conn->rollback();
375  throw(e);
376  } catch (...) {
377  conn->rollback();
378  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
379  }
380  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple iov
Definition: o2o.py:307
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
template<class DATT , class IOVT >
void EcalCondDBInterface::insertDataSet ( const std::map< EcalLogicID, DATT > *  data,
IOVT *  iov 
)
throw (std::runtime_error
)
inline

Definition at line 308 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, gather_cfg::cout, alignCSCRings::e, EcalDBConnection::env, o2o::iov, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by EcalBarrelMonitorClient::endRunDb(), EcalEndcapMonitorClient::endRunDb(), EcalPedOffset::writeDb(), EcalEndcapMonitorClient::writeDb(), and EcalBarrelMonitorClient::writeDb().

310  {
311  try {
312  iov->setConnection(env, conn);
313  // if it has not yet been written then write
314  if(iov->getID()==0){
315  std::cout<<"IOV was not set we retrieve it from DB"<<std::endl;
316  iov->fetchID();
317  }
318  if(iov->getID()==0){
319  std::cout<<"IOV was not written we write it"<<std::endl;
320  iov->writeDB();
321  }
322 
323  DATT dataIface;
324  dataIface.setConnection(env, conn);
325  dataIface.prepareWrite();
326 
327  const EcalLogicID* channel;
328  const DATT* dataitem;
329  typedef typename std::map< EcalLogicID, DATT >::const_iterator CI;
330  for (CI p = data->begin(); p != data->end(); ++p) {
331  channel = &(p->first);
332  dataitem = &(p->second);
333  dataIface.writeDB( channel, dataitem, iov);
334  }
335  conn->commit();
336  dataIface.terminateWriteStatement();
337  } catch (std::runtime_error &e) {
338  conn->rollback();
339  throw(e);
340  } catch (...) {
341  conn->rollback();
342  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
343  }
344  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple iov
Definition: o2o.py:307
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
template<class DATT , class IOVT >
void EcalCondDBInterface::insertDataSetVector ( std::vector< EcalLogicID ecid,
std::vector< IOVT >  run_iov,
std::vector< DATT >  data 
)
throw (std::runtime_error
)
inline

Definition at line 383 of file EcalCondDBInterface.h.

References EcalDBConnection::conn, data, alignCSCRings::e, EcalDBConnection::env, and i.

385  {
386 
387  int nruns= run_iov.size();
388 
389  if(run_iov.size()!=ecid.size() &&ecid.size()!=data.size()){
390  throw(std::runtime_error("EcalCondDBInterface::insertDataSetVector: vector sizes are different.."));
391  }
392 
393 
394  try {
395 
396  DATT dataIface;
397  dataIface.setConnection(env, conn);
398  dataIface.prepareWrite();
399 
400  for (int i=0; i<nruns; i++){
401 
402  run_iov[i].setConnection(env, conn);
403  run_iov[i].writeDB();
404 
405  dataIface.writeDB( &ecid[i], &data[i], &run_iov[i]);
406 
407  conn->commit();
408  }
409  } catch (std::runtime_error &e) {
410  conn->rollback();
411  throw(e);
412  } catch (...) {
413  conn->rollback();
414  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
415  }
416  }
int i
Definition: DBlmapReader.cc:9
oracle::occi::Environment * env
oracle::occi::Connection * conn
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void EcalCondDBInterface::insertDCUIOV ( DCUIOV iov)
throw (std::runtime_error
)

Insert a DCU IOV object. Nothing is committed in the event of an exception

Definition at line 709 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

711 {
712  try {
713  iov->setConnection(env, conn);
714  iov->writeDB();
715  } catch(std::runtime_error &e) {
716  conn->rollback();
717  throw(e);
718  }
719  conn->commit();
720 }
oracle::occi::Environment * env
int writeDB()
Definition: DCUIOV.cc:164
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::insertLmfDat ( LMFDat dat)
throw (std::runtime_error
)

Definition at line 571 of file EcalCondDBInterface.cc.

References results_mgr::conn, and web.browse_db::env.

573 {
574  try {
575  dat->setConnection(env, conn);
576  dat->writeDB();
577  } catch(std::runtime_error &e) {
578  conn->rollback();
579  throw(e);
580  }
581  conn->commit();
582 }
oracle::occi::Environment * env
int writeDB()
Definition: LMFDat.cc:398
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::insertLmfDat ( std::list< LMFDat * >  dat)
throw (std::runtime_error
)

Definition at line 584 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and i.

586 {
587  try {
588  std::list<LMFDat *>::iterator i = dat.begin();
589  std::list<LMFDat *>::iterator e = dat.end();
590  while (i != e) {
591  (*i)->setConnection(env, conn);
592  (*i)->writeDB();
593  i++;
594  }
595  } catch(std::runtime_error &e) {
596  conn->rollback();
597  throw(e);
598  }
599  conn->commit();
600 }
int i
Definition: DBlmapReader.cc:9
oracle::occi::Environment * env
oracle::occi::Connection * conn
void EcalCondDBInterface::insertLmfIOV ( LMFIOV iov)
throw (std::runtime_error
)

Definition at line 558 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

560 {
561  try {
562  iov->setConnection(env, conn);
563  iov->writeDB();
564  } catch(std::runtime_error &e) {
565  conn->rollback();
566  throw(e);
567  }
568  conn->commit();
569 }
oracle::occi::Environment * env
virtual int writeDB()
Definition: LMFUnique.cc:339
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::insertLmfLmrSubIOV ( LMFLmrSubIOV iov)
throw (std::runtime_error
)

Definition at line 545 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

547 {
548  try {
549  iov->setConnection(env, conn);
550  iov->writeDB();
551  } catch(std::runtime_error &e) {
552  conn->rollback();
553  throw(e);
554  }
555  conn->commit();
556 }
oracle::occi::Environment * env
virtual int writeDB()
Definition: LMFUnique.cc:339
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::insertLmfRunIOV ( LMFRunIOV iov)
throw (std::runtime_error
)

Definition at line 602 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

604 {
605  try {
606  iov->setConnection(env, conn);
607  iov->writeDB();
608  } catch(std::runtime_error &e) {
609  conn->rollback();
610  throw(e);
611  }
612  conn->commit();
613 }
oracle::occi::Environment * env
virtual int writeDB()
Definition: LMFUnique.cc:339
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::insertLmfSeq ( LMFSeqDat iov)
throw (std::runtime_error
)

Definition at line 532 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

534 {
535  try {
536  iov->setConnection(env, conn);
537  iov->writeDB();
538  } catch(std::runtime_error &e) {
539  conn->rollback();
540  throw(e);
541  }
542  conn->commit();
543 }
oracle::occi::Environment * env
virtual int writeDB()
Definition: LMFUnique.cc:339
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::insertMonRunIOV ( MonRunIOV iov)
throw (std::runtime_error
)

Insert a monitoring run object. Nothing is committed in the event of an exception

Definition at line 696 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

Referenced by EcalBarrelMonitorClient::writeDb(), and EcalEndcapMonitorClient::writeDb().

698 {
699  try {
700  iov->setConnection(env, conn);
701  iov->writeDB();
702  } catch(std::runtime_error &e) {
703  conn->rollback();
704  throw(e);
705  }
706  conn->commit();
707 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
int writeDB()
Definition: MonRunIOV.cc:216
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::insertRunIOV ( RunIOV iov)
throw (std::runtime_error
)

Insert a run IOV object. Nothing is committed in the event of an exception

Definition at line 519 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

Referenced by EcalBarrelMonitorClient::beginRunDb(), and EcalEndcapMonitorClient::beginRunDb().

521 {
522  try {
523  iov->setConnection(env, conn);
524  iov->writeDB();
525  } catch(std::runtime_error &e) {
526  conn->rollback();
527  throw(e);
528  }
529  conn->commit();
530 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
int writeDB()
Definition: RunIOV.cc:190
void EcalCondDBInterface::updateRunConfig ( ODRunConfigInfo od)
throw (std::runtime_error
)

Definition at line 654 of file EcalCondDBInterface.cc.

References results_mgr::conn, and web.browse_db::env.

656 {
657  try {
658  od->setConnection(env, conn);
659  od->updateDefaultCycle();
660  } catch(std::runtime_error &e) {
661  conn->rollback();
662  throw(e);
663  }
664  conn->commit();
665 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void EcalCondDBInterface::updateRunIOV ( RunIOV iov)
throw (std::runtime_error
)

Definition at line 615 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

617 {
618  try {
619  iov->setConnection(env, conn);
620  iov->updateEndTimeDB();
621  } catch(std::runtime_error &e) {
622  conn->rollback();
623  throw(e);
624  }
625  conn->commit();
626 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
int updateEndTimeDB()
Definition: RunIOV.cc:240
void EcalCondDBInterface::updateRunIOVEndTime ( RunIOV iov)
throw (std::runtime_error
)

Definition at line 628 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

630 {
631  try {
632  iov->setConnection(env, conn);
633  iov->updateEndTimeDB();
634  } catch(std::runtime_error &e) {
635  conn->rollback();
636  throw(e);
637  }
638  conn->commit();
639 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
int updateEndTimeDB()
Definition: RunIOV.cc:240
void EcalCondDBInterface::updateRunIOVStartTime ( RunIOV iov)
throw (std::runtime_error
)

Definition at line 641 of file EcalCondDBInterface.cc.

References results_mgr::conn, web.browse_db::env, and o2o::iov.

643 {
644  try {
645  iov->setConnection(env, conn);
646  iov->updateStartTimeDB();
647  } catch(std::runtime_error &e) {
648  conn->rollback();
649  throw(e);
650  }
651  conn->commit();
652 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
int updateStartTimeDB()
Definition: RunIOV.cc:330
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23

Member Data Documentation

std::map<int, int> EcalCondDBInterface::_detId2LogicId
private

Definition at line 743 of file EcalCondDBInterface.h.

Referenced by getDetId2LogicIdMap(), and getLogicIdFromDetId().

std::map<int, int> EcalCondDBInterface::_logicId2DetId
private
DateHandler* EcalCondDBInterface::dh
private