|
ATLAS Offline Software
|
Go to the documentation of this file.
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"
41 #include "boost/lexical_cast.hpp"
51 using boost::lexical_cast;
55 using namespace TrigConfCoolL1PayloadConverters;
56 using namespace TrigConfCoolHLTPayloadConverters;
59 #define READ_ONLY true
60 #define READ_WRITE false
66 m_neededToOpen(false),
92 if(dbIsOpen())
return true;
101 return m_dbPtr.use_count()>0 && m_dbPtr->isOpen();
110 if(dbIsOpen())
return m_dbPtr;
111 cool::IDatabaseSvc&
dbSvc = databaseService();
113 m_ostream <<
"Opening database '" << m_dbId <<
"' in " << (readOnly?
"read-only":
"read-write") <<
" mode" << endl;
114 m_dbPtr =
dbSvc.openDatabase( m_dbId, readOnly );
118 }
catch(cool::DatabaseDoesNotExist&
e) {
120 m_ostream <<
"Database '" << m_dbId <<
"' does not exist. Can't create it since connection is read-only." << endl;
123 m_ostream <<
"Database '" << m_dbId <<
"' does not exist, will create it" << endl;
124 m_dbPtr =
dbSvc.createDatabase( m_dbId );
125 m_ostream <<
"Created DB" << endl;
128 }
catch(Exception&
e) {
129 m_ostream <<
"*** COOL exception caught: " <<
e.what() << endl;
130 m_ostream <<
"Couldn't open database " << m_dbId << endl;
142 if(
db.use_count()>0 &&
db->isOpen()) {
143 m_ostream <<
"Closing database (old way) '" << m_dbId <<
"'" << endl;
144 db->closeDatabase( );
147 m_ostream <<
"*** COOL exception caught: " <<
e.what() << endl
148 <<
"Couldn't close conditions database: " << m_dbId << endl;
161 m_ostream <<
"Closing database '" << m_dbId <<
"'" << endl;
162 m_dbPtr->closeDatabase();
165 m_ostream <<
"*** COOL exception caught: " <<
e.what() << endl
166 <<
"Couldn't close conditions database: " << m_dbId << endl;
176 bool needToOpen = !dbIsOpen();
181 catch(cool::DatabaseDoesNotExist&
e) {
182 m_ostream <<
"*** : " <<
e.what() << endl;
183 m_ostream <<
"Will create a new database: " << m_dbId << endl;
187 catch(cool::Exception&
e) {
188 m_ostream <<
"*** COOL exception caught: " <<
e.what() << endl;
189 m_ostream <<
"Coudn't create a new schema: " << m_dbId << endl;
196 m_ostream <<
"Creating schema '" << m_dbId <<
"' with version " << schemaVersion
200 catch(cool::Exception&
e) {
201 m_ostream <<
"*** COOL exception caught: " <<
e.what() << endl;
202 m_ostream <<
"Coudn't create a new schema: " << m_dbId << endl;
205 if(needToOpen) closeDb();
227 o <<
"Schema version is " << schemaVersion
249 m_ostream <<
"Creating database '" << m_dbId <<
"'" << endl;
251 cool::IDatabaseSvc&
dbSvc = databaseService();
252 m_dbPtr =
dbSvc.createDatabase( m_dbId );
255 m_ostream <<
"*** COOL exception caught: " <<
e.what() << endl;
256 m_ostream <<
"Coudn't create a new conditions database: " << m_dbId << endl;
266 cool::ValidityKey
since,
267 cool::ValidityKey
until) {
270 if(
since==ValidityKeyMin &&
until==ValidityKeyMax) {
275 unsigned long long run[2];
276 unsigned long long lb[2];
280 run[0] &= 0x7FFFFFFF;
282 run[1] &= 0x7FFFFFFF;
284 if(
lb[0]==0 &&
lb[1]==0) {
286 unsigned int last =
run[1]-1;
290 m_ostream <<
"IOV Info: writing " <<
content <<
" for run range [" <<
first <<
"," << last <<
"]" << endl;
295 m_ostream <<
"IOV Info: writing " <<
content <<
" for run " <<
run[0] <<
" and LB " <<
lb[0] << endl;
297 m_ostream <<
"IOV Info: writing " <<
content <<
" for run " <<
run[0] <<
" and LB range [" <<
lb[0] <<
"," <<
lb[1]-1 <<
"]" << endl;
299 m_ostream <<
"IOV Info: writing " <<
content <<
" for range [" <<
run[0] <<
"/" <<
lb[0] <<
"," <<
run[1] <<
"/" <<
lb[1] <<
"[" << endl;
318 m_ostream <<
"<writeL1Payload> caught and re-throw exception: " <<
e.what() << endl;
328 const string& configSource)
334 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/HltConfigKeys") ) {
335 rangeInfo(
"HLT configuration keys",
vr.since(),
vr.until());
339 confkeyFolder->storeObject(
vr.since(),
vr.until(),
payload, 0);
342 m_ostream <<
"<writeHLTPayload> caught and re-throw exception: " <<
e.what() << endl
343 <<
"WARNING: Failed to write configuration keys to COOL" << endl;
351 writeHltPrescalePayload(
vr.since(),
vr.until(), pss);
354 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/Menu") ||
355 shouldFolderBeUpdated(
"/TRIGGER/HLT/Groups") ) {
358 rangeInfo(
"HLT menu",
vr.since(),
vr.until());
366 ChannelId menuChannel(0);
370 hltMenuFolder->setupStorageBuffer();
371 hltGroupFolder->setupStorageBuffer();
377 hltMenuFolder->storeObject(
vr.since(),
vr.until(),
payload, menuChannel);
380 hltGroupFolder->storeObject(
vr.since(),
vr.until(), payloadGroups, menuChannel);
381 m_ostream <<
"Writing (to buffer) HLT chain " <<
chain->chain_name()
382 <<
"(id " <<
chain->chain_counter()
383 <<
" level "<<
chain->level()
384 <<
") to COOL channel " << menuChannel
385 <<
" [belongs to groups " << payloadGroups[
"Groups"].data<cool::String4k>() <<
"]" << endl;
387 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/Menu") ) {
388 m_ostream <<
"Flushing HLT menu buffer to /TRIGGER/HLT/Menu" << endl;
390 hltMenuFolder->flushStorageBuffer();
392 catch ( cool::Exception &
e) {
393 m_ostream <<
"WARNING: Flushing buffer to DB failed: " <<
e.what() << endl
394 <<
"warning will be ignored, job will continue" << endl;
397 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/Groups") ) {
398 m_ostream <<
"Flushing HLT group buffer to /TRIGGER/HLT/Groups" << endl;
400 hltGroupFolder->flushStorageBuffer();
402 catch ( cool::Exception &
e) {
403 m_ostream <<
"WARNING: Flushing buffer to DB failed: " <<
e.what() << endl
404 <<
"warning will be ignored, job will continue" << endl;
408 catch( cool::Exception &
e) {
409 m_ostream <<
"Caught cool::Exception: " <<
e.what() << endl;
410 m_ostream <<
"Failed to write HLT menu to COOL" << endl;
414 m_ostream <<
"<writeHLTPayload> Caught std::exception: " <<
e.what() << endl;
418 m_ostream <<
"List of HLT Chains is empty, nothing is written to COOL" << endl;
437 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/MenuAwareMonConfigKey") ) {
438 rangeInfo(
"Monitoring configuration key",
vr.since(),
vr.until());
442 monconfkeyFolder->storeObject(
vr.since(),
vr.until(),
payload, 0,
"MenuAwareMonConfigKey-"+
release);
445 m_ostream <<
"<writeMCKPayload> caught and re-throw exception: " <<
e.what() << endl
446 <<
"WARNING: Failed to write monitoring configuration key (MCK) to COOL" << endl;
459 unsigned int masterConfigKey,
460 unsigned int hltPrescaleKey,
465 const std::string & configSource)
481 const std::string & configSource)
511 if(lvl1Menu == 0)
throw std::runtime_error(
"L1 trigger menu ptr is NULL");
521 rangeInfo(
"LVL1 monitoring",
vr.since(),
vr.until());
523 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/CTPInMonitoringMapping") ) {
530 std::map<cool::ChannelId,std::string> monNames;
531 std::map<cool::ChannelId,std::string> thrNames;
532 std::map<cool::ChannelId,std::string> slots;
533 std::map<cool::ChannelId,std::string> cons;
534 std::map<cool::ChannelId,std::string> mults;
535 std::map<cool::ChannelId,std::string> starts;
536 std::map<cool::ChannelId,std::string> ends;
537 std::map<cool::ChannelId,std::string> actives;
540 std::map<cool::ChannelId,std::string> counterType;
541 std::map<cool::ChannelId,uint16_t> bgId;
542 const std::vector<TrigConf::ThresholdMonitor*>& monCounter = lvl1Menu->
moncountVector();
543 std::vector<TrigConf::ThresholdMonitor*>::const_iterator
mc = monCounter.begin();
544 for(;
mc != monCounter.end(); ++
mc) {
545 cool::ChannelId
index =
static_cast<cool::ChannelId
>((*mc)->internalCounter());
549 if((*mc)->counterType().find(
"CTPMON") != std::string::npos) {
554 std::stringstream strSlot; strSlot << (*mc)->ctpinSlot();
555 std::stringstream strCon; strCon << (*mc)->ctpinConnector();
556 std::stringstream strMult; strMult << (*mc)->multiplicity();
557 std::stringstream strStart; strStart << (*mc)->thresholdStartBit();
558 std::stringstream strEnd; strEnd << (*mc)->thresholdEndBit();
560 if((*mc)->thresholdActive())
active =
"ENABLED";
565 if( monNames.find(
index) == monNames.end() ){
572 if( thrNames.find(
index) == thrNames.end() ){
574 m_ostream <<
"PROBLEM counter " <<
index <<
" : no thrNames in previous entries, overwrite all with new one" << endl;
575 }
else if( slots.find(
index) == slots.end() ){
577 m_ostream <<
"PROBLEM counter " <<
index <<
" : no slots in previous entries, overwrite all with new one" << endl;
578 }
else if( cons.find(
index) == cons.end() ){
580 m_ostream <<
"PROBLEM counter " <<
index <<
" : no cons in previous entries, overwrite all with new one" << endl;
581 }
else if( mults.find(
index) == mults.end() ){
583 m_ostream <<
"PROBLEM counter " <<
index <<
" : no mults in previous entries, overwrite all with new one" << endl;
584 }
else if( starts.find(
index) == starts.end() ){
586 m_ostream <<
"PROBLEM counter " <<
index <<
" : no starts in previous entries, overwrite all with new one" << endl;
587 }
else if( ends.find(
index) == ends.end() ){
589 m_ostream <<
"PROBLEM counter " <<
index <<
" : no ends in previous entries, overwrite all with new one" << endl;
590 }
else if( actives.find(
index) == actives.end() ){
592 m_ostream <<
"PROBLEM counter " <<
index <<
" : no actives in previous entries, overwrite all with new one" << endl;
593 }
else if( counterType.find(
index) == counterType.end() ){
595 m_ostream <<
"PROBLEM counter " <<
index <<
" : no counterType in previous entries, overwrite all with new one" << endl;
596 }
else if( bgId.find(
index) == bgId.end() ){
598 m_ostream <<
"PROBLEM counter " <<
index <<
" : no bgId in previous entries, overwrite all with new one" << endl;
602 std::vector<std::string> thrNamesCheck =
split(thrNames[
index],
":");
603 std::vector<std::string> slotsCheck =
split(slots[
index],
":");
604 std::vector<std::string> consCheck =
split(cons[
index],
":");
605 std::vector<std::string> multsCheck =
split(mults[
index],
":");
606 std::vector<std::string> startsCheck =
split(starts[
index],
":");
607 std::vector<std::string> endsCheck =
split(ends[
index],
":");
608 std::vector<std::string> activesCheck =
split(actives[
index],
":");
609 if (thrNamesCheck.size() != slotsCheck.size()||
610 thrNamesCheck.size() != consCheck.size()||
611 thrNamesCheck.size() != multsCheck.size()||
612 thrNamesCheck.size() != startsCheck.size()||
613 thrNamesCheck.size() != endsCheck.size()||
614 thrNamesCheck.size() != activesCheck.size()){
616 m_ostream <<
"PROBLEM counter " <<
index <<
" : numbers of entries are different, overwrite all with new one" << endl;
618 for (
unsigned int i = 0;
i < thrNamesCheck.size();
i++){
619 if(thrNamesCheck[
i]==(*mc)->thresholdName()&&
620 slotsCheck[
i]==strSlot.str()&&
621 consCheck[
i]==strCon.str()&&
622 multsCheck[
i]==strMult.str()&&
623 startsCheck[
i]==strStart.str()&&
624 endsCheck[
i]==strEnd.str()&&
639 monNames[
index]=(*mc)->name();
640 thrNames[
index]=(*mc)->thresholdName();
641 slots[
index]=strSlot.str();
642 cons[
index]=strCon.str();
643 mults[
index]=strMult.str();
644 starts[
index]=strStart.str();
645 ends[
index]=strEnd.str();
647 counterType[
index]=(*mc)->counterType();
648 bgId[
index]=(*mc)->bunchGroupId();
652 if (monNames[
index]!=(*mc)->name()){
653 std::stringstream
str;
655 str <<
" : previous monitor name" << monNames[
index];
656 str <<
", current monitor name " << (*mc)->name() << endl;
657 m_ostream <<
str.str() << endl;
660 if(counterType[
index] != (*mc)->counterType()) {
661 std::stringstream
str;
663 str <<
" : previous type " << counterType[
index];
664 str <<
", current type " << (*mc)->counterType() << endl;
665 m_ostream <<
str.str() << endl;
668 if(bgId[
index] != (*mc)->bunchGroupId()) {
669 std::stringstream
str;
671 str <<
" : previous bunch-group id " << bgId[
index];
672 str <<
", current id " << (*mc)->bunchGroupId() << endl;
673 m_ostream <<
str.str() << endl;
676 monNames[
index]=(*mc)->name();
677 counterType[
index]=(*mc)->counterType();
678 bgId[
index]=(*mc)->bunchGroupId();
680 thrNames[
index]+=
":";thrNames[
index]+=(*mc)->thresholdName();
681 slots[
index]+=
":";slots[
index]+=strSlot.str();
683 mults[
index]+=
":";mults[
index]+=strMult.str();
684 starts[
index]+=
":";starts[
index]+=strStart.str();
688 m_ostream <<
"PROBLEM counter " <<
index <<
" : unknown flag = " <<
flag << endl;
696 monFolder->setupStorageBuffer();
698 it != thrNames.end();++
it) {
714 m_ostream <<
"Write monitoring counter (channel " <<
channel <<
") :: "
715 <<
" monname '" << monNames[
channel] <<
"'"
716 <<
" type '" << counterType[
channel] <<
"'"
717 <<
" bgid '" << bgId[
channel] <<
"'"
718 <<
" thnames '" <<
it->second <<
"'"
719 <<
" slots '" << slots[
channel] <<
"'"
720 <<
" connectors '" << cons[
channel] <<
"'"
721 <<
" multiplicities '" << mults[
channel] <<
"'"
722 <<
" start bits '" << starts[
channel] <<
"'"
723 <<
" end bits '" << ends[
channel] <<
"'"
724 <<
" thresholds active '" << actives[
channel] <<
"'"
728 monFolder->flushStorageBuffer();
729 }
catch( cool::Exception &
e) {
730 m_ostream <<
"Caught cool::Exception: " <<
e.what() << endl;
731 m_ostream <<
"Failed to write LVL1 monitoring mapping to COOL" << endl;
734 m_ostream <<
"<writeLVL1MonPayload> Caught std::exception: " <<
e.what() << endl;
747 const Menu& lvl1Menu)
754 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/Thresholds") &&
759 rangeInfo(
"LVL1 thresholds",
vr.since(),
vr.until());
764 lvl1ThresholdFolder->setupStorageBuffer();
767 cool::ChannelId thrChannel = 0;
770 m_ostream <<
"Writing (to buffer) LVL1 threshold " << thr->name()
771 <<
" (version " << thr->version() <<
") to channel "
772 << thrChannel << endl;
773 lvl1ThresholdFolder->storeObject(
vr.since(),
vr.until(), payloadThr, thrChannel++);
779 m_ostream <<
"Writing (to buffer) LVL1 threshold 'JetWeights':";
781 std::copy(jetweights.begin(), jetweights.end(), std::ostream_iterator<int>(m_ostream,
", "));
784 lvl1ThresholdFolder->storeObject(
vr.since(),
vr.until(), payloadJW, thrChannel++);
787 m_ostream <<
"Writing (to buffer) LVL1 threshold 'MET Significance parameters':";
790 lvl1ThresholdFolder->storeObject(
vr.since(),
vr.until(), payloadMETSigParams, thrChannel++);
793 m_ostream <<
"Flushing LVL1 thresholds buffer to /TRIGGER/LVL1/Thresholds" << endl;
795 lvl1ThresholdFolder->flushStorageBuffer();
797 catch ( cool::Exception &
e) {
798 m_ostream <<
"WARNING: Flushing buffer to DB failed: " <<
e.what() << endl
799 <<
"warning will be ignored, job will continue" << endl;
802 }
catch( cool::Exception &
e) {
803 m_ostream <<
"Caught cool::Exception: " <<
e.what() << endl;
804 m_ostream <<
"Failed to write LVL1 menu to COOL" << endl;
807 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " <<
e.what() << endl;
815 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/Menu") ||
816 shouldFolderBeUpdated(
"/TRIGGER/LVL1/ItemDef") ) {
818 rangeInfo(
"LVL1 menu",
vr.since(),
vr.until());
824 lvl1MenuFolder->setupStorageBuffer();
825 lvl1ItemDefFolder->setupStorageBuffer();
830 cool::ChannelId menuChannel =
static_cast<cool::ChannelId
>(
item->ctpId());
831 m_ostream <<
"Writing (to buffer) LVL1 item " <<
item->name()
832 <<
" (logic " << payloadItemDef[
"Logic"].data<cool::String255>()
833 <<
": [" << payloadItemDef[
"ConditionsList"].data<cool::String4k>() <<
"]) to channel "
834 << menuChannel << endl;
835 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/Menu") )
836 lvl1MenuFolder->storeObject(
vr.since(),
vr.until(), payloadMenu, menuChannel);
838 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/ItemDef") )
839 lvl1ItemDefFolder->storeObject(
vr.since(),
vr.until(), payloadItemDef, menuChannel);
842 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/Menu") ) {
843 m_ostream <<
"Flushing LVL1 menu buffer to /TRIGGER/LVL1/Menu" << endl;
845 lvl1MenuFolder->flushStorageBuffer();
847 catch ( cool::Exception &
e) {
848 m_ostream <<
"WARNING: Flushing buffer to DB failed: " <<
e.what() << endl
849 <<
"warning will be ignored, job will continue" << endl;
852 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/ItemDef") ) {
853 m_ostream <<
"Flushing LVL1 item buffer to /TRIGGER/LVL1/ItemDef" << endl;
855 lvl1ItemDefFolder->flushStorageBuffer();
857 catch ( cool::Exception &
e) {
858 m_ostream <<
"WARNING: Flushing buffer to DB failed: " <<
e.what() << endl
859 <<
"warning will be ignored, job will continue" << endl;
863 }
catch( cool::Exception &
e) {
864 m_ostream <<
"Caught cool::Exception: " <<
e.what() << endl;
865 m_ostream <<
"Failed to write LVL1 menu to COOL" << endl;
868 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " <<
e.what() << endl;
872 writeL1CTPCoreInputMapping(
vr, lvl1Menu );
884 writeL1MenuPayload(
rr, lvl1Menu );
895 const Menu& lvl1Menu)
897 if( ! shouldFolderBeUpdated(
"/TRIGGER/LVL1/CTPCoreInputMapping") )
906 tipFolder->setupStorageBuffer();
910 cool::ChannelId tipNum =
static_cast<cool::ChannelId
>(tip->tipNumber());
912 stringstream tipName;
913 tipName <<
"name:" << tip->thresholdName();
914 tipName <<
"|thresh bit:" << tip->thresholdBit();
915 tipName <<
"|pos:" << tip->thresholdMapping();
916 tipName <<
"|active:" << tip->thresholdActive();
917 tipName <<
"|ctpin slot:" << tip->slot();
918 tipName <<
"|con:" << tip->connector();
919 tipName <<
"|cable bit:" << tip->cableBit();
920 m_ostream <<
"Write TIP / channel " << tipNum <<
" : " << tipName.str() << endl;
923 tipFolder->storeObject(
vr.since(),
vr.until(),
payload, tipNum);
925 m_ostream <<
"Flushing LVL1 CTPInputMap buffer to /TRIGGER/LVL1/CTPCoreInputMapping" << endl;
926 tipFolder->flushStorageBuffer();
927 }
catch( cool::Exception &
e) {
928 m_ostream <<
"Caught cool::Exception: " <<
e.what() << endl;
929 m_ostream <<
"Failed to write LVL1 TIP mapping to COOL" << endl;
932 m_ostream <<
"<writeLVL1RunPayload> Caught std::exception: " <<
e.what() << endl;
946 const Menu& lvl1Menu,
949 if( !shouldFolderBeUpdated(
"/TRIGGER/LVL1/BunchGroupDescription") )
return;
952 rangeInfo(
"LVL1 bunch group descriptions",
vr.since(),
vr.until());
956 m_ostream <<
"Store LVL1 BG description buffer to /TRIGGER/LVL1/BunchGroupDescription" << endl;
957 bgDescFolder->storeObject(
vr.since(),
vr.until(),
payload, 0);
960 m_ostream <<
"<writeL1BunchGroupRunPayload> caught and re-throw exception: " <<
e.what() << endl;
974 writeL1BunchGroupRunPayload(
rr, lvl1Menu, bgs);
986 writeL1BunchGroupLBPayload(
rr, bgKey, bgs);
998 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/BunchGroupKey") ) {
999 rangeInfo(
"LVL1 bunchgroup key",
vr.since(),
vr.until());
1002 m_ostream <<
"Store LVL1 BG key to /TRIGGER/LVL1/BunchGroupKey" << endl;
1003 lvl1BGKFolder->storeObject(
vr.since(),
vr.until(),
payload, 0);
1006 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/BunchGroupContent") ) {
1007 rangeInfo(
"LVL1 bunchgroups",
vr.since(),
vr.until());
1010 m_ostream <<
"Store LVL1 BG content to /TRIGGER/LVL1/BunchGroupContent" << endl;
1011 lvl1BGContentFolder->storeObject(
vr.since(),
vr.until(),
payload, 0);
1015 m_ostream <<
"<writeLVL1BGPayload> caugh and re-throw exception: " <<
e.what() << endl;
1058 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/PrescaleKey") ) {
1062 m_ostream <<
"Store HLT prescale key " << pss.
id() <<
" to /TRIGGER/HLT/PrescaleKey" << endl;
1066 if( shouldFolderBeUpdated(
"/TRIGGER/HLT/Prescales") ) {
1070 hltpssFolder->setupStorageBuffer();
1071 m_ostream <<
"Writing (to buffer) HLT prescales [(value/channel)]:" << endl;
1073 const uint ccmax = 8192;
1080 m_ostream <<
"(L2:" <<
sc.prescale() <<
"/" <<
cc <<
") ";
1081 if((++printcount)%10==0) m_ostream << endl;
1092 m_ostream <<
"(EF:" <<
sc.prescale() <<
"/" <<
cc <<
") ";
1093 if((++printcount)%10==0) m_ostream << endl;
1102 m_ostream <<
"(HLT:" <<
sc.prescale() <<
"/" << 20000+
cc <<
") ";
1103 if((++printcount)%10==0) m_ostream << endl;
1106 m_ostream <<
"]" << endl;
1107 m_ostream <<
"Flushing HLT prescales buffer to /TRIGGER/HLT/Prescales" << endl;
1108 hltpssFolder->flushStorageBuffer();
1112 m_ostream <<
"<writeHltPrescalePayload> caught and re-throw exception: " <<
e.what() << endl;
1128 IObjectIteratorPtr
objects = hltpskFolder->browseObjects(
vr.since(),
vr.since()+1, 0 );
1141 cool::IObjectIteratorPtr
objects = hltpssFolder->browseObjects(
vr.since(),
vr.since()+1, cool::ChannelSelection());
1144 const cool::IObject&
obj =
objects->currentRef();
1149 const ChannelId&
ch =
obj.channelId();
1174 unsigned int lvl1PrescaleKey,
1188 unsigned int lvl1PrescaleKey,
1199 cool::ValidityKey
until,
1200 unsigned int lvl1PrescaleKey,
1203 prescaleSet.
print(
"",5);
1208 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/Lvl1ConfigKey") ) {
1209 rangeInfo(
"LVL1 prescale key",
since,
until);
1212 m_ostream <<
"Store LVL1 prescale key " << lvl1PrescaleKey <<
" to /TRIGGER/LVL1/Lvl1ConfigKey" << endl;
1216 if( shouldFolderBeUpdated(
"/TRIGGER/LVL1/Prescales") ) {
1217 rangeInfo(
"LVL1 prescale set",
since,
until);
1219 vector<int32_t> prescaleV = prescaleSet.
cuts();
1221 vector<int32_t>::const_iterator psIt = prescaleV.begin();
1224 lvl1PsConfFolder->setupStorageBuffer();
1226 m_ostream <<
"Writing (to buffer) LVL1 prescales [(value/channel)]:" << endl;
1231 m_ostream <<
"(" << *psIt <<
"/" <<
channel <<
") ";
1232 if((
channel+1)%10==0) m_ostream << endl;
1234 m_ostream <<
"]" << endl;
1235 m_ostream <<
"Flushing LVL1 prescales buffer to /TRIGGER/LVL1/Prescales" << endl;
1236 lvl1PsConfFolder->flushStorageBuffer();
1240 m_ostream <<
"<writeL1PrescalePayload> caught and re-throw exception: " <<
e.what() << endl;
1260 IObjectIteratorPtr
objects = hltMenuFolder->findObjects(
pointInTime, ChannelSelection() );
1261 while (
objects->goToNext() ) {
1271 while (
objects->goToNext() ) {
1279 IObjectPtr
object = hltConfigKeyFolder->findObject(
pointInTime, (ChannelId) 0 );
1280 const IRecord &
payload =
object->payload();
1281 unsigned int smk, hltPrescaleKey;
1282 string configSource;
1287 catch(
const cool::ObjectNotFound& o) {
1288 m_ostream <<
"<readHLTPayload> No entry found in HLT keys folder for run " <<
run << endl;
1295 unsigned int & masterConfigKey,
1297 string & configSource)
1300 masterConfigKey = hltFrame.
smk();
1321 vector<TIP*>& tips )
1327 vector<bool> foundTip(512,
false);
1330 if(
objects->size()==0)
continue;
1331 while (
objects->goToNext() ) {
1337 if(tipNumber > 511) {
1338 m_ostream <<
"TIP number " << tipNumber <<
" out of bounds!" << endl;
1339 throw runtime_error(
"TIP number ouf ot bounds!");
1341 if(foundTip[tipNumber]) {
1343 str <<
"TIP '" << tipNumber <<
"' had already been read!";
1344 throw runtime_error(
str.str());
1346 foundTip[tipNumber] =
true;
1350 pits.push_back(pit);
1351 tips.push_back(tip);
1359 vector<ThresholdMonitor*>& mons)
1366 vector<bool> foundCounter(768,
false);
1371 if(
objects->size()==0)
continue;
1372 while (
objects->goToNext() ) {
1376 int counterNumber =
obj.channelId();
1377 if(counterNumber > 768) {
1378 m_ostream <<
"Monitoring counter number " << counterNumber <<
" out of bounds!" << endl;
1379 throw runtime_error(
"Monitoring counter ouf of bounds!");
1381 if(foundCounter[counterNumber]) {
1383 str <<
"MonCounter '" << counterNumber <<
"' had already been read!";
1384 throw runtime_error(
str.str());
1386 foundCounter[counterNumber] =
true;
1387 for(
size_t i = 0 ;
i < counters.size(); ++
i) {
1388 counters[
i]->setInternalCounter(counterNumber);
1389 mons.push_back( counters[
i] );
1399 vector<TriggerItem*>&
items)
1406 vector<bool> foundItem(512,
false);
1409 objects =
folder->browseObjects(
vr.since(),
vr.until()-1,cool::ChannelSelection());
1411 while (
objects->goToNext() ) {
1412 const cool::IObject&
obj =
objects->currentRef();
1413 const cool::IRecord &
payload =
obj.payload();
1417 m_ostream <<
"Item ctpid " << ctpId <<
" out of bounds!" << endl;
1418 throw runtime_error(
"Item ctpid ouf ot bounds!");
1420 if(foundItem[ctpId]) {
1422 str <<
"Item '" << ctpId <<
"' had already been read!";
1423 throw runtime_error(
str.str());
1425 foundItem[ctpId] =
true;
1426 item->setCtpId(ctpId);
1437 vector<TriggerThreshold*>& thrs) {
1442 IObjectIteratorPtr
objects = L1thrFolder->browseObjects(
vr.since(),
vr.until()-1, cool::ChannelSelection() );
1443 while (
objects->goToNext() ) {
1453 const vector<TriggerItem*>&
items,
1454 const vector<TriggerThreshold*>& thrs)
1461 ChannelId itemChannel =
item->ctpId();
1462 IObjectIteratorPtr
objects = L1ItemDefFolder->browseObjects(
vr.since(),
vr.until()-1, itemChannel );
1463 while (
objects->goToNext() ) {
1480 vector<TriggerThreshold*> thrs;
1490 if( thr->cableName()==
"EM1" || thr->cableName()==
"EM2" ||
1491 thr->cableName()==
"JET1" || thr->cableName()==
"JET2" ||
1492 thr->cableName()==
"TOPO1" || thr->cableName()==
"TOPO2" ||
1493 thr->cableName()==
"TAU1" || thr->cableName()==
"TAU2") {
1501 cout <<
"TrigConfCoolWriter::readL1Menu for run " <<
run <<
". Determined format " << (
isRun2 ?
"Run 2" :
"Run 1") << endl;
1504 vector<TriggerItem*>
items;
1516 if ( thr->name()==
"JetWeights" ) {
1518 for (
const string&
weights :
split( thr->cableName(),
",") )
1522 else if ( thr->name()==
"METSigParams" ) {
1523 vector<string> metvals =
split( thr->cableName(),
",");
1524 int XSSigmaScale = boost::lexical_cast<int, string>(metvals[0]);
1525 int XSSigmaOffset = boost::lexical_cast<int, string>(metvals[1]);
1526 int XEmin = boost::lexical_cast<int, string>(metvals[2]);
1527 int XEmax = boost::lexical_cast<int, string>(metvals[3]);
1528 int TESqrtMin = boost::lexical_cast<int, string>(metvals[4]);
1529 int TESqrtMax = boost::lexical_cast<int, string>(metvals[5]);
1531 XEmin, XEmax, TESqrtMin, TESqrtMax);
1535 menu.thresholdConfig().addTriggerThreshold(thr);
1538 menu.setCaloInfo(ci);
1544 for (
PIT* pit : pits) {
1545 if(pit->ctpinSlot()==10)
continue;
1548 for (
TIP* tip : tips) {
1556 pair< vector<string>, map<unsigned int,unsigned char> >
1562 IObjectIteratorPtr
objects =
folder->browseObjects(
vr.since(),
vr.until()-1, 0 );
1584 vr.until() =
vr.since();
1588 IObjectIteratorPtr
objects = lvl1BGKeyFolder->browseObjects(
vr.since(),
vr.until(), 0 );
1591 const IRecord & payload1 =
obj.payload();
1596 IObjectIteratorPtr objects2 = lvl1BGContentFolder->browseObjects(
vr.since(),
vr.until(), 0);
1597 objects2->goToNext();
1598 const IObject&
obj2 = objects2->currentRef();
1599 const IRecord & payload2 =
obj2.payload();
1604 vector<string>
names = bg_pair.first;
1608 uint newBGSSize = bgV.size() <=
names.size() ? bgV.size() :
names.size();
1610 if(bgV.size() !=
names.size()) {
1611 cout <<
"WARNING Bunchgroup content vector is of size " << bgV.size()
1612 <<
", which is different from the size of the names vector: " <<
names.size()
1613 <<
". Using " << newBGSSize << endl;
1619 for(
unsigned int i=0;
i<newBGSSize;
i++) {
1620 string bgname =
names[
i];
1621 if(bgname==
"") bgname =
"NoName";
1622 bgV[
i].setName(bgname);
1623 bgV[
i].setInternalNumber(
i);
1640 unsigned int& lvl1PrescaleKey,
1645 vr.until() =
vr.since()+1;
1648 IObjectIteratorPtr
objects = lvl1CkFolder->browseObjects(
vr.since(),
vr.since()+1, 0 );
1658 size_t nPrescales = lvl1PsFolder->listChannels().size();
1659 bool isRun2 = ( nPrescales == 512 );
1660 prescale.
resize( nPrescales );
1667 throw std::runtime_error(
"Lvl1 prescale access error: found empty prescale channel ");
1673 int64_t prescaleVal=0;
1681 prescale.
setId( lvl1PrescaleKey );
1688 return m_dbPtr->existsFolder(
"/TRIGGER/HLT/Prescales" );
1717 m_ostream <<
"Checking for run " <<
run <<
" and lb range " << (
vr.since() & 0xFFFFFFFF) <<
" - " << ( (
vr.until()-1) & 0xFFFFFFFF) << endl
1719 <<
" Folder Payload Size" << endl
1720 <<
"================================================================================" << endl;
1722 vector<string> foldersToFix;
1725 "/TRIGGER/LVL1/Menu",
1726 "/TRIGGER/LVL1/ItemDef",
1727 "/TRIGGER/LVL1/Thresholds",
1728 "/TRIGGER/LVL1/CTPCoreInputMapping",
1729 "/TRIGGER/LVL1/Lvl1ConfigKey",
1730 "/TRIGGER/LVL1/Prescales",
1731 "/TRIGGER/LVL1/BunchGroupKey",
1732 "/TRIGGER/LVL1/BunchGroupContent",
1733 "/TRIGGER/LVL1/BunchGroupDescription",
1734 "/TRIGGER/HLT/HltConfigKeys",
1735 "/TRIGGER/HLT/Menu",
1736 "/TRIGGER/HLT/Groups",
1737 "/TRIGGER/HLT/PrescaleKey",
1738 "/TRIGGER/HLT/Prescales"
1743 unsigned int size =
folder->countObjects(
vr.since(),
vr.until()-1, ChannelSelection() );
1744 bool isSingleVersion =
folder->versioningMode()==FolderVersioning::SINGLE_VERSION;
1745 bool needsFixing = (
size == 0);
1747 bool displayFixing =
false;
1748 if(displayMode==1) {
1749 displayFixing = (
size == 0);
1750 }
else if(displayMode==2) {
1751 displayFixing = (
size == 0) || !isSingleVersion;
1754 string fn =
folderName + (isSingleVersion ?
" (sv)" :
" (mv)");
1756 m_ostream << setw(2) << foldersToFix.size()+1 <<
") ";
1761 m_ostream << left << setw(40) <<
fn << right << setw(15) <<
size <<
" " << ( needsFixing ?
"NEEDS FIX" :
" OK") << endl;
1764 return foldersToFix;
JetConstituentVector::iterator iterator
static void setMaxThresholdsFromL1Version(unsigned int l1version)
cool::Record createHltPrescaleKeyPayload(cool::IFolderPtr, int psk)
build a COOL db record from a HLT prescale value
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.
void writeL1MonPayload(unsigned int runNumber, const TrigConf::Menu *lvl1Menu)
Writing L1 run-wise monitoring configuration to COOL.
static cool::IFolderPtr getLvl1PrescalesFolder(cool::IDatabasePtr db)
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
std::pair< std::vector< std::string >, std::map< unsigned int, unsigned char > > readL1BunchGroupRunPayload(unsigned int runNumber)
Reading bunch group configuration information from COOL database.
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
void readHLTPayload(unsigned int run, HLTFrame &hltFrame)
cool::Record createLvl1PrescalesPayload(cool::IFolderPtr, int prescale)
build a COOL db record from a LVL1 prescale value
std::vector< RunRange > RunRangeVec
static cool::IFolderPtr getHltChainGroupFolder(cool::IDatabasePtr db)
bool hasPrescale(unsigned int counter, TrigConf::HLTLevel level=HLT) const
cool::Record createLvl1ConfigKeyPayload(cool::IFolderPtr, unsigned int lvl1PrescaleKey)
build a COOL db record from a LVL1 configuration key
void rangeInfo(const std::string &content, cool::ValidityKey since, cool::ValidityKey until)
TrigConf::PIT * readLvl1InputMap(const coral::AttributeList &al)
Build a LVL1 PIT object from COOL payload.
virtual void print(const std::string &indent="", unsigned int detail=1) const override
void setValues(int XSSigmaScale, int XSSigmaOffset, int XEmin, int XEmax, int TESqrtMin, int TESqrtMax)
void readL1Thresholds(unsigned int runNumber, std::vector< TrigConf::TriggerThreshold * > &thrs)
Read run-wise L1 threshold vector from COOL database.
static cool::IFolderPtr getLvl1ConfKeyFolder(cool::IDatabasePtr db)
std::vector< std::string > checkPayloadSize(unsigned int run, unsigned int lb, int displayMode, bool openend, unsigned int lbend)
void readL1MonMapPayload(unsigned int runNumber, std::vector< TrigConf::ThresholdMonitor * > &mons)
Read run-wise LVL1 monitoring configuration from COOL database.
int readHltPrescaleKey(const coral::AttributeList &al)
build the HLT prescale key from a COOL db record
static cool::IFolderPtr getLvl1MenuFolder(cool::IDatabasePtr db)
static int getDefaultSchemaVersion()
access to the version
static cool::IFolderPtr getLvl1BGKeyFolder(cool::IDatabasePtr db)
const BunchGroupSet & bunchGroupSet() const
std::vector< TrigConf::BunchGroup > readLvl1BGContent(const coral::AttributeList &al)
build the LVL1 Bunchgroup code
static cool::IFolderSetPtr createFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the COOL database
static cool::IFolderPtr getHltConfKeyFolder(cool::IDatabasePtr db)
int readLvl1BGKey(const coral::AttributeList &al)
build the LVL1 Bunchgroup key value
cool::Record createLvl1METSigPayload(cool::IFolderPtr, const METSigParam &metSigParams)
build a COOL db record from a L1 MET significance global parameters
void readL1Menu(unsigned int runNumber, CTPConfig &ctpc)
Read L1 menu from COOL database.
METSigParam & metSigParam()
static cool::IFolderSetPtr createMonFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the monitoring COOL database
cool::Record createLvl1ThresholdPayload(cool::IFolderPtr, const TrigConf::TriggerThreshold &thr)
build a COOL db record from a LVL1 TriggerItem
cool::Record createHltPrescalesPayload(cool::IFolderPtr, float prescale, float passthrough, float rerunprescale)
build a COOL db record from a HLT prescale value
void readL1PrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, unsigned int &lvl1PrescaleKey, TrigConf::PrescaleSet &prescale)
Reading luminosityblock-wise configuration information the COOL database.
TriggerThreshold * createLvl1Threshold(const coral::AttributeList &al)
build a LVL1 TriggerThreshold from a COOL db record
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
HLT chain configuration information.
void readL1Items(unsigned int runNumber, std::vector< TrigConf::TriggerItem * > &items)
Read run-wise L1 item vector from COOL database.
void printSchema(std::ostream &o)
Prints the schema in the COOL database.
void setPitNumber(const uint16_t &pitnumber)
void writeL1MenuPayload(ValidityRange vr, const TrigConf::Menu &lvl1Menu)
Writing L1 run-wise configuration information to the COOL database.
void writeMCKPayload(ValidityRange vr, unsigned int mck, std::string &release, std::string &info)
cool::Record createHltChainGroupPayload(cool::IFolderPtr, const TrigConf::HLTChain &ch)
build a COOL db record from a HLT chain
static cool::IFolderPtr getHltPrescalesFolder(cool::IDatabasePtr db)
void recreateSchema(int schemaVersion=0)
Create a new schema in the COOL database with prior deletion of the old one.
void readHltPrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, TrigConf::HLTPrescaleSet &pss)
Reading luminosityblock-wise configuration information the COOL database.
cool::Record createLvl1BGDescPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs, const TrigConf::Menu &lvl1Menu)
build a COOL db record from a bunch group description
std::pair< unsigned int, unsigned int > RunRange
static cool::IFolderPtr getMonConfKeyFolder(cool::IDatabasePtr db)
HLTSequenceList & theHLTSequenceList()
accessor to the list of HLT sequences
HLTPrescale & setPassThrough(float pass_through)
HLTPrescale & thePrescale(unsigned int chain_counter, HLTLevel level)
Forward iterator to traverse the main components of the trigger configuration.
void setClock(const int &clock)
cool::Record createLvl1ItemDefPayload(cool::IFolderPtr, const TrigConf::TriggerItem &item)
build a COOL db record from a LVL1 TriggerItem (the conditions)
static cool::IFolderPtr getHltMenuFolder(cool::IDatabasePtr db)
HLTChain * createHLTChain(const coral::AttributeList &al, TrigConf::HLTSequenceList *sequences=0)
build an HLT chain from a COOL db record
cool::IDatabasePtr m_dbPtr
COOL database pointer.
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.
unsigned int l1Version() const
bool dbIsOpen()
check if db is open
void readLvl1ConfigKey(const coral::AttributeList &al, unsigned int &lvl1PrescaleKey)
build the LVL1 configuration key from a coral::AttributeList
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::list< cont > & sets()
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.
void readLvl1Prescale(const coral::AttributeList &al, int &ps)
build the LVL1 prescale value from a coral::AttributeList
void dropDb()
delete the COOL database
void writeL1BunchGroupLBPayload(const RunRangeVec &runRanges, unsigned int bgKey, const BunchGroupSet &bgs)
Writing LB-wise L1 bunch group definition to the COOL database.
unsigned int l1Version() const
cool::IDatabaseSvc & databaseService()
get COOL db service
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.
const std::vector< TriggerThreshold * > & thresholdVector(L1DataDef::TriggerType) const
void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__((deprecated))
Set the prescale NUM from the int64 value prescaleValue.
cool::Record createHltMenuPayload(cool::IFolderPtr, const TrigConf::HLTChain &, const std::string &concise)
build a COOL db record from a HLT chain
static cool::IFolderPtr getLvl1BGDescFolder(cool::IDatabasePtr db)
const HLTPrescale & getPrescale(unsigned int chain_counter, HLTLevel level=HLT) const
const std::vector< int32_t > & cuts() const
TriggerItem * createLvl1TriggerItem(const coral::AttributeList &al)
build a LVL1 TriggerItem from a COOL db record
void addBunchGroup(const BunchGroup &)
const PrescaleSet & prescaleSet(unsigned int partition=0) const
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
cool::Record createLvl1JetWeightPayload(cool::IFolderPtr, const std::vector< int > &jetweights)
build a COOL db record from a L1 Jet Weights vector
void readL1InputMapPayload(unsigned int runNumber, std::vector< TrigConf::PIT * > &pits, std::vector< TrigConf::TIP * > &tips)
Read run-wise PIT configuration from 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 setId(unsigned int id)
HLT chain configuration information.
void writeL1Payload(ValidityRange vr, const CTPConfig &ctpConfig)
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
cool::Record createMonConfigKeyPayload(cool::IFolderPtr fld, uint MCK, std::string &info)
build a COOL db record from a HLT monitoring configuration key
void writeHltPrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, const TrigConf::HLTPrescaleSet &pss)
Writing luminosityblock-wise configuration information the COOL database.
void closeDb(cool::IDatabasePtr &db)
close the COOL database
void setCut(unsigned int num, int32_t cut)
cool::Record createLvl1BGKeyPayload(cool::IFolderPtr, unsigned int lvl1BunchgroupKey)
build a COOL db record from a LVL1 bunch group key
cool::Application m_coolApp
COOL application.
def isRun2(cursor, schemaname)
static std::set< std::string > allTEsProduced(const TrigConf::HLTFrame &frame)
void readL1Payload(unsigned int run, CTPConfig &ctpc)
void setTipNumber(const uint16_t &tipnumber)
static int readSchemaVersion(cool::IDatabasePtr db)
get the version of the COOL database
HLTPrescale & setPrescale(float prescale)
static cool::IFolderPtr getLvl1ItemDefFolder(cool::IDatabasePtr db)
cool::IDatabasePtr createDb()
create a new COOL database
static std::string ChainCondenseDisplay(const HLTChain &chain, const HLTFrame &frame)
std::ostream & m_ostream
output stream for all messages
void addGroupsToHltChain(const coral::AttributeList &al, const TrigConf::HLTChainList &chl)
add the groups to and HLT chain from a AttributeList
cool::Record createLvl1BGContentPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs)
build a COOL db record from a bunch group definition value
bool checkDbConnection(bool readonly)
void setCTPVersion(unsigned int v)
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
Reading/Writing of trigger configuration data from/to COOL.
void writeHLTPayload(ValidityRange vr, const HLTFrame &hltFrame, const std::string &configSource)
const Menu & menu() const
TrigConfCoolWriter * m_writer
void setL1Version(unsigned int v)
HLTPrescale & setRerunPrescale(const std::string &targetName, float ps)
cool::Record createLvl1MenuPayload(cool::IFolderPtr, const TrigConf::TriggerItem &item)
build a COOL db record from a LVL1 TriggerItem (the item name and version)
const HLTChainList & getHLTChainList() const
const accessor to the list of HLT chains
static cool::IFolderPtr getLvl1BGContentFolder(cool::IDatabasePtr db)
std::vector< TrigConf::ThresholdMonitor * > readLvl1MonMap(const cool::IRecord &payload)
Build a LVL1 mon counter object from COOL payload.
static void printFolderStructure(cool::IDatabasePtr db, std::ostream &o)
prints the folder structure that is in the COOL database
cool::Record createLvl1InputMapPayload(cool::IFolderPtr, const TrigConf::TIP &tip)
build a COOL db record from a PIT-mapping string value
const HLTPrescaleSetCollection & getPrescaleSetCollection() const
cool::IDatabasePtr openDb(bool readOnly=true)
open COOL db connection
void readHltPrescale(const coral::AttributeList &al, float &ps, float &pt, float &rrps)
build the HLT prescale value from a COOL db record
const boost::regex rr(r_r)
HLTChainList & theHLTChainList()
accessor to the list of HLT chains
static cool::IFolderPtr getLvl1MonMapFolder(cool::IDatabasePtr db)
void printSchemaVersion(std::ostream &o)
Prints the schema in the COOL database.
static cool::IFolderPtr getLvl1ThresholdFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getHltPrescaleKeyFolder(cool::IDatabasePtr db)
const std::vector< int > & jetWeights() const
static cool::IFolderPtr getLvl1InputMapFolder(cool::IDatabasePtr db)
void readHltConfigKeys(const coral::AttributeList &al, unsigned int &masterConfigKey, unsigned int &hltPrescaleKey, std::string &configSource)
read the HLT configuration keys from a coral::AttributeList
virtual void print(const std::string &indent="", unsigned int detail=1) const
void setConfigSource(const std::string &src)
writer
show summary of content
TrigConf::TIP * readLvl1TIPMap(const coral::AttributeList &al)
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
void createSchema(int schemaVersion=0)
Create a new schema in the COOL database.
const std::string & configSource() const
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 writeL1CTPCoreInputMapping(ValidityRange vr, const Menu &lvl1Menu)