test
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, const 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, const Tm &t) throw (std::runtime_error)
 
DCSPTMTempList fetchDCSPTMTempList (const EcalLogicID &ecid) throw (std::runtime_error)
 
DCSPTMTempList fetchDCSPTMTempList (const EcalLogicID &ecid, const Tm &start, const Tm &end) throw (std::runtime_error)
 
DCUIOV fetchDCUIOV (DCUTag *tag, const Tm &evenTm) throw (std::runtime_error)
 
std::list< ODDelaysDatfetchFEDelaysForRun (RunIOV *iov) throw (std::runtime_error)
 
RunList fetchGlobalRunListByLocation (const 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 (const RunTag &tag, const MonRunTag &monruntag) throw (std::runtime_error)
 
MonRunList fetchMonRunList (const RunTag &tag, const MonRunTag &monruntag, int min_run, int max_run) throw (std::runtime_error)
 
MonRunList fetchMonRunListLastNRuns (const RunTag &tag, const MonRunTag &monruntag, int max_run, int n_runs) throw (std::runtime_error)
 
RunList fetchNonEmptyGlobalRunList (const RunTag &tag, int min_run, int max_run) throw (std::runtime_error)
 
RunList fetchNonEmptyRunList (const 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 (const RunTag &tag) throw (std::runtime_error)
 
RunList fetchRunList (const RunTag &tag, int min_run, int max_run) throw (std::runtime_error)
 
RunList fetchRunListByLocation (const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) throw (std::runtime_error)
 
RunList fetchRunListLastNRuns (const 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 (const std::vector< EcalLogicID > &ecid, const std::vector< IOVT > &run_iov, const 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 38 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 54 of file EcalCondDBInterface.h.

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

60  {
61  // call the parent constructor
62 
63  // create a DateHandler
64  dh = new DateHandler(env, conn);
65  }
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 76 of file EcalCondDBInterface.h.

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

80  {
81  // call the parent constructor
82 
83  // create a DateHandler
84  dh = new DateHandler(env, conn);
85  }
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 91 of file EcalCondDBInterface.h.

References dh.

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

Member Function Documentation

void EcalCondDBInterface::dummy ( )

Definition at line 919 of file EcalCondDBInterface.cc.

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

Return a Calibration IOV object

Definition at line 791 of file EcalCondDBInterface.cc.

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

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

Definition at line 557 of file EcalCondDBInterface.h.

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

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

Definition at line 448 of file EcalCondDBInterface.h.

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

Referenced by EcalTPGDBApp::readFromConfDB_TPGPedestals().

450  {
451 
452  iconf->clear();
453  iconf->setConnection(env, conn);
454  iconf->createReadStatement();
455  iconf->fetchData(iconf);
456  iconf->terminateReadStatement();
457 
458  }
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 580 of file EcalCondDBInterface.h.

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

Referenced by EcalTPGParamBuilder::analyze(), ecaldqm::fetchAndFill(), EcalTPGDBApp::readFromCondDB_Pedestals(), and EcalTPGDBApp::readFromConfDB_TPGPedestals().

582  {
583  fillMap->clear();
584 
585  DATT datiface;
586  datiface.setConnection(env, conn);
587  datiface.createReadStatement();
588  datiface.setPrefetchRowCount(1024);
589  datiface.fetchData( fillMap, iov );
590  datiface.terminateReadStatement();
591 
592  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
tuple iov
Definition: o2o.py:307
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 624 of file EcalCondDBInterface.h.

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

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

Definition at line 601 of file EcalCondDBInterface.h.

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

603  {
604  fillMap->clear();
605 
606  DATT datiface;
607  datiface.setConnection(env, conn);
608  datiface.createReadStatement();
609  datiface.setPrefetchRowCount(1024);
610  datiface.fetchHistoricalData( fillMap, t );
611  datiface.terminateReadStatement();
612 
613  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
DCSPTMTempList EcalCondDBInterface::fetchDCSPTMTempList ( const EcalLogicID ecid)
throw (std::runtime_error
)

Return a PTM Temp List

Definition at line 800 of file EcalCondDBInterface.cc.

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

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

Definition at line 809 of file EcalCondDBInterface.cc.

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

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

Return a DCU IOV object

Definition at line 736 of file EcalCondDBInterface.cc.

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

738 {
739  DCUIOV dcuiov;
740  dcuiov.setConnection(env, conn);
741  dcuiov.setByTm(tag, eventTm);
742  return dcuiov;
743 }
void setByTm(DCUTag *tag, const 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 106 of file EcalCondDBInterface.cc.

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

108 {
109  std::list<ODDelaysDat> ret;
110  RunFEConfigDat d;
111  std::map<EcalLogicID, RunFEConfigDat > fillMap;
112  try {
113  d.setConnection(env, conn);
114  d.fetchData(&fillMap, iov);
115  } catch (std::runtime_error &e) {
116  throw e;
117  }
118  std::map<EcalLogicID, RunFEConfigDat >::const_iterator i = fillMap.begin();
119  std::map<EcalLogicID, RunFEConfigDat >::const_iterator e = fillMap.end();
120  while (i != e) {
121  ODFEDAQConfig feDaqConfig;
123  temp.setId(i->second.getConfigId());
124  feDaqConfig.setConnection(env, conn);
125  feDaqConfig.fetchData(&temp);
126  std::vector<ODDelaysDat> delays;
127  ODDelaysDat temp2;
128  temp2.setConnection(env, conn);
129  temp2.fetchData(&delays, temp.getDelayId());
130  std::vector<ODDelaysDat>::const_iterator di = delays.begin();
131  std::vector<ODDelaysDat>::const_iterator de = delays.end();
132  while (di != de) {
133  ret.push_back(*di++);
134  }
135  i++;
136  }
137  return ret;
138 }
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 fetchData(std::vector< ODDelaysDat > *fillMap, int id)
Definition: ODDelaysDat.cc:73
RunList EcalCondDBInterface::fetchGlobalRunListByLocation ( const RunTag tag,
int  min_run,
int  max_run,
const LocationDef locDef 
)
throw (std::runtime_error
)

Definition at line 861 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.

862  {
863  RunList r;
864  r.setConnection(env, conn);
865  r.setRunTag(tag);
866  r.fetchGlobalRunsByLocation( min_run, max_run, locDef);
867  return r;
868 }
void setRunTag(const 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 464 of file EcalCondDBInterface.h.

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

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

Definition at line 745 of file EcalCondDBInterface.cc.

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

745  {
746  LMFSeqDat seq(env, conn);
747  return seq.fetchLastRun();
748 }
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 750 of file EcalCondDBInterface.cc.

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

752 {
753  RunIOV runiov = fetchRunIOV(runtag, run);
754  LMFRunIOV lmfiov;
755  lmfiov.setConnection(env, conn);
756  // lmfiov.setByRun(lmftag, &runiov, subrun);
757  return lmfiov;
758 }
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 760 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().

761  {
762  bool ret = false;
763  iov.setConnection(env, conn);
764  std::list<LMFRunIOV> iovlist = iov.fetchBySequence(seq, lmr, type, color);
765  int s = iovlist.size();
766  if (s > 0) {
767  iov = iovlist.front();
768  ret = true;
769  if (s > 1) {
770  // should not happen
771  std::cout << "################################" << std::endl;
772  std::cout << "################################" << std::endl;
773  std::cout << "WARNING: More than one LMFRUNIOV" << std::endl;
774  std::cout << " Found for seq " << seq.getID() << std::endl;
775  std::cout << " lmr " << lmr << " type " << type << std::endl;
776  std::cout << " and color " << color << std::endl;
777  std::cout << "################################" << std::endl;
778  std::cout << "################################" << std::endl;
779  }
780  } else {
781  // find the most recent data
782  iovlist = iov.fetchLastBeforeSequence(seq, lmr, type, color);
783  s = iovlist.size();
784  if (s == 1) {
785  iov = iovlist.front();
786  }
787  }
788  return ret;
789 }
type
Definition: HCALResponse.h:21
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 724 of file EcalCondDBInterface.cc.

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

Referenced by EcalCondDBWriter::dqmEndJob(), EcalCondDBReader::EcalCondDBReader(), and EcalPedOffset::writeDb().

726 {
727  RunIOV runiov = fetchRunIOV(runtag, run);
728  MonRunIOV moniov;
729  moniov.setConnection(env, conn);
730  moniov.setByRun(montag, &runiov, subrun);
731  return moniov;
732 }
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 ( const RunTag tag,
const MonRunTag monruntag 
)
throw (std::runtime_error
)

Definition at line 884 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.

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

Definition at line 895 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.

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

Definition at line 906 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().

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

Definition at line 844 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.

844  {
845  RunList r;
846  r.setConnection(env, conn);
847  r.setRunTag(tag);
848  r.fetchNonEmptyGlobalRuns( min_run, max_run);
849  return r;
850 }
void setRunTag(const 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 ( const RunTag tag,
int  min_run,
int  max_run 
)
throw (std::runtime_error
)

Definition at line 836 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.

836  {
837  RunList r;
838  r.setConnection(env, conn);
839  r.setRunTag(tag);
840  r.fetchNonEmptyRuns( min_run, max_run);
841  return r;
842 }
void setRunTag(const 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 666 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 EcalCondDBWriter::dqmEndJob(), EcalCondDBReader::EcalCondDBReader(), and EcalPedOffset::writeDb().

668 {
669  RunIOV iov;
670  iov.setConnection(env, conn);
671  iov.setByRun(tag, run);
672  return iov;
673 }
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 677 of file EcalCondDBInterface.cc.

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

679 {
680  RunIOV iov;
681  iov.setConnection(env, conn);
682  iov.setByRun(location, run);
683  return iov;
684 }
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 686 of file EcalCondDBInterface.cc.

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

688 {
689  RunIOV iov;
690  iov.setConnection(env, conn);
691  iov.setByTime(location, t);
692  return iov;
693 }
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 ( const RunTag tag)
throw (std::runtime_error
)

Return a Run List

Definition at line 818 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.

820 {
821  RunList r;
822  r.setConnection(env, conn);
823  r.setRunTag(tag);
824  r.fetchRuns();
825  return r;
826 }
void setRunTag(const 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 ( const RunTag tag,
int  min_run,
int  max_run 
)
throw (std::runtime_error
)

Definition at line 828 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.

828  {
829  RunList r;
830  r.setConnection(env, conn);
831  r.setRunTag(tag);
832  r.fetchRuns( min_run, max_run);
833  return r;
834 }
void setRunTag(const 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 ( const RunTag tag,
int  min_run,
int  max_run,
const LocationDef locDef 
)
throw (std::runtime_error
)

Definition at line 852 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.

853  {
854  RunList r;
855  r.setConnection(env, conn);
856  r.setRunTag(tag);
857  r.fetchRunsByLocation( min_run, max_run, locDef);
858  return r;
859 }
void setRunTag(const 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 ( const RunTag tag,
int  max_run,
int  n_runs 
)
throw (std::runtime_error
)

Definition at line 870 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.

871  {
872  RunList r;
873  r.setConnection(env, conn);
874  r.setRunTag(tag);
875  r.fetchLastNRuns( max_run, n_runs);
876  return r;
877 }
void setRunTag(const 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 646 of file EcalCondDBInterface.h.

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

650  {
651  fillMap->clear();
652  DATT datiface;
653  fillIOV->setConnection(env, conn);
654  fillIOV->setByRecentData(datiface.getTable(), tag, run);
655  datiface.setConnection(env, conn);
656  datiface.createReadStatement();
657  datiface.setPrefetchRowCount(1024);
658  datiface.fetchData( fillMap, fillIOV );
659  datiface.terminateReadStatement();
660  }
oracle::occi::Environment * env
oracle::occi::Connection * conn
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 670 of file EcalCondDBInterface.h.

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

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

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

Definition at line 28 of file EcalCondDBInterface.cc.

References EcalLogicID::NULLID.

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

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

Return a date handler associated with this connection

Definition at line 104 of file EcalCondDBInterface.h.

References dh.

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

Definition at line 715 of file EcalCondDBInterface.h.

References _detId2LogicId, _logicId2DetId, and fillLogicId2DetIdMaps().

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

Definition at line 686 of file EcalCondDBInterface.h.

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

686  {
687  int detid = -1;
688  if (_logicId2DetId.size() == 0) {
690  }
691  if (_logicId2DetId.find(logic_id) != _logicId2DetId.end()) {
692  detid = _logicId2DetId[logic_id];
693  }
694  return detid;
695  }
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 69 of file EcalCondDBInterface.cc.

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

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

Definition at line 294 of file EcalCondDBInterface.cc.

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

294  {
295  std::map<int, int> ret;
296  std::vector<EcalLogicID> crystals_EB =
297  getEcalLogicIDSetOrdered( "EB_crystal_number",
298  1,36,1,1700,
300  "EB_crystal_number", EcalLogicID::NULLID);
301  std::vector<EcalLogicID> crystals_EE =
302  getEcalLogicIDSetOrdered( "EE_crystal_number",
303  -1,1,1,100,
304  1,100,
305  "EE_crystal_number", EcalLogicID::NULLID);
306  std::vector<EcalLogicID> EB_lmr =
307  getEcalLogicIDSetOrdered( "EB_crystal_number",
308  1,36,1,1700,
310  "ECAL_LMR", EcalLogicID::NULLID);
311  std::vector<EcalLogicID> EE_lmr =
312  getEcalLogicIDSetOrdered( "EE_crystal_number",
313  -1,1,1,100,
314  1,100,
315  "ECAL_LMR", EcalLogicID::NULLID);
316  unsigned int neb = crystals_EB.size();
317  unsigned int nee = crystals_EE.size();
318  if (neb != EB_lmr.size()) {
319  throw(std::runtime_error("ERROR: EB Vectors size do not agree"));
320  }
321  if (nee != EE_lmr.size()) {
322  throw(std::runtime_error("ERROR: EE Vectors size do not agree"));
323  }
324  for (unsigned int i = 0; i < neb; i++) {
325  ret[crystals_EB[i].getLogicID()] = EB_lmr[i].getLogicID() % 100;
326  }
327  for (unsigned int i = 0; i < nee; i++) {
328  ret[crystals_EE[i].getLogicID()] = EE_lmr[i].getLogicID() % 100;
329  }
330  return ret;
331 }
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:42
std::vector< EcalLogicID > EcalCondDBInterface::getEcalLogicIDForLMPN ( int  lmr_logic_id)

Definition at line 388 of file EcalCondDBInterface.cc.

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

Definition at line 396 of file EcalCondDBInterface.cc.

References EcalLogicID::getLogicID().

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

Definition at line 380 of file EcalCondDBInterface.cc.

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

Definition at line 384 of file EcalCondDBInterface.cc.

References EcalLogicID::getLogicID().

384  {
385  return getEcalLogicIDForLMR(lmr.getLogicID());
386 }
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 333 of file EcalCondDBInterface.cc.

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

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

References IDBObject::ECALDB_NROWS, i, mergeVDriftHistosByStation::name, EcalLogicID::NULLID, query::result, and contentValuesCheck::ss.

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

References IDBObject::ECALDB_NROWS, i, mergeVDriftHistosByStation::name, EcalLogicID::NULLID, query::result, and contentValuesCheck::ss.

Referenced by EcalTPGParamBuilder::analyze().

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

Definition at line 708 of file EcalCondDBInterface.h.

References _logicId2DetId, and fillLogicId2DetIdMaps().

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

Definition at line 697 of file EcalCondDBInterface.h.

References _detId2LogicId, _logicId2DetId, and fillLogicId2DetIdMaps().

697  {
698  int logic_id = -1;
699  if (_logicId2DetId.size() == 0) {
701  }
702  if (_detId2LogicId.find(det_id) != _detId2LogicId.end()) {
703  logic_id = _detId2LogicId[det_id];
704  }
705  return logic_id;
706  }
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 521 of file EcalCondDBInterface.h.

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

Referenced by EcalDccWeightBuilder::writeWeightToDB().

523  {
524  try {
525  iconf->setConnection(env, conn);
526  // if it has not yet been written then write
527  if(iconf->getId()==0){
528  std::cout<<"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
529  iconf->fetchID();
530  }
531  if(iconf->getId()==0){
532  std::cout<<"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
533  iconf->writeDB();
534  }
535 
536  DATT dataIface;
537  dataIface.setConnection(env, conn);
538  dataIface.prepareWrite();
539 
540  dataIface.writeArrayDB(data, iconf);
541  conn->commit();
542 
543  dataIface.terminateWriteStatement();
544 
545  } catch (std::runtime_error &e) {
546  conn->rollback();
547  throw(e);
548  } catch (...) {
549  conn->rollback();
550  throw(std::runtime_error("EcalCondDBInterface::insertConfigDataArraySet: Unknown exception caught"));
551  }
552  }
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 482 of file EcalCondDBInterface.h.

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

484  {
485  try {
486  iconf->setConnection(env, conn);
487  // if it has not yet been written then write
488  if(iconf->getId()==0){
489  std::cout<<"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
490  iconf->fetchID();
491  }
492  if(iconf->getId()==0){
493  std::cout<<"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
494  iconf->writeDB();
495  }
496 
497  DATT dataIface;
498  dataIface.setConnection(env, conn);
499  dataIface.prepareWrite();
500 
501  const DATT* dataitem;
502 
503  for (int p = 0; p != data->size(); ++p) {
504  dataitem = data[p];
505  dataIface.writeDB( dataitem, iconf);
506  }
507  conn->commit();
508  dataIface.terminateWriteStatement();
509  } catch (std::runtime_error &e) {
510  conn->rollback();
511  throw(e);
512  } catch (...) {
513  conn->rollback();
514  throw(std::runtime_error("EcalCondDBInterface::insertConfigDataSet: Unknown exception caught"));
515  }
516  }
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 424 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().

426  {
427  try {
428  iconf->setConnection(env, conn);
429  iconf->prepareWrite();
430  // if it has not yet been written then write
431  iconf->writeDB();
432  std::cout<< "iconf inserted with ID="<<iconf->getId()<<std::endl;
433  conn->commit();
434  iconf->terminateWriteStatement();
435  } catch (std::runtime_error &e) {
436  conn->rollback();
437  throw(e);
438  } catch (...) {
439  conn->rollback();
440  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
441  }
442  }
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 347 of file EcalCondDBInterface.h.

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

Referenced by ecaldqm::IntegrityWriter::run(), ecaldqm::LaserWriter::run(), ecaldqm::PedestalWriter::run(), ecaldqm::PresampleWriter::run(), ecaldqm::TestPulseWriter::run(), ecaldqm::TimingWriter::run(), ecaldqm::LedWriter::run(), ecaldqm::OccupancyWriter::run(), 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().

349  {
350  try {
351  iov->setConnection(env, conn);
352  if(iov->getID()==0){
353  std::cout<<"IOV was not set we retrieve it from DB"<<std::endl;
354  iov->fetchID();
355  }
356  if(iov->getID()==0){
357  std::cout<<"IOV was not written we write it"<<std::endl;
358  iov->writeDB();
359  }
360 
361  std::cout<<"id="<<iov->getID()<<std::endl;
362 
363  DATT dataIface;
364  dataIface.setConnection(env, conn);
365  dataIface.prepareWrite();
366 
367  dataIface.writeArrayDB(data, iov);
368  conn->commit();
369 
370  dataIface.terminateWriteStatement();
371 
372  } catch (std::runtime_error &e) {
373  conn->rollback();
374  throw(e);
375  } catch (...) {
376  conn->rollback();
377  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
378  }
379  }
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 307 of file EcalCondDBInterface.h.

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

Referenced by ecaldqm::TestPulseWriter::run(), ecaldqm::SummaryWriter::run(), and EcalPedOffset::writeDb().

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

Definition at line 382 of file EcalCondDBInterface.h.

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

384  {
385 
386  int nruns= run_iov.size();
387 
388  if(run_iov.size()!=ecid.size() &&ecid.size()!=data.size()){
389  throw(std::runtime_error("EcalCondDBInterface::insertDataSetVector: vector sizes are different.."));
390  }
391 
392 
393  try {
394 
395  DATT dataIface;
396  dataIface.setConnection(env, conn);
397  dataIface.prepareWrite();
398 
399  for (int i=0; i<nruns; i++){
400 
401  run_iov[i].setConnection(env, conn);
402  run_iov[i].writeDB();
403 
404  dataIface.writeDB( &ecid[i], &data[i], &run_iov[i]);
405 
406  conn->commit();
407  }
408  } catch (std::runtime_error &e) {
409  conn->rollback();
410  throw(e);
411  } catch (...) {
412  conn->rollback();
413  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
414  }
415  }
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 708 of file EcalCondDBInterface.cc.

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

710 {
711  try {
712  iov->setConnection(env, conn);
713  iov->writeDB();
714  } catch(std::runtime_error &e) {
715  conn->rollback();
716  throw(e);
717  }
718  conn->commit();
719 }
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 570 of file EcalCondDBInterface.cc.

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

572 {
573  try {
574  dat->setConnection(env, conn);
575  dat->writeDB();
576  } catch(std::runtime_error &e) {
577  conn->rollback();
578  throw(e);
579  }
580  conn->commit();
581 }
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 583 of file EcalCondDBInterface.cc.

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

585 {
586  try {
587  std::list<LMFDat *>::iterator i = dat.begin();
588  std::list<LMFDat *>::iterator e = dat.end();
589  while (i != e) {
590  (*i)->setConnection(env, conn);
591  (*i)->writeDB();
592  i++;
593  }
594  } catch(std::runtime_error &e) {
595  conn->rollback();
596  throw(e);
597  }
598  conn->commit();
599 }
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 557 of file EcalCondDBInterface.cc.

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

559 {
560  try {
561  iov->setConnection(env, conn);
562  iov->writeDB();
563  } catch(std::runtime_error &e) {
564  conn->rollback();
565  throw(e);
566  }
567  conn->commit();
568 }
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 544 of file EcalCondDBInterface.cc.

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

546 {
547  try {
548  iov->setConnection(env, conn);
549  iov->writeDB();
550  } catch(std::runtime_error &e) {
551  conn->rollback();
552  throw(e);
553  }
554  conn->commit();
555 }
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 601 of file EcalCondDBInterface.cc.

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

603 {
604  try {
605  iov->setConnection(env, conn);
606  iov->writeDB();
607  } catch(std::runtime_error &e) {
608  conn->rollback();
609  throw(e);
610  }
611  conn->commit();
612 }
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 531 of file EcalCondDBInterface.cc.

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

533 {
534  try {
535  iov->setConnection(env, conn);
536  iov->writeDB();
537  } catch(std::runtime_error &e) {
538  conn->rollback();
539  throw(e);
540  }
541  conn->commit();
542 }
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 695 of file EcalCondDBInterface.cc.

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

Referenced by EcalCondDBWriter::dqmEndJob().

697 {
698  try {
699  iov->setConnection(env, conn);
700  iov->writeDB();
701  } catch(std::runtime_error &e) {
702  conn->rollback();
703  throw(e);
704  }
705  conn->commit();
706 }
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 518 of file EcalCondDBInterface.cc.

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

Referenced by EcalCondDBWriter::dqmEndJob().

520 {
521  try {
522  iov->setConnection(env, conn);
523  iov->writeDB();
524  } catch(std::runtime_error &e) {
525  conn->rollback();
526  throw(e);
527  }
528  conn->commit();
529 }
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 653 of file EcalCondDBInterface.cc.

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

655 {
656  try {
657  od->setConnection(env, conn);
658  od->updateDefaultCycle();
659  } catch(std::runtime_error &e) {
660  conn->rollback();
661  throw(e);
662  }
663  conn->commit();
664 }
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 614 of file EcalCondDBInterface.cc.

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

616 {
617  try {
618  iov->setConnection(env, conn);
619  iov->updateEndTimeDB();
620  } catch(std::runtime_error &e) {
621  conn->rollback();
622  throw(e);
623  }
624  conn->commit();
625 }
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 627 of file EcalCondDBInterface.cc.

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

629 {
630  try {
631  iov->setConnection(env, conn);
632  iov->updateEndTimeDB();
633  } catch(std::runtime_error &e) {
634  conn->rollback();
635  throw(e);
636  }
637  conn->commit();
638 }
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 640 of file EcalCondDBInterface.cc.

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

642 {
643  try {
644  iov->setConnection(env, conn);
645  iov->updateStartTimeDB();
646  } catch(std::runtime_error &e) {
647  conn->rollback();
648  throw(e);
649  }
650  conn->commit();
651 }
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 742 of file EcalCondDBInterface.h.

Referenced by getDetId2LogicIdMap(), and getLogicIdFromDetId().

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