9 #ifndef ECALCONDDBINTERFACE_HH
10 #define ECALCONDDBINTERFACE_HH
93 throw(std::runtime_error)
123 std::string mapsTo =
"" )
124 throw(std::runtime_error);
146 throw(std::runtime_error);
161 std::
string mapsTo = "" )
162 throw(std::runtime_error);
166 int fromId1,
int toId1,
169 std::
string mapsTo = "",
int orderedBy=
EcalLogicID::NULLID )
throw(std::runtime_error);
176 throw(std::runtime_error);
179 throw(std::runtime_error);
181 throw(std::runtime_error);
183 throw(std::runtime_error);
188 throw(std::runtime_error);
190 throw(std::runtime_error);
192 throw(std::runtime_error);
194 throw(std::runtime_error);
196 throw(std::runtime_error);
198 throw(std::runtime_error);
205 throw(std::runtime_error);
211 throw(std::runtime_error);
221 throw(std::runtime_error);
224 throw(std::runtime_error);
232 throw(std::runtime_error);
239 throw(std::runtime_error);
246 throw(std::runtime_error);
253 throw(std::runtime_error);
261 throw(std::runtime_error);
270 throw(std::runtime_error);
309 throw(std::runtime_error)
315 std::cout<<
"IOV was not set we retrieve it from DB"<<std::endl;
319 std::cout<<
"IOV was not written we write it"<<std::endl;
324 dataIface.setConnection(
env,
conn);
325 dataIface.prepareWrite();
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);
336 dataIface.terminateWriteStatement();
337 }
catch (std::runtime_error &
e) {
342 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
347 template<
class DATT,
class IOVT>
349 throw(std::runtime_error)
354 std::cout<<
"IOV was not set we retrieve it from DB"<<std::endl;
358 std::cout<<
"IOV was not written we write it"<<std::endl;
365 dataIface.setConnection(
env,
conn);
366 dataIface.prepareWrite();
368 dataIface.writeArrayDB(
data,
iov);
371 dataIface.terminateWriteStatement();
373 }
catch (std::runtime_error &
e) {
378 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
382 template<
class DATT,
class IOVT>
384 throw(std::runtime_error)
387 int nruns= run_iov.size();
389 if(run_iov.size()!=ecid.size() &&ecid.size()!=
data.size()){
390 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSetVector: vector sizes are different.."));
397 dataIface.setConnection(
env,
conn);
398 dataIface.prepareWrite();
400 for (
int i=0;
i<nruns;
i++){
402 run_iov[
i].setConnection(
env,
conn);
403 run_iov[
i].writeDB();
405 dataIface.writeDB( &ecid[
i], &
data[i], &run_iov[i]);
409 }
catch (std::runtime_error &
e) {
414 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
424 template<
class ICONF >
426 throw(std::runtime_error)
429 iconf->setConnection(
env,
conn);
430 iconf->prepareWrite();
433 std::cout<<
"iconf inserted with ID="<<iconf->getId()<<std::endl;
435 iconf->terminateWriteStatement();
436 }
catch (std::runtime_error &
e) {
441 throw(std::runtime_error(
"EcalCondDBInterface::insertDataSet: Unknown exception caught"));
448 template<
class ICONF>
450 throw(std::runtime_error)
454 iconf->setConnection(
env,
conn);
455 iconf->createReadStatement();
456 iconf->fetchData(iconf);
457 iconf->terminateReadStatement();
464 template<
class ICONF>
466 throw(std::runtime_error)
470 iconf->setConnection(
env,
conn);
471 iconf->createReadStatement();
472 iconf->fetchLastData(iconf);
473 iconf->terminateReadStatement();
482 template<
class DATT,
class ICONF>
484 throw(std::runtime_error)
487 iconf->setConnection(
env,
conn);
489 if(iconf->getId()==0){
490 std::cout<<
"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
493 if(iconf->getId()==0){
494 std::cout<<
"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
499 dataIface.setConnection(
env,
conn);
500 dataIface.prepareWrite();
502 const DATT* dataitem;
504 for (
int p = 0;
p !=
data->size(); ++
p) {
506 dataIface.writeDB( dataitem, iconf);
509 dataIface.terminateWriteStatement();
510 }
catch (std::runtime_error &
e) {
515 throw(std::runtime_error(
"EcalCondDBInterface::insertConfigDataSet: Unknown exception caught"));
521 template<
class DATT,
class ICONF>
523 throw(std::runtime_error)
526 iconf->setConnection(
env,
conn);
528 if(iconf->getId()==0){
529 std::cout<<
"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
532 if(iconf->getId()==0){
533 std::cout<<
"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
538 dataIface.setConnection(
env,
conn);
539 dataIface.prepareWrite();
541 dataIface.writeArrayDB(
data, iconf);
544 dataIface.terminateWriteStatement();
546 }
catch (std::runtime_error &
e) {
551 throw(std::runtime_error(
"EcalCondDBInterface::insertConfigDataArraySet: Unknown exception caught"));
557 template<
class DATT,
class ICONF>
559 throw(std::runtime_error)
563 datiface.setConnection(
env,
conn);
564 datiface.createReadStatement();
565 datiface.setPrefetchRowCount(1024);
566 datiface.fetchData(
fillMap, iconf );
567 datiface.terminateReadStatement();
580 template<
class DATT,
class IOVT>
582 throw(std::runtime_error)
587 datiface.setConnection(
env,
conn);
588 datiface.createReadStatement();
589 datiface.setPrefetchRowCount(1024);
591 datiface.terminateReadStatement();
603 throw(std::runtime_error)
608 datiface.setConnection(
env,
conn);
609 datiface.createReadStatement();
610 datiface.setPrefetchRowCount(1024);
611 datiface.fetchHistoricalData(
fillMap,
t );
612 datiface.terminateReadStatement();
624 template<
class DATT,
class IOVT>
626 throw(std::runtime_error)
631 datiface.setConnection(
env,
conn);
632 datiface.createReadStatement();
633 datiface.setPrefetchRowCount(1024);
634 datiface.fetchData(
fillMap,
iov , mapping_name);
635 datiface.terminateReadStatement();
646 template<
class DATT,
class IOVT>
650 throw(std::runtime_error)
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();
670 template<
class DATT,
class IOVT>
673 std::string location,
run_t run = (
unsigned int)-1)
674 throw(std::runtime_error)
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();
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="")
std::map< int, int > _detId2LogicId
std::map< int, int > _logicId2DetId
void insertRunIOV(RunIOV *iov)
std::list< ODDelaysDat > fetchFEDelaysForRun(RunIOV *iov)
int getLogicIdFromDetId(int det_id)
void insertConfigSet(ICONF *iconf)
RunList fetchNonEmptyGlobalRunList(RunTag tag, int min_run, int max_run)
RunList fetchRunListByLocation(RunTag tag, int min_run, int max_run, const LocationDef locDef)
DCSPTMTempList fetchDCSPTMTempList(EcalLogicID ecid)
void fetchValidDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, RunTag *tag, run_t run=(unsigned int)-1)
void insertLmfDat(LMFDat *dat)
oracle::occi::Environment * env
RunIOV fetchRunIOV(RunTag *tag, run_t run)
void insertDataSetVector(std::vector< EcalLogicID > ecid, std::vector< IOVT > run_iov, std::vector< DATT > data)
void updateRunIOVStartTime(RunIOV *iov)
void insertLmfSeq(LMFSeqDat *iov)
EcalCondDBInterface(std::string host, std::string sid, std::string user, std::string pass, int port=1521)
std::vector< EcalLogicID > getEcalLogicIDMappedTo(int logic_id, std::string maps_to)
DCUIOV fetchDCUIOV(DCUTag *tag, Tm evenTm)
LMFRunIOV fetchLMFRunIOV(RunTag *runtag, LMFRunTag *lmftag, run_t run, subrun_t lmfrun)
std::vector< EcalLogicID > getEcalLogicIDForLMPN(int lmr_logic_id)
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)
void fetchLastConfigSet(ICONF *iconf)
void fetchConfigDataSet(std::vector< DATT > *fillMap, ICONF *iconf)
DateHandler * getDateHandler()
CaliIOV fetchCaliIOV(CaliTag *tag, Tm evenTm)
void insertConfigDataArraySet(const std::vector< DATT > data, ICONF *iconf)
oracle::occi::Connection * conn
RunList fetchGlobalRunListByLocation(RunTag tag, int min_run, int max_run, const LocationDef locDef)
EcalCondDBInterface(std::string sid, std::string user, std::string pass)
RunList fetchRunList(RunTag tag)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
MonRunList fetchMonRunListLastNRuns(RunTag tag, MonRunTag monruntag, int max_run, int n_runs)
std::map< int, int > getEcalLogicID2LmrMap()
EcalLogicID getEcalLogicID(std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="")
RunIOV fetchLMFLastRun() const
void insertDCUIOV(DCUIOV *iov)
void insertConfigDataSet(const std::vector< DATT > data, ICONF *iconf)
void insertLmfRunIOV(LMFRunIOV *iov)
void insertLmfIOV(LMFIOV *iov)
void updateRunConfig(ODRunConfigInfo *od)
MonRunList fetchMonRunList(RunTag tag, MonRunTag monruntag)
virtual ~EcalCondDBInterface()
RunList fetchNonEmptyRunList(RunTag tag, int min_run, int max_run)
void fetchConfigSet(ICONF *iconf)
void fetchDCSDataSet(std::list< std::pair< Tm, std::map< EcalLogicID, DATT > > > *fillMap, Tm t)
MonRunIOV fetchMonRunIOV(RunTag *runtag, MonRunTag *montag, run_t run, subrun_t monrun)
RunList fetchRunListLastNRuns(RunTag tag, int max_run, int n_runs)
int getDetIdFromLogicId(int logic_id)
void insertMonRunIOV(MonRunIOV *iov)
char data[epos_bytes_allocation]
std::map< int, int > getLogicId2DetIdMap()
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
void fillLogicId2DetIdMaps()
void updateRunIOV(RunIOV *iov)
void updateRunIOVEndTime(RunIOV *iov)
void fillMap(Registry *reg, regmap_type &fillme)
std::vector< EcalLogicID > getEcalLogicIDForLMR(int lmr_logic_id)
void fetchDataSetWithMap(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov, std::string mapping_name)
std::map< int, int > getDetId2LogicIdMap()
void insertLmfLmrSubIOV(LMFLmrSubIOV *iov)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void fetchValidDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, std::string location, run_t run=(unsigned int)-1)