24#include "CoolKernel/ValidityKey.h"
25#include "CoolKernel/IFolder.h"
26#include "CoolKernel/Exception.h"
27#include "CoolKernel/IObject.h"
28#include "CoolKernel/IObjectIterator.h"
29#include "CoolKernel/Record.h"
30#include "CoolKernel/IDatabaseSvc.h"
31#include "CoralKernel/Context.h"
32#include "RelationalAccess/ConnectionService.h"
33#include "RelationalAccess/IConnectionService.h"
34#include "RelationalAccess/IConnectionServiceConfiguration.h"
35#include "RelationalAccess/ILookupService.h"
36#include "RelationalAccess/IAuthenticationService.h"
37#include "RelationalAccess/IAuthenticationCredentials.h"
38#include "RelationalAccess/IDatabaseServiceDescription.h"
39#include "RelationalAccess/IDatabaseServiceSet.h"
57#define READ_WRITE false
67 m_neededToOpen = false;
69 m_writer->openDb(m_ro);
70 m_neededToOpen = true;
110 m_ostream <<
"Opening database '" <<
m_dbId <<
"' in " << (readOnly?
"read-only":
"read-write") <<
" mode" << endl;
115 }
catch(cool::DatabaseDoesNotExist& e) {
117 m_ostream <<
"Database '" <<
m_dbId <<
"' does not exist. Can't create it since connection is read-only." << endl;
120 m_ostream <<
"Database '" <<
m_dbId <<
"' does not exist, will create it" << endl;
125 }
catch(Exception& e) {
126 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
139 if(db.use_count()>0 && db->isOpen()) {
141 db->closeDatabase( );
143 }
catch(std::exception& e) {
144 m_ostream <<
"*** COOL exception caught: " << e.what() << endl
145 <<
"Couldn't close conditions database: " <<
m_dbId << endl;
161 }
catch(std::exception& e) {
162 m_ostream <<
"*** COOL exception caught: " << e.what() << endl
163 <<
"Couldn't close conditions database: " <<
m_dbId << endl;
178 catch(cool::DatabaseDoesNotExist& e) {
179 m_ostream <<
"*** : " << e.what() << endl;
184 catch(cool::Exception& e) {
185 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
193 m_ostream <<
"Creating schema '" <<
m_dbId <<
"' with version " << schemaVersion
197 catch(cool::Exception& e) {
198 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
224 o <<
"Schema version is " << schemaVersion
251 catch(std::exception& e) {
252 m_ostream <<
"*** COOL exception caught: " << e.what() << endl;
253 m_ostream <<
"Coudn't create a new conditions database: " <<
m_dbId << endl;
263 cool::ValidityKey since,
264 cool::ValidityKey until) {
267 if(since==ValidityKeyMin && until==ValidityKeyMax) {
268 m_ostream <<
"Writing " << content <<
" for infinite range [0,oo]" << endl;
272 unsigned long long run[2];
273 unsigned long long lb[2];
274 lb[0] = since & 0xFFFFFFFF;
275 lb[1] = until & 0xFFFFFFFF;
277 run[0] &= 0x7FFFFFFF;
279 run[1] &= 0x7FFFFFFF;
281 if(
lb[0]==0 &&
lb[1]==0) {
282 unsigned int first =
run[0];
283 unsigned int last =
run[1]-1;
285 m_ostream <<
"IOV Info: writing " << content <<
" for run " << first << endl;
287 m_ostream <<
"IOV Info: writing " << content <<
" for run range [" << first <<
"," << last <<
"]" << endl;
292 m_ostream <<
"IOV Info: writing " << content <<
" for run " <<
run[0] <<
" and LB " <<
lb[0] << endl;
294 m_ostream <<
"IOV Info: writing " << content <<
" for run " <<
run[0] <<
" and LB range [" <<
lb[0] <<
"," <<
lb[1]-1 <<
"]" << endl;
296 m_ostream <<
"IOV Info: writing " << content <<
" for range [" <<
run[0] <<
"/" <<
lb[0] <<
"," <<
run[1] <<
"/" <<
lb[1] <<
"[" << endl;
314 catch(exception & e) {
315 m_ostream <<
"<writeL1Payload> caught and re-throw exception: " << e.what() << endl;
325 const string& configSource)
332 rangeInfo(
"HLT configuration keys", vr.since(), vr.until());
336 confkeyFolder->storeObject(vr.since(), vr.until(), payload, 0);
338 catch(exception & e) {
339 m_ostream <<
"<writeHLTPayload> caught and re-throw exception: " << e.what() << endl
340 <<
"WARNING: Failed to write configuration keys to COOL" << endl;
355 rangeInfo(
"HLT menu", vr.since(), vr.until());
363 ChannelId menuChannel(0);
367 hltMenuFolder->setupStorageBuffer();
368 hltGroupFolder->setupStorageBuffer();
374 hltMenuFolder->storeObject(vr.since(), vr.until(), payload, menuChannel);
377 hltGroupFolder->storeObject(vr.since(), vr.until(), payloadGroups, menuChannel);
378 m_ostream <<
"Writing (to buffer) HLT chain " << chain->chain_name()
379 <<
"(id " << chain->chain_counter()
380 <<
" level "<< chain->level()
381 <<
") to COOL channel " << menuChannel
382 <<
" [belongs to groups " << payloadGroups[
"Groups"].data<cool::String4k>() <<
"]" << endl;
385 m_ostream <<
"Flushing HLT menu buffer to /TRIGGER/HLT/Menu" << endl;
387 hltMenuFolder->flushStorageBuffer();
389 catch ( cool::Exception & e) {
390 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
391 <<
"warning will be ignored, job will continue" << endl;
395 m_ostream <<
"Flushing HLT group buffer to /TRIGGER/HLT/Groups" << endl;
397 hltGroupFolder->flushStorageBuffer();
399 catch ( cool::Exception & e) {
400 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
401 <<
"warning will be ignored, job will continue" << endl;
405 catch( cool::Exception & e) {
406 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
407 m_ostream <<
"Failed to write HLT menu to COOL" << endl;
410 catch(std::exception & e) {
411 m_ostream <<
"<writeHLTPayload> Caught std::exception: " << e.what() << endl;
415 m_ostream <<
"List of HLT Chains is empty, nothing is written to COOL" << endl;
435 rangeInfo(
"Monitoring configuration key", vr.since(), vr.until());
439 monconfkeyFolder->storeObject(vr.since(), vr.until(), payload, 0,
"MenuAwareMonConfigKey-"+
release);
441 catch(exception & e) {
442 m_ostream <<
"<writeMCKPayload> caught and re-throw exception: " << e.what() << endl
443 <<
"WARNING: Failed to write monitoring configuration key (MCK) to COOL" << endl;
456 unsigned int masterConfigKey,
457 unsigned int hltPrescaleKey,
462 const std::string & configSource)
465 runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
466 writeRunPayload( runRanges, masterConfigKey, hltPrescaleKey, lvl1Thr, ctpConfig, caloInfo, hltFrame, configSource);
478 const std::string & configSource)
500 runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
508 if(lvl1Menu == 0)
throw std::runtime_error(
"L1 trigger menu ptr is NULL");
518 rangeInfo(
"LVL1 monitoring", vr.since(), vr.until());
527 std::map<cool::ChannelId,std::string> monNames;
528 std::map<cool::ChannelId,std::string> thrNames;
529 std::map<cool::ChannelId,std::string> slots;
530 std::map<cool::ChannelId,std::string> cons;
531 std::map<cool::ChannelId,std::string> mults;
532 std::map<cool::ChannelId,std::string> starts;
533 std::map<cool::ChannelId,std::string> ends;
534 std::map<cool::ChannelId,std::string> actives;
537 std::map<cool::ChannelId,std::string> counterType;
538 std::map<cool::ChannelId,uint16_t> bgId;
539 const std::vector<TrigConf::ThresholdMonitor*>& monCounter = lvl1Menu->
moncountVector();
540 std::vector<TrigConf::ThresholdMonitor*>::const_iterator
mc = monCounter.begin();
541 for(;
mc != monCounter.end(); ++
mc) {
542 cool::ChannelId
index =
static_cast<cool::ChannelId
>((*mc)->internalCounter());
546 if((*mc)->counterType().find(
"CTPMON") != std::string::npos) {
551 std::stringstream strSlot; strSlot << (*mc)->ctpinSlot();
552 std::stringstream strCon; strCon << (*mc)->ctpinConnector();
553 std::stringstream strMult; strMult << (*mc)->multiplicity();
554 std::stringstream strStart; strStart << (*mc)->thresholdStartBit();
555 std::stringstream strEnd; strEnd << (*mc)->thresholdEndBit();
557 if((*mc)->thresholdActive()) active =
"ENABLED";
558 else active =
"DISABLED";
562 if( monNames.find(
index) == monNames.end() ){
569 if( thrNames.find(
index) == thrNames.end() ){
571 m_ostream <<
"PROBLEM counter " <<
index <<
" : no thrNames in previous entries, overwrite all with new one" << endl;
572 }
else if( slots.find(
index) == slots.end() ){
574 m_ostream <<
"PROBLEM counter " <<
index <<
" : no slots in previous entries, overwrite all with new one" << endl;
575 }
else if( cons.find(
index) == cons.end() ){
577 m_ostream <<
"PROBLEM counter " <<
index <<
" : no cons in previous entries, overwrite all with new one" << endl;
578 }
else if( mults.find(
index) == mults.end() ){
580 m_ostream <<
"PROBLEM counter " <<
index <<
" : no mults in previous entries, overwrite all with new one" << endl;
581 }
else if( starts.find(
index) == starts.end() ){
583 m_ostream <<
"PROBLEM counter " <<
index <<
" : no starts in previous entries, overwrite all with new one" << endl;
584 }
else if( ends.find(
index) == ends.end() ){
586 m_ostream <<
"PROBLEM counter " <<
index <<
" : no ends in previous entries, overwrite all with new one" << endl;
587 }
else if( actives.find(
index) == actives.end() ){
589 m_ostream <<
"PROBLEM counter " <<
index <<
" : no actives in previous entries, overwrite all with new one" << endl;
590 }
else if( counterType.find(
index) == counterType.end() ){
592 m_ostream <<
"PROBLEM counter " <<
index <<
" : no counterType in previous entries, overwrite all with new one" << endl;
593 }
else if( bgId.find(
index) == bgId.end() ){
595 m_ostream <<
"PROBLEM counter " <<
index <<
" : no bgId in previous entries, overwrite all with new one" << endl;
599 std::vector<std::string> thrNamesCheck =
split(thrNames[
index],
":");
600 std::vector<std::string> slotsCheck =
split(slots[
index],
":");
601 std::vector<std::string> consCheck =
split(cons[
index],
":");
602 std::vector<std::string> multsCheck =
split(mults[
index],
":");
603 std::vector<std::string> startsCheck =
split(starts[
index],
":");
604 std::vector<std::string> endsCheck =
split(ends[
index],
":");
605 std::vector<std::string> activesCheck =
split(actives[
index],
":");
606 if (thrNamesCheck.size() != slotsCheck.size()||
607 thrNamesCheck.size() != consCheck.size()||
608 thrNamesCheck.size() != multsCheck.size()||
609 thrNamesCheck.size() != startsCheck.size()||
610 thrNamesCheck.size() != endsCheck.size()||
611 thrNamesCheck.size() != activesCheck.size()){
613 m_ostream <<
"PROBLEM counter " <<
index <<
" : numbers of entries are different, overwrite all with new one" << endl;
615 for (
unsigned int i = 0; i < thrNamesCheck.size();i++){
616 if(thrNamesCheck[i]==(*mc)->thresholdName()&&
617 slotsCheck[i]==strSlot.str()&&
618 consCheck[i]==strCon.str()&&
619 multsCheck[i]==strMult.str()&&
620 startsCheck[i]==strStart.str()&&
621 endsCheck[i]==strEnd.str()&&
622 activesCheck[i]==active){
636 monNames[
index]=(*mc)->name();
637 thrNames[
index]=(*mc)->thresholdName();
638 slots[
index]=strSlot.str();
639 cons[
index]=strCon.str();
640 mults[
index]=strMult.str();
641 starts[
index]=strStart.str();
642 ends[
index]=strEnd.str();
643 actives[
index]=std::move(active);
644 counterType[
index]=(*mc)->counterType();
645 bgId[
index]=(*mc)->bunchGroupId();
649 if (monNames[
index]!=(*mc)->name()){
650 std::stringstream
str;
652 str <<
" : previous monitor name" << monNames[
index];
653 str <<
", current monitor name " << (*mc)->name() << endl;
657 if(counterType[
index] != (*mc)->counterType()) {
658 std::stringstream
str;
660 str <<
" : previous type " << counterType[
index];
661 str <<
", current type " << (*mc)->counterType() << endl;
665 if(bgId[
index] != (*mc)->bunchGroupId()) {
666 std::stringstream
str;
668 str <<
" : previous bunch-group id " << bgId[
index];
669 str <<
", current id " << (*mc)->bunchGroupId() << endl;
673 monNames[
index]=(*mc)->name();
674 counterType[
index]=(*mc)->counterType();
675 bgId[
index]=(*mc)->bunchGroupId();
677 thrNames[
index]+=
":";thrNames[
index]+=(*mc)->thresholdName();
678 slots[
index]+=
":";slots[
index]+=strSlot.str();
680 mults[
index]+=
":";mults[
index]+=strMult.str();
681 starts[
index]+=
":";starts[
index]+=strStart.str();
685 m_ostream <<
"PROBLEM counter " <<
index <<
" : unknown flag = " << flag << endl;
690 cool::ChannelId channel(0);
693 monFolder->setupStorageBuffer();
694 for(std::map<cool::ChannelId,std::string>::iterator it = thrNames.begin();
695 it != thrNames.end();++it) {
697 cool::Record payload =
699 counterType[channel],
711 m_ostream <<
"Write monitoring counter (channel " << channel <<
") :: "
712 <<
" monname '" << monNames[channel] <<
"'"
713 <<
" type '" << counterType[channel] <<
"'"
714 <<
" bgid '" << bgId[channel] <<
"'"
715 <<
" thnames '" << it->second <<
"'"
716 <<
" slots '" << slots[channel] <<
"'"
717 <<
" connectors '" << cons[channel] <<
"'"
718 <<
" multiplicities '" << mults[channel] <<
"'"
719 <<
" start bits '" << starts[channel] <<
"'"
720 <<
" end bits '" << ends[channel] <<
"'"
721 <<
" thresholds active '" << actives[channel] <<
"'"
723 monFolder->storeObject(vr.since(), vr.until(), payload, channel);
725 monFolder->flushStorageBuffer();
726 }
catch( cool::Exception & e) {
727 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
728 m_ostream <<
"Failed to write LVL1 monitoring mapping to COOL" << endl;
730 }
catch(std::exception & e) {
731 m_ostream <<
"<writeLVL1MonPayload> Caught std::exception: " << e.what() << endl;
744 const Menu& lvl1Menu)
756 rangeInfo(
"LVL1 thresholds", vr.since(), vr.until());
761 lvl1ThresholdFolder->setupStorageBuffer();
764 cool::ChannelId thrChannel = 0;
767 m_ostream <<
"Writing (to buffer) LVL1 threshold " << thr->name()
768 <<
" (version " << thr->version() <<
") to channel "
769 << thrChannel << endl;
770 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadThr, thrChannel++);
776 m_ostream <<
"Writing (to buffer) LVL1 threshold 'JetWeights':";
778 std::copy(jetweights.begin(), jetweights.end(), std::ostream_iterator<int>(
m_ostream,
", "));
781 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadJW, thrChannel++);
784 m_ostream <<
"Writing (to buffer) LVL1 threshold 'MET Significance parameters':";
787 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadMETSigParams, thrChannel++);
790 m_ostream <<
"Flushing LVL1 thresholds buffer to /TRIGGER/LVL1/Thresholds" << endl;
792 lvl1ThresholdFolder->flushStorageBuffer();
794 catch ( cool::Exception & e) {
795 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
796 <<
"warning will be ignored, job will continue" << endl;
799 }
catch( cool::Exception & e) {
800 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
801 m_ostream <<
"Failed to write LVL1 menu to COOL" << endl;
803 }
catch(std::exception & e) {
804 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
815 rangeInfo(
"LVL1 menu", vr.since(), vr.until());
821 lvl1MenuFolder->setupStorageBuffer();
822 lvl1ItemDefFolder->setupStorageBuffer();
827 cool::ChannelId menuChannel =
static_cast<cool::ChannelId
>(item->ctpId());
828 m_ostream <<
"Writing (to buffer) LVL1 item " << item->name()
829 <<
" (logic " << payloadItemDef[
"Logic"].data<cool::String255>()
831 << menuChannel << endl;
833 lvl1MenuFolder->storeObject(vr.since(), vr.until(), payloadMenu, menuChannel);
836 lvl1ItemDefFolder->storeObject(vr.since(), vr.until(), payloadItemDef, menuChannel);
840 m_ostream <<
"Flushing LVL1 menu buffer to /TRIGGER/LVL1/Menu" << endl;
842 lvl1MenuFolder->flushStorageBuffer();
844 catch ( cool::Exception & e) {
845 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
846 <<
"warning will be ignored, job will continue" << endl;
850 m_ostream <<
"Flushing LVL1 item buffer to /TRIGGER/LVL1/ItemDef" << endl;
852 lvl1ItemDefFolder->flushStorageBuffer();
854 catch ( cool::Exception & e) {
855 m_ostream <<
"WARNING: Flushing buffer to DB failed: " << e.what() << endl
856 <<
"warning will be ignored, job will continue" << endl;
860 }
catch( cool::Exception & e) {
861 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
862 m_ostream <<
"Failed to write LVL1 menu to COOL" << endl;
864 }
catch(std::exception & e) {
865 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
892 const Menu& lvl1Menu)
903 tipFolder->setupStorageBuffer();
907 cool::ChannelId tipNum =
static_cast<cool::ChannelId
>(tip->tipNumber());
909 stringstream tipName;
910 tipName <<
"name:" << tip->thresholdName();
911 tipName <<
"|thresh bit:" << tip->thresholdBit();
912 tipName <<
"|pos:" << tip->thresholdMapping();
913 tipName <<
"|active:" << tip->thresholdActive();
914 tipName <<
"|ctpin slot:" << tip->slot();
915 tipName <<
"|con:" << tip->connector();
916 tipName <<
"|cable bit:" << tip->cableBit();
917 m_ostream <<
"Write TIP / channel " << tipNum <<
" : " << tipName.str() << endl;
920 tipFolder->storeObject(vr.since(), vr.until(), payload, tipNum);
922 m_ostream <<
"Flushing LVL1 CTPInputMap buffer to /TRIGGER/LVL1/CTPCoreInputMapping" << endl;
923 tipFolder->flushStorageBuffer();
924 }
catch( cool::Exception & e) {
925 m_ostream <<
"Caught cool::Exception: " << e.what() << endl;
926 m_ostream <<
"Failed to write LVL1 TIP mapping to COOL" << endl;
928 }
catch( exception & e) {
929 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
943 const Menu& lvl1Menu,
949 rangeInfo(
"LVL1 bunch group descriptions", vr.since(), vr.until());
953 m_ostream <<
"Store LVL1 BG description buffer to /TRIGGER/LVL1/BunchGroupDescription" << endl;
954 bgDescFolder->storeObject(vr.since(), vr.until(), payload, 0);
956 catch(exception & e) {
957 m_ostream <<
"<writeL1BunchGroupRunPayload> caught and re-throw exception: " << e.what() << endl;
996 rangeInfo(
"LVL1 bunchgroup key", vr.since(), vr.until());
999 m_ostream <<
"Store LVL1 BG key to /TRIGGER/LVL1/BunchGroupKey" << endl;
1000 lvl1BGKFolder->storeObject(vr.since(), vr.until(), payload, 0);
1004 rangeInfo(
"LVL1 bunchgroups", vr.since(), vr.until());
1007 m_ostream <<
"Store LVL1 BG content to /TRIGGER/LVL1/BunchGroupContent" << endl;
1008 lvl1BGContentFolder->storeObject(vr.since(), vr.until(), payload, 0);
1011 catch(exception & e) {
1012 m_ostream <<
"<writeLVL1BGPayload> caugh and re-throw exception: " << e.what() << endl;
1055 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/PrescaleKey") ) {
1057 rangeInfo(
"HLT prescale key", since, until);
1059 m_ostream <<
"Store HLT prescale key " << pss.
id() <<
" to /TRIGGER/HLT/PrescaleKey" << endl;
1060 hltpskFolder->storeObject(since, until, payload, 0);
1063 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/Prescales") ) {
1064 rangeInfo(
"HLT prescale set", since, until);
1067 hltpssFolder->setupStorageBuffer();
1068 m_ostream <<
"Writing (to buffer) HLT prescales [(value/channel)]:" << endl;
1070 const uint ccmax = 8192;
1072 for(
uint cc=0; cc<ccmax; cc++) {
1076 hltpssFolder->storeObject(since, until, payload, 2*cc);
1077 m_ostream <<
"(L2:" <<
sc.prescale() <<
"/" << cc <<
") ";
1078 if((++printcount)%10==0) m_ostream << endl;
1088 hltpssFolder->storeObject(since, until, payload, 2*cc+1);
1089 m_ostream <<
"(EF:" <<
sc.prescale() <<
"/" <<
cc <<
") ";
1090 if((++printcount)%10==0) m_ostream << endl;
1098 hltpssFolder->storeObject(since, until, payload, 20000+cc);
1099 m_ostream <<
"(HLT:" <<
sc.prescale() <<
"/" << 20000+
cc <<
") ";
1100 if((++printcount)%10==0) m_ostream << endl;
1103 m_ostream <<
"]" << endl;
1104 m_ostream <<
"Flushing HLT prescales buffer to /TRIGGER/HLT/Prescales" << endl;
1105 hltpssFolder->flushStorageBuffer();
1108 catch(exception & e) {
1109 m_ostream <<
"<writeHltPrescalePayload> caught and re-throw exception: " <<
e.what() << endl;
1125 IObjectIteratorPtr objects = hltpskFolder->browseObjects( vr.since(), vr.since()+1, 0 );
1126 objects->goToNext();
1127 const IObject& obj = objects->currentRef();
1128 const IRecord & payload = obj.payload();
1138 cool::IObjectIteratorPtr objects = hltpssFolder->browseObjects( vr.since(), vr.since()+1, cool::ChannelSelection());
1140 while(objects->goToNext()) {
1141 const cool::IObject& obj = objects->currentRef();
1143 pss.
setIOV(obj.since(), obj.until());
1146 const ChannelId& ch = obj.channelId();
1147 const IRecord& payload = obj.payload();
1155 level = (ch%2==0)?
L2:
EF;
1171 unsigned int lvl1PrescaleKey,
1185 unsigned int lvl1PrescaleKey,
1196 cool::ValidityKey until,
1197 unsigned int lvl1PrescaleKey,
1200 prescaleSet.
print(
"",5);
1206 rangeInfo(
"LVL1 prescale key", since, until);
1207 cool::Record payload =
1209 m_ostream <<
"Store LVL1 prescale key " << lvl1PrescaleKey <<
" to /TRIGGER/LVL1/Lvl1ConfigKey" << endl;
1210 lvl1CkConfFolder->storeObject(since, until, payload, 0);
1214 rangeInfo(
"LVL1 prescale set", since, until);
1216 vector<int32_t> prescaleV = prescaleSet.
cuts();
1218 vector<int32_t>::const_iterator psIt = prescaleV.begin();
1221 lvl1PsConfFolder->setupStorageBuffer();
1223 m_ostream <<
"Writing (to buffer) LVL1 prescales [(value/channel)]:" << endl;
1224 for(
int channel=0; psIt != prescaleV.end(); channel++, ++psIt) {
1227 lvl1PsConfFolder->storeObject(since, until, payload, channel);
1228 m_ostream <<
"(" << *psIt <<
"/" << channel <<
") ";
1229 if((channel+1)%10==0)
m_ostream << endl;
1232 m_ostream <<
"Flushing LVL1 prescales buffer to /TRIGGER/LVL1/Prescales" << endl;
1233 lvl1PsConfFolder->flushStorageBuffer();
1236 catch(std::exception & e) {
1237 m_ostream <<
"<writeL1PrescalePayload> caught and re-throw exception: " << e.what() << endl;
1253 ValidityKey pointInTime( (ValidityKey(
run)<<32) + 1);
1257 IObjectIteratorPtr objects = hltMenuFolder->findObjects( pointInTime, ChannelSelection() );
1258 while ( objects->goToNext() ) {
1259 const IObject& obj = objects->currentRef();
1260 const IRecord & payload = obj.payload();
1267 objects = hltGroupFolder->findObjects( pointInTime, ChannelSelection() );
1268 while ( objects->goToNext() ) {
1269 const IObject& obj = objects->currentRef();
1270 const IRecord & payload = obj.payload();
1276 IObjectPtr
object = hltConfigKeyFolder->findObject( pointInTime, (ChannelId) 0 );
1277 const IRecord & payload =
object->payload();
1278 unsigned int smk, hltPrescaleKey;
1279 string configSource;
1280 readHltConfigKeys( payload.attributeList(), smk, hltPrescaleKey, configSource );
1284 catch(
const cool::ObjectNotFound& o) {
1285 m_ostream <<
"<readHLTPayload> No entry found in HLT keys folder for run " <<
run << endl;
1292 unsigned int & masterConfigKey,
1294 string & configSource)
1297 masterConfigKey = hltFrame.
smk();
1318 vector<TIP*>& tips )
1322 IObjectIteratorPtr objects;
1324 vector<bool> foundTip(512,
false);
1325 for(ChannelId channel = 0; channel < 512; ++channel) {
1326 objects = folder->browseObjects( vr.since(), vr.until()-1, channel );
1327 if(objects->size()==0)
continue;
1328 while ( objects->goToNext() ) {
1329 const IObject& obj = objects->currentRef();
1330 const IRecord & payload = obj.payload();
1333 uint16_t tipNumber = obj.channelId();
1334 if(tipNumber > 511) {
1335 m_ostream <<
"TIP number " << tipNumber <<
" out of bounds!" << endl;
1336 throw runtime_error(
"TIP number ouf ot bounds!");
1338 if(foundTip[tipNumber]) {
1340 str <<
"TIP '" << tipNumber <<
"' had already been read!";
1341 throw runtime_error(
str.str());
1343 foundTip[tipNumber] =
true;
1347 pits.push_back(pit);
1348 tips.push_back(tip);
1356 vector<ThresholdMonitor*>& mons)
1361 IObjectIteratorPtr objects;
1363 vector<bool> foundCounter(768,
false);
1365 for(ChannelId channel = 0; channel < 768; ++channel) {
1367 objects = folder->browseObjects( vr.since(), vr.until()-1, channel );
1368 if(objects->size()==0)
continue;
1369 while ( objects->goToNext() ) {
1370 const IObject& obj = objects->currentRef();
1371 const IRecord & payload = obj.payload();
1373 int counterNumber = obj.channelId();
1374 if(counterNumber > 768) {
1375 m_ostream <<
"Monitoring counter number " << counterNumber <<
" out of bounds!" << endl;
1376 throw runtime_error(
"Monitoring counter ouf of bounds!");
1378 if(foundCounter[counterNumber]) {
1380 str <<
"MonCounter '" << counterNumber <<
"' had already been read!";
1381 throw runtime_error(
str.str());
1383 foundCounter[counterNumber] =
true;
1384 for(
size_t i = 0 ; i < counters.size(); ++i) {
1385 counters[i]->setInternalCounter(counterNumber);
1386 mons.push_back( counters[i] );
1396 vector<TriggerItem*>& items)
1401 IObjectIteratorPtr objects;
1403 vector<bool> foundItem(512,
false);
1406 objects = folder->browseObjects( vr.since(), vr.until()-1,cool::ChannelSelection());
1408 while ( objects->goToNext() ) {
1409 const cool::IObject& obj = objects->currentRef();
1410 const cool::IRecord & payload = obj.payload();
1412 uint32_t ctpId = obj.channelId();
1414 m_ostream <<
"Item ctpid " << ctpId <<
" out of bounds!" << endl;
1415 throw runtime_error(
"Item ctpid ouf ot bounds!");
1417 if(foundItem[ctpId]) {
1419 str <<
"Item '" << ctpId <<
"' had already been read!";
1420 throw runtime_error(
str.str());
1422 foundItem[ctpId] =
true;
1423 item->setCtpId(ctpId);
1424 items.push_back(item);
1434 vector<TriggerThreshold*>& thrs) {
1439 IObjectIteratorPtr objects = L1thrFolder->browseObjects( vr.since(), vr.until()-1, cool::ChannelSelection() );
1440 while ( objects->goToNext() ) {
1441 const IObject& obj = objects->currentRef();
1442 const IRecord & payload = obj.payload();
1450 const vector<TriggerItem*>& items,
1451 const vector<TriggerThreshold*>& thrs)
1458 ChannelId itemChannel = item->ctpId();
1459 IObjectIteratorPtr objects = L1ItemDefFolder->browseObjects( vr.since(), vr.until()-1, itemChannel );
1460 while ( objects->goToNext() ) {
1461 const IObject& obj = objects->currentRef();
1462 const IRecord & payload = obj.payload();
1477 vector<TriggerThreshold*> thrs;
1485 bool isRun2 =
false;
1487 if( thr->cableName()==
"EM1" || thr->cableName()==
"EM2" ||
1488 thr->cableName()==
"JET1" || thr->cableName()==
"JET2" ||
1489 thr->cableName()==
"TOPO1" || thr->cableName()==
"TOPO2" ||
1490 thr->cableName()==
"TAU1" || thr->cableName()==
"TAU2") {
1498 cout <<
"TrigConfCoolWriter::readL1Menu for run " <<
run <<
". Determined format " << (isRun2 ?
"Run 2" :
"Run 1") << endl;
1501 vector<TriggerItem*> items;
1504 menu.addTriggerItem(item);
1513 if ( thr->name()==
"JetWeights" ) {
1515 for (
const string&
weights :
split( thr->cableName(),
",") )
1519 else if ( thr->name()==
"METSigParams" ) {
1520 vector<string> metvals =
split( thr->cableName(),
",");
1521 int XSSigmaScale = std::stoi(metvals[0]);
1522 int XSSigmaOffset = std::stoi(metvals[1]);
1523 int XEmin = std::stoi(metvals[2]);
1524 int XEmax = std::stoi(metvals[3]);
1525 int TESqrtMin = std::stoi(metvals[4]);
1526 int TESqrtMax = std::stoi(metvals[5]);
1528 XEmin, XEmax, TESqrtMin, TESqrtMax);
1532 menu.thresholdConfig().addTriggerThreshold(thr);
1535 menu.setCaloInfo(ci);
1541 for (
PIT* pit : pits) {
1542 if(pit->ctpinSlot()==10)
continue;
1545 for (
TIP* tip : tips) {
1553pair< vector<string>, map<unsigned int,unsigned char> >
1559 IObjectIteratorPtr objects = folder->browseObjects( vr.since(), vr.until()-1, 0 );
1560 objects->goToNext();
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 objects->goToNext();
1587 const IObject& obj = objects->currentRef();
1588 const IRecord & payload1 = obj.payload();
1593 IObjectIteratorPtr objects2 = lvl1BGContentFolder->browseObjects( vr.since(), vr.until(), 0);
1594 objects2->goToNext();
1595 const IObject& obj2 = objects2->currentRef();
1596 const IRecord & payload2 = obj2.payload();
1601 vector<string> names = bg_pair.first;
1605 uint newBGSSize = bgV.size() <= names.size() ? bgV.size() : names.size();
1607 if(bgV.size() != names.size()) {
1608 cout <<
"WARNING Bunchgroup content vector is of size " << bgV.size()
1609 <<
", which is different from the size of the names vector: " << names.size()
1610 <<
". Using " << newBGSSize << endl;
1616 for(
unsigned int i=0; i<newBGSSize; i++) {
1617 string bgname = names[i];
1618 if(bgname==
"") bgname =
"NoName";
1619 bgV[i].setName(bgname);
1620 bgV[i].setInternalNumber(i);
1637 unsigned int& lvl1PrescaleKey,
1642 vr.until() = vr.since()+1;
1645 IObjectIteratorPtr objects = lvl1CkFolder->browseObjects( vr.since(), vr.since()+1, 0 );
1646 objects->goToNext();
1647 const IObject& obj = objects->currentRef();
1648 const IRecord & payload = obj.payload();
1655 size_t nPrescales = lvl1PsFolder->listChannels().size();
1656 bool isRun2 = ( nPrescales == 512 );
1657 prescale.
resize( nPrescales );
1659 for(cool::ChannelId channel = 0; channel < nPrescales; channel++) {
1661 objects = lvl1PsFolder->browseObjects( vr.since(), vr.until(), channel );
1663 if(objects->size()!=1) {
1664 throw std::runtime_error(
"Lvl1 prescale access error: found empty prescale channel ");
1667 objects->goToNext();
1668 const IObject& obj = objects->currentRef();
1669 const IRecord & payload = obj.payload();
1670 int64_t prescaleVal=0;
1673 prescale.
setCut( channel, prescaleVal );
1675 prescale.
setPrescale( channel, (
float)prescaleVal );
1678 prescale.
setId( lvl1PrescaleKey );
1685 return m_dbPtr->existsFolder(
"/TRIGGER/HLT/Prescales" );
1710 ValidityKey since(
run); since <<= 32; since +=
lb;
1711 ValidityKey until(
run); until <<= 32; until +=
lbend+1;
1714 m_ostream <<
"Checking for run " <<
run <<
" and lb range " << (vr.since() & 0xFFFFFFFF) <<
" - " << ( (vr.until()-1) & 0xFFFFFFFF) << endl
1716 <<
" Folder Payload Size" << endl
1717 <<
"================================================================================" << endl;
1719 vector<string> foldersToFix;
1721 vector<string> folderList = {
1722 "/TRIGGER/LVL1/Menu",
1723 "/TRIGGER/LVL1/ItemDef",
1724 "/TRIGGER/LVL1/Thresholds",
1725 "/TRIGGER/LVL1/CTPCoreInputMapping",
1726 "/TRIGGER/LVL1/Lvl1ConfigKey",
1727 "/TRIGGER/LVL1/Prescales",
1728 "/TRIGGER/LVL1/BunchGroupKey",
1729 "/TRIGGER/LVL1/BunchGroupContent",
1730 "/TRIGGER/LVL1/BunchGroupDescription",
1731 "/TRIGGER/HLT/HltConfigKeys",
1732 "/TRIGGER/HLT/Menu",
1733 "/TRIGGER/HLT/Groups",
1734 "/TRIGGER/HLT/PrescaleKey",
1735 "/TRIGGER/HLT/Prescales"
1738 for(
const string & folderName : folderList) {
1739 IFolderPtr folder =
m_dbPtr->getFolder( folderName );
1740 unsigned int size = folder->countObjects( vr.since(), vr.until()-1, ChannelSelection() );
1741 bool isSingleVersion = folder->versioningMode()==FolderVersioning::SINGLE_VERSION;
1742 bool needsFixing = (size == 0);
1744 bool displayFixing =
false;
1745 if(displayMode==1) {
1746 displayFixing = (size == 0);
1747 }
else if(displayMode==2) {
1748 displayFixing = (size == 0) || !isSingleVersion;
1751 string fn = folderName + (isSingleVersion ?
" (sv)" :
" (mv)");
1753 m_ostream << setw(2) << foldersToFix.size()+1 <<
") ";
1754 foldersToFix.push_back(folderName);
1758 m_ostream << left << setw(40) << fn << right << setw(15) << size <<
" " << ( needsFixing ?
"NEEDS FIX" :
" OK") << endl;
1761 return foldersToFix;
const boost::regex rr(r_r)
char data[hepevt_bytes_allocation_ATLAS]
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