|
|
Go to the documentation of this file.
8 #ifndef ECALCONDDBINTERFACE_HH
9 #define ECALCONDDBINTERFACE_HH
139 std::
string mapsTo = "") noexcept(
false);
149 std::
string mapsTo = "",
248 int n_runs) noexcept(
false);
264 if (iov->getID() == 0) {
265 std::cout <<
"IOV was not set we retrieve it from DB" << std::endl;
268 if (iov->getID() == 0) {
269 std::cout <<
"IOV was not written we write it" << std::endl;
274 dataIface.setConnection(
env,
conn);
275 dataIface.prepareWrite();
278 const DATT* dataitem;
279 typedef typename std::map<EcalLogicID, DATT>::const_iterator CI;
280 for (CI
p =
data->begin();
p !=
data->end(); ++
p) {
281 channel = &(
p->first);
282 dataitem = &(
p->second);
283 dataIface.writeDB(channel, dataitem, iov);
286 dataIface.terminateWriteStatement();
287 }
catch (std::runtime_error&
e) {
292 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
297 template <
class DATT,
class IOVT>
301 if (iov->getID() == 0) {
302 std::cout <<
"IOV was not set we retrieve it from DB" << std::endl;
305 if (iov->getID() == 0) {
306 std::cout <<
"IOV was not written we write it" << std::endl;
310 std::cout <<
"id=" << iov->getID() << std::endl;
313 dataIface.setConnection(
env,
conn);
314 dataIface.prepareWrite();
316 dataIface.writeArrayDB(
data, iov);
319 dataIface.terminateWriteStatement();
321 }
catch (std::runtime_error&
e) {
326 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
330 template <
class DATT,
class IOVT>
332 const std::vector<IOVT>& run_iov,
333 const std::vector<DATT>&
data) noexcept(
false) {
334 int nruns = run_iov.size();
336 if (run_iov.size() != ecid.size() && ecid.size() !=
data.size()) {
337 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSetVector: vector sizes are different.."));
342 dataIface.setConnection(
env,
conn);
343 dataIface.prepareWrite();
345 for (
int i = 0;
i < nruns;
i++) {
346 run_iov[
i].setConnection(
env,
conn);
347 run_iov[
i].writeDB();
349 dataIface.writeDB(&ecid[
i], &
data[
i], &run_iov[
i]);
353 }
catch (std::runtime_error&
e) {
358 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
364 template <
class ICONF>
367 iconf->setConnection(
env,
conn);
368 iconf->prepareWrite();
371 std::cout <<
"iconf inserted with ID=" << iconf->getId() << std::endl;
373 iconf->terminateWriteStatement();
374 }
catch (std::runtime_error&
e) {
379 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
386 template <
class ICONF>
389 iconf->setConnection(
env,
conn);
390 iconf->createReadStatement();
391 iconf->fetchData(iconf);
392 iconf->terminateReadStatement();
398 template <
class ICONF>
401 iconf->setConnection(
env,
conn);
402 iconf->createReadStatement();
403 iconf->fetchLastData(iconf);
404 iconf->terminateReadStatement();
410 template <
class DATT,
class ICONF>
413 iconf->setConnection(
env,
conn);
415 if (iconf->getId() == 0) {
416 std::cout <<
"EcalCondDBInterface>> config_id was not set we retrieve it from DB" << std::endl;
419 if (iconf->getId() == 0) {
420 std::cout <<
"EcalCondDBInterface>> configuration info was not written we write it" << std::endl;
425 dataIface.setConnection(
env,
conn);
426 dataIface.prepareWrite();
428 const DATT* dataitem;
430 for (
int p = 0;
p !=
data->size(); ++
p) {
432 dataIface.writeDB(dataitem, iconf);
435 dataIface.terminateWriteStatement();
436 }
catch (std::runtime_error&
e) {
441 throw(std::runtime_error(
"EcalCondDBInterface::insertConfigDataSet: Unknown exception caught"));
447 template <
class DATT,
class ICONF>
450 iconf->setConnection(
env,
conn);
452 if (iconf->getId() == 0) {
453 std::cout <<
"EcalCondDBInterface>> config_id was not set we retrieve it from DB" << std::endl;
456 if (iconf->getId() == 0) {
457 std::cout <<
"EcalCondDBInterface>> configuration info was not written we write it" << std::endl;
462 dataIface.setConnection(
env,
conn);
463 dataIface.prepareWrite();
465 dataIface.writeArrayDB(
data, iconf);
468 dataIface.terminateWriteStatement();
470 }
catch (std::runtime_error&
e) {
475 throw(std::runtime_error(
"EcalCondDBInterface::insertConfigDataArraySet: Unknown exception caught"));
481 template <
class DATT,
class ICONF>
484 datiface.setConnection(
env,
conn);
485 datiface.createReadStatement();
486 datiface.setPrefetchRowCount(1024);
487 datiface.fetchData(fillMap, iconf);
488 datiface.terminateReadStatement();
494 template <
class DATT,
class IOVT>
495 void fetchDataSet(std::map<EcalLogicID, DATT>* fillMap, IOVT* iov) noexcept(
false) {
499 datiface.setConnection(
env,
conn);
500 datiface.createReadStatement();
501 datiface.setPrefetchRowCount(1024);
502 datiface.fetchData(fillMap, iov);
503 datiface.terminateReadStatement();
509 template <
class DATT>
514 datiface.setConnection(
env,
conn);
515 datiface.createReadStatement();
516 datiface.setPrefetchRowCount(1024);
517 datiface.fetchHistoricalData(fillMap,
t);
518 datiface.terminateReadStatement();
525 template <
class DATT,
class IOVT>
530 datiface.setConnection(
env,
conn);
531 datiface.createReadStatement();
532 datiface.setPrefetchRowCount(1024);
533 datiface.fetchData(fillMap, iov, mapping_name);
534 datiface.terminateReadStatement();
544 template <
class DATT,
class IOVT>
551 fillIOV->setConnection(
env,
conn);
552 fillIOV->setByRecentData(datiface.getTable(),
tag,
run);
553 datiface.setConnection(
env,
conn);
554 datiface.createReadStatement();
555 datiface.setPrefetchRowCount(1024);
556 datiface.fetchData(fillMap, fillIOV);
557 datiface.terminateReadStatement();
567 template <
class DATT,
class IOVT>
574 fillIOV->setConnection(
env,
conn);
575 fillIOV->setByRecentData(datiface.getTable(),
location,
run);
576 datiface.setConnection(
env,
conn);
577 datiface.createReadStatement();
578 datiface.setPrefetchRowCount(1024);
579 datiface.fetchData(fillMap, fillIOV);
580 datiface.terminateReadStatement();
EcalCondDBInterface(std::string host, std::string sid, std::string user, std::string pass, int port=1521)
std::map< int, int > getDetId2LogicIdMap()
void insertConfigSet(ICONF *iconf) noexcept(false)
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
void updateRunIOVStartTime(RunIOV *iov) noexcept(false)
MonRunList fetchMonRunList(const RunTag &tag, const MonRunTag &monruntag) noexcept(false)
void fetchDataSetWithMap(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov, std::string mapping_name) noexcept(false)
std::map< int, int > _logicId2DetId
void fetchConfigSet(ICONF *iconf) noexcept(false)
RunList fetchRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
void insertDCUIOV(DCUIOV *iov) noexcept(false)
MonRunIOV fetchMonRunIOV(RunTag *runtag, MonRunTag *montag, run_t run, subrun_t monrun) noexcept(false)
RunList fetchRunList(const RunTag &tag) noexcept(false)
RunList fetchNonEmptyGlobalRunList(const RunTag &tag, int min_run, int max_run) noexcept(false)
void insertRunIOV(RunIOV *iov) noexcept(false)
std::vector< EcalLogicID > getEcalLogicIDMappedTo(int logic_id, std::string maps_to)
void updateRunIOV(RunIOV *iov) noexcept(false)
void fetchLastConfigSet(ICONF *iconf) noexcept(false)
int getLogicIdFromDetId(int det_id)
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
std::map< int, int > getLogicId2DetIdMap()
void insertConfigDataArraySet(const std::vector< DATT > &data, ICONF *iconf) noexcept(false)
void updateRunIOVEndTime(RunIOV *iov) noexcept(false)
std::map< int, int > getEcalLogicID2LmrMap()
std::vector< EcalLogicID > getEcalLogicIDForLMR(int lmr_logic_id)
DateHandler * getDateHandler()
void insertLmfLmrSubIOV(LMFLmrSubIOV *iov) noexcept(false)
void updateRunConfig(ODRunConfigInfo *od) noexcept(false)
void insertConfigDataSet(const std::vector< DATT > data, ICONF *iconf) noexcept(false)
LMFRunIOV fetchLMFRunIOV(RunTag *runtag, LMFRunTag *lmftag, run_t run, subrun_t lmfrun) noexcept(false)
void insertLmfIOV(LMFIOV *iov) noexcept(false)
void fetchDCSDataSet(std::list< std::pair< Tm, std::map< EcalLogicID, DATT > > > *fillMap, const Tm &t) noexcept(false)
void fillLogicId2DetIdMaps()
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
void insertLmfDat(LMFDat *dat) noexcept(false)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
void insertMonRunIOV(MonRunIOV *iov) noexcept(false)
def template(fileName, svg, replaceme="REPLACEME")
EcalLogicID getEcalLogicID(std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="") noexcept(false)
void insertLmfSeq(LMFSeqDat *iov) noexcept(false)
CaliIOV fetchCaliIOV(CaliTag *tag, const Tm &evenTm) noexcept(false)
void insertDataSetVector(const std::vector< EcalLogicID > &ecid, const std::vector< IOVT > &run_iov, const std::vector< DATT > &data) noexcept(false)
RunIOV fetchLMFLastRun() const
void fetchValidDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, std::string location, run_t run=(unsigned int) -1) noexcept(false)
void fetchConfigDataSet(std::vector< DATT > *fillMap, ICONF *iconf) noexcept(false)
DCSPTMTempList fetchDCSPTMTempList(const EcalLogicID &ecid) noexcept(false)
oracle::occi::Environment * env
~EcalCondDBInterface() noexcept(false) override
void fetchValidDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, RunTag *tag, run_t run=(unsigned int) -1) noexcept(false)
std::vector< EcalLogicID > 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="") noexcept(false)
EcalCondDBInterface()=delete
std::vector< EcalLogicID > getEcalLogicIDForLMPN(int lmr_logic_id)
char data[epos_bytes_allocation]
void insertLmfRunIOV(LMFRunIOV *iov) noexcept(false)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
std::map< int, int > _detId2LogicId
int getDetIdFromLogicId(int logic_id)
DCUIOV fetchDCUIOV(DCUTag *tag, const Tm &evenTm) noexcept(false)
RunIOV fetchRunIOV(RunTag *tag, run_t run) noexcept(false)
RunList fetchNonEmptyRunList(const RunTag &tag, int min_run, int max_run) noexcept(false)
std::list< ODDelaysDat > fetchFEDelaysForRun(RunIOV *iov) noexcept(false)
oracle::occi::Connection * conn
EcalCondDBInterface(std::string sid, std::string user, std::string pass)
MonRunList fetchMonRunListLastNRuns(const RunTag &tag, const MonRunTag &monruntag, int max_run, int n_runs) noexcept(false)
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) noexcept(false)
RunList fetchRunListLastNRuns(const RunTag &tag, int max_run, int n_runs) noexcept(false)