ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConf::TrigConfCoolWriter Class Reference

Reading/Writing of trigger configuration data from/to COOL. More...

#include <TrigConfCoolWriter.h>

Collaboration diagram for TrigConf::TrigConfCoolWriter:

Public Member Functions

 TrigConfCoolWriter (const std::string &dbId, std::ostream &o=std::cout)
 constructor
 ~TrigConfCoolWriter ()
 destructor
void createSchema (int schemaVersion=0)
 Create a new schema in the COOL database.
void recreateSchema (int schemaVersion=0)
 Create a new schema in the COOL database with prior deletion of the old one.
void printSchema (std::ostream &o)
 Prints the schema in the COOL database.
void printSchemaVersion (std::ostream &o)
 Prints the schema in the COOL database.
void writeL1Payload (ValidityRange vr, const CTPConfig &ctpConfig)
void writeHLTPayload (ValidityRange vr, const HLTFrame &hltFrame, const std::string &configSource)
void writeMCKPayload (ValidityRange vr, unsigned int mck, std::string &release, std::string &info)
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 writeRunPayload (const RunRangeVec &runRanges, 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)
void writeL1MenuPayload (ValidityRange vr, const TrigConf::Menu &lvl1Menu)
 Writing L1 run-wise configuration information to the COOL database.
void writeL1MenuPayload (const RunRangeVec &runRanges, const TrigConf::Menu &lvl1Menu)
void writeL1CTPCoreInputMapping (ValidityRange vr, const Menu &lvl1Menu)
void writeL1MonPayload (unsigned int runNumber, const TrigConf::Menu *lvl1Menu)
 Writing L1 run-wise monitoring configuration to COOL.
void writeL1MonPayload (const RunRangeVec &runRanges, const TrigConf::Menu *lvl1Menu)
void writeL1BunchGroupLBPayload (const RunRangeVec &runRanges, unsigned int bgKey, const BunchGroupSet &bgs)
 Writing LB-wise L1 bunch group definition to the COOL database.
void writeL1BunchGroupLBPayload (ValidityRange vr, unsigned int bgKey, const BunchGroupSet &bgs)
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 writeL1BunchGroupRunPayload (const RunRangeVec &runRanges, const TrigConf::Menu &lvl1Menu, const TrigConf::BunchGroupSet &bgs)
void writeHltPrescalePayload (unsigned int runNumber, unsigned int lumiblockNumber, const TrigConf::HLTPrescaleSet &pss)
 Writing luminosityblock-wise configuration information the COOL database.
void writeHltPrescalePayload (const RunRangeVec &runRanges, const TrigConf::HLTPrescaleSet &pss)
void writeHltPrescalePayload (cool::ValidityKey since, cool::ValidityKey until, const TrigConf::HLTPrescaleSet &pss)
void writeL1PrescalePayload (unsigned int runNumber, unsigned int lumiblockNumber, unsigned int lvl1PrescaleKey, const TrigConf::PrescaleSet &prescale)
 Writing luminosityblock-wise configuration information the COOL database.
void writeL1PrescalePayload (const RunRangeVec &runRanges, unsigned int lvl1PrescaleKey, const TrigConf::PrescaleSet &prescale)
void writeL1PrescalePayload (cool::ValidityKey since, cool::ValidityKey until, unsigned int lvl1PrescaleKey, const TrigConf::PrescaleSet &prescaleSet)
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 readHLTPayload (unsigned int run, HLTFrame &hltFrame)
void readL1Payload (unsigned int run, CTPConfig &ctpc)
void readHltPrescalePayload (unsigned int runNumber, unsigned int lumiblockNumber, TrigConf::HLTPrescaleSet &pss)
 Reading luminosityblock-wise configuration information 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.
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 readL1PrescalePayload (unsigned int runNumber, unsigned int lumiblockNumber, unsigned int &lvl1PrescaleKey, TrigConf::PrescaleSet &prescale)
 Reading luminosityblock-wise configuration information the COOL database.
void readL1InputMapPayload (unsigned int runNumber, std::vector< TrigConf::PIT * > &pits, std::vector< TrigConf::TIP * > &tips)
 Read run-wise PIT configuration from COOL database.
void readL1MonMapPayload (unsigned int runNumber, std::vector< TrigConf::ThresholdMonitor * > &mons)
 Read run-wise LVL1 monitoring configuration from COOL database.
void readL1Items (unsigned int runNumber, std::vector< TrigConf::TriggerItem * > &items)
 Read run-wise L1 item vector from COOL database.
void readL1Thresholds (unsigned int runNumber, std::vector< TrigConf::TriggerThreshold * > &thrs)
 Read run-wise L1 threshold vector from COOL database.
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 readL1Menu (unsigned int runNumber, CTPConfig &ctpc)
 Read L1 menu from COOL database.
std::vector< std::string > checkPayloadSize (unsigned int run, unsigned int lb, int displayMode, bool openend, unsigned int lbend)
void addWriteFolder (const std::string &fname)
void setVerbosityLevel (unsigned int level)
unsigned int verbosityLevel () const
bool checkDbConnection (bool readonly)
bool HLTPrescaleFolderExists ()
void clearWriteFolder ()

Private Member Functions

 TrigConfCoolWriter ()
 default constructor
 TrigConfCoolWriter (const TrigConfCoolWriter &orig)
 copy constructor
cool::IDatabaseSvc & databaseService ()
 get COOL db service
cool::IDatabasePtr openDb (bool readOnly=true)
 open COOL db connection
bool dbIsOpen ()
 check if db is open
void dropDb ()
 delete the COOL database
void closeDb (cool::IDatabasePtr &db)
 close the COOL database
void closeDb ()
cool::IDatabasePtr createDb ()
 create a new COOL database
cool::IDatabasePtr recreateDb ()
 create a new COOL database with prior deletion of the old one
void rangeInfo (const std::string &content, cool::ValidityKey since, cool::ValidityKey until)
bool shouldFolderBeUpdated (const std::string &foldername)
 check if foldername is in list of writeable folders

Private Attributes

cool::DatabaseId m_dbId
 db connection string
cool::IDatabasePtr m_dbPtr
 COOL database pointer.
cool::Application m_coolApp
 COOL application.
std::vector< std::string > m_writeFolderList
 list of folders to which writing is restricted
std::ostream & m_ostream
 output stream for all messages
int m_verbosityLevel {0}

Friends

class AutoDBOpen

Detailed Description

Reading/Writing of trigger configuration data from/to COOL.

Definition at line 95 of file TrigConfCoolWriter.h.

Constructor & Destructor Documentation

◆ TrigConfCoolWriter() [1/3]

TrigConf::TrigConfCoolWriter::TrigConfCoolWriter ( const std::string & dbId,
std::ostream & o = std::cout )
inline

constructor

Parameters
dbIddatabase connection string
ooutput stream for all messages (defaults to cout)

Definition at line 103 of file TrigConfCoolWriter.h.

103 :
104 m_dbId(cool::DatabaseId(dbId)),
106 m_ostream(o)
107 {}
std::ostream & m_ostream
output stream for all messages
std::vector< std::string > m_writeFolderList
list of folders to which writing is restricted
cool::DatabaseId m_dbId
db connection string

◆ ~TrigConfCoolWriter()

TrigConf::TrigConfCoolWriter::~TrigConfCoolWriter ( )
inline

destructor

Definition at line 110 of file TrigConfCoolWriter.h.

110{};

◆ TrigConfCoolWriter() [2/3]

TrigConf::TrigConfCoolWriter::TrigConfCoolWriter ( )
inlineprivate

default constructor

Definition at line 393 of file TrigConfCoolWriter.h.

393 :
394 m_ostream(std::cout)
395 {};

◆ TrigConfCoolWriter() [3/3]

TrigConf::TrigConfCoolWriter::TrigConfCoolWriter ( const TrigConfCoolWriter & orig)
inlineprivate

copy constructor

Definition at line 398 of file TrigConfCoolWriter.h.

398 :
399 m_ostream(orig.m_ostream)
400 {};

Member Function Documentation

◆ addWriteFolder()

void TrigConf::TrigConfCoolWriter::addWriteFolder ( const std::string & fname)
inline

Definition at line 378 of file TrigConfCoolWriter.h.

378{ m_writeFolderList.push_back( fname ); }

◆ checkDbConnection()

bool TrigConf::TrigConfCoolWriter::checkDbConnection ( bool readonly)

Definition at line 88 of file TrigConfCoolWriter.cxx.

88 {
89 if(dbIsOpen()) return true;
90 openDb( readOnly );
91 closeDb();
92 return true;
93}
bool dbIsOpen()
check if db is open
cool::IDatabasePtr openDb(bool readOnly=true)
open COOL db connection

◆ checkPayloadSize()

vector< string > TrigConf::TrigConfCoolWriter::checkPayloadSize ( unsigned int run,
unsigned int lb,
int displayMode,
bool openend,
unsigned int lbend )

Definition at line 1701 of file TrigConfCoolWriter.cxx.

1701 {
1702 AutoDBOpen db(this, READ_ONLY);
1703
1704
1705 ValidityRange vr(run);
1706
1707 if(openend) {
1708 vr = ValidityRange(run, lb);
1709 } else {
1710 ValidityKey since(run); since <<= 32; since += lb;
1711 ValidityKey until(run); until <<= 32; until += lbend+1;
1712 vr = ValidityRange(since, until);
1713 }
1714 m_ostream << "Checking for run " << run << " and lb range " << (vr.since() & 0xFFFFFFFF) << " - " << ( (vr.until()-1) & 0xFFFFFFFF) << endl
1715 << endl
1716 << " Folder Payload Size" << endl
1717 << "================================================================================" << endl;
1718
1719 vector<string> foldersToFix;
1720
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"
1736 };
1737
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);
1743
1744 bool displayFixing = false;
1745 if(displayMode==1) { // only allow fixing of folders that are empty
1746 displayFixing = (size == 0);
1747 } else if(displayMode==2) { // allow fixing of folders that are empty or mv
1748 displayFixing = (size == 0) || !isSingleVersion;
1749 }
1750
1751 string fn = folderName + (isSingleVersion ? " (sv)" : " (mv)");
1752 if(displayFixing) {
1753 m_ostream << setw(2) << foldersToFix.size()+1 << ") ";
1754 foldersToFix.push_back(folderName);
1755 } else {
1756 m_ostream << " ";
1757 }
1758 m_ostream << left << setw(40) << fn << right << setw(15) << size << " " << ( needsFixing ? "NEEDS FIX" : " OK") << endl;
1759 }
1760
1761 return foldersToFix;
1762
1763}
#define READ_ONLY
cool::IDatabasePtr m_dbPtr
COOL database pointer.
int lb
Definition globals.cxx:23
static std::vector< uint32_t > lbend
Definition iLumiCalc.h:39

◆ clearWriteFolder()

void TrigConf::TrigConfCoolWriter::clearWriteFolder ( )
inline

Definition at line 387 of file TrigConfCoolWriter.h.

387{ m_writeFolderList.clear(); }

◆ closeDb() [1/2]

void TrigConf::TrigConfCoolWriter::closeDb ( )
private

Definition at line 155 of file TrigConfCoolWriter.cxx.

155 {
156 try {
157 if(dbIsOpen()) {
158 m_ostream << "Closing database '" << m_dbId << "'" << endl;
159 m_dbPtr->closeDatabase();
160 }
161 } catch(std::exception& e) {
162 m_ostream << "*** COOL exception caught: " << e.what() << endl
163 << "Couldn't close conditions database: " << m_dbId << endl;
164 }
165}

◆ closeDb() [2/2]

void TrigConf::TrigConfCoolWriter::closeDb ( cool::IDatabasePtr & db)
private

close the COOL database

Definition at line 137 of file TrigConfCoolWriter.cxx.

137 {
138 try {
139 if(db.use_count()>0 && db->isOpen()) {
140 m_ostream << "Closing database (old way) '" << m_dbId << "'" << endl;
141 db->closeDatabase( );
142 }
143 } catch(std::exception& e) {
144 m_ostream << "*** COOL exception caught: " << e.what() << endl
145 << "Couldn't close conditions database: " << m_dbId << endl;
146 }
147 return;
148}

◆ createDb()

cool::IDatabasePtr TrigConf::TrigConfCoolWriter::createDb ( )
private

create a new COOL database

Definition at line 245 of file TrigConfCoolWriter.cxx.

245 {
246 m_ostream << "Creating database '" << m_dbId << "'" << endl;
247 try {
248 cool::IDatabaseSvc& dbSvc = databaseService();
249 m_dbPtr = dbSvc.createDatabase( m_dbId );
250 }
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;
254 throw;
255 }
256
257 return m_dbPtr;
258}
cool::IDatabaseSvc & databaseService()
get COOL db service

◆ createSchema()

void TrigConf::TrigConfCoolWriter::createSchema ( int schemaVersion = 0)

Create a new schema in the COOL database.

Definition at line 172 of file TrigConfCoolWriter.cxx.

172 {
173 bool needToOpen = !dbIsOpen();
174 if(needToOpen) {
175 try {
176 openDb(false);
177 }
178 catch(cool::DatabaseDoesNotExist& e) {
179 m_ostream << "*** : " << e.what() << endl;
180 m_ostream << "Will create a new database: " << m_dbId << endl;
181 createDb();
182 openDb(false);
183 }
184 catch(cool::Exception& e) {
185 m_ostream << "*** COOL exception caught: " << e.what() << endl;
186 m_ostream << "Coudn't create a new schema: " << m_dbId << endl;
187 throw;
188 }
189 }
190
191 try {
192 if(schemaVersion==0) schemaVersion=TrigConfCoolFolderSpec::getDefaultSchemaVersion();
193 m_ostream << "Creating schema '" << m_dbId << "' with version " << schemaVersion
194 << (schemaVersion==TrigConfCoolFolderSpec::getDefaultSchemaVersion()?" (=default)":"") << endl;
196 }
197 catch(cool::Exception& e) {
198 m_ostream << "*** COOL exception caught: " << e.what() << endl;
199 m_ostream << "Coudn't create a new schema: " << m_dbId << endl;
200 throw;
201 }
202 if(needToOpen) closeDb();
203 return;
204}
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
cool::IDatabasePtr createDb()
create a new COOL database

◆ databaseService()

cool::IDatabaseSvc & TrigConfCoolWriter::databaseService ( )
private

get COOL db service

Definition at line 81 of file TrigConfCoolWriter.cxx.

82{
83 return m_coolApp.databaseService();
84}
cool::Application m_coolApp
COOL application.

◆ dbIsOpen()

bool TrigConf::TrigConfCoolWriter::dbIsOpen ( )
private

check if db is open

Definition at line 97 of file TrigConfCoolWriter.cxx.

97 {
98 return m_dbPtr.use_count()>0 && m_dbPtr->isOpen();
99}

◆ dropDb()

void TrigConf::TrigConfCoolWriter::dropDb ( )
private

delete the COOL database

Definition at line 238 of file TrigConfCoolWriter.cxx.

238{}

◆ HLTPrescaleFolderExists()

bool TrigConf::TrigConfCoolWriter::HLTPrescaleFolderExists ( )

Definition at line 1683 of file TrigConfCoolWriter.cxx.

1683 {
1684 AutoDBOpen db(this, READ_ONLY);
1685 return m_dbPtr->existsFolder( "/TRIGGER/HLT/Prescales" );
1686}

◆ openDb()

cool::IDatabasePtr TrigConf::TrigConfCoolWriter::openDb ( bool readOnly = true)
private

open COOL db connection

Parameters
readOnlyif true the db is opened in readonly mode

Definition at line 106 of file TrigConfCoolWriter.cxx.

106 {
107 if(dbIsOpen()) return m_dbPtr;
108 cool::IDatabaseSvc& dbSvc = databaseService();
109 try {
110 m_ostream << "Opening database '" << m_dbId << "' in " << (readOnly?"read-only":"read-write") << " mode" << endl;
111 m_dbPtr = dbSvc.openDatabase( m_dbId, readOnly ); // If the database does not exist, an exception is thrown
112 // int schemaVersion = TrigConfCoolFolderSpec::readSchemaVersion(m_dbPtr);
113 // m_ostream << "Found schema with version " << schemaVersion << endl;
114 return m_dbPtr;
115 } catch(cool::DatabaseDoesNotExist& e) {
116 if(readOnly) {
117 m_ostream << "Database '" << m_dbId << "' does not exist. Can't create it since connection is read-only." << endl;
118 throw;
119 } else {
120 m_ostream << "Database '" << m_dbId << "' does not exist, will create it" << endl;
121 m_dbPtr = dbSvc.createDatabase( m_dbId );
122 m_ostream << "Created DB" << endl;
123 return m_dbPtr;
124 }
125 } catch(Exception& e) {
126 m_ostream << "*** COOL exception caught: " << e.what() << endl;
127 m_ostream << "Couldn't open database " << m_dbId << endl;
128 throw;
129 }
130}

◆ printSchema()

void TrigConf::TrigConfCoolWriter::printSchema ( std::ostream & o)

Prints the schema in the COOL database.

Parameters
ooutput stream

Definition at line 211 of file TrigConfCoolWriter.cxx.

211 {
212 AutoDBOpen db(this, READ_ONLY);
214}
static void printFolderStructure(cool::IDatabasePtr db, std::ostream &o)
prints the folder structure that is in the COOL database

◆ printSchemaVersion()

void TrigConf::TrigConfCoolWriter::printSchemaVersion ( std::ostream & o)

Prints the schema in the COOL database.

Parameters
ooutput stream

Definition at line 221 of file TrigConfCoolWriter.cxx.

221 {
222 AutoDBOpen db(this, READ_ONLY);
224 o << "Schema version is " << schemaVersion
225 << (schemaVersion==TrigConfCoolFolderSpec::getDefaultSchemaVersion()?" (=default)":"") << endl;
226}
static int readSchemaVersion(cool::IDatabasePtr db)
get the version of the COOL database

◆ rangeInfo()

void TrigConfCoolWriter::rangeInfo ( const std::string & content,
cool::ValidityKey since,
cool::ValidityKey until )
private

Definition at line 262 of file TrigConfCoolWriter.cxx.

264 {
265
266
267 if(since==ValidityKeyMin && until==ValidityKeyMax) {
268 m_ostream << "Writing " << content << " for infinite range [0,oo]" << endl;
269 return;
270 }
271
272 unsigned long long run[2];
273 unsigned long long lb[2];
274 lb[0] = since & 0xFFFFFFFF;
275 lb[1] = until & 0xFFFFFFFF;
276 run[0] = since>>32;
277 run[0] &= 0x7FFFFFFF;
278 run[1] = until>>32;
279 run[1] &= 0x7FFFFFFF;
280
281 if(lb[0]==0 && lb[1]==0) {
282 unsigned int first = run[0];
283 unsigned int last = run[1]-1;
284 if(first==last) {
285 m_ostream << "IOV Info: writing " << content << " for run " << first << endl;
286 } else {
287 m_ostream << "IOV Info: writing " << content << " for run range [" << first << "," << last << "]" << endl;
288 }
289 } else {
290 if(run[0]==run[1]) {
291 if(lb[0]==lb[1]-1)
292 m_ostream << "IOV Info: writing " << content << " for run " << run[0] << " and LB " << lb[0] << endl;
293 else
294 m_ostream << "IOV Info: writing " << content << " for run " << run[0] << " and LB range [" << lb[0] << "," << lb[1]-1 << "]" << endl;
295 } else {
296 m_ostream << "IOV Info: writing " << content << " for range [" << run[0] << "/" << lb[0] << "," << run[1] << "/" << lb[1] << "[" << endl;
297 }
298 }
299}
bool first
Definition DeMoScan.py:534
str content
Definition grepfile.py:56

◆ readHLTPayload()

void TrigConfCoolWriter::readHLTPayload ( unsigned int run,
HLTFrame & hltFrame )

Definition at line 1249 of file TrigConfCoolWriter.cxx.

1251{
1252 AutoDBOpen db(this, READ_ONLY);
1253 ValidityKey pointInTime( (ValidityKey(run)<<32) + 1);
1254
1255 // read the general chain info
1256 IFolderPtr hltMenuFolder = TrigConfCoolFolderSpec::getHltMenuFolder(m_dbPtr);
1257 IObjectIteratorPtr objects = hltMenuFolder->findObjects( pointInTime, ChannelSelection() );
1258 while ( objects->goToNext() ) {
1259 const IObject& obj = objects->currentRef();
1260 const IRecord & payload = obj.payload();
1261 HLTChain* ch = createHLTChain( payload.attributeList(), &hltFrame.theHLTSequenceList() );
1262 hltFrame.theHLTChainList().addHLTChain(ch);
1263 }
1264
1265 // read the chain groups (they are in a separate folder)
1266 IFolderPtr hltGroupFolder = TrigConfCoolFolderSpec::getHltChainGroupFolder(m_dbPtr);
1267 objects = hltGroupFolder->findObjects( pointInTime, ChannelSelection() );
1268 while ( objects->goToNext() ) {
1269 const IObject& obj = objects->currentRef();
1270 const IRecord & payload = obj.payload();
1271 addGroupsToHltChain( payload.attributeList(), hltFrame.theHLTChainList());
1272 }
1273
1274 IFolderPtr hltConfigKeyFolder = TrigConfCoolFolderSpec::getHltConfKeyFolder(m_dbPtr);
1275 try {
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 ); // the hltPrescaleKey here is not useable (it is superseeded by the multiversion one)
1281 hltFrame.setSMK(smk);
1282 hltFrame.setConfigSource(configSource);
1283 }
1284 catch(const cool::ObjectNotFound& o) {
1285 m_ostream << "<readHLTPayload> No entry found in HLT keys folder for run " << run << endl;
1286 }
1287}
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
HLTSequenceList & theHLTSequenceList()
accessor to the list of HLT sequences
Definition HLTFrame.h:45
HLTChainList & theHLTChainList()
accessor to the list of HLT chains
Definition HLTFrame.h:44
void setConfigSource(const std::string &src)
Definition HLTFrame.h:59
static cool::IFolderPtr getHltChainGroupFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getHltMenuFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getHltConfKeyFolder(cool::IDatabasePtr db)
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
HLTChain * createHLTChain(const coral::AttributeList &al, TrigConf::HLTSequenceList *sequences=0)
build an HLT chain from a COOL db record

◆ readHltPrescalePayload()

void TrigConfCoolWriter::readHltPrescalePayload ( unsigned int runNumber,
unsigned int lumiblockNumber,
TrigConf::HLTPrescaleSet & pss )

Reading luminosityblock-wise configuration information the COOL database.

Parameters
runNumberrun number
lumiblockNumberluminosity block number
pssHLT prescale configuration object

Definition at line 1115 of file TrigConfCoolWriter.cxx.

1116 {
1117
1118 AutoDBOpen db(this, READ_ONLY);
1119 ValidityRange vr(run, lb);
1120 pss.reset();
1121
1122 // read the prescale key
1123 {
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();
1129 unsigned int hltpsk = readHltPrescaleKey( payload.attributeList() );
1130 pss.setId(hltpsk);
1131 }
1132
1133 // read the prescale set
1134 {
1135 float ps, pt, rrps;
1137 cool::IFolderPtr hltpssFolder = TrigConfCoolFolderSpec::getHltPrescalesFolder(m_dbPtr);
1138 cool::IObjectIteratorPtr objects = hltpssFolder->browseObjects( vr.since(), vr.since()+1, cool::ChannelSelection());
1139 bool iovset=false;
1140 while(objects->goToNext()) {
1141 const cool::IObject& obj = objects->currentRef();
1142 if(!iovset) {
1143 pss.setIOV(obj.since(), obj.until()); // assume the IOV of the first channel is like all the others
1144 iovset=true;
1145 }
1146 const ChannelId& ch = obj.channelId();
1147 const IRecord& payload = obj.payload();
1148 readHltPrescale( payload.attributeList(), ps, pt, rrps);
1149 unsigned int counter = ch/2;
1150
1151 if (ch >=20000 ) {
1152 level=HLT;
1153 counter = ch - 20000;
1154 } else
1155 level = (ch%2==0)?L2:EF;
1156
1157 pss.thePrescale( counter, level )
1158 .setPrescale(ps)
1159 .setPassThrough(pt)
1160 .setRerunPrescale("",rrps);
1161 }
1162 }
1163}
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
HLTPrescale & thePrescale(unsigned int chain_counter, HLTLevel level)
HLTPrescale & setRerunPrescale(const std::string &targetName, float ps)
HLTPrescale & setPassThrough(float pass_through)
Definition HLTPrescale.h:47
HLTPrescale & setPrescale(float prescale)
Definition HLTPrescale.h:46
static cool::IFolderPtr getHltPrescaleKeyFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getHltPrescalesFolder(cool::IDatabasePtr db)
void setId(unsigned int id)
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

◆ readL1BunchGroupLBPayload()

void TrigConfCoolWriter::readL1BunchGroupLBPayload ( unsigned int runNumber,
unsigned int lumiblockNumber,
int & bgKey,
TrigConf::BunchGroupSet & bgs )

Reading lb-wise bunch group configuration information from COOL database.

Parameters
runNumberrun number
lumiblockNumberlb number
bgKeyHLT bunch group set configuration key
bgsthe bunchgroup set

Definition at line 1576 of file TrigConfCoolWriter.cxx.

1578{
1579 AutoDBOpen db(this, READ_ONLY);
1580 ValidityRange vr(run,lb);
1581 vr.until() = vr.since(); // single LB
1582
1583 // read the bunch group key
1584 IFolderPtr lvl1BGKeyFolder = TrigConfCoolFolderSpec::getLvl1BGKeyFolder(m_dbPtr);
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();
1589 bgKey = readLvl1BGKey( payload1.attributeList() );
1590
1591 // read the bunch group content
1592 IFolderPtr lvl1BGContentFolder = TrigConfCoolFolderSpec::getLvl1BGContentFolder(m_dbPtr);
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();
1597 vector<BunchGroup> bgV = readLvl1BGContent( payload2.attributeList() );
1598
1599 // read the bunch group names
1600 pair< vector<string>, map<unsigned int,unsigned char> > bg_pair = readL1BunchGroupRunPayload(run);
1601 vector<string> names = bg_pair.first;
1602
1603
1604
1605 uint newBGSSize = bgV.size() <= names.size() ? bgV.size() : names.size();
1606
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;
1611
1612 }
1613
1614 // create a new bunch group set, set names and bunch groups
1615 bgs = BunchGroupSet();
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);
1621 bgs.addBunchGroup(bgV[i]);
1622 }
1623 bgs.setId(bgKey);
1624}
unsigned int uint
void addBunchGroup(const BunchGroup &)
static cool::IFolderPtr getLvl1BGContentFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1BGKeyFolder(cool::IDatabasePtr db)
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::vector< TrigConf::BunchGroup > readLvl1BGContent(const coral::AttributeList &al)
build the LVL1 Bunchgroup code
int readLvl1BGKey(const coral::AttributeList &al)
build the LVL1 Bunchgroup key value

◆ readL1BunchGroupRunPayload()

pair< vector< string >, map< unsigned int, unsigned char > > TrigConf::TrigConfCoolWriter::readL1BunchGroupRunPayload ( unsigned int runNumber)

Reading bunch group configuration information from COOL database.

Parameters
runNumberrun number
lumiblockNumberlb number
bgKeyHLT bunch group set configuration key
bgsthe bunchgroup set

Definition at line 1554 of file TrigConfCoolWriter.cxx.

1555{
1556 AutoDBOpen db(this, READ_ONLY);
1557 ValidityRange vr(run);
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();
1563 return readLvl1BGDesc( payload.attributeList() );
1564}
static cool::IFolderPtr getLvl1BGDescFolder(cool::IDatabasePtr db)
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

◆ readL1InputMapPayload()

void TrigConfCoolWriter::readL1InputMapPayload ( unsigned int runNumber,
std::vector< TrigConf::PIT * > & pits,
std::vector< TrigConf::TIP * > & tips )

Read run-wise PIT configuration from COOL database.

Parameters
runNumberrun number
pitsVector of PIT object to be filled

Definition at line 1316 of file TrigConfCoolWriter.cxx.

1319{
1320 AutoDBOpen db(this, READ_ONLY);
1321 ValidityRange vr(run, 1);
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();
1331 PIT* pit = readLvl1InputMap( payload.attributeList() );
1332 TIP* tip = readLvl1TIPMap( payload.attributeList() );
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!");
1337 } else {
1338 if(foundTip[tipNumber]) {
1339 stringstream str;
1340 str << "TIP '" << tipNumber << "' had already been read!";
1341 throw runtime_error(str.str());
1342 }
1343 foundTip[tipNumber] = true;
1344 pit->setPitNumber(tipNumber);
1345 tip->setTipNumber(tipNumber);
1346 tip->setClock(tipNumber%2);
1347 pits.push_back(pit);
1348 tips.push_back(tip);
1349 }
1350 }
1351 }
1352}
void setPitNumber(const uint16_t &pitnumber)
Definition PIT.h:30
void setTipNumber(const uint16_t &tipnumber)
Definition TIP.h:30
void setClock(const int &clock)
Definition TIP.h:54
static cool::IFolderPtr getLvl1InputMapFolder(cool::IDatabasePtr db)
TrigConf::PIT * readLvl1InputMap(const coral::AttributeList &al)
Build a LVL1 PIT object from COOL payload.
TrigConf::TIP * readLvl1TIPMap(const coral::AttributeList &al)
setWord1 uint16_t

◆ readL1ItemDef()

void TrigConfCoolWriter::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.

Parameters
runNumberrun number
itemsVector of Item object to be updated
thrsVector of Thresholds from which some are added to the item

Definition at line 1449 of file TrigConfCoolWriter.cxx.

1452{
1453 AutoDBOpen db(this, READ_ONLY);
1454 ValidityRange vr(run, 1);
1455
1456 IFolderPtr L1ItemDefFolder = TrigConfCoolFolderSpec::getLvl1ItemDefFolder(m_dbPtr);
1457 for(TriggerItem* item: items) {
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();
1463 addThresholdsToTriggerItem( payload.attributeList(), item, thrs);
1464 }
1465 }
1466}
static cool::IFolderPtr getLvl1ItemDefFolder(cool::IDatabasePtr db)
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

◆ readL1Items()

void TrigConfCoolWriter::readL1Items ( unsigned int runNumber,
std::vector< TrigConf::TriggerItem * > & items )

Read run-wise L1 item vector from COOL database.

Parameters
runNumberrun number
itemsVector of Item object to be filled

Definition at line 1395 of file TrigConfCoolWriter.cxx.

1397{
1398 AutoDBOpen db(this, READ_ONLY);
1399 ValidityRange vr(run, 1);
1400
1401 IObjectIteratorPtr objects;
1403 vector<bool> foundItem(512,false);
1404
1405 //for(ChannelId channel = 0; channel < 512; ++channel) {
1406 objects = folder->browseObjects( vr.since(), vr.until()-1,cool::ChannelSelection());
1407 //if(objects->size()==0) continue;
1408 while ( objects->goToNext() ) {
1409 const cool::IObject& obj = objects->currentRef();
1410 const cool::IRecord & payload = obj.payload();
1411 TriggerItem* item = createLvl1TriggerItem( payload.attributeList() );
1412 uint32_t ctpId = obj.channelId();
1413 if(ctpId > 511) {
1414 m_ostream << "Item ctpid " << ctpId << " out of bounds!" << endl;
1415 throw runtime_error("Item ctpid ouf ot bounds!");
1416 } else {
1417 if(foundItem[ctpId]) {
1418 stringstream str;
1419 str << "Item '" << ctpId << "' had already been read!";
1420 throw runtime_error(str.str());
1421 }
1422 foundItem[ctpId] = true;
1423 item->setCtpId(ctpId);
1424 items.push_back(item);
1425 }
1426 }
1427 // }
1428
1429}
static cool::IFolderPtr getLvl1MenuFolder(cool::IDatabasePtr db)
TriggerItem * createLvl1TriggerItem(const coral::AttributeList &al)
build a LVL1 TriggerItem from a COOL db record
setEventNumber uint32_t

◆ readL1Menu()

void TrigConfCoolWriter::readL1Menu ( unsigned int runNumber,
CTPConfig & ctpc )

Read L1 menu from COOL database.

Parameters
runNumberrun number
Returns
L1 Menu pointer

a unpleasant hack so we can figure out if this Run1 (CTPVersion 3) or Run2 (CTPVersion 4)

we use the fact that in Run2 the cable names were different

Definition at line 1470 of file TrigConfCoolWriter.cxx.

1471{
1472 AutoDBOpen db(this, READ_ONLY);
1473
1474 Menu & menu = ctpc.menu();
1475
1476 // thresholds
1477 vector<TriggerThreshold*> thrs;
1478 readL1Thresholds(run, thrs);
1479
1485 bool isRun2 = false;
1486 for(TriggerThreshold* thr : thrs) {
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") {
1491 isRun2 = true;
1492 break;
1493 }
1494 }
1495 ctpc.setCTPVersion(isRun2 ? 4 : 3);
1496 ctpc.setL1Version(isRun2 ? 1 : 0);
1498 cout << "TrigConfCoolWriter::readL1Menu for run " << run << ". Determined format " << (isRun2 ? "Run 2" : "Run 1") << endl;
1499
1500 // items
1501 vector<TriggerItem*> items;
1502 readL1Items(run, items);
1503 for(TriggerItem* item: items)
1504 menu.addTriggerItem(item);
1505
1506
1507 readL1ItemDef(run, items, thrs);
1508
1509 CaloInfo ci;
1510
1511 for(TriggerThreshold* thr: thrs) {
1512
1513 if ( thr->name()=="JetWeights" ) {
1514 if(!isRun2) {
1515 for ( const string& weights : split( thr->cableName(),",") )
1516 ci.addJetWeight( std::stoi(weights) );
1517 }
1518 }
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]);
1527 ci.metSigParam().setValues( XSSigmaScale, XSSigmaOffset,
1528 XEmin, XEmax, TESqrtMin, TESqrtMax);
1529 }
1530 else {
1531 // trigger thresholds sorted by type
1532 menu.thresholdConfig().addTriggerThreshold(thr);
1533 }
1534 }
1535 menu.setCaloInfo(ci);
1536
1537 // PITs (run1), TIPs (run2)
1538 vector<PIT*> pits;
1539 vector<TIP*> tips;
1540 readL1InputMapPayload(run, pits, tips);
1541 for ( PIT* pit : pits) {
1542 if(pit->ctpinSlot()==10) continue;
1543 menu.addPit(pit);
1544 }
1545 for ( TIP* tip : tips) {
1546 // cout << tip->tipNumber() << " : thr = " << tip->thresholdName() << ", slot = " << tip->slot() << ", conn = " << tip->connector() << ", thrBit = "
1547 // << tip->thresholdBit() << ", cableBit = " << tip->cableBit() << endl;
1548 menu.addTip(tip);
1549 }
1550}
unsigned int l1Version() const
Definition CTPConfig.h:34
const Menu & menu() const
Definition CTPConfig.h:38
void setL1Version(unsigned int v)
Definition CTPConfig.cxx:39
void setCTPVersion(unsigned int v)
Definition CTPConfig.cxx:33
METSigParam & metSigParam()
Definition CaloInfo.h:50
void addJetWeight(int)
Definition CaloInfo.cxx:29
static void setMaxThresholdsFromL1Version(unsigned int l1version)
Definition L1DataDef.cxx:65
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.
void readL1InputMapPayload(unsigned int runNumber, std::vector< TrigConf::PIT * > &pits, std::vector< TrigConf::TIP * > &tips)
Read run-wise PIT configuration from COOL database.
void readL1Items(unsigned int runNumber, std::vector< TrigConf::TriggerItem * > &items)
Read run-wise L1 item vector from COOL database.
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 > split(const std::string &line, const std::string &del=" ")

◆ readL1MonMapPayload()

void TrigConfCoolWriter::readL1MonMapPayload ( unsigned int runNumber,
std::vector< TrigConf::ThresholdMonitor * > & mons )

Read run-wise LVL1 monitoring configuration from COOL database.

Parameters
runNumberrun number
monsVector of mon counter objects to be filled

Definition at line 1355 of file TrigConfCoolWriter.cxx.

1357{
1358 AutoDBOpen db(this, READ_ONLY);
1359 ValidityRange vr(run, 1);
1360
1361 IObjectIteratorPtr objects;
1363 vector<bool> foundCounter(768,false);
1364
1365 for(ChannelId channel = 0; channel < 768; ++channel) {
1366
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();
1372 vector<ThresholdMonitor*> counters = readLvl1MonMap( 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!");
1377 } else {
1378 if(foundCounter[counterNumber]) {
1379 stringstream str;
1380 str << "MonCounter '" << counterNumber << "' had already been read!";
1381 throw runtime_error(str.str());
1382 }
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] );
1387 }
1388 }
1389 }
1390 ++channel;
1391 }
1392}
static cool::IFolderPtr getLvl1MonMapFolder(cool::IDatabasePtr db)
std::vector< TrigConf::ThresholdMonitor * > readLvl1MonMap(const cool::IRecord &payload)
Build a LVL1 mon counter object from COOL payload.

◆ readL1Payload()

void TrigConfCoolWriter::readL1Payload ( unsigned int run,
CTPConfig & ctpc )

Setting the ctpVersion based on the run number does not work for MC

Definition at line 1303 of file TrigConfCoolWriter.cxx.

1305{
1306
1311
1312 readL1Menu( run, ctpc );
1313}
void readL1Menu(unsigned int runNumber, CTPConfig &ctpc)
Read L1 menu from COOL database.

◆ readL1PrescalePayload()

void TrigConfCoolWriter::readL1PrescalePayload ( unsigned int runNumber,
unsigned int lumiblockNumber,
unsigned int & lvl1PrescaleKey,
TrigConf::PrescaleSet & prescale )

Reading luminosityblock-wise configuration information the COOL database.

Parameters
runNumberrun number
lumiblockNumberluminosity block number
lvl1PrescaleKeyL1 prescale configuration key
prescaleL1 prescale configuration object

Definition at line 1636 of file TrigConfCoolWriter.cxx.

1639{
1640 AutoDBOpen db(this, READ_ONLY);
1641 ValidityRange vr(run,lb);
1642 vr.until() = vr.since()+1; // single LB
1643
1644 IFolderPtr lvl1CkFolder = TrigConfCoolFolderSpec::getLvl1ConfKeyFolder(m_dbPtr);
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();
1649 readLvl1ConfigKey( payload.attributeList(), lvl1PrescaleKey );
1650
1651
1652 cool::IFolderPtr lvl1PsFolder = TrigConfCoolFolderSpec::getLvl1PrescalesFolder(m_dbPtr);
1653
1654 // resize the vector to the correct size
1655 size_t nPrescales = lvl1PsFolder->listChannels().size();
1656 bool isRun2 = ( nPrescales == 512 );
1657 prescale.resize( nPrescales );
1658
1659 for(cool::ChannelId channel = 0; channel < nPrescales; channel++) {
1660
1661 objects = lvl1PsFolder->browseObjects( vr.since(), vr.until(), channel );
1662
1663 if(objects->size()!=1) {
1664 throw std::runtime_error("Lvl1 prescale access error: found empty prescale channel ");
1665 }
1666
1667 objects->goToNext();
1668 const IObject& obj = objects->currentRef();
1669 const IRecord & payload = obj.payload();
1670 int64_t prescaleVal=0;
1671 readLvl1Prescale( payload.attributeList(), prescaleVal );
1672 if( isRun2 ) {
1673 prescale.setCut( channel, prescaleVal );
1674 } else {
1675 prescale.setPrescale( channel, (float)prescaleVal );
1676 }
1677 }
1678 prescale.setId( lvl1PrescaleKey );
1679}
void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__((deprecated))
Set the prescale NUM from the int64 value prescaleValue.
void setCut(unsigned int num, int32_t cut)
void resize(size_t size)
static cool::IFolderPtr getLvl1ConfKeyFolder(cool::IDatabasePtr db)
static cool::IFolderPtr getLvl1PrescalesFolder(cool::IDatabasePtr db)
void readLvl1Prescale(const coral::AttributeList &al, int &ps)
build the LVL1 prescale value from a coral::AttributeList
void readLvl1ConfigKey(const coral::AttributeList &al, unsigned int &lvl1PrescaleKey)
build the LVL1 configuration key from a coral::AttributeList

◆ readL1Thresholds()

void TrigConfCoolWriter::readL1Thresholds ( unsigned int runNumber,
std::vector< TrigConf::TriggerThreshold * > & thrs )

Read run-wise L1 threshold vector from COOL database.

Parameters
runNumberrun number
itemsVector of Item object to be filled

Definition at line 1433 of file TrigConfCoolWriter.cxx.

1434 {
1435 AutoDBOpen db(this, READ_ONLY);
1436 ValidityRange vr(run, 1);
1437 thrs.clear();
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();
1443 thrs.push_back( createLvl1Threshold( payload.attributeList() ) );
1444 }
1445}
static cool::IFolderPtr getLvl1ThresholdFolder(cool::IDatabasePtr db)
TriggerThreshold * createLvl1Threshold(const coral::AttributeList &al)
build a LVL1 TriggerThreshold from a COOL db record

◆ readRunPayload()

void TrigConfCoolWriter::readRunPayload ( unsigned int runNumber,
TrigConf::HLTFrame & hltFrame,
unsigned int & masterConfigKey,
unsigned int & hltPrescaleKey,
std::string & configSource )

Reading run-wise configuration information from COOL database.

Parameters
runNumberrun number
hltFrameHLT menu configuration object
masterConfigKeyconfiguration super master key
hltPrescaleKeyHLT prescale configuration key
configSourceconfiguration source (DB connection string or XML file name(s))

Definition at line 1290 of file TrigConfCoolWriter.cxx.

1295{
1296 readHLTPayload( run, hltFrame);
1297 masterConfigKey = hltFrame.smk();
1298 configSource = hltFrame.configSource();
1299}
const std::string & configSource() const
Definition HLTFrame.h:54
void readHLTPayload(unsigned int run, HLTFrame &hltFrame)
unsigned int smk() const

◆ recreateDb()

cool::IDatabasePtr TrigConf::TrigConfCoolWriter::recreateDb ( )
private

create a new COOL database with prior deletion of the old one

◆ recreateSchema()

void TrigConf::TrigConfCoolWriter::recreateSchema ( int schemaVersion = 0)

Create a new schema in the COOL database with prior deletion of the old one.

Definition at line 232 of file TrigConfCoolWriter.cxx.

232{}

◆ setVerbosityLevel()

void TrigConf::TrigConfCoolWriter::setVerbosityLevel ( unsigned int level)
inline

◆ shouldFolderBeUpdated()

bool TrigConf::TrigConfCoolWriter::shouldFolderBeUpdated ( const std::string & foldername)
inlineprivate

check if foldername is in list of writeable folders

Definition at line 432 of file TrigConfCoolWriter.h.

432 {
433 if( m_writeFolderList.size()==0 ) return true; // nothing specified --> write everything (default)
434 return std::count(m_writeFolderList.begin(),m_writeFolderList.end(),foldername)>0;
435 }

◆ verbosityLevel()

unsigned int TrigConf::TrigConfCoolWriter::verbosityLevel ( ) const
inline

Definition at line 381 of file TrigConfCoolWriter.h.

381{ return m_verbosityLevel; }

◆ writeHLTPayload()

void TrigConf::TrigConfCoolWriter::writeHLTPayload ( ValidityRange vr,
const HLTFrame & hltFrame,
const std::string & configSource )

Definition at line 323 of file TrigConfCoolWriter.cxx.

326{
327 AutoDBOpen db(this, READ_WRITE);
329
330 // writing configuration keys
331 if( shouldFolderBeUpdated("/TRIGGER/HLT/HltConfigKeys") ) {
332 rangeInfo("HLT configuration keys", vr.since(), vr.until());
333 try {
334 IFolderPtr confkeyFolder = TrigConfCoolFolderSpec::getHltConfKeyFolder(m_dbPtr);
335 Record payload = createHltConfigKeysPayload(confkeyFolder, hltFrame.smk(), 0, configSource);
336 confkeyFolder->storeObject(vr.since(), vr.until(), payload, 0);
337 }
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;
341 throw;
342 }
343 }
344
345 if(!hltFrame.getPrescaleSetCollection().sets().empty()) {
346 // we only support one prescale set at a time here
347 const HLTPrescaleSet& pss = *hltFrame.getPrescaleSetCollection().sets().front().pss;
348 writeHltPrescalePayload(vr.since(), vr.until(), pss);
349 }
350
351 if( shouldFolderBeUpdated("/TRIGGER/HLT/Menu") ||
352 shouldFolderBeUpdated("/TRIGGER/HLT/Groups") ) {
353 if( hltFrame.getHLTChainList().size() > 0 ) {
354
355 rangeInfo("HLT menu", vr.since(), vr.until());
356
357 // this call is needed to set the level of each sequence
359
360 // writing the chains of the HLT menu
361 try {
362
363 ChannelId menuChannel(0);
364 IFolderPtr hltMenuFolder = TrigConfCoolFolderSpec::getHltMenuFolder(m_dbPtr);
365 IFolderPtr hltGroupFolder = TrigConfCoolFolderSpec::getHltChainGroupFolder(m_dbPtr);
366 // use buffer to speed up COOL writing
367 hltMenuFolder->setupStorageBuffer();
368 hltGroupFolder->setupStorageBuffer();
369
370 for ( const HLTChain* chain : hltFrame.getHLTChainList() ) {
371 menuChannel++;
372 string concise = HLTTEUtils::ChainCondenseDisplay( *chain, hltFrame);
373 Record payload = createHltMenuPayload( hltMenuFolder, *chain, concise );
374 hltMenuFolder->storeObject(vr.since(), vr.until(), payload, menuChannel);
375
376 Record payloadGroups = TrigConfCoolHLTPayloadConverters::createHltChainGroupPayload(hltGroupFolder, *chain );
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;
383 }
384 if( shouldFolderBeUpdated("/TRIGGER/HLT/Menu") ) {
385 m_ostream << "Flushing HLT menu buffer to /TRIGGER/HLT/Menu" << endl;
386 try {
387 hltMenuFolder->flushStorageBuffer();
388 }
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;
392 }
393 }
394 if( shouldFolderBeUpdated("/TRIGGER/HLT/Groups") ) {
395 m_ostream << "Flushing HLT group buffer to /TRIGGER/HLT/Groups" << endl;
396 try {
397 hltGroupFolder->flushStorageBuffer();
398 }
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;
402 }
403 }
404 }
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;
408 throw;
409 }
410 catch(std::exception & e) {
411 m_ostream << "<writeHLTPayload> Caught std::exception: " << e.what() << endl;
412 throw;
413 }
414 } else {
415 m_ostream << "List of HLT Chains is empty, nothing is written to COOL" << endl;
416 }
417 }
418}
#define READ_WRITE
const HLTPrescaleSetCollection & getPrescaleSetCollection() const
Definition HLTFrame.h:51
const HLTChainList & getHLTChainList() const
const accessor to the list of HLT chains
Definition HLTFrame.h:49
static std::set< std::string > allTEsProduced(const TrigConf::HLTFrame &frame)
static std::string ChainCondenseDisplay(const HLTChain &chain, const HLTFrame &frame)
void writeHltPrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, const TrigConf::HLTPrescaleSet &pss)
Writing luminosityblock-wise configuration information the COOL database.
bool shouldFolderBeUpdated(const std::string &foldername)
check if foldername is in list of writeable folders
void rangeInfo(const std::string &content, cool::ValidityKey since, cool::ValidityKey until)
cool::Record createHltChainGroupPayload(cool::IFolderPtr, const TrigConf::HLTChain &ch)
build a COOL db record from a HLT chain
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 createHltMenuPayload(cool::IFolderPtr, const TrigConf::HLTChain &, const std::string &concise)
build a COOL db record from a HLT chain

◆ writeHltPrescalePayload() [1/3]

void TrigConfCoolWriter::writeHltPrescalePayload ( const RunRangeVec & runRanges,
const TrigConf::HLTPrescaleSet & pss )

Definition at line 1024 of file TrigConfCoolWriter.cxx.

1026{
1027 AutoDBOpen db(this, READ_WRITE);
1029 for ( RunRange rr : runRanges) {
1030 ValidityRange vr(rr);
1031 writeHltPrescalePayload( vr.since(), vr.until(), pss);
1032 }
1033}
const boost::regex rr(r_r)
std::pair< unsigned int, unsigned int > RunRange

◆ writeHltPrescalePayload() [2/3]

void TrigConf::TrigConfCoolWriter::writeHltPrescalePayload ( cool::ValidityKey since,
cool::ValidityKey until,
const TrigConf::HLTPrescaleSet & pss )

◆ writeHltPrescalePayload() [3/3]

void TrigConfCoolWriter::writeHltPrescalePayload ( unsigned int runNumber,
unsigned int lumiblockNumber,
const TrigConf::HLTPrescaleSet & pss )

Writing luminosityblock-wise configuration information the COOL database.

Parameters
runNumberrun number
lumiblockNumberluminosity block number
hltPrescaleKeyHLT prescale configuration key
prescaleHLT prescale configuration object

Definition at line 1037 of file TrigConfCoolWriter.cxx.

1039{
1040 AutoDBOpen db(this, READ_WRITE);
1042 ValidityRange vr(run, lb);
1043 writeHltPrescalePayload( vr.since(), vr.until(), pss);
1044}

◆ writeL1BunchGroupLBPayload() [1/2]

void TrigConf::TrigConfCoolWriter::writeL1BunchGroupLBPayload ( const RunRangeVec & runRanges,
unsigned int bgKey,
const BunchGroupSet & bgs )

Writing LB-wise L1 bunch group definition to the COOL database.

Parameters
runNumberrun number
bgsBunchGroup set

Definition at line 976 of file TrigConfCoolWriter.cxx.

979{
980 AutoDBOpen db(this, READ_WRITE);
981 for ( RunRange rr : runRanges) {
982 ValidityRange vr(rr);
983 writeL1BunchGroupLBPayload( rr, bgKey, bgs);
984 }
985}
void writeL1BunchGroupLBPayload(const RunRangeVec &runRanges, unsigned int bgKey, const BunchGroupSet &bgs)
Writing LB-wise L1 bunch group definition to the COOL database.

◆ writeL1BunchGroupLBPayload() [2/2]

void TrigConf::TrigConfCoolWriter::writeL1BunchGroupLBPayload ( ValidityRange vr,
unsigned int bgKey,
const BunchGroupSet & bgs )

Definition at line 988 of file TrigConfCoolWriter.cxx.

991{
992 AutoDBOpen db(this, READ_WRITE);
994 try {
995 if( shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupKey") ) {
996 rangeInfo("LVL1 bunchgroup key", vr.since(), vr.until());
997 IFolderPtr lvl1BGKFolder = TrigConfCoolFolderSpec::getLvl1BGKeyFolder(m_dbPtr);
998 Record payload = createLvl1BGKeyPayload(lvl1BGKFolder, bgKey);
999 m_ostream << "Store LVL1 BG key to /TRIGGER/LVL1/BunchGroupKey" << endl;
1000 lvl1BGKFolder->storeObject(vr.since(), vr.until(), payload, 0);
1001 }
1002
1003 if( shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupContent") ) {
1004 rangeInfo("LVL1 bunchgroups", vr.since(), vr.until());
1005 IFolderPtr lvl1BGContentFolder = TrigConfCoolFolderSpec::getLvl1BGContentFolder(m_dbPtr);
1006 Record payload = createLvl1BGContentPayload(lvl1BGContentFolder, bgs);
1007 m_ostream << "Store LVL1 BG content to /TRIGGER/LVL1/BunchGroupContent" << endl;
1008 lvl1BGContentFolder->storeObject(vr.since(), vr.until(), payload, 0);
1009 }
1010 }
1011 catch(exception & e) {
1012 m_ostream << "<writeLVL1BGPayload> caugh and re-throw exception: " << e.what() << endl;
1013 throw;
1014 }
1015}
cool::Record createLvl1BGKeyPayload(cool::IFolderPtr, unsigned int lvl1BunchgroupKey)
build a COOL db record from a LVL1 bunch group key
cool::Record createLvl1BGContentPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs)
build a COOL db record from a bunch group definition value

◆ writeL1BunchGroupRunPayload() [1/2]

void TrigConf::TrigConfCoolWriter::writeL1BunchGroupRunPayload ( const RunRangeVec & runRanges,
const TrigConf::Menu & lvl1Menu,
const TrigConf::BunchGroupSet & bgs )

Definition at line 964 of file TrigConfCoolWriter.cxx.

967{
968 AutoDBOpen db(this, READ_WRITE);
970 for ( RunRange rr : runRanges)
971 writeL1BunchGroupRunPayload( rr, lvl1Menu, bgs);
972}
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.

◆ writeL1BunchGroupRunPayload() [2/2]

void TrigConf::TrigConfCoolWriter::writeL1BunchGroupRunPayload ( ValidityRange vr,
const Menu & lvl1Menu,
const BunchGroupSet & bgs )

Writing run-wise L1 bunch group names and item to bunch group mapping to COOL.

Parameters
runNumberrun number
lvl1MenuL1 Menu
bgsBunchGroup set

Definition at line 942 of file TrigConfCoolWriter.cxx.

945{
946 if( !shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupDescription") ) return;
947 AutoDBOpen db(this, READ_WRITE);
949 rangeInfo("LVL1 bunch group descriptions", vr.since(), vr.until());
950 try {
951 IFolderPtr bgDescFolder = TrigConfCoolFolderSpec::getLvl1BGDescFolder(m_dbPtr);
952 Record payload = createLvl1BGDescPayload(bgDescFolder, bgs,lvl1Menu);
953 m_ostream << "Store LVL1 BG description buffer to /TRIGGER/LVL1/BunchGroupDescription" << endl;
954 bgDescFolder->storeObject(vr.since(), vr.until(), payload, 0);
955 }
956 catch(exception & e) {
957 m_ostream << "<writeL1BunchGroupRunPayload> caught and re-throw exception: " << e.what() << endl;
958 throw;
959 }
960}
cool::Record createLvl1BGDescPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs, const TrigConf::Menu &lvl1Menu)
build a COOL db record from a bunch group description

◆ writeL1CTPCoreInputMapping()

void TrigConf::TrigConfCoolWriter::writeL1CTPCoreInputMapping ( ValidityRange vr,
const Menu & lvl1Menu )

Definition at line 891 of file TrigConfCoolWriter.cxx.

893{
894 if( ! shouldFolderBeUpdated("/TRIGGER/LVL1/CTPCoreInputMapping") )
895 return;
896
897 AutoDBOpen db(this, READ_WRITE);
898
899 // now write PIT mapping
900 try {
901
902 cool::IFolderPtr tipFolder = TrigConfCoolFolderSpec::getLvl1InputMapFolder(m_dbPtr);
903 tipFolder->setupStorageBuffer();
904
905 for ( const TIP * tip : lvl1Menu.tipVector() ) {
906
907 cool::ChannelId tipNum = static_cast<cool::ChannelId>(tip->tipNumber());
908
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;
918
920 tipFolder->storeObject(vr.since(), vr.until(), payload, tipNum);
921 }
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;
927 throw;
928 } catch( exception & e) {
929 m_ostream << "<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
930 throw;
931 }
932}
const std::vector< TIP * > & tipVector() const
Definition Menu.h:71
cool::Record createLvl1InputMapPayload(cool::IFolderPtr, const TrigConf::TIP &tip)
build a COOL db record from a PIT-mapping string value

◆ writeL1MenuPayload() [1/2]

void TrigConf::TrigConfCoolWriter::writeL1MenuPayload ( const RunRangeVec & runRanges,
const TrigConf::Menu & lvl1Menu )

Definition at line 876 of file TrigConfCoolWriter.cxx.

878{
879 AutoDBOpen db(this, READ_WRITE);
880 for ( RunRange rr : runRanges)
881 writeL1MenuPayload( rr, lvl1Menu );
882}
void writeL1MenuPayload(ValidityRange vr, const TrigConf::Menu &lvl1Menu)
Writing L1 run-wise configuration information to the COOL database.

◆ writeL1MenuPayload() [2/2]

void TrigConf::TrigConfCoolWriter::writeL1MenuPayload ( ValidityRange vr,
const TrigConf::Menu & lvl1Menu )

Writing L1 run-wise configuration information to the COOL database.

Parameters
runNumberrun number
lvl1MenuL1 Menu

Definition at line 743 of file TrigConfCoolWriter.cxx.

745{
746 AutoDBOpen db(this, READ_WRITE);
748
749 // writing the Lvl1 menu
750 try {
751 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Thresholds") &&
752 lvl1Menu.thresholdConfig().thresholdVector().size()>0 ) { // if there are no thresholds we don't want to write anything (METsig, JETWeights)
753 // get the folders for the menu, itemDef, and thresholds
754 cool::IFolderPtr lvl1ThresholdFolder = TrigConfCoolFolderSpec::getLvl1ThresholdFolder(m_dbPtr);
755
756 rangeInfo("LVL1 thresholds", vr.since(), vr.until());
757 // first, parse the threshold list and write to threshold folder
758 const std::vector<TrigConf::TriggerThreshold*> & lvl1Thrs = lvl1Menu.thresholdConfig().thresholdVector();
759 // use buffer to speed up COOL writing
760
761 lvl1ThresholdFolder->setupStorageBuffer();
762
763 // go through the thresholds, channels assigned in the order (0..#thr-1)
764 cool::ChannelId thrChannel = 0;
765 for (TrigConf::TriggerThreshold* thr : lvl1Thrs) {
766 Record payloadThr = TrigConfCoolL1PayloadConverters::createLvl1ThresholdPayload( lvl1ThresholdFolder, *thr );
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++);
771 }
772
773
774 // TODO
775 if( lvl1Menu.thresholdConfig().l1Version() == 0 ) {
776 m_ostream << "Writing (to buffer) LVL1 threshold 'JetWeights':";
777 const std::vector<int>& jetweights = lvl1Menu.caloInfo().jetWeights();
778 std::copy(jetweights.begin(), jetweights.end(), std::ostream_iterator<int>(m_ostream, ", "));
779 m_ostream << endl;
780 Record payloadJW = TrigConfCoolL1PayloadConverters::createLvl1JetWeightPayload( lvl1ThresholdFolder, lvl1Menu.caloInfo().jetWeights() );
781 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadJW, thrChannel++);
782 }
783
784 m_ostream << "Writing (to buffer) LVL1 threshold 'MET Significance parameters':";
785 lvl1Menu.caloInfo().metSigParam().print();
786 cool::Record payloadMETSigParams = TrigConfCoolL1PayloadConverters::createLvl1METSigPayload( lvl1ThresholdFolder, lvl1Menu.caloInfo().metSigParam() );
787 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadMETSigParams, thrChannel++);
788
789 // write
790 m_ostream << "Flushing LVL1 thresholds buffer to /TRIGGER/LVL1/Thresholds" << endl;
791 try {
792 lvl1ThresholdFolder->flushStorageBuffer();
793 }
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;
797 }
798 }
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;
802 throw;
803 } catch(std::exception & e) {
804 m_ostream << "<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
805 throw;
806 }
807
808
809 try {
810
811 // second, parse the items and write to menu and itemDef folders
812 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Menu") ||
813 shouldFolderBeUpdated("/TRIGGER/LVL1/ItemDef") ) {
814
815 rangeInfo("LVL1 menu", vr.since(), vr.until());
816
817 cool::IFolderPtr lvl1MenuFolder = TrigConfCoolFolderSpec::getLvl1MenuFolder(m_dbPtr);
818 cool::IFolderPtr lvl1ItemDefFolder = TrigConfCoolFolderSpec::getLvl1ItemDefFolder(m_dbPtr);
819
820 // use buffer to speed up COOL writing
821 lvl1MenuFolder->setupStorageBuffer();
822 lvl1ItemDefFolder->setupStorageBuffer();
823 // go through the items
824 for ( TriggerItem* item : lvl1Menu.items()) {
825 cool::Record payloadMenu = TrigConfCoolL1PayloadConverters::createLvl1MenuPayload( lvl1MenuFolder, *item );
826 cool::Record payloadItemDef = TrigConfCoolL1PayloadConverters::createLvl1ItemDefPayload( lvl1ItemDefFolder, *item );
827 cool::ChannelId menuChannel = static_cast<cool::ChannelId>(item->ctpId()); // int -> uint32
828 m_ostream << "Writing (to buffer) LVL1 item " << item->name()
829 << " (logic " << payloadItemDef["Logic"].data<cool::String255>()
830 << ": [" << payloadItemDef["ConditionsList"].data<cool::String4k>() << "]) to channel "
831 << menuChannel << endl;
832 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Menu") )
833 lvl1MenuFolder->storeObject(vr.since(), vr.until(), payloadMenu, menuChannel);
834
835 if( shouldFolderBeUpdated("/TRIGGER/LVL1/ItemDef") )
836 lvl1ItemDefFolder->storeObject(vr.since(), vr.until(), payloadItemDef, menuChannel);
837 }
838 // write
839 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Menu") ) {
840 m_ostream << "Flushing LVL1 menu buffer to /TRIGGER/LVL1/Menu" << endl;
841 try {
842 lvl1MenuFolder->flushStorageBuffer();
843 }
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;
847 }
848 }
849 if( shouldFolderBeUpdated("/TRIGGER/LVL1/ItemDef") ) {
850 m_ostream << "Flushing LVL1 item buffer to /TRIGGER/LVL1/ItemDef" << endl;
851 try {
852 lvl1ItemDefFolder->flushStorageBuffer();
853 }
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;
857 }
858 }
859 }
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;
863 throw;
864 } catch(std::exception & e) {
865 m_ostream << "<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
866 throw;
867 }
868
869 writeL1CTPCoreInputMapping( vr, lvl1Menu );
870
871}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const std::vector< int > & jetWeights() const
Definition CaloInfo.h:46
virtual void print(const std::string &indent="", unsigned int detail=1) const
const CaloInfo & caloInfo() const
Definition Menu.h:74
const ThresholdConfig & thresholdConfig() const
Definition Menu.h:73
const ItemContainer & items() const
Definition Menu.h:140
const std::vector< TriggerThreshold * > & thresholdVector(L1DataDef::TriggerType) const
unsigned int l1Version() const
void writeL1CTPCoreInputMapping(ValidityRange vr, const Menu &lvl1Menu)
cool::Record createLvl1METSigPayload(cool::IFolderPtr, const METSigParam &metSigParams)
build a COOL db record from a L1 MET significance global parameters
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 createLvl1ItemDefPayload(cool::IFolderPtr, const TrigConf::TriggerItem &item)
build a COOL db record from a LVL1 TriggerItem (the conditions)
cool::Record createLvl1ThresholdPayload(cool::IFolderPtr, const TrigConf::TriggerThreshold &thr)
build a COOL db record from a LVL1 TriggerItem
cool::Record createLvl1JetWeightPayload(cool::IFolderPtr, const std::vector< int > &jetweights)
build a COOL db record from a L1 Jet Weights vector

◆ writeL1MonPayload() [1/2]

void TrigConf::TrigConfCoolWriter::writeL1MonPayload ( const RunRangeVec & runRanges,
const TrigConf::Menu * lvl1Menu )

Definition at line 505 of file TrigConfCoolWriter.cxx.

507{
508 if(lvl1Menu == 0) throw std::runtime_error("L1 trigger menu ptr is NULL");
509
510 AutoDBOpen db(this, READ_WRITE);
511 // just in case
513
514 // loop over the run ranges
515 for ( RunRange rr : runRanges) {
516
517 ValidityRange vr(rr);
518 rangeInfo("LVL1 monitoring", vr.since(), vr.until());
519
520 if( shouldFolderBeUpdated("/TRIGGER/LVL1/CTPInMonitoringMapping") ) {
521
522 try {
523 // maps to store exact description of mon counters; channel id is
524 // internal mon counter id. Different entries in the mon vector
525 // belong to the same counter, the strings are concatenated,
526 // separated by ':'
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;
535 // not possible yet std::map<cool::ChannelId,std::string> counterlogic;
536 // the next 2 must be unique
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());
543 // the CTPMON goes into the same table, the configuration
544 // of the 160 counters is written with internal counter
545 // as MONCOUNTER + 768, i.e. is added at the end
546 if((*mc)->counterType().find("CTPMON") != std::string::npos) {
547 index += 768;
548 }
549
550 //prepare strings
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();
556 std::string active;
557 if((*mc)->thresholdActive()) active = "ENABLED";
558 else active = "DISABLED";
559
560
561 int flag=0;//0: not write, 1: write new entry, 2: concatenate
562 if( monNames.find(index) == monNames.end() ){
563 //no entries for this counter
564 flag=1;
565 }else{
566 flag=2;
567
568 //check if all parameters exist for the index
569 if( thrNames.find(index) == thrNames.end() ){
570 flag=1;
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() ){
573 flag=1;
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() ){
576 flag=1;
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() ){
579 flag=1;
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() ){
582 flag=1;
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() ){
585 flag=1;
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() ){
588 flag=1;
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() ){
591 flag=1;
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() ){
594 flag=1;
595 m_ostream << "PROBLEM counter " << index << " : no bgId in previous entries, overwrite all with new one" << endl;
596 }else{
597
598 //check if previous entries for same name have same parameters
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()){
612 flag=1;
613 m_ostream << "PROBLEM counter " << index << " : numbers of entries are different, overwrite all with new one" << endl;
614 }else{
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){
623
624 flag=0;
625 break;
626 }
627 }
628 }
629 }
630 }
631
632 if(flag==0)continue;
633
634
635 if(flag==1){
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();
646 // not possible yet
647 // monNames[index]=(*mc)->counterLogic();
648 }else if(flag==2){
649 if (monNames[index]!=(*mc)->name()){
650 std::stringstream str;
651 str << "PROBLEM counter " << index;
652 str << " : previous monitor name" << monNames[index];
653 str << ", current monitor name " << (*mc)->name() << endl;
654 m_ostream << str.str() << endl;
655 // throw std::runtime_error(str.str());
656 }
657 if(counterType[index] != (*mc)->counterType()) {
658 std::stringstream str;
659 str << "PROBLEM counter " << index;
660 str << " : previous type " << counterType[index];
661 str << ", current type " << (*mc)->counterType() << endl;
662 m_ostream << str.str() << endl;
663 // throw std::runtime_error(str.str());
664 }
665 if(bgId[index] != (*mc)->bunchGroupId()) {
666 std::stringstream str;
667 str << "PROBLEM counter " << index;
668 str << " : previous bunch-group id " << bgId[index];
669 str << ", current id " << (*mc)->bunchGroupId() << endl;
670 m_ostream << str.str() << endl;
671 // throw std::runtime_error(str.str());
672 }
673 monNames[index]=(*mc)->name();
674 counterType[index]=(*mc)->counterType();
675 bgId[index]=(*mc)->bunchGroupId();
676
677 thrNames[index]+=":";thrNames[index]+=(*mc)->thresholdName();
678 slots[index]+=":";slots[index]+=strSlot.str();
679 cons[index]+=":";cons[index]+=strCon.str();
680 mults[index]+=":";mults[index]+=strMult.str();
681 starts[index]+=":";starts[index]+=strStart.str();
682 ends[index]+=":";ends[index]+=strEnd.str();
683 actives[index]+=":";actives[index]+=active;
684 }else{
685 m_ostream << "PROBLEM counter " << index << " : unknown flag = " << flag << endl;
686 continue;
687 }
688 }
689
690 cool::ChannelId channel(0);
691 cool::IFolderPtr monFolder = TrigConfCoolFolderSpec::getLvl1MonMapFolder(m_dbPtr);
692 // use buffer to speed up COOL writing
693 monFolder->setupStorageBuffer();
694 for(std::map<cool::ChannelId,std::string>::iterator it = thrNames.begin();
695 it != thrNames.end();++it) {
696 channel = it->first;
697 cool::Record payload =
699 counterType[channel],
700 bgId[channel],
701 it->second,
702 slots[channel],
703 cons[channel],
704 mults[channel],
705 starts[channel],
706 ends[channel],
707 actives[channel],
708 monNames[channel]);
709 // add counterlogic above and below when implemented in trigger db
710
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] << "'"
722 << endl;
723 monFolder->storeObject(vr.since(), vr.until(), payload, channel);
724 }
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;
729 //throw;
730 } catch(std::exception & e) {
731 m_ostream << "<writeLVL1MonPayload> Caught std::exception: " << e.what() << endl;
732 //throw;
733 }
734 }
735 }
736}
const std::vector< ThresholdMonitor * > & moncountVector() const
Definition Menu.h:69
static cool::IFolderSetPtr createMonFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the monitoring COOL database
str index
Definition DeMoScan.py:362
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
@ active
Definition Layer.h:47
bool flag
Definition master.py:29

◆ writeL1MonPayload() [2/2]

void TrigConf::TrigConfCoolWriter::writeL1MonPayload ( unsigned int runNumber,
const TrigConf::Menu * lvl1Menu )

Writing L1 run-wise monitoring configuration to COOL.

Parameters
runNumberrun number
lvl1MenuL1 Menu

Definition at line 497 of file TrigConfCoolWriter.cxx.

498 {
500 runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
501 writeL1MonPayload( runRanges, lvl1Menu);
502}
void writeL1MonPayload(unsigned int runNumber, const TrigConf::Menu *lvl1Menu)
Writing L1 run-wise monitoring configuration to COOL.
std::vector< RunRange > RunRangeVec

◆ writeL1Payload()

void TrigConfCoolWriter::writeL1Payload ( ValidityRange vr,
const CTPConfig & ctpConfig )

Definition at line 304 of file TrigConfCoolWriter.cxx.

305{
306 AutoDBOpen db(this, READ_WRITE);
308 try {
309 writeL1MenuPayload (vr, ctpConfig.menu());
310 writeL1BunchGroupRunPayload(vr, ctpConfig.menu(), ctpConfig.bunchGroupSet() ); // writes bunchgroup description folder
311 writeL1BunchGroupLBPayload (vr, ctpConfig.bunchGroupSet().id(), ctpConfig.bunchGroupSet()); // writes bunchgroup content and key folders
312 writeL1PrescalePayload(vr.since(), vr.until(), ctpConfig.prescaleSet().id(), ctpConfig.prescaleSet());
313 }
314 catch(exception & e) {
315 m_ostream << "<writeL1Payload> caught and re-throw exception: " << e.what() << endl;
316 throw;
317 }
318}
const BunchGroupSet & bunchGroupSet() const
Definition CTPConfig.h:40
const PrescaleSet & prescaleSet(unsigned int partition=0) const
Definition CTPConfig.h:39
void writeL1PrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, unsigned int lvl1PrescaleKey, const TrigConf::PrescaleSet &prescale)
Writing luminosityblock-wise configuration information the COOL database.
unsigned int id() const

◆ writeL1PrescalePayload() [1/3]

void TrigConfCoolWriter::writeL1PrescalePayload ( const RunRangeVec & runRanges,
unsigned int lvl1PrescaleKey,
const TrigConf::PrescaleSet & prescale )

Definition at line 1170 of file TrigConfCoolWriter.cxx.

1173{
1174 AutoDBOpen db(this, READ_WRITE);
1176 for ( RunRange rr : runRanges) {
1177 ValidityRange vr(rr);
1178 writeL1PrescalePayload( vr.since(), vr.until(), lvl1PrescaleKey, prescale);
1179 }
1180}

◆ writeL1PrescalePayload() [2/3]

void TrigConf::TrigConfCoolWriter::writeL1PrescalePayload ( cool::ValidityKey since,
cool::ValidityKey until,
unsigned int lvl1PrescaleKey,
const TrigConf::PrescaleSet & prescaleSet )

Definition at line 1195 of file TrigConfCoolWriter.cxx.

1199{
1200 prescaleSet.print("",5);
1201 AutoDBOpen db(this, READ_WRITE);
1202 // writing configuration keys and prescales
1203 try {
1204 IFolderPtr lvl1CkConfFolder = TrigConfCoolFolderSpec::getLvl1ConfKeyFolder(m_dbPtr);
1205 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Lvl1ConfigKey") ) {
1206 rangeInfo("LVL1 prescale key", since, until);
1207 cool::Record payload =
1208 TrigConfCoolL1PayloadConverters::createLvl1ConfigKeyPayload(lvl1CkConfFolder, lvl1PrescaleKey);
1209 m_ostream << "Store LVL1 prescale key " << lvl1PrescaleKey << " to /TRIGGER/LVL1/Lvl1ConfigKey" << endl;
1210 lvl1CkConfFolder->storeObject(since, until, payload, 0);
1211 }
1212
1213 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Prescales") ) {
1214 rangeInfo("LVL1 prescale set", since, until);
1215 IFolderPtr lvl1PsConfFolder = TrigConfCoolFolderSpec::getLvl1PrescalesFolder(m_dbPtr);
1216 vector<int32_t> prescaleV = prescaleSet.cuts();
1217
1218 vector<int32_t>::const_iterator psIt = prescaleV.begin();
1219
1220 // use buffer to speed up COOL writing
1221 lvl1PsConfFolder->setupStorageBuffer();
1222
1223 m_ostream << "Writing (to buffer) LVL1 prescales [(value/channel)]:" << endl;
1224 for(int channel=0; psIt != prescaleV.end(); channel++, ++psIt) {
1225 Record payload =
1227 lvl1PsConfFolder->storeObject(since, until, payload, channel);
1228 m_ostream << "(" << *psIt << "/" << channel << ") ";
1229 if((channel+1)%10==0) m_ostream << endl;
1230 }
1231 m_ostream << "]" << endl;
1232 m_ostream << "Flushing LVL1 prescales buffer to /TRIGGER/LVL1/Prescales" << endl;
1233 lvl1PsConfFolder->flushStorageBuffer();
1234 }
1235 }
1236 catch(std::exception & e) {
1237 m_ostream << "<writeL1PrescalePayload> caught and re-throw exception: " << e.what() << endl;
1238 throw;
1239 }
1240
1241}
virtual void print(const std::string &indent="", unsigned int detail=1) const override
const std::vector< int32_t > & cuts() const
Definition PrescaleSet.h:44
cool::Record createLvl1ConfigKeyPayload(cool::IFolderPtr, unsigned int lvl1PrescaleKey)
build a COOL db record from a LVL1 configuration key
cool::Record createLvl1PrescalesPayload(cool::IFolderPtr, int prescale)
build a COOL db record from a LVL1 prescale value

◆ writeL1PrescalePayload() [3/3]

void TrigConfCoolWriter::writeL1PrescalePayload ( unsigned int runNumber,
unsigned int lumiblockNumber,
unsigned int lvl1PrescaleKey,
const TrigConf::PrescaleSet & prescale )

Writing luminosityblock-wise configuration information the COOL database.

Parameters
runNumberrun number
lumiblockNumberluminosity block number
hltpskHLT prescale configuration key
prescaleL1 prescale configuration object

Definition at line 1184 of file TrigConfCoolWriter.cxx.

1187{
1188 AutoDBOpen db(this, READ_WRITE);
1190 ValidityRange vr(run, lb);
1191 writeL1PrescalePayload( vr.since(), vr.until(), lvl1PrescaleKey, prescaleSet);
1192}

◆ writeMCKPayload()

void TrigConf::TrigConfCoolWriter::writeMCKPayload ( ValidityRange vr,
unsigned int mck,
std::string & release,
std::string & info )

Definition at line 425 of file TrigConfCoolWriter.cxx.

429{
430 AutoDBOpen db(this, READ_WRITE);
432
433 // writing monitoring configuration key
434 if( shouldFolderBeUpdated("/TRIGGER/HLT/MenuAwareMonConfigKey") ) {
435 rangeInfo("Monitoring configuration key", vr.since(), vr.until());
436 try {
437 IFolderPtr monconfkeyFolder = TrigConfCoolFolderSpec::getMonConfKeyFolder(m_dbPtr);
438 Record payload = createMonConfigKeyPayload(monconfkeyFolder, mck, info);
439 monconfkeyFolder->storeObject(vr.since(), vr.until(), payload, 0, "MenuAwareMonConfigKey-"+release); //tag
440 }
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;
444 throw;
445 }
446 }
447
448}
static cool::IFolderPtr getMonConfKeyFolder(cool::IDatabasePtr db)
static std::string release
Definition computils.h:50
cool::Record createMonConfigKeyPayload(cool::IFolderPtr fld, uint MCK, std::string &info)
build a COOL db record from a HLT monitoring configuration key

◆ writeRunPayload() [1/2]

void TrigConfCoolWriter::writeRunPayload ( const RunRangeVec & runRanges,
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 )

Definition at line 471 of file TrigConfCoolWriter.cxx.

479{
480 AutoDBOpen db(this, READ_WRITE);
482
483 for ( RunRange rr : runRanges) {
484 writeL1Payload(rr, ctpConfig);
485 }
486
487 // loop over the run ranges
488 for ( RunRange rr : runRanges) {
489 writeHLTPayload( ValidityRange(rr), hltFrame, configSource);
490 }
491}
void writeHLTPayload(ValidityRange vr, const HLTFrame &hltFrame, const std::string &configSource)
void writeL1Payload(ValidityRange vr, const CTPConfig &ctpConfig)

◆ writeRunPayload() [2/2]

void TrigConfCoolWriter::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.

Parameters
runNumberrun number
masterConfigKeyconfiguration super master key
hltPrescaleKeyHLT prescale configuration key
lvl1ThrL1 threshold configuration object
ctpConfigL1 CTP configuration object
caloInfoL1 calorimeter configuration object
hltFrameHLT menu configuration object
configSourceconfiguration source (DB connection string or XML file name(s))

Definition at line 455 of file TrigConfCoolWriter.cxx.

463{
465 runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
466 writeRunPayload( runRanges, masterConfigKey, hltPrescaleKey, lvl1Thr, ctpConfig, caloInfo, hltFrame, configSource);
467}
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.

◆ AutoDBOpen

friend class AutoDBOpen
friend

Definition at line 390 of file TrigConfCoolWriter.h.

Member Data Documentation

◆ m_coolApp

cool::Application TrigConf::TrigConfCoolWriter::m_coolApp
private

COOL application.

Definition at line 441 of file TrigConfCoolWriter.h.

◆ m_dbId

cool::DatabaseId TrigConf::TrigConfCoolWriter::m_dbId
private

db connection string

Definition at line 439 of file TrigConfCoolWriter.h.

◆ m_dbPtr

cool::IDatabasePtr TrigConf::TrigConfCoolWriter::m_dbPtr
private

COOL database pointer.

Definition at line 440 of file TrigConfCoolWriter.h.

◆ m_ostream

std::ostream& TrigConf::TrigConfCoolWriter::m_ostream
private

output stream for all messages

Definition at line 444 of file TrigConfCoolWriter.h.

◆ m_verbosityLevel

int TrigConf::TrigConfCoolWriter::m_verbosityLevel {0}
private

Definition at line 446 of file TrigConfCoolWriter.h.

446{0};

◆ m_writeFolderList

std::vector<std::string> TrigConf::TrigConfCoolWriter::m_writeFolderList
private

list of folders to which writing is restricted

Definition at line 443 of file TrigConfCoolWriter.h.


The documentation for this class was generated from the following files: