25#include "CoolKernel/ValidityKey.h"
26#include "CoolKernel/IFolder.h"
27#include "CoolKernel/Exception.h"
28#include "CoolKernel/IObject.h"
29#include "CoolKernel/IObjectIterator.h"
30#include "CoolKernel/Record.h"
31#include "CoolKernel/IDatabaseSvc.h"
32#include "CoralKernel/Context.h"
33#include "RelationalAccess/ConnectionService.h"
34#include "RelationalAccess/IConnectionService.h"
35#include "RelationalAccess/IConnectionServiceConfiguration.h"
36#include "RelationalAccess/ILookupService.h"
37#include "RelationalAccess/IAuthenticationService.h"
38#include "RelationalAccess/IAuthenticationCredentials.h"
39#include "RelationalAccess/IDatabaseServiceDescription.h"
40#include "RelationalAccess/IDatabaseServiceSet.h"
56#define READ_WRITE false
66 m_neededToOpen = false;
68 m_writer->openDb(m_ro);
69 m_neededToOpen = true;
109 m_ostream <<
"Opening database '" <<
m_dbId <<
"' in " << (readOnly?
"read-only":
"read-write") <<
" mode" << endl;
114 }
catch(cool::DatabaseDoesNotExist& e) {
116 m_ostream <<
"Database '" <<
m_dbId <<
"' does not exist. Can't create it since connection is read-only." << endl;
119 m_ostream <<
"Database '" <<
m_dbId <<
"' does not exist, will create it" << endl;
124 }
catch(Exception& e) {
125 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
138 if(db.use_count()>0 && db->isOpen()) {
140 db->closeDatabase( );
142 }
catch(std::exception& e) {
143 m_ostream <<
"*** COOL exception caught: " << e.what() << endl
144 <<
"Couldn't close conditions database: " <<
m_dbId << endl;
160 }
catch(std::exception& e) {
161 m_ostream <<
"*** COOL exception caught: " << e.what() << endl
162 <<
"Couldn't close conditions database: " <<
m_dbId << endl;
177 catch(cool::DatabaseDoesNotExist& e) {
178 m_ostream <<
"*** : " << e.what() << endl;
183 catch(cool::Exception& e) {
184 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
192 m_ostream <<
"Creating schema '" <<
m_dbId <<
"' with version " << schemaVersion
196 catch(cool::Exception& e) {
197 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
223 o <<
"Schema version is " << schemaVersion
250 catch(std::exception& e) {
251 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
252 m_ostream <<
"Coudn't create a new conditions database: " <<
m_dbId << endl;
262 cool::ValidityKey since,
263 cool::ValidityKey until) {
266 if(since==ValidityKeyMin && until==ValidityKeyMax) {
267 m_ostream <<
"Writing " << content <<
" for infinite range [0,oo]" << endl;
271 unsigned long long run[2];
272 unsigned long long lb[2];
273 lb[0] = since & 0xFFFFFFFF;
274 lb[1] = until & 0xFFFFFFFF;
276 run[0] &= 0x7FFFFFFF;
278 run[1] &= 0x7FFFFFFF;
280 if(
lb[0]==0 &&
lb[1]==0) {
281 unsigned int first =
run[0];
282 unsigned int last =
run[1]-1;
284 m_ostream <<
"IOV Info: writing " << content <<
" for run " << first << endl;
286 m_ostream <<
"IOV Info: writing " << content <<
" for run range [" << first <<
"," << last <<
"]" << endl;
291 m_ostream <<
"IOV Info: writing " << content <<
" for run " <<
run[0] <<
" and LB " <<
lb[0] << endl;
293 m_ostream <<
"IOV Info: writing " << content <<
" for run " <<
run[0] <<
" and LB range [" <<
lb[0] <<
"," <<
lb[1]-1 <<
"]" << endl;
295 m_ostream <<
"IOV Info: writing " << content <<
" for range [" <<
run[0] <<
"/" <<
lb[0] <<
"," <<
run[1] <<
"/" <<
lb[1] <<
"[" << endl;
313 catch(exception & e) {
314 m_ostream <<
"<writeL1Payload> caught and re-throw exception: " << e.what() << endl;
324 const string& configSource)
331 rangeInfo(
"HLT configuration keys", vr.since(), vr.until());
335 confkeyFolder->storeObject(vr.since(), vr.until(), payload, 0);
337 catch(exception & e) {
338 m_ostream <<
"<writeHLTPayload> caught and re-throw exception: " << e.what() << endl
339 <<
"WARNING: Failed to write configuration keys to COOL" << endl;
354 rangeInfo(
"HLT menu", vr.since(), vr.until());
362 ChannelId menuChannel(0);
366 hltMenuFolder->setupStorageBuffer();
367 hltGroupFolder->setupStorageBuffer();
373 hltMenuFolder->storeObject(vr.since(), vr.until(), payload, menuChannel);
376 hltGroupFolder->storeObject(vr.since(), vr.until(), payloadGroups, menuChannel);
377 m_ostream <<
"Writing (to buffer) HLT chain " << chain->chain_name()
378 <<
"(id " << chain->chain_counter()
379 <<
" level "<< chain->level()
380 <<
") to COOL channel " << menuChannel
381 <<
" [belongs to groups " << payloadGroups[
"Groups"].data<cool::String4k>() <<
"]" << endl;
384 m_ostream <<
"Flushing HLT menu buffer to /TRIGGER/HLT/Menu" << endl;
386 hltMenuFolder->flushStorageBuffer();
388 catch ( cool::Exception & e) {
389 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
390 <<
"warning will be ignored, job will continue" << endl;
394 m_ostream <<
"Flushing HLT group buffer to /TRIGGER/HLT/Groups" << endl;
396 hltGroupFolder->flushStorageBuffer();
398 catch ( cool::Exception & e) {
399 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
400 <<
"warning will be ignored, job will continue" << endl;
404 catch( cool::Exception & e) {
405 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
406 m_ostream <<
"Failed to write HLT menu to COOL" << endl;
409 catch(std::exception & e) {
410 m_ostream <<
"<writeHLTPayload> Caught std::exception: " << e.what() << endl;
414 m_ostream <<
"List of HLT Chains is empty, nothing is written to COOL" << endl;
434 rangeInfo(
"Monitoring configuration key", vr.since(), vr.until());
438 monconfkeyFolder->storeObject(vr.since(), vr.until(), payload, 0,
"MenuAwareMonConfigKey-"+
release);
440 catch(exception & e) {
441 m_ostream <<
"<writeMCKPayload> caught and re-throw exception: " << e.what() << endl
442 <<
"WARNING: Failed to write monitoring configuration key (MCK) to COOL" << endl;
455 unsigned int masterConfigKey,
456 unsigned int hltPrescaleKey,
461 const std::string & configSource)
464 runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
465 writeRunPayload( runRanges, masterConfigKey, hltPrescaleKey, lvl1Thr, ctpConfig, caloInfo, hltFrame, configSource);
477 const std::string & configSource)
499 runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
507 if(lvl1Menu == 0)
throw std::runtime_error(
"L1 trigger menu ptr is NULL");
517 rangeInfo(
"LVL1 monitoring", vr.since(), vr.until());
526 std::map<cool::ChannelId,std::string> monNames;
527 std::map<cool::ChannelId,std::string> thrNames;
528 std::map<cool::ChannelId,std::string> slots;
529 std::map<cool::ChannelId,std::string> cons;
530 std::map<cool::ChannelId,std::string> mults;
531 std::map<cool::ChannelId,std::string> starts;
532 std::map<cool::ChannelId,std::string> ends;
533 std::map<cool::ChannelId,std::string> actives;
536 std::map<cool::ChannelId,std::string> counterType;
537 std::map<cool::ChannelId,uint16_t> bgId;
538 const std::vector<TrigConf::ThresholdMonitor*>& monCounter = lvl1Menu->
moncountVector();
539 std::vector<TrigConf::ThresholdMonitor*>::const_iterator
mc = monCounter.begin();
540 for(;
mc != monCounter.end(); ++
mc) {
541 cool::ChannelId
index =
static_cast<cool::ChannelId
>((*mc)->internalCounter());
545 if((*mc)->counterType().find(
"CTPMON") != std::string::npos) {
550 std::stringstream strSlot; strSlot << (*mc)->ctpinSlot();
551 std::stringstream strCon; strCon << (*mc)->ctpinConnector();
552 std::stringstream strMult; strMult << (*mc)->multiplicity();
553 std::stringstream strStart; strStart << (*mc)->thresholdStartBit();
554 std::stringstream strEnd; strEnd << (*mc)->thresholdEndBit();
556 if((*mc)->thresholdActive()) active =
"ENABLED";
557 else active =
"DISABLED";
561 if( monNames.find(
index) == monNames.end() ){
568 if( thrNames.find(
index) == thrNames.end() ){
570 m_ostream <<
"PROBLEM counter " <<
index <<
" : no thrNames in previous entries, overwrite all with new one" << endl;
571 }
else if( slots.find(
index) == slots.end() ){
573 m_ostream <<
"PROBLEM counter " <<
index <<
" : no slots in previous entries, overwrite all with new one" << endl;
574 }
else if( cons.find(
index) == cons.end() ){
576 m_ostream <<
"PROBLEM counter " <<
index <<
" : no cons in previous entries, overwrite all with new one" << endl;
577 }
else if( mults.find(
index) == mults.end() ){
579 m_ostream <<
"PROBLEM counter " <<
index <<
" : no mults in previous entries, overwrite all with new one" << endl;
580 }
else if( starts.find(
index) == starts.end() ){
582 m_ostream <<
"PROBLEM counter " <<
index <<
" : no starts in previous entries, overwrite all with new one" << endl;
583 }
else if( ends.find(
index) == ends.end() ){
585 m_ostream <<
"PROBLEM counter " <<
index <<
" : no ends in previous entries, overwrite all with new one" << endl;
586 }
else if( actives.find(
index) == actives.end() ){
588 m_ostream <<
"PROBLEM counter " <<
index <<
" : no actives in previous entries, overwrite all with new one" << endl;
589 }
else if( counterType.find(
index) == counterType.end() ){
591 m_ostream <<
"PROBLEM counter " <<
index <<
" : no counterType in previous entries, overwrite all with new one" << endl;
592 }
else if( bgId.find(
index) == bgId.end() ){
594 m_ostream <<
"PROBLEM counter " <<
index <<
" : no bgId in previous entries, overwrite all with new one" << endl;
598 std::vector<std::string> thrNamesCheck =
split(thrNames[
index],
":");
599 std::vector<std::string> slotsCheck =
split(slots[
index],
":");
600 std::vector<std::string> consCheck =
split(cons[
index],
":");
601 std::vector<std::string> multsCheck =
split(mults[
index],
":");
602 std::vector<std::string> startsCheck =
split(starts[
index],
":");
603 std::vector<std::string> endsCheck =
split(ends[
index],
":");
604 std::vector<std::string> activesCheck =
split(actives[
index],
":");
605 if (thrNamesCheck.size() != slotsCheck.size()||
606 thrNamesCheck.size() != consCheck.size()||
607 thrNamesCheck.size() != multsCheck.size()||
608 thrNamesCheck.size() != startsCheck.size()||
609 thrNamesCheck.size() != endsCheck.size()||
610 thrNamesCheck.size() != activesCheck.size()){
612 m_ostream <<
"PROBLEM counter " <<
index <<
" : numbers of entries are different, overwrite all with new one" << endl;
614 for (
unsigned int i = 0; i < thrNamesCheck.size();i++){
615 if(thrNamesCheck[i]==(*mc)->thresholdName()&&
616 slotsCheck[i]==strSlot.str()&&
617 consCheck[i]==strCon.str()&&
618 multsCheck[i]==strMult.str()&&
619 startsCheck[i]==strStart.str()&&
620 endsCheck[i]==strEnd.str()&&
621 activesCheck[i]==active){
635 monNames[
index]=(*mc)->name();
636 thrNames[
index]=(*mc)->thresholdName();
637 slots[
index]=strSlot.str();
638 cons[
index]=strCon.str();
639 mults[
index]=strMult.str();
640 starts[
index]=strStart.str();
641 ends[
index]=strEnd.str();
642 actives[
index]=std::move(active);
643 counterType[
index]=(*mc)->counterType();
644 bgId[
index]=(*mc)->bunchGroupId();
648 if (monNames[
index]!=(*mc)->name()){
649 std::stringstream
str;
651 str <<
" : previous monitor name" << monNames[
index];
652 str <<
", current monitor name " << (*mc)->name() << endl;
655 if(counterType[
index] != (*mc)->counterType()) {
656 std::stringstream
str;
658 str <<
" : previous type " << counterType[
index];
659 str <<
", current type " << (*mc)->counterType() << endl;
662 if(bgId[
index] != (*mc)->bunchGroupId()) {
663 std::stringstream
str;
665 str <<
" : previous bunch-group id " << bgId[
index];
666 str <<
", current id " << (*mc)->bunchGroupId() << endl;
669 monNames[
index]=(*mc)->name();
670 counterType[
index]=(*mc)->counterType();
671 bgId[
index]=(*mc)->bunchGroupId();
673 thrNames[
index]+=
":";thrNames[
index]+=(*mc)->thresholdName();
674 slots[
index]+=
":";slots[
index]+=strSlot.str();
676 mults[
index]+=
":";mults[
index]+=strMult.str();
677 starts[
index]+=
":";starts[
index]+=strStart.str();
681 m_ostream <<
"PROBLEM counter " <<
index <<
" : unknown flag = " << flag << endl;
686 cool::ChannelId channel(0);
689 monFolder->setupStorageBuffer();
690 for(std::map<cool::ChannelId,std::string>::iterator it = thrNames.begin();
691 it != thrNames.end();++it) {
693 cool::Record payload =
695 counterType[channel],
707 m_ostream <<
"Write monitoring counter (channel " << channel <<
") :: "
708 <<
" monname '" << monNames[channel] <<
"'"
709 <<
" type '" << counterType[channel] <<
"'"
710 <<
" bgid '" << bgId[channel] <<
"'"
711 <<
" thnames '" << it->second <<
"'"
712 <<
" slots '" << slots[channel] <<
"'"
713 <<
" connectors '" << cons[channel] <<
"'"
714 <<
" multiplicities '" << mults[channel] <<
"'"
715 <<
" start bits '" << starts[channel] <<
"'"
716 <<
" end bits '" << ends[channel] <<
"'"
717 <<
" thresholds active '" << actives[channel] <<
"'"
719 monFolder->storeObject(vr.since(), vr.until(), payload, channel);
721 monFolder->flushStorageBuffer();
722 }
catch( cool::Exception & e) {
723 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
724 m_ostream <<
"Failed to write LVL1 monitoring mapping to COOL" << endl;
726 }
catch(std::exception & e) {
727 m_ostream <<
"<writeLVL1MonPayload> Caught std::exception: " << e.what() << endl;
739 const Menu& lvl1Menu)
751 rangeInfo(
"LVL1 thresholds", vr.since(), vr.until());
756 lvl1ThresholdFolder->setupStorageBuffer();
759 cool::ChannelId thrChannel = 0;
762 m_ostream <<
"Writing (to buffer) LVL1 threshold " << thr->name()
763 <<
" (version " << thr->version() <<
") to channel "
764 << thrChannel << endl;
765 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadThr, thrChannel++);
771 m_ostream <<
"Writing (to buffer) LVL1 threshold 'JetWeights':";
773 std::copy(jetweights.begin(), jetweights.end(), std::ostream_iterator<int>(
m_ostream,
", "));
776 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadJW, thrChannel++);
779 m_ostream <<
"Writing (to buffer) LVL1 threshold 'MET Significance parameters':";
782 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadMETSigParams, thrChannel++);
785 m_ostream <<
"Flushing LVL1 thresholds buffer to /TRIGGER/LVL1/Thresholds" << endl;
787 lvl1ThresholdFolder->flushStorageBuffer();
789 catch ( cool::Exception & e) {
790 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
791 <<
"warning will be ignored, job will continue" << endl;
794 }
catch( cool::Exception & e) {
795 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
796 m_ostream <<
"Failed to write LVL1 menu to COOL" << endl;
798 }
catch(std::exception & e) {
799 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
810 rangeInfo(
"LVL1 menu", vr.since(), vr.until());
816 lvl1MenuFolder->setupStorageBuffer();
817 lvl1ItemDefFolder->setupStorageBuffer();
822 cool::ChannelId menuChannel =
static_cast<cool::ChannelId
>(item->ctpId());
823 m_ostream <<
"Writing (to buffer) LVL1 item " << item->name()
824 <<
" (logic " << payloadItemDef[
"Logic"].data<cool::String255>()
826 << menuChannel << endl;
828 lvl1MenuFolder->storeObject(vr.since(), vr.until(), payloadMenu, menuChannel);
831 lvl1ItemDefFolder->storeObject(vr.since(), vr.until(), payloadItemDef, menuChannel);
835 m_ostream <<
"Flushing LVL1 menu buffer to /TRIGGER/LVL1/Menu" << endl;
837 lvl1MenuFolder->flushStorageBuffer();
839 catch ( cool::Exception & e) {
840 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
841 <<
"warning will be ignored, job will continue" << endl;
845 m_ostream <<
"Flushing LVL1 item buffer to /TRIGGER/LVL1/ItemDef" << endl;
847 lvl1ItemDefFolder->flushStorageBuffer();
849 catch ( cool::Exception & e) {
850 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
851 <<
"warning will be ignored, job will continue" << endl;
855 }
catch( cool::Exception & e) {
856 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
857 m_ostream <<
"Failed to write LVL1 menu to COOL" << endl;
859 }
catch(std::exception & e) {
860 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
887 const Menu& lvl1Menu)
898 tipFolder->setupStorageBuffer();
902 cool::ChannelId tipNum =
static_cast<cool::ChannelId
>(tip->tipNumber());
904 stringstream tipName;
905 tipName <<
"name:" << tip->thresholdName();
906 tipName <<
"|thresh bit:" << tip->thresholdBit();
907 tipName <<
"|pos:" << tip->thresholdMapping();
908 tipName <<
"|active:" << tip->thresholdActive();
909 tipName <<
"|ctpin slot:" << tip->slot();
910 tipName <<
"|con:" << tip->connector();
911 tipName <<
"|cable bit:" << tip->cableBit();
912 m_ostream <<
"Write TIP / channel " << tipNum <<
" : " << tipName.str() << endl;
915 tipFolder->storeObject(vr.since(), vr.until(), payload, tipNum);
917 m_ostream <<
"Flushing LVL1 CTPInputMap buffer to /TRIGGER/LVL1/CTPCoreInputMapping" << endl;
918 tipFolder->flushStorageBuffer();
919 }
catch( cool::Exception & e) {
920 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
921 m_ostream <<
"Failed to write LVL1 TIP mapping to COOL" << endl;
923 }
catch( exception & e) {
924 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
938 const Menu& lvl1Menu,
944 rangeInfo(
"LVL1 bunch group descriptions", vr.since(), vr.until());
948 m_ostream <<
"Store LVL1 BG description buffer to /TRIGGER/LVL1/BunchGroupDescription" << endl;
949 bgDescFolder->storeObject(vr.since(), vr.until(), payload, 0);
951 catch(exception & e) {
952 m_ostream <<
"<writeL1BunchGroupRunPayload> caught and re-throw exception: " << e.what() << endl;
991 rangeInfo(
"LVL1 bunchgroup key", vr.since(), vr.until());
994 m_ostream <<
"Store LVL1 BG key to /TRIGGER/LVL1/BunchGroupKey" << endl;
995 lvl1BGKFolder->storeObject(vr.since(), vr.until(), payload, 0);
999 rangeInfo(
"LVL1 bunchgroups", vr.since(), vr.until());
1002 m_ostream <<
"Store LVL1 BG content to /TRIGGER/LVL1/BunchGroupContent" << endl;
1003 lvl1BGContentFolder->storeObject(vr.since(), vr.until(), payload, 0);
1006 catch(exception & e) {
1007 m_ostream <<
"<writeLVL1BGPayload> caugh and re-throw exception: " << e.what() << endl;
1050 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/PrescaleKey") ) {
1052 rangeInfo(
"HLT prescale key", since, until);
1054 m_ostream <<
"Store HLT prescale key " << pss.
id() <<
" to /TRIGGER/HLT/PrescaleKey" << endl;
1055 hltpskFolder->storeObject(since, until, payload, 0);
1058 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/Prescales") ) {
1059 rangeInfo(
"HLT prescale set", since, until);
1062 hltpssFolder->setupStorageBuffer();
1063 m_ostream <<
"Writing (to buffer) HLT prescales [(value/channel)]:" << endl;
1065 const uint ccmax = 8192;
1067 for(
uint cc=0; cc<ccmax; cc++) {
1071 hltpssFolder->storeObject(since, until, payload, 2*cc);
1072 m_ostream <<
"(L2:" <<
sc.prescale() <<
"/" << cc <<
") ";
1073 if((++printcount)%10==0) m_ostream << endl;
1083 hltpssFolder->storeObject(since, until, payload, 2*cc+1);
1084 m_ostream <<
"(EF:" <<
sc.prescale() <<
"/" <<
cc <<
") ";
1085 if((++printcount)%10==0) m_ostream << endl;
1093 hltpssFolder->storeObject(since, until, payload, 20000+cc);
1094 m_ostream <<
"(HLT:" <<
sc.prescale() <<
"/" << 20000+
cc <<
") ";
1095 if((++printcount)%10==0) m_ostream << endl;
1098 m_ostream <<
"]" << endl;
1099 m_ostream <<
"Flushing HLT prescales buffer to /TRIGGER/HLT/Prescales" << endl;
1100 hltpssFolder->flushStorageBuffer();
1103 catch(exception & e) {
1104 m_ostream <<
"<writeHltPrescalePayload> caught and re-throw exception: " <<
e.what() << endl;
1120 IObjectIteratorPtr objects = hltpskFolder->browseObjects( vr.since(), vr.since()+1, 0 );
1121 if (not objects->goToNext()){
1122 throw std::runtime_error(
"'objects' is empty");
1124 const IObject& obj = objects->currentRef();
1125 const IRecord & payload = obj.payload();
1136 cool::IObjectIteratorPtr objects = hltpssFolder->browseObjects( vr.since(), vr.since()+1, cool::ChannelSelection());
1138 while(objects->goToNext()) {
1139 const cool::IObject& obj = objects->currentRef();
1141 pss.
setIOV(obj.since(), obj.until());
1144 const ChannelId& ch = obj.channelId();
1145 const IRecord& payload = obj.payload();
1153 level = (ch%2==0)?
L2:
EF;
1169 unsigned int lvl1PrescaleKey,
1183 unsigned int lvl1PrescaleKey,
1194 cool::ValidityKey until,
1195 unsigned int lvl1PrescaleKey,
1198 prescaleSet.
print(
"",5);
1204 rangeInfo(
"LVL1 prescale key", since, until);
1205 cool::Record payload =
1207 m_ostream <<
"Store LVL1 prescale key " << lvl1PrescaleKey <<
" to /TRIGGER/LVL1/Lvl1ConfigKey" << endl;
1208 lvl1CkConfFolder->storeObject(since, until, payload, 0);
1212 rangeInfo(
"LVL1 prescale set", since, until);
1214 vector<int32_t> prescaleV = prescaleSet.
cuts();
1216 vector<int32_t>::const_iterator psIt = prescaleV.begin();
1219 lvl1PsConfFolder->setupStorageBuffer();
1221 m_ostream <<
"Writing (to buffer) LVL1 prescales [(value/channel)]:" << endl;
1222 for(
int channel=0; psIt != prescaleV.end(); channel++, ++psIt) {
1225 lvl1PsConfFolder->storeObject(since, until, payload, channel);
1226 m_ostream <<
"(" << *psIt <<
"/" << channel <<
") ";
1227 if((channel+1)%10==0)
m_ostream << endl;
1230 m_ostream <<
"Flushing LVL1 prescales buffer to /TRIGGER/LVL1/Prescales" << endl;
1231 lvl1PsConfFolder->flushStorageBuffer();
1234 catch(std::exception & e) {
1235 m_ostream <<
"<writeL1PrescalePayload> caught and re-throw exception: " << e.what() << endl;
1251 ValidityKey pointInTime( (ValidityKey(
run)<<32) + 1);
1255 IObjectIteratorPtr objects = hltMenuFolder->findObjects( pointInTime, ChannelSelection() );
1256 while ( objects->goToNext() ) {
1257 const IObject& obj = objects->currentRef();
1258 const IRecord & payload = obj.payload();
1265 objects = hltGroupFolder->findObjects( pointInTime, ChannelSelection() );
1266 while ( objects->goToNext() ) {
1267 const IObject& obj = objects->currentRef();
1268 const IRecord & payload = obj.payload();
1274 IObjectPtr
object = hltConfigKeyFolder->findObject( pointInTime, (ChannelId) 0 );
1275 const IRecord & payload =
object->payload();
1276 unsigned int smk, hltPrescaleKey;
1277 string configSource;
1278 readHltConfigKeys( payload.attributeList(), smk, hltPrescaleKey, configSource );
1282 catch(
const cool::ObjectNotFound& o) {
1283 m_ostream <<
"<readHLTPayload> No entry found in HLT keys folder for run " <<
run << endl;
1290 unsigned int & masterConfigKey,
1292 string & configSource)
1295 masterConfigKey = hltFrame.
smk();
1316 vector<TIP*>& tips )
1320 IObjectIteratorPtr objects;
1322 vector<bool> foundTip(512,
false);
1323 for(ChannelId channel = 0; channel < 512; ++channel) {
1324 objects = folder->browseObjects( vr.since(), vr.until()-1, channel );
1325 if(objects->size()==0)
continue;
1326 while ( objects->goToNext() ) {
1327 const IObject& obj = objects->currentRef();
1328 const IRecord & payload = obj.payload();
1331 uint16_t tipNumber = obj.channelId();
1332 if(tipNumber > 511) {
1333 m_ostream <<
"TIP number " << tipNumber <<
" out of bounds!" << endl;
1334 throw runtime_error(
"TIP number ouf ot bounds!");
1336 if(foundTip[tipNumber]) {
1338 str <<
"TIP '" << tipNumber <<
"' had already been read!";
1339 throw runtime_error(
str.str());
1341 foundTip[tipNumber] =
true;
1345 pits.push_back(pit);
1346 tips.push_back(tip);
1354 vector<ThresholdMonitor*>& mons)
1359 IObjectIteratorPtr objects;
1361 vector<bool> foundCounter(768,
false);
1363 for(ChannelId channel = 0; channel < 768; ++channel) {
1365 objects = folder->browseObjects( vr.since(), vr.until()-1, channel );
1366 if(objects->size()==0)
continue;
1367 while ( objects->goToNext() ) {
1368 const IObject& obj = objects->currentRef();
1369 const IRecord & payload = obj.payload();
1371 int counterNumber = obj.channelId();
1372 if(counterNumber > 768) {
1373 m_ostream <<
"Monitoring counter number " << counterNumber <<
" out of bounds!" << endl;
1374 throw runtime_error(
"Monitoring counter ouf of bounds!");
1376 if(foundCounter[counterNumber]) {
1378 str <<
"MonCounter '" << counterNumber <<
"' had already been read!";
1379 throw runtime_error(
str.str());
1381 foundCounter[counterNumber] =
true;
1382 for(
size_t i = 0 ; i < counters.size(); ++i) {
1383 counters[i]->setInternalCounter(counterNumber);
1384 mons.push_back( counters[i] );
1394 vector<TriggerItem*>& items)
1399 IObjectIteratorPtr objects;
1401 vector<bool> foundItem(512,
false);
1404 objects = folder->browseObjects( vr.since(), vr.until()-1,cool::ChannelSelection());
1406 while ( objects->goToNext() ) {
1407 const cool::IObject& obj = objects->currentRef();
1408 const cool::IRecord & payload = obj.payload();
1410 uint32_t ctpId = obj.channelId();
1412 m_ostream <<
"Item ctpid " << ctpId <<
" out of bounds!" << endl;
1413 throw runtime_error(
"Item ctpid ouf ot bounds!");
1415 if(foundItem[ctpId]) {
1417 str <<
"Item '" << ctpId <<
"' had already been read!";
1418 throw runtime_error(
str.str());
1420 foundItem[ctpId] =
true;
1422 items.push_back(item);
1432 vector<TriggerThreshold*>& thrs) {
1437 IObjectIteratorPtr objects = L1thrFolder->browseObjects( vr.since(), vr.until()-1, cool::ChannelSelection() );
1438 while ( objects->goToNext() ) {
1439 const IObject& obj = objects->currentRef();
1440 const IRecord & payload = obj.payload();
1448 const vector<TriggerItem*>& items,
1449 const vector<TriggerThreshold*>& thrs)
1456 ChannelId itemChannel = item->ctpId();
1457 IObjectIteratorPtr objects = L1ItemDefFolder->browseObjects( vr.since(), vr.until()-1, itemChannel );
1458 while ( objects->goToNext() ) {
1459 const IObject& obj = objects->currentRef();
1460 const IRecord & payload = obj.payload();
1475 vector<TriggerThreshold*> thrs;
1483 bool isRun2 =
false;
1485 if( thr->cableName()==
"EM1" || thr->cableName()==
"EM2" ||
1486 thr->cableName()==
"JET1" || thr->cableName()==
"JET2" ||
1487 thr->cableName()==
"TOPO1" || thr->cableName()==
"TOPO2" ||
1488 thr->cableName()==
"TAU1" || thr->cableName()==
"TAU2") {
1496 cout <<
"TrigConfCoolWriter::readL1Menu for run " <<
run <<
". Determined format " << (isRun2 ?
"Run 2" :
"Run 1") << endl;
1499 vector<TriggerItem*> items;
1502 menu.addTriggerItem(item);
1511 if ( thr->name()==
"JetWeights" ) {
1513 for (
const string&
weights :
split( thr->cableName(),
",") )
1517 else if ( thr->name()==
"METSigParams" ) {
1518 vector<string> metvals =
split( thr->cableName(),
",");
1519 int XSSigmaScale = std::stoi(metvals[0]);
1520 int XSSigmaOffset = std::stoi(metvals[1]);
1521 int XEmin = std::stoi(metvals[2]);
1522 int XEmax = std::stoi(metvals[3]);
1523 int TESqrtMin = std::stoi(metvals[4]);
1524 int TESqrtMax = std::stoi(metvals[5]);
1526 XEmin, XEmax, TESqrtMin, TESqrtMax);
1530 menu.thresholdConfig().addTriggerThreshold(thr);
1533 menu.setCaloInfo(ci);
1539 for (
PIT* pit : pits) {
1540 if(pit->ctpinSlot()==10)
continue;
1543 for (
TIP* tip : tips) {
1551pair< vector<string>, map<unsigned int,unsigned char> >
1557 IObjectIteratorPtr objects = folder->browseObjects( vr.since(), vr.until()-1, 0 );
1558 if (not objects->goToNext()){
1559 throw std::runtime_error(
"TrigConfCoolWriter::readL1BunchGroupRunPayload: 'objects' is empty.");
1561 const IObject& obj = objects->currentRef();
1562 const IRecord & payload = obj.payload();
1581 vr.until() = vr.since();
1585 IObjectIteratorPtr objects = lvl1BGKeyFolder->browseObjects( vr.since(), vr.until(), 0 );
1586 if (not objects->goToNext()){
1587 throw std::runtime_error(
"TrigConfCoolWriter::readL1BunchGroupLBPayload: 'objects' is empty.");
1589 const IObject& obj = objects->currentRef();
1590 const IRecord & payload1 = obj.payload();
1595 IObjectIteratorPtr objects2 = lvl1BGContentFolder->browseObjects( vr.since(), vr.until(), 0);
1596 if (not objects2->goToNext()){
1597 throw std::runtime_error(
"TrigConfCoolWriter::readL1BunchGroupLBPayload: 'objects2' is empty.");
1599 const IObject& obj2 = objects2->currentRef();
1600 const IRecord & payload2 = obj2.payload();
1605 vector<string> names = bg_pair.first;
1609 uint newBGSSize = bgV.size() <= names.size() ? bgV.size() : names.size();
1611 if(bgV.size() != names.size()) {
1612 cout <<
"WARNING Bunchgroup content vector is of size " << bgV.size()
1613 <<
", which is different from the size of the names vector: " << names.size()
1614 <<
". Using " << newBGSSize << endl;
1620 for(
unsigned int i=0; i<newBGSSize; i++) {
1621 string bgname = names[i];
1622 if(bgname==
"") bgname =
"NoName";
1623 bgV[i].setName(bgname);
1624 bgV[i].setInternalNumber(i);
1641 unsigned int& lvl1PrescaleKey,
1646 vr.until() = vr.since()+1;
1649 IObjectIteratorPtr objects = lvl1CkFolder->browseObjects( vr.since(), vr.since()+1, 0 );
1650 if (not objects->goToNext()){
1651 throw std::runtime_error(
"TrigConfCoolWriter::readL1PrescalePayload: 'objects' is empty.");
1653 const IObject& obj = objects->currentRef();
1654 const IRecord & payload = obj.payload();
1659 size_t nPrescales = lvl1PsFolder->listChannels().size();
1660 bool isRun2 = ( nPrescales == 512 );
1661 prescale.
resize( nPrescales );
1663 for(cool::ChannelId channel = 0; channel < nPrescales; channel++) {
1664 objects = lvl1PsFolder->browseObjects( vr.since(), vr.until(), channel );
1665 if(objects->size()!=1) {
1666 throw std::runtime_error(
"Lvl1 prescale access error: found empty prescale channel ");
1669 (void)objects->goToNext();
1670 const IObject& obj = objects->currentRef();
1671 const IRecord & payload = obj.payload();
1672 int64_t prescaleVal=0;
1675 prescale.
setCut( channel, prescaleVal );
1677 prescale.
setPrescale( channel, (
float)prescaleVal );
1680 prescale.
setId( lvl1PrescaleKey );
1687 return m_dbPtr->existsFolder(
"/TRIGGER/HLT/Prescales" );
1712 ValidityKey since(
run); since <<= 32; since +=
lb;
1713 ValidityKey until(
run); until <<= 32; until +=
lbend+1;
1716 m_ostream <<
"Checking for run " <<
run <<
" and lb range " << (vr.since() & 0xFFFFFFFF) <<
" - " << ( (vr.until()-1) & 0xFFFFFFFF) << endl
1718 <<
" Folder Payload Size" << endl
1719 <<
"================================================================================" << endl;
1721 vector<string> foldersToFix;
1723 vector<string> folderList = {
1724 "/TRIGGER/LVL1/Menu",
1725 "/TRIGGER/LVL1/ItemDef",
1726 "/TRIGGER/LVL1/Thresholds",
1727 "/TRIGGER/LVL1/CTPCoreInputMapping",
1728 "/TRIGGER/LVL1/Lvl1ConfigKey",
1729 "/TRIGGER/LVL1/Prescales",
1730 "/TRIGGER/LVL1/BunchGroupKey",
1731 "/TRIGGER/LVL1/BunchGroupContent",
1732 "/TRIGGER/LVL1/BunchGroupDescription",
1733 "/TRIGGER/HLT/HltConfigKeys",
1734 "/TRIGGER/HLT/Menu",
1735 "/TRIGGER/HLT/Groups",
1736 "/TRIGGER/HLT/PrescaleKey",
1737 "/TRIGGER/HLT/Prescales"
1740 for(
const string & folderName : folderList) {
1741 IFolderPtr folder =
m_dbPtr->getFolder( folderName );
1742 unsigned int size = folder->countObjects( vr.since(), vr.until()-1, ChannelSelection() );
1743 bool isSingleVersion = folder->versioningMode()==FolderVersioning::SINGLE_VERSION;
1744 bool needsFixing = (
size == 0);
1746 bool displayFixing =
false;
1747 if(displayMode==1) {
1748 displayFixing = (
size == 0);
1749 }
else if(displayMode==2) {
1750 displayFixing = (
size == 0) || !isSingleVersion;
1753 string fn = folderName + (isSingleVersion ?
" (sv)" :
" (mv)");
1755 m_ostream << setw(2) << foldersToFix.size()+1 <<
") ";
1756 foldersToFix.push_back(folderName);
1760 m_ostream << left << setw(40) << fn << right << setw(15) <<
size <<
" " << ( needsFixing ?
"NEEDS FIX" :
" OK") << endl;
1763 return foldersToFix;
const boost::regex rr(r_r)
std::shared_ptr< HepMC3::Writer > writer
char data[hepevt_bytes_allocation_ATLAS]
size_t size() const
Number of registered mappings.
AutoDBOpen(TrigConfCoolWriter *writer, bool readOnly)
TrigConfCoolWriter * m_writer
void addBunchGroup(const BunchGroup &)
unsigned int l1Version() const
const BunchGroupSet & bunchGroupSet() const
const Menu & menu() const
const PrescaleSet & prescaleSet(unsigned int partition=0) const
void setL1Version(unsigned int v)
void setCTPVersion(unsigned int v)
const std::vector< int > & jetWeights() const
METSigParam & metSigParam()
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
HLT chain configuration information.
const std::string & configSource() const
HLTSequenceList & theHLTSequenceList()
accessor to the list of HLT sequences
const HLTPrescaleSetCollection & getPrescaleSetCollection() const
HLTChainList & theHLTChainList()
accessor to the list of HLT chains
const HLTChainList & getHLTChainList() const
const accessor to the list of HLT chains
void setConfigSource(const std::string &src)
std::list< cont > & sets()
HLT chain configuration information.
void setIOV(uint32_t start_run, uint32_t start_lb, uint32_t end_run, uint32_t end_lb)
sets the IOV of the prescale set
bool hasPrescale(unsigned int counter, TrigConf::HLTLevel level=HLT) const
HLTPrescale & thePrescale(unsigned int chain_counter, HLTLevel level)
const HLTPrescale & getPrescale(unsigned int chain_counter, HLTLevel level=HLT) const
HLTPrescale & setRerunPrescale(const std::string &targetName, float ps)
HLTPrescale & setPassThrough(float pass_through)
HLTPrescale & setPrescale(float prescale)
static std::set< std::string > allTEsProduced(const TrigConf::HLTFrame &frame)
static std::string ChainCondenseDisplay(const HLTChain &chain, const HLTFrame &frame)
static void setMaxThresholdsFromL1Version(unsigned int l1version)
virtual void print(const std::string &indent="", unsigned int detail=1) const
void setValues(int XSSigmaScale, int XSSigmaOffset, int XEmin, int XEmax, int TESqrtMin, int TESqrtMax)
void setPitNumber(const uint16_t &pitnumber)
void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__((deprecated))
Set the prescale NUM from the int64 value prescaleValue.
virtual void print(const std::string &indent="", unsigned int detail=1) const override
void setCut(unsigned int num, int32_t cut)
const std::vector< int32_t > & cuts() const
void setTipNumber(const uint16_t &tipnumber)
void setClock(const int &clock)
const std::vector< TriggerThreshold * > & thresholdVector(L1DataDef::TriggerType) const
unsigned int l1Version() const
static cool::IFolderSetPtr createMonFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the monitoring COOL database
static cool::IFolderPtr getHltPrescaleKeyFolder(cool::IDatabasePtr db)
static void printFolderStructure(cool::IDatabasePtr db, std::ostream &o)
prints the folder structure that is in the COOL database
static cool::IFolderPtr getHltChainGroupFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1ConfKeyFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getHltMenuFolder(cool::IDatabasePtr db)
static int readSchemaVersion(cool::IDatabasePtr db)
get the version of the COOL database
static cool::IFolderPtr getMonConfKeyFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1ItemDefFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1BGContentFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getHltConfKeyFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1PrescalesFolder(cool::IDatabasePtr db)
static int getDefaultSchemaVersion()
access to the version
static cool::IFolderSetPtr createFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the COOL database
static cool::IFolderPtr getLvl1MonMapFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1BGDescFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1BGKeyFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1ThresholdFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1InputMapFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1MenuFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getHltPrescalesFolder(cool::IDatabasePtr db)
Reading/Writing of trigger configuration data from/to COOL.
void writeL1BunchGroupRunPayload(ValidityRange vr, const Menu &lvl1Menu, const BunchGroupSet &bgs)
Writing run-wise L1 bunch group names and item to bunch group mapping to COOL.
bool dbIsOpen()
check if db is open
void closeDb(cool::IDatabasePtr &db)
close the COOL database
void printSchema(std::ostream &o)
Prints the schema in the COOL database.
void readL1Thresholds(unsigned int runNumber, std::vector< TrigConf::TriggerThreshold * > &thrs)
Read run-wise L1 threshold vector from COOL database.
bool checkDbConnection(bool readonly)
void writeHltPrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, const TrigConf::HLTPrescaleSet &pss)
Writing luminosityblock-wise configuration information the COOL database.
void writeL1CTPCoreInputMapping(ValidityRange vr, const Menu &lvl1Menu)
void writeL1MenuPayload(ValidityRange vr, const TrigConf::Menu &lvl1Menu)
Writing L1 run-wise configuration information to the COOL database.
void readL1BunchGroupLBPayload(unsigned int runNumber, unsigned int lumiblockNumber, int &bgKey, TrigConf::BunchGroupSet &bgs)
Reading lb-wise bunch group configuration information from COOL database.
void writeL1PrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, unsigned int lvl1PrescaleKey, const TrigConf::PrescaleSet &prescale)
Writing luminosityblock-wise configuration information the COOL database.
bool HLTPrescaleFolderExists()
void readL1InputMapPayload(unsigned int runNumber, std::vector< TrigConf::PIT * > &pits, std::vector< TrigConf::TIP * > &tips)
Read run-wise PIT configuration from COOL database.
bool shouldFolderBeUpdated(const std::string &foldername)
check if foldername is in list of writeable folders
std::pair< std::vector< std::string >, std::map< unsigned int, unsigned char > > readL1BunchGroupRunPayload(unsigned int runNumber)
Reading bunch group configuration information from COOL database.
void readL1Payload(unsigned int run, CTPConfig &ctpc)
void readL1Menu(unsigned int runNumber, CTPConfig &ctpc)
Read L1 menu from COOL database.
cool::IDatabasePtr openDb(bool readOnly=true)
open COOL db connection
void writeL1MonPayload(unsigned int runNumber, const TrigConf::Menu *lvl1Menu)
Writing L1 run-wise monitoring configuration to COOL.
void readHltPrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, TrigConf::HLTPrescaleSet &pss)
Reading luminosityblock-wise configuration information the COOL database.
cool::Application m_coolApp
COOL application.
void rangeInfo(const std::string &content, cool::ValidityKey since, cool::ValidityKey until)
void writeRunPayload(unsigned int runNumber, unsigned int masterConfigKey, unsigned int hltPrescaleKey, const TrigConf::ThresholdConfig &lvl1Thr, const TrigConf::CTPConfig &ctpConfig, const TrigConf::CaloInfo &caloInfo, const TrigConf::HLTFrame &hltFrame, const std::string &configSource)
Writing run-wise configuration information the COOL database.
void recreateSchema(int schemaVersion=0)
Create a new schema in the COOL database with prior deletion of the old one.
cool::IDatabasePtr m_dbPtr
COOL database pointer.
void createSchema(int schemaVersion=0)
Create a new schema in the COOL database.
void printSchemaVersion(std::ostream &o)
Prints the schema in the COOL database.
void dropDb()
delete the COOL database
cool::IDatabaseSvc & databaseService()
get COOL db service
void readL1PrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, unsigned int &lvl1PrescaleKey, TrigConf::PrescaleSet &prescale)
Reading luminosityblock-wise configuration information the COOL database.
void writeHLTPayload(ValidityRange vr, const HLTFrame &hltFrame, const std::string &configSource)
std::ostream & m_ostream
output stream for all messages
void readRunPayload(unsigned int runNumber, TrigConf::HLTFrame &hltFrame, unsigned int &masterConfigKey, unsigned int &hltPrescaleKey, std::string &configSource)
Reading run-wise configuration information from COOL database.
void readL1Items(unsigned int runNumber, std::vector< TrigConf::TriggerItem * > &items)
Read run-wise L1 item vector from COOL database.
void writeMCKPayload(ValidityRange vr, unsigned int mck, std::string &release, std::string &info)
cool::DatabaseId m_dbId
db connection string
void writeL1Payload(ValidityRange vr, const CTPConfig &ctpConfig)
void readL1MonMapPayload(unsigned int runNumber, std::vector< TrigConf::ThresholdMonitor * > &mons)
Read run-wise LVL1 monitoring configuration from COOL database.
cool::IDatabasePtr createDb()
create a new COOL database
void writeL1BunchGroupLBPayload(const RunRangeVec &runRanges, unsigned int bgKey, const BunchGroupSet &bgs)
Writing LB-wise L1 bunch group definition to the COOL database.
void readHLTPayload(unsigned int run, HLTFrame &hltFrame)
void readL1ItemDef(unsigned int runNumber, const std::vector< TrigConf::TriggerItem * > &items, const std::vector< TrigConf::TriggerThreshold * > &thrs)
Read run-wise L1 item defintions (conditions) from COOL database.
std::vector< std::string > checkPayloadSize(unsigned int run, unsigned int lb, int displayMode, bool openend, unsigned int lbend)
void setId(unsigned int id)
static std::string release
static std::vector< uint32_t > lbend
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
cool::Record createHltPrescaleKeyPayload(cool::IFolderPtr, int psk)
build a COOL db record from a HLT prescale value
cool::Record createHltPrescalesPayload(cool::IFolderPtr, float prescale, float passthrough, float rerunprescale)
build a COOL db record from a HLT prescale value
int readHltPrescaleKey(const coral::AttributeList &al)
build the HLT prescale key from a COOL db record
void readHltPrescale(const coral::AttributeList &al, float &ps, float &pt, float &rrps)
build the HLT prescale value from a COOL db record
cool::Record createHltChainGroupPayload(cool::IFolderPtr, const TrigConf::HLTChain &ch)
build a COOL db record from a HLT chain
cool::Record createMonConfigKeyPayload(cool::IFolderPtr fld, uint MCK, std::string &info)
build a COOL db record from a HLT monitoring configuration key
void addGroupsToHltChain(const coral::AttributeList &al, const TrigConf::HLTChainList &chl)
add the groups to and HLT chain from a AttributeList
void readHltConfigKeys(const coral::AttributeList &al, unsigned int &masterConfigKey, unsigned int &hltPrescaleKey, std::string &configSource)
read the HLT configuration keys from a coral::AttributeList
cool::Record createHltConfigKeysPayload(cool::IFolderPtr, unsigned int masterKey, unsigned int hltPrescaleKey, const std::string &configSource)
build a COOL db record from a set of HLT configuration keys
HLTChain * createHLTChain(const coral::AttributeList &al, TrigConf::HLTSequenceList *sequences=0)
build an HLT chain from a COOL db record
cool::Record createHltMenuPayload(cool::IFolderPtr, const TrigConf::HLTChain &, const std::string &concise)
build a COOL db record from a HLT chain
std::vector< TrigConf::ThresholdMonitor * > readLvl1MonMap(const cool::IRecord &payload)
Build a LVL1 mon counter object from COOL payload.
cool::Record createLvl1MonMapPayload(cool::IFolderPtr, const std::string &type, const uint16_t &bgId, const std::string &threshName, const std::string &slot, const std::string &con, const std::string &mult, const std::string &start, const std::string &end, const std::string &active, const std::string &monName=std::string(""), const std::string &CounterLogic=std::string(""))
build a COOL db record from a monitoring-mapping string value
cool::Record createLvl1METSigPayload(cool::IFolderPtr, const METSigParam &metSigParams)
build a COOL db record from a L1 MET significance global parameters
cool::Record createLvl1ConfigKeyPayload(cool::IFolderPtr, unsigned int lvl1PrescaleKey)
build a COOL db record from a LVL1 configuration key
std::pair< std::vector< std::string >, std::map< unsigned int, unsigned char > > readLvl1BGDesc(const coral::AttributeList &al)
build the LVL1 Bunchgroup descriptions from a coral::AttributeList
cool::Record createLvl1BGKeyPayload(cool::IFolderPtr, unsigned int lvl1BunchgroupKey)
build a COOL db record from a LVL1 bunch group key
cool::Record createLvl1MenuPayload(cool::IFolderPtr, const TrigConf::TriggerItem &item)
build a COOL db record from a LVL1 TriggerItem (the item name and version)
cool::Record createLvl1PrescalesPayload(cool::IFolderPtr, int prescale)
build a COOL db record from a LVL1 prescale value
TrigConf::PIT * readLvl1InputMap(const coral::AttributeList &al)
Build a LVL1 PIT object from COOL payload.
TrigConf::TIP * readLvl1TIPMap(const coral::AttributeList &al)
void readLvl1Prescale(const coral::AttributeList &al, int &ps)
build the LVL1 prescale value from a coral::AttributeList
cool::Record createLvl1BGDescPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs, const TrigConf::Menu &lvl1Menu)
build a COOL db record from a bunch group description
cool::Record createLvl1BGContentPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs)
build a COOL db record from a bunch group definition value
cool::Record createLvl1ItemDefPayload(cool::IFolderPtr, const TrigConf::TriggerItem &item)
build a COOL db record from a LVL1 TriggerItem (the conditions)
void readLvl1ConfigKey(const coral::AttributeList &al, unsigned int &lvl1PrescaleKey)
build the LVL1 configuration key from a coral::AttributeList
std::vector< TrigConf::BunchGroup > readLvl1BGContent(const coral::AttributeList &al)
build the LVL1 Bunchgroup code
TriggerItem * createLvl1TriggerItem(const coral::AttributeList &al)
build a LVL1 TriggerItem from a COOL db record
cool::Record createLvl1InputMapPayload(cool::IFolderPtr, const TrigConf::TIP &tip)
build a COOL db record from a PIT-mapping string value
cool::Record createLvl1ThresholdPayload(cool::IFolderPtr, const TrigConf::TriggerThreshold &thr)
build a COOL db record from a LVL1 TriggerItem
void addThresholdsToTriggerItem(const coral::AttributeList &al, TriggerItem *item, const std::vector< TrigConf::TriggerThreshold * > &thrs)
build a TriggerThreshold definition from a COOL db record and add to the corresponding item
TriggerThreshold * createLvl1Threshold(const coral::AttributeList &al)
build a LVL1 TriggerThreshold from a COOL db record
cool::Record createLvl1JetWeightPayload(cool::IFolderPtr, const std::vector< int > &jetweights)
build a COOL db record from a L1 Jet Weights vector
int readLvl1BGKey(const coral::AttributeList &al)
build the LVL1 Bunchgroup key value
Forward iterator to traverse the main components of the trigger configuration.
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
std::pair< unsigned int, unsigned int > RunRange
std::vector< RunRange > RunRangeVec
int run(int argc, char *argv[])