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 87 of file TrigConfCoolWriter.cxx.

87 {
88 if(dbIsOpen()) return true;
89 openDb( readOnly );
90 closeDb();
91 return true;
92}
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 1703 of file TrigConfCoolWriter.cxx.

1703 {
1704 AutoDBOpen db(this, READ_ONLY);
1705
1706
1707 ValidityRange vr(run);
1708
1709 if(openend) {
1710 vr = ValidityRange(run, lb);
1711 } else {
1712 ValidityKey since(run); since <<= 32; since += lb;
1713 ValidityKey until(run); until <<= 32; until += lbend+1;
1714 vr = ValidityRange(since, until);
1715 }
1716 m_ostream << "Checking for run " << run << " and lb range " << (vr.since() & 0xFFFFFFFF) << " - " << ( (vr.until()-1) & 0xFFFFFFFF) << endl
1717 << endl
1718 << " Folder Payload Size" << endl
1719 << "================================================================================" << endl;
1720
1721 vector<string> foldersToFix;
1722
1723 vector<string> folderList = {
1724 "/TRIGGER/LVL1/Menu",
1725 "/TRIGGER/LVL1/ItemDef",
1726 "/TRIGGER/LVL1/Thresholds",
1727 "/TRIGGER/LVL1/CTPCoreInputMapping",
1728 "/TRIGGER/LVL1/Lvl1ConfigKey",
1729 "/TRIGGER/LVL1/Prescales",
1730 "/TRIGGER/LVL1/BunchGroupKey",
1731 "/TRIGGER/LVL1/BunchGroupContent",
1732 "/TRIGGER/LVL1/BunchGroupDescription",
1733 "/TRIGGER/HLT/HltConfigKeys",
1734 "/TRIGGER/HLT/Menu",
1735 "/TRIGGER/HLT/Groups",
1736 "/TRIGGER/HLT/PrescaleKey",
1737 "/TRIGGER/HLT/Prescales"
1738 };
1739
1740 for(const string & folderName : folderList) {
1741 IFolderPtr folder = m_dbPtr->getFolder( folderName );
1742 unsigned int size = folder->countObjects( vr.since(), vr.until()-1, ChannelSelection() );
1743 bool isSingleVersion = folder->versioningMode()==FolderVersioning::SINGLE_VERSION;
1744 bool needsFixing = (size == 0);
1745
1746 bool displayFixing = false;
1747 if(displayMode==1) { // only allow fixing of folders that are empty
1748 displayFixing = (size == 0);
1749 } else if(displayMode==2) { // allow fixing of folders that are empty or mv
1750 displayFixing = (size == 0) || !isSingleVersion;
1751 }
1752
1753 string fn = folderName + (isSingleVersion ? " (sv)" : " (mv)");
1754 if(displayFixing) {
1755 m_ostream << setw(2) << foldersToFix.size()+1 << ") ";
1756 foldersToFix.push_back(folderName);
1757 } else {
1758 m_ostream << " ";
1759 }
1760 m_ostream << left << setw(40) << fn << right << setw(15) << size << " " << ( needsFixing ? "NEEDS FIX" : " OK") << endl;
1761 }
1762
1763 return foldersToFix;
1764
1765}
size_t size() const
Number of registered mappings.
#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
int run(int argc, char *argv[])

◆ 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 154 of file TrigConfCoolWriter.cxx.

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

◆ closeDb() [2/2]

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

close the COOL database

Definition at line 136 of file TrigConfCoolWriter.cxx.

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

◆ createDb()

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

create a new COOL database

Definition at line 244 of file TrigConfCoolWriter.cxx.

244 {
245 m_ostream << "Creating database '" << m_dbId << "'" << endl;
246 try {
247 cool::IDatabaseSvc& dbSvc = databaseService();
248 m_dbPtr = dbSvc.createDatabase( m_dbId );
249 }
250 catch(std::exception& e) {
251 m_ostream << "*** COOL exception caught: " << e.what() << endl;
252 m_ostream << "Coudn't create a new conditions database: " << m_dbId << endl;
253 throw;
254 }
255
256 return m_dbPtr;
257}
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 171 of file TrigConfCoolWriter.cxx.

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

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

◆ dbIsOpen()

bool TrigConf::TrigConfCoolWriter::dbIsOpen ( )
private

check if db is open

Definition at line 96 of file TrigConfCoolWriter.cxx.

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

◆ dropDb()

void TrigConf::TrigConfCoolWriter::dropDb ( )
private

delete the COOL database

Definition at line 237 of file TrigConfCoolWriter.cxx.

237{}

◆ HLTPrescaleFolderExists()

bool TrigConf::TrigConfCoolWriter::HLTPrescaleFolderExists ( )

Definition at line 1685 of file TrigConfCoolWriter.cxx.

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

◆ 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 105 of file TrigConfCoolWriter.cxx.

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

◆ printSchema()

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

Prints the schema in the COOL database.

Parameters
ooutput stream

Definition at line 210 of file TrigConfCoolWriter.cxx.

210 {
211 AutoDBOpen db(this, READ_ONLY);
213}
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 220 of file TrigConfCoolWriter.cxx.

220 {
221 AutoDBOpen db(this, READ_ONLY);
223 o << "Schema version is " << schemaVersion
224 << (schemaVersion==TrigConfCoolFolderSpec::getDefaultSchemaVersion()?" (=default)":"") << endl;
225}
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 261 of file TrigConfCoolWriter.cxx.

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

◆ readHLTPayload()

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

Definition at line 1247 of file TrigConfCoolWriter.cxx.

1249{
1250 AutoDBOpen db(this, READ_ONLY);
1251 ValidityKey pointInTime( (ValidityKey(run)<<32) + 1);
1252
1253 // read the general chain info
1254 IFolderPtr hltMenuFolder = TrigConfCoolFolderSpec::getHltMenuFolder(m_dbPtr);
1255 IObjectIteratorPtr objects = hltMenuFolder->findObjects( pointInTime, ChannelSelection() );
1256 while ( objects->goToNext() ) {
1257 const IObject& obj = objects->currentRef();
1258 const IRecord & payload = obj.payload();
1259 HLTChain* ch = createHLTChain( payload.attributeList(), &hltFrame.theHLTSequenceList() );
1260 hltFrame.theHLTChainList().addHLTChain(ch);
1261 }
1262
1263 // read the chain groups (they are in a separate folder)
1264 IFolderPtr hltGroupFolder = TrigConfCoolFolderSpec::getHltChainGroupFolder(m_dbPtr);
1265 objects = hltGroupFolder->findObjects( pointInTime, ChannelSelection() );
1266 while ( objects->goToNext() ) {
1267 const IObject& obj = objects->currentRef();
1268 const IRecord & payload = obj.payload();
1269 addGroupsToHltChain( payload.attributeList(), hltFrame.theHLTChainList());
1270 }
1271
1272 IFolderPtr hltConfigKeyFolder = TrigConfCoolFolderSpec::getHltConfKeyFolder(m_dbPtr);
1273 try {
1274 IObjectPtr object = hltConfigKeyFolder->findObject( pointInTime, (ChannelId) 0 );
1275 const IRecord & payload = object->payload();
1276 unsigned int smk, hltPrescaleKey;
1277 string configSource;
1278 readHltConfigKeys( payload.attributeList(), smk, hltPrescaleKey, configSource ); // the hltPrescaleKey here is not useable (it is superseeded by the multiversion one)
1279 hltFrame.setSMK(smk);
1280 hltFrame.setConfigSource(configSource);
1281 }
1282 catch(const cool::ObjectNotFound& o) {
1283 m_ostream << "<readHLTPayload> No entry found in HLT keys folder for run " << run << endl;
1284 }
1285}
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 1110 of file TrigConfCoolWriter.cxx.

1111 {
1112
1113 AutoDBOpen db(this, READ_ONLY);
1114 ValidityRange vr(run, lb);
1115 pss.reset();
1116
1117 // read the prescale key
1118 {
1120 IObjectIteratorPtr objects = hltpskFolder->browseObjects( vr.since(), vr.since()+1, 0 );
1121 if (not objects->goToNext()){
1122 throw std::runtime_error("'objects' is empty");
1123 }
1124 const IObject& obj = objects->currentRef();
1125 const IRecord & payload = obj.payload();
1126 unsigned int hltpsk = readHltPrescaleKey( payload.attributeList() );
1127 pss.setId(hltpsk);
1128
1129 }
1130
1131 // read the prescale set
1132 {
1133 float ps, pt, rrps;
1135 cool::IFolderPtr hltpssFolder = TrigConfCoolFolderSpec::getHltPrescalesFolder(m_dbPtr);
1136 cool::IObjectIteratorPtr objects = hltpssFolder->browseObjects( vr.since(), vr.since()+1, cool::ChannelSelection());
1137 bool iovset=false;
1138 while(objects->goToNext()) {
1139 const cool::IObject& obj = objects->currentRef();
1140 if(!iovset) {
1141 pss.setIOV(obj.since(), obj.until()); // assume the IOV of the first channel is like all the others
1142 iovset=true;
1143 }
1144 const ChannelId& ch = obj.channelId();
1145 const IRecord& payload = obj.payload();
1146 readHltPrescale( payload.attributeList(), ps, pt, rrps);
1147 unsigned int counter = ch/2;
1148
1149 if (ch >=20000 ) {
1150 level=HLT;
1151 counter = ch - 20000;
1152 } else
1153 level = (ch%2==0)?L2:EF;
1154
1155 pss.thePrescale( counter, level )
1156 .setPrescale(ps)
1157 .setPassThrough(pt)
1158 .setRerunPrescale("",rrps);
1159 }
1160 }
1161}
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 if (not objects->goToNext()){
1587 throw std::runtime_error("TrigConfCoolWriter::readL1BunchGroupLBPayload: 'objects' is empty.");
1588 }
1589 const IObject& obj = objects->currentRef();
1590 const IRecord & payload1 = obj.payload();
1591 bgKey = readLvl1BGKey( payload1.attributeList() );
1592
1593 // read the bunch group content
1594 IFolderPtr lvl1BGContentFolder = TrigConfCoolFolderSpec::getLvl1BGContentFolder(m_dbPtr);
1595 IObjectIteratorPtr objects2 = lvl1BGContentFolder->browseObjects( vr.since(), vr.until(), 0);
1596 if (not objects2->goToNext()){
1597 throw std::runtime_error("TrigConfCoolWriter::readL1BunchGroupLBPayload: 'objects2' is empty.");
1598 }
1599 const IObject& obj2 = objects2->currentRef();
1600 const IRecord & payload2 = obj2.payload();
1601 vector<BunchGroup> bgV = readLvl1BGContent( payload2.attributeList() );
1602
1603 // read the bunch group names
1604 pair< vector<string>, map<unsigned int,unsigned char> > bg_pair = readL1BunchGroupRunPayload(run);
1605 vector<string> names = bg_pair.first;
1606
1607
1608
1609 uint newBGSSize = bgV.size() <= names.size() ? bgV.size() : names.size();
1610
1611 if(bgV.size() != names.size()) {
1612 cout << "WARNING Bunchgroup content vector is of size " << bgV.size()
1613 << ", which is different from the size of the names vector: " << names.size()
1614 << ". Using " << newBGSSize << endl;
1615
1616 }
1617
1618 // create a new bunch group set, set names and bunch groups
1619 bgs = BunchGroupSet();
1620 for(unsigned int i=0; i<newBGSSize; i++) {
1621 string bgname = names[i];
1622 if(bgname=="") bgname = "NoName";
1623 bgV[i].setName(bgname);
1624 bgV[i].setInternalNumber(i);
1625 bgs.addBunchGroup(bgV[i]);
1626 }
1627 bgs.setId(bgKey);
1628}
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 1552 of file TrigConfCoolWriter.cxx.

1553{
1554 AutoDBOpen db(this, READ_ONLY);
1555 ValidityRange vr(run);
1557 IObjectIteratorPtr objects = folder->browseObjects( vr.since(), vr.until()-1, 0 );
1558 if (not objects->goToNext()){
1559 throw std::runtime_error("TrigConfCoolWriter::readL1BunchGroupRunPayload: 'objects' is empty.");
1560 }
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 1314 of file TrigConfCoolWriter.cxx.

1317{
1318 AutoDBOpen db(this, READ_ONLY);
1319 ValidityRange vr(run, 1);
1320 IObjectIteratorPtr objects;
1322 vector<bool> foundTip(512,false);
1323 for(ChannelId channel = 0; channel < 512; ++channel) {
1324 objects = folder->browseObjects( vr.since(), vr.until()-1, channel );
1325 if(objects->size()==0) continue;
1326 while ( objects->goToNext() ) {
1327 const IObject& obj = objects->currentRef();
1328 const IRecord & payload = obj.payload();
1329 PIT* pit = readLvl1InputMap( payload.attributeList() );
1330 TIP* tip = readLvl1TIPMap( payload.attributeList() );
1331 uint16_t tipNumber = obj.channelId();
1332 if(tipNumber > 511) {
1333 m_ostream << "TIP number " << tipNumber << " out of bounds!" << endl;
1334 throw runtime_error("TIP number ouf ot bounds!");
1335 } else {
1336 if(foundTip[tipNumber]) {
1337 stringstream str;
1338 str << "TIP '" << tipNumber << "' had already been read!";
1339 throw runtime_error(str.str());
1340 }
1341 foundTip[tipNumber] = true;
1342 pit->setPitNumber(tipNumber);
1343 tip->setTipNumber(tipNumber);
1344 tip->setClock(tipNumber%2);
1345 pits.push_back(pit);
1346 tips.push_back(tip);
1347 }
1348 }
1349 }
1350}
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 1447 of file TrigConfCoolWriter.cxx.

1450{
1451 AutoDBOpen db(this, READ_ONLY);
1452 ValidityRange vr(run, 1);
1453
1454 IFolderPtr L1ItemDefFolder = TrigConfCoolFolderSpec::getLvl1ItemDefFolder(m_dbPtr);
1455 for(TriggerItem* item: items) {
1456 ChannelId itemChannel = item->ctpId();
1457 IObjectIteratorPtr objects = L1ItemDefFolder->browseObjects( vr.since(), vr.until()-1, itemChannel );
1458 while ( objects->goToNext() ) {
1459 const IObject& obj = objects->currentRef();
1460 const IRecord & payload = obj.payload();
1461 addThresholdsToTriggerItem( payload.attributeList(), item, thrs);
1462 }
1463 }
1464}
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 1393 of file TrigConfCoolWriter.cxx.

1395{
1396 AutoDBOpen db(this, READ_ONLY);
1397 ValidityRange vr(run, 1);
1398
1399 IObjectIteratorPtr objects;
1401 vector<bool> foundItem(512,false);
1402
1403 //for(ChannelId channel = 0; channel < 512; ++channel) {
1404 objects = folder->browseObjects( vr.since(), vr.until()-1,cool::ChannelSelection());
1405 //if(objects->size()==0) continue;
1406 while ( objects->goToNext() ) {
1407 const cool::IObject& obj = objects->currentRef();
1408 const cool::IRecord & payload = obj.payload();
1409 TriggerItem* item = createLvl1TriggerItem( payload.attributeList() );
1410 uint32_t ctpId = obj.channelId();
1411 if(ctpId > 511) {
1412 m_ostream << "Item ctpid " << ctpId << " out of bounds!" << endl;
1413 throw runtime_error("Item ctpid ouf ot bounds!");
1414 } else {
1415 if(foundItem[ctpId]) {
1416 stringstream str;
1417 str << "Item '" << ctpId << "' had already been read!";
1418 throw runtime_error(str.str());
1419 }
1420 foundItem[ctpId] = true;
1421 item->setCtpId(ctpId);
1422 items.push_back(item);
1423 }
1424 }
1425 // }
1426
1427}
static cool::IFolderPtr getLvl1MenuFolder(cool::IDatabasePtr db)
void setCtpId(int id)
Definition TriggerItem.h:46
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 1468 of file TrigConfCoolWriter.cxx.

1469{
1470 AutoDBOpen db(this, READ_ONLY);
1471
1472 Menu & menu = ctpc.menu();
1473
1474 // thresholds
1475 vector<TriggerThreshold*> thrs;
1476 readL1Thresholds(run, thrs);
1477
1483 bool isRun2 = false;
1484 for(TriggerThreshold* thr : thrs) {
1485 if( thr->cableName()=="EM1" || thr->cableName()=="EM2" ||
1486 thr->cableName()=="JET1" || thr->cableName()=="JET2" ||
1487 thr->cableName()=="TOPO1" || thr->cableName()=="TOPO2" ||
1488 thr->cableName()=="TAU1" || thr->cableName()=="TAU2") {
1489 isRun2 = true;
1490 break;
1491 }
1492 }
1493 ctpc.setCTPVersion(isRun2 ? 4 : 3);
1494 ctpc.setL1Version(isRun2 ? 1 : 0);
1496 cout << "TrigConfCoolWriter::readL1Menu for run " << run << ". Determined format " << (isRun2 ? "Run 2" : "Run 1") << endl;
1497
1498 // items
1499 vector<TriggerItem*> items;
1500 readL1Items(run, items);
1501 for(TriggerItem* item: items)
1502 menu.addTriggerItem(item);
1503
1504
1505 readL1ItemDef(run, items, thrs);
1506
1507 CaloInfo ci;
1508
1509 for(TriggerThreshold* thr: thrs) {
1510
1511 if ( thr->name()=="JetWeights" ) {
1512 if(!isRun2) {
1513 for ( const string& weights : split( thr->cableName(),",") )
1514 ci.addJetWeight( std::stoi(weights) );
1515 }
1516 }
1517 else if ( thr->name()=="METSigParams" ) {
1518 vector<string> metvals = split( thr->cableName(),",");
1519 int XSSigmaScale = std::stoi(metvals[0]);
1520 int XSSigmaOffset = std::stoi(metvals[1]);
1521 int XEmin = std::stoi(metvals[2]);
1522 int XEmax = std::stoi(metvals[3]);
1523 int TESqrtMin = std::stoi(metvals[4]);
1524 int TESqrtMax = std::stoi(metvals[5]);
1525 ci.metSigParam().setValues( XSSigmaScale, XSSigmaOffset,
1526 XEmin, XEmax, TESqrtMin, TESqrtMax);
1527 }
1528 else {
1529 // trigger thresholds sorted by type
1530 menu.thresholdConfig().addTriggerThreshold(thr);
1531 }
1532 }
1533 menu.setCaloInfo(ci);
1534
1535 // PITs (run1), TIPs (run2)
1536 vector<PIT*> pits;
1537 vector<TIP*> tips;
1538 readL1InputMapPayload(run, pits, tips);
1539 for ( PIT* pit : pits) {
1540 if(pit->ctpinSlot()==10) continue;
1541 menu.addPit(pit);
1542 }
1543 for ( TIP* tip : tips) {
1544 // cout << tip->tipNumber() << " : thr = " << tip->thresholdName() << ", slot = " << tip->slot() << ", conn = " << tip->connector() << ", thrBit = "
1545 // << tip->thresholdBit() << ", cableBit = " << tip->cableBit() << endl;
1546 menu.addTip(tip);
1547 }
1548}
unsigned int l1Version() const
Definition CTPConfig.h:35
const Menu & menu() const
Definition CTPConfig.h:39
void setL1Version(unsigned int v)
Definition CTPConfig.cxx:37
void setCTPVersion(unsigned int v)
Definition CTPConfig.cxx:31
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 1353 of file TrigConfCoolWriter.cxx.

1355{
1356 AutoDBOpen db(this, READ_ONLY);
1357 ValidityRange vr(run, 1);
1358
1359 IObjectIteratorPtr objects;
1361 vector<bool> foundCounter(768,false);
1362
1363 for(ChannelId channel = 0; channel < 768; ++channel) {
1364
1365 objects = folder->browseObjects( vr.since(), vr.until()-1, channel );
1366 if(objects->size()==0) continue;
1367 while ( objects->goToNext() ) {
1368 const IObject& obj = objects->currentRef();
1369 const IRecord & payload = obj.payload();
1370 vector<ThresholdMonitor*> counters = readLvl1MonMap( payload );
1371 int counterNumber = obj.channelId();
1372 if(counterNumber > 768) {
1373 m_ostream << "Monitoring counter number " << counterNumber << " out of bounds!" << endl;
1374 throw runtime_error("Monitoring counter ouf of bounds!");
1375 } else {
1376 if(foundCounter[counterNumber]) {
1377 stringstream str;
1378 str << "MonCounter '" << counterNumber << "' had already been read!";
1379 throw runtime_error(str.str());
1380 }
1381 foundCounter[counterNumber] = true;
1382 for(size_t i = 0 ; i < counters.size(); ++i) {
1383 counters[i]->setInternalCounter(counterNumber);
1384 mons.push_back( counters[i] );
1385 }
1386 }
1387 }
1388 ++channel;
1389 }
1390}
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 1301 of file TrigConfCoolWriter.cxx.

1303{
1304
1309
1310 readL1Menu( run, ctpc );
1311}
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 1640 of file TrigConfCoolWriter.cxx.

1643{
1644 AutoDBOpen db(this, READ_ONLY);
1645 ValidityRange vr(run,lb);
1646 vr.until() = vr.since()+1; // single LB
1647
1648 IFolderPtr lvl1CkFolder = TrigConfCoolFolderSpec::getLvl1ConfKeyFolder(m_dbPtr);
1649 IObjectIteratorPtr objects = lvl1CkFolder->browseObjects( vr.since(), vr.since()+1, 0 );
1650 if (not objects->goToNext()){
1651 throw std::runtime_error("TrigConfCoolWriter::readL1PrescalePayload: 'objects' is empty.");
1652 }
1653 const IObject& obj = objects->currentRef();
1654 const IRecord & payload = obj.payload();
1655 readLvl1ConfigKey( payload.attributeList(), lvl1PrescaleKey );
1656 cool::IFolderPtr lvl1PsFolder = TrigConfCoolFolderSpec::getLvl1PrescalesFolder(m_dbPtr);
1657
1658 // resize the vector to the correct size
1659 size_t nPrescales = lvl1PsFolder->listChannels().size();
1660 bool isRun2 = ( nPrescales == 512 );
1661 prescale.resize( nPrescales );
1662
1663 for(cool::ChannelId channel = 0; channel < nPrescales; channel++) {
1664 objects = lvl1PsFolder->browseObjects( vr.since(), vr.until(), channel );
1665 if(objects->size()!=1) {
1666 throw std::runtime_error("Lvl1 prescale access error: found empty prescale channel ");
1667 }
1668 //already checked size, so this should be ok
1669 (void)objects->goToNext();
1670 const IObject& obj = objects->currentRef();
1671 const IRecord & payload = obj.payload();
1672 int64_t prescaleVal=0;
1673 readLvl1Prescale( payload.attributeList(), prescaleVal );
1674 if( isRun2 ) {
1675 prescale.setCut( channel, prescaleVal );
1676 } else {
1677 prescale.setPrescale( channel, (float)prescaleVal );
1678 }
1679 }
1680 prescale.setId( lvl1PrescaleKey );
1681}
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 1431 of file TrigConfCoolWriter.cxx.

1432 {
1433 AutoDBOpen db(this, READ_ONLY);
1434 ValidityRange vr(run, 1);
1435 thrs.clear();
1437 IObjectIteratorPtr objects = L1thrFolder->browseObjects( vr.since(), vr.until()-1, cool::ChannelSelection() );
1438 while ( objects->goToNext() ) {
1439 const IObject& obj = objects->currentRef();
1440 const IRecord & payload = obj.payload();
1441 thrs.push_back( createLvl1Threshold( payload.attributeList() ) );
1442 }
1443}
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 1288 of file TrigConfCoolWriter.cxx.

1293{
1294 readHLTPayload( run, hltFrame);
1295 masterConfigKey = hltFrame.smk();
1296 configSource = hltFrame.configSource();
1297}
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 231 of file TrigConfCoolWriter.cxx.

231{}

◆ 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 322 of file TrigConfCoolWriter.cxx.

325{
326 AutoDBOpen db(this, READ_WRITE);
328
329 // writing configuration keys
330 if( shouldFolderBeUpdated("/TRIGGER/HLT/HltConfigKeys") ) {
331 rangeInfo("HLT configuration keys", vr.since(), vr.until());
332 try {
333 IFolderPtr confkeyFolder = TrigConfCoolFolderSpec::getHltConfKeyFolder(m_dbPtr);
334 Record payload = createHltConfigKeysPayload(confkeyFolder, hltFrame.smk(), 0, configSource);
335 confkeyFolder->storeObject(vr.since(), vr.until(), payload, 0);
336 }
337 catch(exception & e) {
338 m_ostream << "<writeHLTPayload> caught and re-throw exception: " << e.what() << endl
339 << "WARNING: Failed to write configuration keys to COOL" << endl;
340 throw;
341 }
342 }
343
344 if(!hltFrame.getPrescaleSetCollection().sets().empty()) {
345 // we only support one prescale set at a time here
346 const HLTPrescaleSet& pss = *hltFrame.getPrescaleSetCollection().sets().front().pss;
347 writeHltPrescalePayload(vr.since(), vr.until(), pss);
348 }
349
350 if( shouldFolderBeUpdated("/TRIGGER/HLT/Menu") ||
351 shouldFolderBeUpdated("/TRIGGER/HLT/Groups") ) {
352 if( hltFrame.getHLTChainList().size() > 0 ) {
353
354 rangeInfo("HLT menu", vr.since(), vr.until());
355
356 // this call is needed to set the level of each sequence
358
359 // writing the chains of the HLT menu
360 try {
361
362 ChannelId menuChannel(0);
363 IFolderPtr hltMenuFolder = TrigConfCoolFolderSpec::getHltMenuFolder(m_dbPtr);
364 IFolderPtr hltGroupFolder = TrigConfCoolFolderSpec::getHltChainGroupFolder(m_dbPtr);
365 // use buffer to speed up COOL writing
366 hltMenuFolder->setupStorageBuffer();
367 hltGroupFolder->setupStorageBuffer();
368
369 for ( const HLTChain* chain : hltFrame.getHLTChainList() ) {
370 menuChannel++;
371 string concise = HLTTEUtils::ChainCondenseDisplay( *chain, hltFrame);
372 Record payload = createHltMenuPayload( hltMenuFolder, *chain, concise );
373 hltMenuFolder->storeObject(vr.since(), vr.until(), payload, menuChannel);
374
375 Record payloadGroups = TrigConfCoolHLTPayloadConverters::createHltChainGroupPayload(hltGroupFolder, *chain );
376 hltGroupFolder->storeObject(vr.since(), vr.until(), payloadGroups, menuChannel);
377 m_ostream << "Writing (to buffer) HLT chain " << chain->chain_name()
378 << "(id " << chain->chain_counter()
379 << " level "<< chain->level()
380 << ") to COOL channel " << menuChannel
381 << " [belongs to groups " << payloadGroups["Groups"].data<cool::String4k>() << "]" << endl;
382 }
383 if( shouldFolderBeUpdated("/TRIGGER/HLT/Menu") ) {
384 m_ostream << "Flushing HLT menu buffer to /TRIGGER/HLT/Menu" << endl;
385 try {
386 hltMenuFolder->flushStorageBuffer();
387 }
388 catch ( cool::Exception & e) {
389 m_ostream << "WARNING: Flushing buffer to DB failed: " << e.what() << endl
390 << "warning will be ignored, job will continue" << endl;
391 }
392 }
393 if( shouldFolderBeUpdated("/TRIGGER/HLT/Groups") ) {
394 m_ostream << "Flushing HLT group buffer to /TRIGGER/HLT/Groups" << endl;
395 try {
396 hltGroupFolder->flushStorageBuffer();
397 }
398 catch ( cool::Exception & e) {
399 m_ostream << "WARNING: Flushing buffer to DB failed: " << e.what() << endl
400 << "warning will be ignored, job will continue" << endl;
401 }
402 }
403 }
404 catch( cool::Exception & e) {
405 m_ostream << "Caught cool::Exception: " << e.what() << endl;
406 m_ostream << "Failed to write HLT menu to COOL" << endl;
407 throw;
408 }
409 catch(std::exception & e) {
410 m_ostream << "<writeHLTPayload> Caught std::exception: " << e.what() << endl;
411 throw;
412 }
413 } else {
414 m_ostream << "List of HLT Chains is empty, nothing is written to COOL" << endl;
415 }
416 }
417}
#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 1019 of file TrigConfCoolWriter.cxx.

1021{
1022 AutoDBOpen db(this, READ_WRITE);
1024 for ( RunRange rr : runRanges) {
1025 ValidityRange vr(rr);
1026 writeHltPrescalePayload( vr.since(), vr.until(), pss);
1027 }
1028}
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 1032 of file TrigConfCoolWriter.cxx.

1034{
1035 AutoDBOpen db(this, READ_WRITE);
1037 ValidityRange vr(run, lb);
1038 writeHltPrescalePayload( vr.since(), vr.until(), pss);
1039}

◆ 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 971 of file TrigConfCoolWriter.cxx.

974{
975 AutoDBOpen db(this, READ_WRITE);
976 for ( RunRange rr : runRanges) {
977 ValidityRange vr(rr);
978 writeL1BunchGroupLBPayload( rr, bgKey, bgs);
979 }
980}
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 983 of file TrigConfCoolWriter.cxx.

986{
987 AutoDBOpen db(this, READ_WRITE);
989 try {
990 if( shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupKey") ) {
991 rangeInfo("LVL1 bunchgroup key", vr.since(), vr.until());
992 IFolderPtr lvl1BGKFolder = TrigConfCoolFolderSpec::getLvl1BGKeyFolder(m_dbPtr);
993 Record payload = createLvl1BGKeyPayload(lvl1BGKFolder, bgKey);
994 m_ostream << "Store LVL1 BG key to /TRIGGER/LVL1/BunchGroupKey" << endl;
995 lvl1BGKFolder->storeObject(vr.since(), vr.until(), payload, 0);
996 }
997
998 if( shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupContent") ) {
999 rangeInfo("LVL1 bunchgroups", vr.since(), vr.until());
1000 IFolderPtr lvl1BGContentFolder = TrigConfCoolFolderSpec::getLvl1BGContentFolder(m_dbPtr);
1001 Record payload = createLvl1BGContentPayload(lvl1BGContentFolder, bgs);
1002 m_ostream << "Store LVL1 BG content to /TRIGGER/LVL1/BunchGroupContent" << endl;
1003 lvl1BGContentFolder->storeObject(vr.since(), vr.until(), payload, 0);
1004 }
1005 }
1006 catch(exception & e) {
1007 m_ostream << "<writeLVL1BGPayload> caugh and re-throw exception: " << e.what() << endl;
1008 throw;
1009 }
1010}
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 959 of file TrigConfCoolWriter.cxx.

962{
963 AutoDBOpen db(this, READ_WRITE);
965 for ( RunRange rr : runRanges)
966 writeL1BunchGroupRunPayload( rr, lvl1Menu, bgs);
967}
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 937 of file TrigConfCoolWriter.cxx.

940{
941 if( !shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupDescription") ) return;
942 AutoDBOpen db(this, READ_WRITE);
944 rangeInfo("LVL1 bunch group descriptions", vr.since(), vr.until());
945 try {
946 IFolderPtr bgDescFolder = TrigConfCoolFolderSpec::getLvl1BGDescFolder(m_dbPtr);
947 Record payload = createLvl1BGDescPayload(bgDescFolder, bgs,lvl1Menu);
948 m_ostream << "Store LVL1 BG description buffer to /TRIGGER/LVL1/BunchGroupDescription" << endl;
949 bgDescFolder->storeObject(vr.since(), vr.until(), payload, 0);
950 }
951 catch(exception & e) {
952 m_ostream << "<writeL1BunchGroupRunPayload> caught and re-throw exception: " << e.what() << endl;
953 throw;
954 }
955}
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 886 of file TrigConfCoolWriter.cxx.

888{
889 if( ! shouldFolderBeUpdated("/TRIGGER/LVL1/CTPCoreInputMapping") )
890 return;
891
892 AutoDBOpen db(this, READ_WRITE);
893
894 // now write PIT mapping
895 try {
896
897 cool::IFolderPtr tipFolder = TrigConfCoolFolderSpec::getLvl1InputMapFolder(m_dbPtr);
898 tipFolder->setupStorageBuffer();
899
900 for ( const TIP * tip : lvl1Menu.tipVector() ) {
901
902 cool::ChannelId tipNum = static_cast<cool::ChannelId>(tip->tipNumber());
903
904 stringstream tipName;
905 tipName << "name:" << tip->thresholdName();
906 tipName << "|thresh bit:" << tip->thresholdBit();
907 tipName << "|pos:" << tip->thresholdMapping();
908 tipName << "|active:" << tip->thresholdActive();
909 tipName << "|ctpin slot:" << tip->slot();
910 tipName << "|con:" << tip->connector();
911 tipName << "|cable bit:" << tip->cableBit();
912 m_ostream << "Write TIP / channel " << tipNum << " : " << tipName.str() << endl;
913
915 tipFolder->storeObject(vr.since(), vr.until(), payload, tipNum);
916 }
917 m_ostream << "Flushing LVL1 CTPInputMap buffer to /TRIGGER/LVL1/CTPCoreInputMapping" << endl;
918 tipFolder->flushStorageBuffer();
919 } catch( cool::Exception & e) {
920 m_ostream << "Caught cool::Exception: " << e.what() << endl;
921 m_ostream << "Failed to write LVL1 TIP mapping to COOL" << endl;
922 throw;
923 } catch( exception & e) {
924 m_ostream << "<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
925 throw;
926 }
927}
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 871 of file TrigConfCoolWriter.cxx.

873{
874 AutoDBOpen db(this, READ_WRITE);
875 for ( RunRange rr : runRanges)
876 writeL1MenuPayload( rr, lvl1Menu );
877}
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 738 of file TrigConfCoolWriter.cxx.

740{
741 AutoDBOpen db(this, READ_WRITE);
743
744 // writing the Lvl1 menu
745 try {
746 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Thresholds") &&
747 lvl1Menu.thresholdConfig().thresholdVector().size()>0 ) { // if there are no thresholds we don't want to write anything (METsig, JETWeights)
748 // get the folders for the menu, itemDef, and thresholds
749 cool::IFolderPtr lvl1ThresholdFolder = TrigConfCoolFolderSpec::getLvl1ThresholdFolder(m_dbPtr);
750
751 rangeInfo("LVL1 thresholds", vr.since(), vr.until());
752 // first, parse the threshold list and write to threshold folder
753 const std::vector<TrigConf::TriggerThreshold*> & lvl1Thrs = lvl1Menu.thresholdConfig().thresholdVector();
754 // use buffer to speed up COOL writing
755
756 lvl1ThresholdFolder->setupStorageBuffer();
757
758 // go through the thresholds, channels assigned in the order (0..#thr-1)
759 cool::ChannelId thrChannel = 0;
760 for (TrigConf::TriggerThreshold* thr : lvl1Thrs) {
761 Record payloadThr = TrigConfCoolL1PayloadConverters::createLvl1ThresholdPayload( lvl1ThresholdFolder, *thr );
762 m_ostream << "Writing (to buffer) LVL1 threshold " << thr->name()
763 << " (version " << thr->version() << ") to channel "
764 << thrChannel << endl;
765 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadThr, thrChannel++);
766 }
767
768
769 // TODO
770 if( lvl1Menu.thresholdConfig().l1Version() == 0 ) {
771 m_ostream << "Writing (to buffer) LVL1 threshold 'JetWeights':";
772 const std::vector<int>& jetweights = lvl1Menu.caloInfo().jetWeights();
773 std::copy(jetweights.begin(), jetweights.end(), std::ostream_iterator<int>(m_ostream, ", "));
774 m_ostream << endl;
775 Record payloadJW = TrigConfCoolL1PayloadConverters::createLvl1JetWeightPayload( lvl1ThresholdFolder, lvl1Menu.caloInfo().jetWeights() );
776 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadJW, thrChannel++);
777 }
778
779 m_ostream << "Writing (to buffer) LVL1 threshold 'MET Significance parameters':";
780 lvl1Menu.caloInfo().metSigParam().print();
781 cool::Record payloadMETSigParams = TrigConfCoolL1PayloadConverters::createLvl1METSigPayload( lvl1ThresholdFolder, lvl1Menu.caloInfo().metSigParam() );
782 lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadMETSigParams, thrChannel++);
783
784 // write
785 m_ostream << "Flushing LVL1 thresholds buffer to /TRIGGER/LVL1/Thresholds" << endl;
786 try {
787 lvl1ThresholdFolder->flushStorageBuffer();
788 }
789 catch ( cool::Exception & e) {
790 m_ostream << "WARNING: Flushing buffer to DB failed: " << e.what() << endl
791 << "warning will be ignored, job will continue" << endl;
792 }
793 }
794 } catch( cool::Exception & e) {
795 m_ostream << "Caught cool::Exception: " << e.what() << endl;
796 m_ostream << "Failed to write LVL1 menu to COOL" << endl;
797 throw;
798 } catch(std::exception & e) {
799 m_ostream << "<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
800 throw;
801 }
802
803
804 try {
805
806 // second, parse the items and write to menu and itemDef folders
807 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Menu") ||
808 shouldFolderBeUpdated("/TRIGGER/LVL1/ItemDef") ) {
809
810 rangeInfo("LVL1 menu", vr.since(), vr.until());
811
812 cool::IFolderPtr lvl1MenuFolder = TrigConfCoolFolderSpec::getLvl1MenuFolder(m_dbPtr);
813 cool::IFolderPtr lvl1ItemDefFolder = TrigConfCoolFolderSpec::getLvl1ItemDefFolder(m_dbPtr);
814
815 // use buffer to speed up COOL writing
816 lvl1MenuFolder->setupStorageBuffer();
817 lvl1ItemDefFolder->setupStorageBuffer();
818 // go through the items
819 for ( TriggerItem* item : lvl1Menu.items()) {
820 cool::Record payloadMenu = TrigConfCoolL1PayloadConverters::createLvl1MenuPayload( lvl1MenuFolder, *item );
821 cool::Record payloadItemDef = TrigConfCoolL1PayloadConverters::createLvl1ItemDefPayload( lvl1ItemDefFolder, *item );
822 cool::ChannelId menuChannel = static_cast<cool::ChannelId>(item->ctpId()); // int -> uint32
823 m_ostream << "Writing (to buffer) LVL1 item " << item->name()
824 << " (logic " << payloadItemDef["Logic"].data<cool::String255>()
825 << ": [" << payloadItemDef["ConditionsList"].data<cool::String4k>() << "]) to channel "
826 << menuChannel << endl;
827 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Menu") )
828 lvl1MenuFolder->storeObject(vr.since(), vr.until(), payloadMenu, menuChannel);
829
830 if( shouldFolderBeUpdated("/TRIGGER/LVL1/ItemDef") )
831 lvl1ItemDefFolder->storeObject(vr.since(), vr.until(), payloadItemDef, menuChannel);
832 }
833 // write
834 if( shouldFolderBeUpdated("/TRIGGER/LVL1/Menu") ) {
835 m_ostream << "Flushing LVL1 menu buffer to /TRIGGER/LVL1/Menu" << endl;
836 try {
837 lvl1MenuFolder->flushStorageBuffer();
838 }
839 catch ( cool::Exception & e) {
840 m_ostream << "WARNING: Flushing buffer to DB failed: " << e.what() << endl
841 << "warning will be ignored, job will continue" << endl;
842 }
843 }
844 if( shouldFolderBeUpdated("/TRIGGER/LVL1/ItemDef") ) {
845 m_ostream << "Flushing LVL1 item buffer to /TRIGGER/LVL1/ItemDef" << endl;
846 try {
847 lvl1ItemDefFolder->flushStorageBuffer();
848 }
849 catch ( cool::Exception & e) {
850 m_ostream << "WARNING: Flushing buffer to DB failed: " << e.what() << endl
851 << "warning will be ignored, job will continue" << endl;
852 }
853 }
854 }
855 } catch( cool::Exception & e) {
856 m_ostream << "Caught cool::Exception: " << e.what() << endl;
857 m_ostream << "Failed to write LVL1 menu to COOL" << endl;
858 throw;
859 } catch(std::exception & e) {
860 m_ostream << "<writeLVL1RunPayload> Caught std::exception: " << e.what() << endl;
861 throw;
862 }
863
864 writeL1CTPCoreInputMapping( vr, lvl1Menu );
865
866}
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 504 of file TrigConfCoolWriter.cxx.

506{
507 if(lvl1Menu == 0) throw std::runtime_error("L1 trigger menu ptr is NULL");
508
509 AutoDBOpen db(this, READ_WRITE);
510 // just in case
512
513 // loop over the run ranges
514 for ( RunRange rr : runRanges) {
515
516 ValidityRange vr(rr);
517 rangeInfo("LVL1 monitoring", vr.since(), vr.until());
518
519 if( shouldFolderBeUpdated("/TRIGGER/LVL1/CTPInMonitoringMapping") ) {
520
521 try {
522 // maps to store exact description of mon counters; channel id is
523 // internal mon counter id. Different entries in the mon vector
524 // belong to the same counter, the strings are concatenated,
525 // separated by ':'
526 std::map<cool::ChannelId,std::string> monNames;
527 std::map<cool::ChannelId,std::string> thrNames;
528 std::map<cool::ChannelId,std::string> slots;
529 std::map<cool::ChannelId,std::string> cons;
530 std::map<cool::ChannelId,std::string> mults;
531 std::map<cool::ChannelId,std::string> starts;
532 std::map<cool::ChannelId,std::string> ends;
533 std::map<cool::ChannelId,std::string> actives;
534 // not possible yet std::map<cool::ChannelId,std::string> counterlogic;
535 // the next 2 must be unique
536 std::map<cool::ChannelId,std::string> counterType;
537 std::map<cool::ChannelId,uint16_t> bgId;
538 const std::vector<TrigConf::ThresholdMonitor*>& monCounter = lvl1Menu->moncountVector();
539 std::vector<TrigConf::ThresholdMonitor*>::const_iterator mc = monCounter.begin();
540 for(;mc != monCounter.end(); ++mc) {
541 cool::ChannelId index = static_cast<cool::ChannelId>((*mc)->internalCounter());
542 // the CTPMON goes into the same table, the configuration
543 // of the 160 counters is written with internal counter
544 // as MONCOUNTER + 768, i.e. is added at the end
545 if((*mc)->counterType().find("CTPMON") != std::string::npos) {
546 index += 768;
547 }
548
549 //prepare strings
550 std::stringstream strSlot; strSlot << (*mc)->ctpinSlot();
551 std::stringstream strCon; strCon << (*mc)->ctpinConnector();
552 std::stringstream strMult; strMult << (*mc)->multiplicity();
553 std::stringstream strStart; strStart << (*mc)->thresholdStartBit();
554 std::stringstream strEnd; strEnd << (*mc)->thresholdEndBit();
555 std::string active;
556 if((*mc)->thresholdActive()) active = "ENABLED";
557 else active = "DISABLED";
558
559
560 int flag=0;//0: not write, 1: write new entry, 2: concatenate
561 if( monNames.find(index) == monNames.end() ){
562 //no entries for this counter
563 flag=1;
564 }else{
565 flag=2;
566
567 //check if all parameters exist for the index
568 if( thrNames.find(index) == thrNames.end() ){
569 flag=1;
570 m_ostream << "PROBLEM counter " << index << " : no thrNames in previous entries, overwrite all with new one" << endl;
571 }else if( slots.find(index) == slots.end() ){
572 flag=1;
573 m_ostream << "PROBLEM counter " << index << " : no slots in previous entries, overwrite all with new one" << endl;
574 }else if( cons.find(index) == cons.end() ){
575 flag=1;
576 m_ostream << "PROBLEM counter " << index << " : no cons in previous entries, overwrite all with new one" << endl;
577 }else if( mults.find(index) == mults.end() ){
578 flag=1;
579 m_ostream << "PROBLEM counter " << index << " : no mults in previous entries, overwrite all with new one" << endl;
580 }else if( starts.find(index) == starts.end() ){
581 flag=1;
582 m_ostream << "PROBLEM counter " << index << " : no starts in previous entries, overwrite all with new one" << endl;
583 }else if( ends.find(index) == ends.end() ){
584 flag=1;
585 m_ostream << "PROBLEM counter " << index << " : no ends in previous entries, overwrite all with new one" << endl;
586 }else if( actives.find(index) == actives.end() ){
587 flag=1;
588 m_ostream << "PROBLEM counter " << index << " : no actives in previous entries, overwrite all with new one" << endl;
589 }else if( counterType.find(index) == counterType.end() ){
590 flag=1;
591 m_ostream << "PROBLEM counter " << index << " : no counterType in previous entries, overwrite all with new one" << endl;
592 }else if( bgId.find(index) == bgId.end() ){
593 flag=1;
594 m_ostream << "PROBLEM counter " << index << " : no bgId in previous entries, overwrite all with new one" << endl;
595 }else{
596
597 //check if previous entries for same name have same parameters
598 std::vector<std::string> thrNamesCheck = split(thrNames[index],":");
599 std::vector<std::string> slotsCheck = split(slots[index],":");
600 std::vector<std::string> consCheck = split(cons[index],":");
601 std::vector<std::string> multsCheck = split(mults[index],":");
602 std::vector<std::string> startsCheck = split(starts[index],":");
603 std::vector<std::string> endsCheck = split(ends[index],":");
604 std::vector<std::string> activesCheck = split(actives[index],":");
605 if (thrNamesCheck.size() != slotsCheck.size()||
606 thrNamesCheck.size() != consCheck.size()||
607 thrNamesCheck.size() != multsCheck.size()||
608 thrNamesCheck.size() != startsCheck.size()||
609 thrNamesCheck.size() != endsCheck.size()||
610 thrNamesCheck.size() != activesCheck.size()){
611 flag=1;
612 m_ostream << "PROBLEM counter " << index << " : numbers of entries are different, overwrite all with new one" << endl;
613 }else{
614 for (unsigned int i = 0; i < thrNamesCheck.size();i++){
615 if(thrNamesCheck[i]==(*mc)->thresholdName()&&
616 slotsCheck[i]==strSlot.str()&&
617 consCheck[i]==strCon.str()&&
618 multsCheck[i]==strMult.str()&&
619 startsCheck[i]==strStart.str()&&
620 endsCheck[i]==strEnd.str()&&
621 activesCheck[i]==active){
622
623 flag=0;
624 break;
625 }
626 }
627 }
628 }
629 }
630
631 if(flag==0)continue;
632
633
634 if(flag==1){
635 monNames[index]=(*mc)->name();
636 thrNames[index]=(*mc)->thresholdName();
637 slots[index]=strSlot.str();
638 cons[index]=strCon.str();
639 mults[index]=strMult.str();
640 starts[index]=strStart.str();
641 ends[index]=strEnd.str();
642 actives[index]=std::move(active);
643 counterType[index]=(*mc)->counterType();
644 bgId[index]=(*mc)->bunchGroupId();
645 // not possible yet
646 // monNames[index]=(*mc)->counterLogic();
647 }else if(flag==2){
648 if (monNames[index]!=(*mc)->name()){
649 std::stringstream str;
650 str << "PROBLEM counter " << index;
651 str << " : previous monitor name" << monNames[index];
652 str << ", current monitor name " << (*mc)->name() << endl;
653 m_ostream << str.str() << endl;
654 }
655 if(counterType[index] != (*mc)->counterType()) {
656 std::stringstream str;
657 str << "PROBLEM counter " << index;
658 str << " : previous type " << counterType[index];
659 str << ", current type " << (*mc)->counterType() << endl;
660 m_ostream << str.str() << endl;
661 }
662 if(bgId[index] != (*mc)->bunchGroupId()) {
663 std::stringstream str;
664 str << "PROBLEM counter " << index;
665 str << " : previous bunch-group id " << bgId[index];
666 str << ", current id " << (*mc)->bunchGroupId() << endl;
667 m_ostream << str.str() << endl;
668 }
669 monNames[index]=(*mc)->name();
670 counterType[index]=(*mc)->counterType();
671 bgId[index]=(*mc)->bunchGroupId();
672
673 thrNames[index]+=":";thrNames[index]+=(*mc)->thresholdName();
674 slots[index]+=":";slots[index]+=strSlot.str();
675 cons[index]+=":";cons[index]+=strCon.str();
676 mults[index]+=":";mults[index]+=strMult.str();
677 starts[index]+=":";starts[index]+=strStart.str();
678 ends[index]+=":";ends[index]+=strEnd.str();
679 actives[index]+=":";actives[index]+=active;
680 }else{
681 m_ostream << "PROBLEM counter " << index << " : unknown flag = " << flag << endl;
682 continue;
683 }
684 }
685
686 cool::ChannelId channel(0);
687 cool::IFolderPtr monFolder = TrigConfCoolFolderSpec::getLvl1MonMapFolder(m_dbPtr);
688 // use buffer to speed up COOL writing
689 monFolder->setupStorageBuffer();
690 for(std::map<cool::ChannelId,std::string>::iterator it = thrNames.begin();
691 it != thrNames.end();++it) {
692 channel = it->first;
693 cool::Record payload =
695 counterType[channel],
696 bgId[channel],
697 it->second,
698 slots[channel],
699 cons[channel],
700 mults[channel],
701 starts[channel],
702 ends[channel],
703 actives[channel],
704 monNames[channel]);
705 // add counterlogic above and below when implemented in trigger db
706
707 m_ostream << "Write monitoring counter (channel " << channel << ") :: "
708 << " monname '" << monNames[channel] << "'"
709 << " type '" << counterType[channel] << "'"
710 << " bgid '" << bgId[channel] << "'"
711 << " thnames '" << it->second << "'"
712 << " slots '" << slots[channel] << "'"
713 << " connectors '" << cons[channel] << "'"
714 << " multiplicities '" << mults[channel] << "'"
715 << " start bits '" << starts[channel] << "'"
716 << " end bits '" << ends[channel] << "'"
717 << " thresholds active '" << actives[channel] << "'"
718 << endl;
719 monFolder->storeObject(vr.since(), vr.until(), payload, channel);
720 }
721 monFolder->flushStorageBuffer();
722 } catch( cool::Exception & e) {
723 m_ostream << "Caught cool::Exception: " << e.what() << endl;
724 m_ostream << "Failed to write LVL1 monitoring mapping to COOL" << endl;
725 //throw;
726 } catch(std::exception & e) {
727 m_ostream << "<writeLVL1MonPayload> Caught std::exception: " << e.what() << endl;
728 }
729 }
730 }
731}
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 496 of file TrigConfCoolWriter.cxx.

497 {
499 runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
500 writeL1MonPayload( runRanges, lvl1Menu);
501}
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 303 of file TrigConfCoolWriter.cxx.

304{
305 AutoDBOpen db(this, READ_WRITE);
307 try {
308 writeL1MenuPayload (vr, ctpConfig.menu());
309 writeL1BunchGroupRunPayload(vr, ctpConfig.menu(), ctpConfig.bunchGroupSet() ); // writes bunchgroup description folder
310 writeL1BunchGroupLBPayload (vr, ctpConfig.bunchGroupSet().id(), ctpConfig.bunchGroupSet()); // writes bunchgroup content and key folders
311 writeL1PrescalePayload(vr.since(), vr.until(), ctpConfig.prescaleSet().id(), ctpConfig.prescaleSet());
312 }
313 catch(exception & e) {
314 m_ostream << "<writeL1Payload> caught and re-throw exception: " << e.what() << endl;
315 throw;
316 }
317}
const BunchGroupSet & bunchGroupSet() const
Definition CTPConfig.h:41
const PrescaleSet & prescaleSet(unsigned int partition=0) const
Definition CTPConfig.h:40
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 1168 of file TrigConfCoolWriter.cxx.

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

◆ writeL1PrescalePayload() [2/3]

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

Definition at line 1193 of file TrigConfCoolWriter.cxx.

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

1185{
1186 AutoDBOpen db(this, READ_WRITE);
1188 ValidityRange vr(run, lb);
1189 writeL1PrescalePayload( vr.since(), vr.until(), lvl1PrescaleKey, prescaleSet);
1190}

◆ writeMCKPayload()

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

Definition at line 424 of file TrigConfCoolWriter.cxx.

428{
429 AutoDBOpen db(this, READ_WRITE);
431
432 // writing monitoring configuration key
433 if( shouldFolderBeUpdated("/TRIGGER/HLT/MenuAwareMonConfigKey") ) {
434 rangeInfo("Monitoring configuration key", vr.since(), vr.until());
435 try {
436 IFolderPtr monconfkeyFolder = TrigConfCoolFolderSpec::getMonConfKeyFolder(m_dbPtr);
437 Record payload = createMonConfigKeyPayload(monconfkeyFolder, mck, info);
438 monconfkeyFolder->storeObject(vr.since(), vr.until(), payload, 0, "MenuAwareMonConfigKey-"+release); //tag
439 }
440 catch(exception & e) {
441 m_ostream << "<writeMCKPayload> caught and re-throw exception: " << e.what() << endl
442 << "WARNING: Failed to write monitoring configuration key (MCK) to COOL" << endl;
443 throw;
444 }
445 }
446
447}
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 470 of file TrigConfCoolWriter.cxx.

478{
479 AutoDBOpen db(this, READ_WRITE);
481
482 for ( RunRange rr : runRanges) {
483 writeL1Payload(rr, ctpConfig);
484 }
485
486 // loop over the run ranges
487 for ( RunRange rr : runRanges) {
488 writeHLTPayload( ValidityRange(rr), hltFrame, configSource);
489 }
490}
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 454 of file TrigConfCoolWriter.cxx.

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