ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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 More...
 
 ~TrigConfCoolWriter ()
 destructor More...
 
void createSchema (int schemaVersion=0)
 Create a new schema in the COOL database. More...
 
void recreateSchema (int schemaVersion=0)
 Create a new schema in the COOL database with prior deletion of the old one. More...
 
void printSchema (std::ostream &o)
 Prints the schema in the COOL database. More...
 
void printSchemaVersion (std::ostream &o)
 Prints the schema in the COOL database. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void readL1BunchGroupLBPayload (unsigned int runNumber, unsigned int lumiblockNumber, int &bgKey, TrigConf::BunchGroupSet &bgs)
 Reading lb-wise bunch group configuration information from COOL database. More...
 
std::pair< std::vector< std::string >, std::map< unsigned int, unsigned char > > readL1BunchGroupRunPayload (unsigned int runNumber)
 Reading bunch group configuration information from COOL database. More...
 
void readL1PrescalePayload (unsigned int runNumber, unsigned int lumiblockNumber, unsigned int &lvl1PrescaleKey, TrigConf::PrescaleSet &prescale)
 Reading luminosityblock-wise configuration information the COOL database. More...
 
void readL1InputMapPayload (unsigned int runNumber, std::vector< TrigConf::PIT * > &pits, std::vector< TrigConf::TIP * > &tips)
 Read run-wise PIT configuration from COOL database. More...
 
void readL1MonMapPayload (unsigned int runNumber, std::vector< TrigConf::ThresholdMonitor * > &mons)
 Read run-wise LVL1 monitoring configuration from COOL database. More...
 
void readL1Items (unsigned int runNumber, std::vector< TrigConf::TriggerItem * > &items)
 Read run-wise L1 item vector from COOL database. More...
 
void readL1Thresholds (unsigned int runNumber, std::vector< TrigConf::TriggerThreshold * > &thrs)
 Read run-wise L1 threshold vector from COOL database. More...
 
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. More...
 
void readL1Menu (unsigned int runNumber, CTPConfig &ctpc)
 Read L1 menu from COOL database. More...
 
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 More...
 
 TrigConfCoolWriter (const TrigConfCoolWriter &orig)
 copy constructor More...
 
cool::IDatabaseSvc & databaseService ()
 get COOL db service More...
 
cool::IDatabasePtr openDb (bool readOnly=true)
 open COOL db connection More...
 
bool dbIsOpen ()
 check if db is open More...
 
void dropDb ()
 delete the COOL database More...
 
void closeDb (cool::IDatabasePtr &db)
 close the COOL database More...
 
void closeDb ()
 
cool::IDatabasePtr createDb ()
 create a new COOL database More...
 
cool::IDatabasePtr recreateDb ()
 create a new COOL database with prior deletion of the old one More...
 
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 More...
 

Private Attributes

cool::DatabaseId m_dbId
 db connection string More...
 
cool::IDatabasePtr m_dbPtr
 COOL database pointer. More...
 
cool::Application m_coolApp
 COOL application. More...
 
std::vector< std::string > m_writeFolderList
 list of folders to which writing is restricted More...
 
std::ostream & m_ostream
 output stream for all messages More...
 
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  {}

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

91  {
92  if(dbIsOpen()) return true;
93  openDb( readOnly );
94  closeDb();
95  return true;
96 }

◆ checkPayloadSize()

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

Definition at line 1704 of file TrigConfCoolWriter.cxx.

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

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

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

◆ closeDb() [2/2]

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

close the COOL database

Definition at line 140 of file TrigConfCoolWriter.cxx.

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

◆ createDb()

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

create a new COOL database

Definition at line 248 of file TrigConfCoolWriter.cxx.

248  {
249  m_ostream << "Creating database '" << m_dbId << "'" << endl;
250  try {
251  cool::IDatabaseSvc& dbSvc = databaseService();
252  m_dbPtr = dbSvc.createDatabase( m_dbId );
253  }
254  catch(std::exception& e) {
255  m_ostream << "*** COOL exception caught: " << e.what() << endl;
256  m_ostream << "Coudn't create a new conditions database: " << m_dbId << endl;
257  throw;
258  }
259 
260  return m_dbPtr;
261 }

◆ createSchema()

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

Create a new schema in the COOL database.

Definition at line 175 of file TrigConfCoolWriter.cxx.

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

◆ databaseService()

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

get COOL db service

Definition at line 84 of file TrigConfCoolWriter.cxx.

85 {
86  return m_coolApp.databaseService();
87 }

◆ dbIsOpen()

bool TrigConf::TrigConfCoolWriter::dbIsOpen ( )
private

check if db is open

Definition at line 100 of file TrigConfCoolWriter.cxx.

100  {
101  return m_dbPtr.use_count()>0 && m_dbPtr->isOpen();
102 }

◆ dropDb()

void TrigConf::TrigConfCoolWriter::dropDb ( )
private

delete the COOL database

Definition at line 241 of file TrigConfCoolWriter.cxx.

241 {}

◆ HLTPrescaleFolderExists()

bool TrigConf::TrigConfCoolWriter::HLTPrescaleFolderExists ( )

Definition at line 1686 of file TrigConfCoolWriter.cxx.

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

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

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

◆ printSchema()

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

Prints the schema in the COOL database.

Parameters
ooutput stream

Definition at line 214 of file TrigConfCoolWriter.cxx.

◆ printSchemaVersion()

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

Prints the schema in the COOL database.

Parameters
ooutput stream

Definition at line 224 of file TrigConfCoolWriter.cxx.

224  {
225  AutoDBOpen db(this, READ_ONLY);
227  o << "Schema version is " << schemaVersion
228  << (schemaVersion==TrigConfCoolFolderSpec::getDefaultSchemaVersion()?" (=default)":"") << endl;
229 }

◆ rangeInfo()

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

Definition at line 265 of file TrigConfCoolWriter.cxx.

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

◆ readHLTPayload()

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

Definition at line 1252 of file TrigConfCoolWriter.cxx.

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

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

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

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

1581 {
1582  AutoDBOpen db(this, READ_ONLY);
1584  vr.until() = vr.since(); // single LB
1585 
1586  // read the bunch group key
1587  IFolderPtr lvl1BGKeyFolder = TrigConfCoolFolderSpec::getLvl1BGKeyFolder(m_dbPtr);
1588  IObjectIteratorPtr objects = lvl1BGKeyFolder->browseObjects( vr.since(), vr.until(), 0 );
1589  objects->goToNext();
1590  const IObject& obj = objects->currentRef();
1591  const IRecord & payload1 = obj.payload();
1592  bgKey = readLvl1BGKey( payload1.attributeList() );
1593 
1594  // read the bunch group content
1595  IFolderPtr lvl1BGContentFolder = TrigConfCoolFolderSpec::getLvl1BGContentFolder(m_dbPtr);
1596  IObjectIteratorPtr objects2 = lvl1BGContentFolder->browseObjects( vr.since(), vr.until(), 0);
1597  objects2->goToNext();
1598  const IObject& obj2 = objects2->currentRef();
1599  const IRecord & payload2 = obj2.payload();
1600  vector<BunchGroup> bgV = readLvl1BGContent( payload2.attributeList() );
1601 
1602  // read the bunch group names
1603  pair< vector<string>, map<unsigned int,unsigned char> > bg_pair = readL1BunchGroupRunPayload(run);
1604  vector<string> names = bg_pair.first;
1605 
1606 
1607 
1608  uint newBGSSize = bgV.size() <= names.size() ? bgV.size() : names.size();
1609 
1610  if(bgV.size() != names.size()) {
1611  cout << "WARNING Bunchgroup content vector is of size " << bgV.size()
1612  << ", which is different from the size of the names vector: " << names.size()
1613  << ". Using " << newBGSSize << endl;
1614 
1615  }
1616 
1617  // create a new bunch group set, set names and bunch groups
1618  bgs = BunchGroupSet();
1619  for(unsigned int i=0; i<newBGSSize; i++) {
1620  string bgname = names[i];
1621  if(bgname=="") bgname = "NoName";
1622  bgV[i].setName(bgname);
1623  bgV[i].setInternalNumber(i);
1624  bgs.addBunchGroup(bgV[i]);
1625  }
1626  bgs.setId(bgKey);
1627 }

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

1558 {
1559  AutoDBOpen db(this, READ_ONLY);
1560  ValidityRange vr(run);
1562  IObjectIteratorPtr objects = folder->browseObjects( vr.since(), vr.until()-1, 0 );
1563  objects->goToNext();
1564  const IObject& obj = objects->currentRef();
1565  const IRecord & payload = obj.payload();
1566  return readLvl1BGDesc( payload.attributeList() );
1567 }

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

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

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

1455 {
1456  AutoDBOpen db(this, READ_ONLY);
1457  ValidityRange vr(run, 1);
1458 
1459  IFolderPtr L1ItemDefFolder = TrigConfCoolFolderSpec::getLvl1ItemDefFolder(m_dbPtr);
1460  for(TriggerItem* item: items) {
1461  ChannelId itemChannel = item->ctpId();
1462  IObjectIteratorPtr objects = L1ItemDefFolder->browseObjects( vr.since(), vr.until()-1, itemChannel );
1463  while ( objects->goToNext() ) {
1464  const IObject& obj = objects->currentRef();
1465  const IRecord & payload = obj.payload();
1466  addThresholdsToTriggerItem( payload.attributeList(), item, thrs);
1467  }
1468  }
1469 }

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

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

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

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

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

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

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

1308 {
1309 
1315  readL1Menu( run, ctpc );
1316 }

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

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

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

1437  {
1438  AutoDBOpen db(this, READ_ONLY);
1439  ValidityRange vr(run, 1);
1440  thrs.clear();
1441  IFolderPtr L1thrFolder = TrigConfCoolFolderSpec::getLvl1ThresholdFolder(m_dbPtr);
1442  IObjectIteratorPtr objects = L1thrFolder->browseObjects( vr.since(), vr.until()-1, cool::ChannelSelection() );
1443  while ( objects->goToNext() ) {
1444  const IObject& obj = objects->currentRef();
1445  const IRecord & payload = obj.payload();
1446  thrs.push_back( createLvl1Threshold( payload.attributeList() ) );
1447  }
1448 }

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

1298 {
1299  readHLTPayload( run, hltFrame);
1300  masterConfigKey = hltFrame.smk();
1301  configSource = hltFrame.configSource();
1302 }

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

235 {}

◆ setVerbosityLevel()

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

Definition at line 380 of file TrigConfCoolWriter.h.

380 { m_verbosityLevel = level; }

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

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

◆ writeHltPrescalePayload() [1/3]

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

Definition at line 1027 of file TrigConfCoolWriter.cxx.

1029 {
1030  AutoDBOpen db(this, READ_WRITE);
1032  for ( RunRange rr : runRanges) {
1033  ValidityRange vr(rr);
1034  writeHltPrescalePayload( vr.since(), vr.until(), pss);
1035  }
1036 }

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

1042 {
1043  AutoDBOpen db(this, READ_WRITE);
1045  ValidityRange vr(run, lb);
1046  writeHltPrescalePayload( vr.since(), vr.until(), pss);
1047 }

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

982 {
983  AutoDBOpen db(this, READ_WRITE);
984  for ( RunRange rr : runRanges) {
986  writeL1BunchGroupLBPayload( rr, bgKey, bgs);
987  }
988 }

◆ writeL1BunchGroupLBPayload() [2/2]

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

Definition at line 991 of file TrigConfCoolWriter.cxx.

994 {
995  AutoDBOpen db(this, READ_WRITE);
997  try {
998  if( shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupKey") ) {
999  rangeInfo("LVL1 bunchgroup key", vr.since(), vr.until());
1000  IFolderPtr lvl1BGKFolder = TrigConfCoolFolderSpec::getLvl1BGKeyFolder(m_dbPtr);
1001  Record payload = createLvl1BGKeyPayload(lvl1BGKFolder, bgKey);
1002  m_ostream << "Store LVL1 BG key to /TRIGGER/LVL1/BunchGroupKey" << endl;
1003  lvl1BGKFolder->storeObject(vr.since(), vr.until(), payload, 0);
1004  }
1005 
1006  if( shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupContent") ) {
1007  rangeInfo("LVL1 bunchgroups", vr.since(), vr.until());
1008  IFolderPtr lvl1BGContentFolder = TrigConfCoolFolderSpec::getLvl1BGContentFolder(m_dbPtr);
1009  Record payload = createLvl1BGContentPayload(lvl1BGContentFolder, bgs);
1010  m_ostream << "Store LVL1 BG content to /TRIGGER/LVL1/BunchGroupContent" << endl;
1011  lvl1BGContentFolder->storeObject(vr.since(), vr.until(), payload, 0);
1012  }
1013  }
1014  catch(exception & e) {
1015  m_ostream << "<writeLVL1BGPayload> caugh and re-throw exception: " << e.what() << endl;
1016  throw;
1017  }
1018 }

◆ writeL1BunchGroupRunPayload() [1/2]

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

Definition at line 967 of file TrigConfCoolWriter.cxx.

970 {
971  AutoDBOpen db(this, READ_WRITE);
973  for ( RunRange rr : runRanges)
974  writeL1BunchGroupRunPayload( rr, lvl1Menu, bgs);
975 }

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

948 {
949  if( !shouldFolderBeUpdated("/TRIGGER/LVL1/BunchGroupDescription") ) return;
950  AutoDBOpen db(this, READ_WRITE);
952  rangeInfo("LVL1 bunch group descriptions", vr.since(), vr.until());
953  try {
954  IFolderPtr bgDescFolder = TrigConfCoolFolderSpec::getLvl1BGDescFolder(m_dbPtr);
955  Record payload = createLvl1BGDescPayload(bgDescFolder, bgs,lvl1Menu);
956  m_ostream << "Store LVL1 BG description buffer to /TRIGGER/LVL1/BunchGroupDescription" << endl;
957  bgDescFolder->storeObject(vr.since(), vr.until(), payload, 0);
958  }
959  catch(exception & e) {
960  m_ostream << "<writeL1BunchGroupRunPayload> caught and re-throw exception: " << e.what() << endl;
961  throw;
962  }
963 }

◆ writeL1CTPCoreInputMapping()

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

Definition at line 894 of file TrigConfCoolWriter.cxx.

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

◆ writeL1MenuPayload() [1/2]

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

Definition at line 879 of file TrigConfCoolWriter.cxx.

881 {
882  AutoDBOpen db(this, READ_WRITE);
883  for ( RunRange rr : runRanges)
884  writeL1MenuPayload( rr, lvl1Menu );
885 }

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

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

◆ writeL1MonPayload() [1/2]

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

Definition at line 508 of file TrigConfCoolWriter.cxx.

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

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

501  {
502  RunRangeVec runRanges;
503  runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
504  writeL1MonPayload( runRanges, lvl1Menu);
505 }

◆ writeL1Payload()

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

Definition at line 307 of file TrigConfCoolWriter.cxx.

308 {
309  AutoDBOpen db(this, READ_WRITE);
311  try {
312  writeL1MenuPayload (vr, ctpConfig.menu());
313  writeL1BunchGroupRunPayload(vr, ctpConfig.menu(), ctpConfig.bunchGroupSet() ); // writes bunchgroup description folder
314  writeL1BunchGroupLBPayload (vr, ctpConfig.bunchGroupSet().id(), ctpConfig.bunchGroupSet()); // writes bunchgroup content and key folders
315  writeL1PrescalePayload(vr.since(), vr.until(), ctpConfig.prescaleSet().id(), ctpConfig.prescaleSet());
316  }
317  catch(exception & e) {
318  m_ostream << "<writeL1Payload> caught and re-throw exception: " << e.what() << endl;
319  throw;
320  }
321 }

◆ writeL1PrescalePayload() [1/3]

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

Definition at line 1173 of file TrigConfCoolWriter.cxx.

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

◆ writeL1PrescalePayload() [2/3]

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

Definition at line 1198 of file TrigConfCoolWriter.cxx.

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

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

1190 {
1191  AutoDBOpen db(this, READ_WRITE);
1193  ValidityRange vr(run, lb);
1194  writeL1PrescalePayload( vr.since(), vr.until(), lvl1PrescaleKey, prescaleSet);
1195 }

◆ writeMCKPayload()

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

Definition at line 428 of file TrigConfCoolWriter.cxx.

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

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

482 {
483  AutoDBOpen db(this, READ_WRITE);
485 
486  for ( RunRange rr : runRanges) {
487  writeL1Payload(rr, ctpConfig);
488  }
489 
490  // loop over the run ranges
491  for ( RunRange rr : runRanges) {
492  writeHLTPayload( ValidityRange(rr), hltFrame, configSource);
493  }
494 }

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

466 {
467  RunRangeVec runRanges;
468  runRanges.push_back(std::pair<unsigned int,unsigned int>(runNumber,runNumber));
469  writeRunPayload( runRanges, masterConfigKey, hltPrescaleKey, lvl1Thr, ctpConfig, caloInfo, hltFrame, configSource);
470 }

Friends And Related Function Documentation

◆ 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.

◆ 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:
grepfile.info
info
Definition: grepfile.py:38
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TrigConf::L1DataDef::setMaxThresholdsFromL1Version
static void setMaxThresholdsFromL1Version(unsigned int l1version)
Definition: L1DataDef.cxx:65
TrigConf::TrigConfCoolWriter::readL1ItemDef
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.
Definition: TrigConfCoolWriter.cxx:1452
TrigConf::BunchGroupSet
Definition: BunchGroupSet.h:19
TrigConf::TrigConfCoolWriter::writeL1MonPayload
void writeL1MonPayload(unsigned int runNumber, const TrigConf::Menu *lvl1Menu)
Writing L1 run-wise monitoring configuration to COOL.
Definition: TrigConfCoolWriter.cxx:500
TrigConf::TrigConfCoolFolderSpec::getLvl1PrescalesFolder
static cool::IFolderPtr getLvl1PrescalesFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:511
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1MonMapPayload
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
Definition: TrigConfCoolL1PayloadConverters.cxx:368
TrigConf::TrigConfCoolWriter::readL1BunchGroupRunPayload
std::pair< std::vector< std::string >, std::map< unsigned int, unsigned char > > readL1BunchGroupRunPayload(unsigned int runNumber)
Reading bunch group configuration information from COOL database.
Definition: TrigConfCoolWriter.cxx:1557
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
TrigConf::PIT
Definition: PIT.h:13
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1BGDesc
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
Definition: TrigConfCoolL1PayloadConverters.cxx:555
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
LArConditions2Ntuple.objects
objects
Definition: LArConditions2Ntuple.py:56
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TrigConf::TrigConfCoolWriter::readHLTPayload
void readHLTPayload(unsigned int run, HLTFrame &hltFrame)
Definition: TrigConfCoolWriter.cxx:1252
TrigConf::L2
@ L2
Definition: HLTLevel.h:12
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1PrescalesPayload
cool::Record createLvl1PrescalesPayload(cool::IFolderPtr, int prescale)
build a COOL db record from a LVL1 prescale value
Definition: TrigConfCoolL1PayloadConverters.cxx:190
TrigConf::RunRangeVec
std::vector< RunRange > RunRangeVec
Definition: TrigConfCoolWriter.h:37
TrigConf::TrigConfCoolFolderSpec::getHltChainGroupFolder
static cool::IFolderPtr getHltChainGroupFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:539
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1ConfigKeyPayload
cool::Record createLvl1ConfigKeyPayload(cool::IFolderPtr, unsigned int lvl1PrescaleKey)
build a COOL db record from a LVL1 configuration key
Definition: TrigConfCoolL1PayloadConverters.cxx:182
TrigConf::TrigConfCoolWriter::rangeInfo
void rangeInfo(const std::string &content, cool::ValidityKey since, cool::ValidityKey until)
Definition: TrigConfCoolWriter.cxx:265
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1InputMap
TrigConf::PIT * readLvl1InputMap(const coral::AttributeList &al)
Build a LVL1 PIT object from COOL payload.
Definition: TrigConfCoolL1PayloadConverters.cxx:630
TrigConf::TrigConfCoolWriter::m_verbosityLevel
int m_verbosityLevel
Definition: TrigConfCoolWriter.h:446
TrigConf::Menu::caloInfo
const CaloInfo & caloInfo() const
Definition: Menu.h:74
TrigConf::AutoDBOpen
Definition: TrigConfCoolWriter.h:84
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConf::PrescaleSet::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition: PrescaleSet.cxx:197
TrigConf::METSigParam::setValues
void setValues(int XSSigmaScale, int XSSigmaOffset, int XEmin, int XEmax, int TESqrtMin, int TESqrtMax)
Definition: METSigParam.cxx:35
index
Definition: index.py:1
TrigConf::TrigConfCoolWriter::m_dbId
cool::DatabaseId m_dbId
db connection string
Definition: TrigConfCoolWriter.h:439
TrigConf::TrigConfCoolWriter::readL1Thresholds
void readL1Thresholds(unsigned int runNumber, std::vector< TrigConf::TriggerThreshold * > &thrs)
Read run-wise L1 threshold vector from COOL database.
Definition: TrigConfCoolWriter.cxx:1436
RunEBWeightsComputation.smk
smk
Definition: RunEBWeightsComputation.py:87
TrigConf::TrigConfCoolFolderSpec::getLvl1ConfKeyFolder
static cool::IFolderPtr getLvl1ConfKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:507
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
TrigConf::TrigConfCoolHLTPayloadConverters::readHltPrescaleKey
int readHltPrescaleKey(const coral::AttributeList &al)
build the HLT prescale key from a COOL db record
Definition: TrigConfCoolHLTPayloadConverters.cxx:261
TrigConf::TIP
Definition: TIP.h:13
TrigConf::PrescaleSet::resize
void resize(size_t size)
Definition: PrescaleSet.cxx:80
TrigConf::TrigConfCoolFolderSpec::getLvl1MenuFolder
static cool::IFolderPtr getLvl1MenuFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:495
TrigConf::TrigConfCoolFolderSpec::getDefaultSchemaVersion
static int getDefaultSchemaVersion()
access to the version
Definition: TrigConfCoolFolderSpec.h:60
TrigConf::TrigConfCoolFolderSpec::getLvl1BGKeyFolder
static cool::IFolderPtr getLvl1BGKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:515
TrigConf::CTPConfig::bunchGroupSet
const BunchGroupSet & bunchGroupSet() const
Definition: CTPConfig.h:40
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1BGContent
std::vector< TrigConf::BunchGroup > readLvl1BGContent(const coral::AttributeList &al)
build the LVL1 Bunchgroup code
Definition: TrigConfCoolL1PayloadConverters.cxx:518
python.checkUPD1.foldername
foldername
Definition: checkUPD1.py:77
TrigConf::Menu::tipVector
const std::vector< TIP * > & tipVector() const
Definition: Menu.h:71
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TrigConf::TrigConfCoolFolderSpec::createFolderStructure
static cool::IFolderSetPtr createFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the COOL database
Definition: TrigConfCoolFolderSpec.cxx:415
TrigConf::TrigConfCoolFolderSpec::getHltConfKeyFolder
static cool::IFolderPtr getHltConfKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:543
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1BGKey
int readLvl1BGKey(const coral::AttributeList &al)
build the LVL1 Bunchgroup key value
Definition: TrigConfCoolL1PayloadConverters.cxx:623
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1METSigPayload
cool::Record createLvl1METSigPayload(cool::IFolderPtr, const METSigParam &metSigParams)
build a COOL db record from a L1 MET significance global parameters
Definition: TrigConfCoolL1PayloadConverters.cxx:91
TrigConf::TrigConfCoolWriter::shouldFolderBeUpdated
bool shouldFolderBeUpdated(const std::string &foldername)
check if foldername is in list of writeable folders
Definition: TrigConfCoolWriter.h:432
TrigConf::TrigConfCoolWriter::readL1Menu
void readL1Menu(unsigned int runNumber, CTPConfig &ctpc)
Read L1 menu from COOL database.
Definition: TrigConfCoolWriter.cxx:1473
ReadCellNoiseFromCoolCompare.obj2
obj2
Definition: ReadCellNoiseFromCoolCompare.py:303
TrigConf::CaloInfo::metSigParam
METSigParam & metSigParam()
Definition: CaloInfo.h:50
TrigConf::TrigConfCoolFolderSpec::createMonFolderStructure
static cool::IFolderSetPtr createMonFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the monitoring COOL database
Definition: TrigConfCoolFolderSpec.cxx:476
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1ThresholdPayload
cool::Record createLvl1ThresholdPayload(cool::IFolderPtr, const TrigConf::TriggerThreshold &thr)
build a COOL db record from a LVL1 TriggerItem
Definition: TrigConfCoolL1PayloadConverters.cxx:108
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1Threshold
TriggerThreshold * createLvl1Threshold(const coral::AttributeList &al)
build a LVL1 TriggerThreshold from a COOL db record
Definition: TrigConfCoolL1PayloadConverters.cxx:417
TrigConf::TrigConfCoolL1PayloadConverters::addThresholdsToTriggerItem
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
Definition: TrigConfCoolL1PayloadConverters.cxx:407
TrigConf::HLTChain
HLT chain configuration information.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:35
TrigConf::TrigConfCoolWriter::readL1Items
void readL1Items(unsigned int runNumber, std::vector< TrigConf::TriggerItem * > &items)
Read run-wise L1 item vector from COOL database.
Definition: TrigConfCoolWriter.cxx:1398
TrigConf::PIT::setPitNumber
void setPitNumber(const uint16_t &pitnumber)
Definition: PIT.h:30
TrigConf::TrigConfCoolWriter::writeL1MenuPayload
void writeL1MenuPayload(ValidityRange vr, const TrigConf::Menu &lvl1Menu)
Writing L1 run-wise configuration information to the COOL database.
Definition: TrigConfCoolWriter.cxx:746
TrigConf::TrigConfCoolHLTPayloadConverters::createHltChainGroupPayload
cool::Record createHltChainGroupPayload(cool::IFolderPtr, const TrigConf::HLTChain &ch)
build a COOL db record from a HLT chain
Definition: TrigConfCoolHLTPayloadConverters.cxx:57
TrigConf::TrigConfCoolFolderSpec::getHltPrescalesFolder
static cool::IFolderPtr getHltPrescalesFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:551
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1BGDescPayload
cool::Record createLvl1BGDescPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs, const TrigConf::Menu &lvl1Menu)
build a COOL db record from a bunch group description
Definition: TrigConfCoolL1PayloadConverters.cxx:283
TrigConf::RunRange
std::pair< unsigned int, unsigned int > RunRange
Definition: TrigConfCoolWriter.h:33
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigConf::HLT
@ HLT
Definition: HLTLevel.h:12
TrigConf::TrigConfCoolFolderSpec::getMonConfKeyFolder
static cool::IFolderPtr getMonConfKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:547
TrigConf::HLTFrame::theHLTSequenceList
HLTSequenceList & theHLTSequenceList()
accessor to the list of HLT sequences
Definition: HLTFrame.h:45
dq_defect_copy_defect_database.since
def since
Definition: dq_defect_copy_defect_database.py:54
TrigConf::HLTPrescale::setPassThrough
HLTPrescale & setPassThrough(float pass_through)
Definition: HLTPrescale.h:47
TrigConf::HLTPrescaleSet::thePrescale
HLTPrescale & thePrescale(unsigned int chain_counter, HLTLevel level)
Definition: HLTPrescaleSet.cxx:53
dq_defect_copy_defect_database.until
def until
Definition: dq_defect_copy_defect_database.py:55
grepfile.content
string content
Definition: grepfile.py:56
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TrigConf::TIP::setClock
void setClock(const int &clock)
Definition: TIP.h:54
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1ItemDefPayload
cool::Record createLvl1ItemDefPayload(cool::IFolderPtr, const TrigConf::TriggerItem &item)
build a COOL db record from a LVL1 TriggerItem (the conditions)
Definition: TrigConfCoolL1PayloadConverters.cxx:59
menu
make the sidebar many part of the config
Definition: hcg.cxx:551
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
TrigConf::Menu::moncountVector
const std::vector< ThresholdMonitor * > & moncountVector() const
Definition: Menu.h:69
TrigConf::TrigConfCoolFolderSpec::getHltMenuFolder
static cool::IFolderPtr getHltMenuFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:535
TrigConf::TrigConfCoolHLTPayloadConverters::createHLTChain
HLTChain * createHLTChain(const coral::AttributeList &al, TrigConf::HLTSequenceList *sequences=0)
build an HLT chain from a COOL db record
Definition: TrigConfCoolHLTPayloadConverters.cxx:110
mc
Definition: mc.PG_single_nu_valid.py:1
TrigConf::TrigConfCoolWriter::m_dbPtr
cool::IDatabasePtr m_dbPtr
COOL database pointer.
Definition: TrigConfCoolWriter.h:440
TrigConf::Menu
Definition: Menu.h:49
python.getCurrentFolderTag.fn
fn
Definition: getCurrentFolderTag.py:65
TrigConf::CTPConfig::l1Version
unsigned int l1Version() const
Definition: CTPConfig.h:34
TrigConf::TrigConfCoolWriter::dbIsOpen
bool dbIsOpen()
check if db is open
Definition: TrigConfCoolWriter.cxx:100
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1ConfigKey
void readLvl1ConfigKey(const coral::AttributeList &al, unsigned int &lvl1PrescaleKey)
build the LVL1 configuration key from a coral::AttributeList
Definition: TrigConfCoolL1PayloadConverters.cxx:595
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
TrigConf::EF
@ EF
Definition: HLTLevel.h:12
Trk::active
@ active
Definition: Layer.h:48
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrigConf::TrigConfData::setSMK
void setSMK(int id)
Definition: TrigConfData.h:28
TrigConf::HLTPrescaleSetCollection::sets
std::list< cont > & sets()
Definition: HLTPrescaleSetCollection.h:67
TrigConf::TrigConfCoolWriter::writeL1BunchGroupRunPayload
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.
Definition: TrigConfCoolWriter.cxx:945
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1Prescale
void readLvl1Prescale(const coral::AttributeList &al, int &ps)
build the LVL1 prescale value from a coral::AttributeList
Definition: TrigConfCoolL1PayloadConverters.cxx:603
TrigConf::TrigConfCoolWriter::writeL1BunchGroupLBPayload
void writeL1BunchGroupLBPayload(const RunRangeVec &runRanges, unsigned int bgKey, const BunchGroupSet &bgs)
Writing LB-wise L1 bunch group definition to the COOL database.
Definition: TrigConfCoolWriter.cxx:979
TrigConf::CaloInfo
Definition: CaloInfo.h:35
python.subdetectors.mmg.names
names
Definition: mmg.py:8
TrigConf::ThresholdConfig::l1Version
unsigned int l1Version() const
Definition: ThresholdConfig.h:87
TrigConf::Menu::thresholdConfig
const ThresholdConfig & thresholdConfig() const
Definition: Menu.h:73
TrigConf::TrigConfCoolWriter::databaseService
cool::IDatabaseSvc & databaseService()
get COOL db service
Definition: TrigConfCoolWriter.cxx:84
TrigConf::TrigConfCoolWriter::writeRunPayload
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.
Definition: TrigConfCoolWriter.cxx:458
TrigConf::ThresholdConfig::thresholdVector
const std::vector< TriggerThreshold * > & thresholdVector(L1DataDef::TriggerType) const
Definition: ThresholdConfig.cxx:47
master.flag
bool flag
Definition: master.py:29
TrigConf::PrescaleSet::setPrescale
void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__((deprecated))
Set the prescale NUM from the int64 value prescaleValue.
Definition: PrescaleSet.cxx:166
calibdata.exception
exception
Definition: calibdata.py:496
TrigConf::TrigConfCoolHLTPayloadConverters::createHltMenuPayload
cool::Record createHltMenuPayload(cool::IFolderPtr, const TrigConf::HLTChain &, const std::string &concise)
build a COOL db record from a HLT chain
Definition: TrigConfCoolHLTPayloadConverters.cxx:28
TrigConf::TrigConfCoolFolderSpec::getLvl1BGDescFolder
static cool::IFolderPtr getLvl1BGDescFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:523
TrigConf::PrescaleSet::cuts
const std::vector< int32_t > & cuts() const
Definition: PrescaleSet.h:44
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1TriggerItem
TriggerItem * createLvl1TriggerItem(const coral::AttributeList &al)
build a LVL1 TriggerItem from a COOL db record
Definition: TrigConfCoolL1PayloadConverters.cxx:398
TrigConf::TrigConfCoolWriter::closeDb
void closeDb()
Definition: TrigConfCoolWriter.cxx:158
TrigConf::ValidityRange
Definition: TrigConfCoolWriter.h:39
TrigConf::BunchGroupSet::addBunchGroup
void addBunchGroup(const BunchGroup &)
Definition: BunchGroupSet.cxx:26
TrigConf::CTPConfig::prescaleSet
const PrescaleSet & prescaleSet(unsigned int partition=0) const
Definition: CTPConfig.h:39
run
Definition: run.py:1
TrigConf::HLTPrescaleSet::reset
void reset()
Definition: HLTPrescaleSet.cxx:99
TrigConf::TrigConfCoolHLTPayloadConverters::createHltConfigKeysPayload
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
Definition: TrigConfCoolHLTPayloadConverters.cxx:73
Record
Definition: HephProf.cxx:56
TrigConf::HLTLevel
HLTLevel
Definition: HLTLevel.h:12
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1JetWeightPayload
cool::Record createLvl1JetWeightPayload(cool::IFolderPtr, const std::vector< int > &jetweights)
build a COOL db record from a L1 Jet Weights vector
Definition: TrigConfCoolL1PayloadConverters.cxx:76
TrigConf::TrigConfCoolWriter::readL1InputMapPayload
void readL1InputMapPayload(unsigned int runNumber, std::vector< TrigConf::PIT * > &pits, std::vector< TrigConf::TIP * > &tips)
Read run-wise PIT configuration from COOL database.
Definition: TrigConfCoolWriter.cxx:1319
TrigConf::TrigConfData::setId
void setId(unsigned int id)
Definition: TrigConfData.h:29
TrigConf::HLTPrescaleSet
HLT chain configuration information.
Definition: HLTPrescaleSet.h:31
TrigConf::TrigConfCoolWriter::writeL1Payload
void writeL1Payload(ValidityRange vr, const CTPConfig &ctpConfig)
Definition: TrigConfCoolWriter.cxx:307
TrigConf::HLTChainList::addHLTChain
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
Definition: HLTChainList.cxx:42
TrigConf::TrigConfCoolHLTPayloadConverters::createMonConfigKeyPayload
cool::Record createMonConfigKeyPayload(cool::IFolderPtr fld, uint MCK, std::string &info)
build a COOL db record from a HLT monitoring configuration key
Definition: TrigConfCoolHLTPayloadConverters.cxx:83
READ_ONLY
#define READ_ONLY
Definition: TrigConfCoolWriter.cxx:59
CaloNoise_fillDB.dbSvc
dbSvc
Definition: CaloNoise_fillDB.py:108
TrigConf::TrigConfCoolWriter::writeHltPrescalePayload
void writeHltPrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, const TrigConf::HLTPrescaleSet &pss)
Writing luminosityblock-wise configuration information the COOL database.
Definition: TrigConfCoolWriter.cxx:1040
TrigConf::PrescaleSet::setCut
void setCut(unsigned int num, int32_t cut)
Definition: PrescaleSet.cxx:96
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1BGKeyPayload
cool::Record createLvl1BGKeyPayload(cool::IFolderPtr, unsigned int lvl1BunchgroupKey)
build a COOL db record from a LVL1 bunch group key
Definition: TrigConfCoolL1PayloadConverters.cxx:212
TrigConf::TrigConfCoolWriter::m_coolApp
cool::Application m_coolApp
COOL application.
Definition: TrigConfCoolWriter.h:441
python.TrigConfigSvcUtils.isRun2
def isRun2(cursor, schemaname)
Definition: TrigConfigSvcUtils.py:290
TrigConf::TrigConfData::smk
unsigned int smk() const
Definition: TrigConfData.h:20
TrigConf::HLTTEUtils::allTEsProduced
static std::set< std::string > allTEsProduced(const TrigConf::HLTFrame &frame)
Definition: TrigConfHLTData/Root/HLTUtils.cxx:211
CaloCellTimeCorrFiller.folderName
string folderName
Definition: CaloCellTimeCorrFiller.py:20
TrigConf::counter
Definition: HLTChainList.h:37
TrigConf::TrigConfCoolWriter::m_writeFolderList
std::vector< std::string > m_writeFolderList
list of folders to which writing is restricted
Definition: TrigConfCoolWriter.h:443
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
TrigConf::TrigConfData::id
unsigned int id() const
Definition: TrigConfData.h:21
TrigConf::TIP::setTipNumber
void setTipNumber(const uint16_t &tipnumber)
Definition: TIP.h:30
python.BeamSpotUpdate.folderList
folderList
Definition: BeamSpotUpdate.py:35
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
TrigConf::TrigConfCoolFolderSpec::readSchemaVersion
static int readSchemaVersion(cool::IDatabasePtr db)
get the version of the COOL database
Definition: TrigConfCoolFolderSpec.cxx:32
item
Definition: ItemListSvc.h:43
TrigConf::HLTPrescale::setPrescale
HLTPrescale & setPrescale(float prescale)
Definition: HLTPrescale.h:46
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
TrigConf::TrigConfCoolFolderSpec::getLvl1ItemDefFolder
static cool::IFolderPtr getLvl1ItemDefFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:499
TrigConf::TrigConfCoolWriter::createDb
cool::IDatabasePtr createDb()
create a new COOL database
Definition: TrigConfCoolWriter.cxx:248
TrigConf::HLTTEUtils::ChainCondenseDisplay
static std::string ChainCondenseDisplay(const HLTChain &chain, const HLTFrame &frame)
Definition: TrigConfHLTData/Root/HLTUtils.cxx:341
TrigConf::TrigConfCoolWriter::m_ostream
std::ostream & m_ostream
output stream for all messages
Definition: TrigConfCoolWriter.h:444
TrigConf::TrigConfCoolHLTPayloadConverters::addGroupsToHltChain
void addGroupsToHltChain(const coral::AttributeList &al, const TrigConf::HLTChainList &chl)
add the groups to and HLT chain from a AttributeList
Definition: TrigConfCoolHLTPayloadConverters.cxx:222
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1BGContentPayload
cool::Record createLvl1BGContentPayload(cool::IFolderPtr fld, const TrigConf::BunchGroupSet &bgs)
build a COOL db record from a bunch group definition value
Definition: TrigConfCoolL1PayloadConverters.cxx:220
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
DeMoScan.index
string index
Definition: DeMoScan.py:362
TrigConf::CTPConfig::setCTPVersion
void setCTPVersion(unsigned int v)
Definition: CTPConfig.cxx:33
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TrigConf::split
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:27
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
TrigConf::TrigConfCoolWriter::writeHLTPayload
void writeHLTPayload(ValidityRange vr, const HLTFrame &hltFrame, const std::string &configSource)
Definition: TrigConfCoolWriter.cxx:326
TrigConf::CTPConfig::menu
const Menu & menu() const
Definition: CTPConfig.h:38
TrigConf::CTPConfig::setL1Version
void setL1Version(unsigned int v)
Definition: CTPConfig.cxx:39
TrigConf::Menu::items
const ItemContainer & items() const
Definition: Menu.h:140
TrigConf::HLTPrescale::setRerunPrescale
HLTPrescale & setRerunPrescale(const std::string &targetName, float ps)
Definition: HLTPrescale.cxx:29
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1MenuPayload
cool::Record createLvl1MenuPayload(cool::IFolderPtr, const TrigConf::TriggerItem &item)
build a COOL db record from a LVL1 TriggerItem (the item name and version)
Definition: TrigConfCoolL1PayloadConverters.cxx:50
DeMoScan.first
bool first
Definition: DeMoScan.py:534
TrigConf::HLTFrame::getHLTChainList
const HLTChainList & getHLTChainList() const
const accessor to the list of HLT chains
Definition: HLTFrame.h:49
TrigConf::TrigConfCoolFolderSpec::getLvl1BGContentFolder
static cool::IFolderPtr getLvl1BGContentFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:519
TrigConf::CaloInfo::addJetWeight
void addJetWeight(int)
Definition: CaloInfo.cxx:29
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1MonMap
std::vector< TrigConf::ThresholdMonitor * > readLvl1MonMap(const cool::IRecord &payload)
Build a LVL1 mon counter object from COOL payload.
Definition: TrigConfCoolL1PayloadConverters.cxx:660
TrigConf::TrigConfCoolFolderSpec::printFolderStructure
static void printFolderStructure(cool::IDatabasePtr db, std::ostream &o)
prints the folder structure that is in the COOL database
Definition: TrigConfCoolFolderSpec.cxx:564
TrigConf::TrigConfCoolL1PayloadConverters::createLvl1InputMapPayload
cool::Record createLvl1InputMapPayload(cool::IFolderPtr, const TrigConf::TIP &tip)
build a COOL db record from a PIT-mapping string value
Definition: TrigConfCoolL1PayloadConverters.cxx:351
TrigConf::HLTFrame::getPrescaleSetCollection
const HLTPrescaleSetCollection & getPrescaleSetCollection() const
Definition: HLTFrame.h:51
TrigConf::TrigConfCoolWriter::openDb
cool::IDatabasePtr openDb(bool readOnly=true)
open COOL db connection
Definition: TrigConfCoolWriter.cxx:109
str
Definition: BTagTrackIpAccessor.cxx:11
TrigConf::TrigConfCoolHLTPayloadConverters::readHltPrescale
void readHltPrescale(const coral::AttributeList &al, float &ps, float &pt, float &rrps)
build the HLT prescale value from a COOL db record
Definition: TrigConfCoolHLTPayloadConverters.cxx:251
rr
const boost::regex rr(r_r)
calibdata.copy
bool copy
Definition: calibdata.py:27
python.StandardJetMods.vr
vr
Definition: StandardJetMods.py:276
TrigConf::HLTFrame::theHLTChainList
HLTChainList & theHLTChainList()
accessor to the list of HLT chains
Definition: HLTFrame.h:44
TrigConf::TrigConfCoolFolderSpec::getLvl1MonMapFolder
static cool::IFolderPtr getLvl1MonMapFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:531
TrigConf::TrigConfCoolFolderSpec::getLvl1ThresholdFolder
static cool::IFolderPtr getLvl1ThresholdFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:503
TrigConf::TrigConfCoolFolderSpec::getHltPrescaleKeyFolder
static cool::IFolderPtr getHltPrescaleKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:555
TrigConf::CaloInfo::jetWeights
const std::vector< int > & jetWeights() const
Definition: CaloInfo.h:46
TrigConf::TrigConfCoolFolderSpec::getLvl1InputMapFolder
static cool::IFolderPtr getLvl1InputMapFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:527
TrigConf::TrigConfCoolHLTPayloadConverters::readHltConfigKeys
void readHltConfigKeys(const coral::AttributeList &al, unsigned int &masterConfigKey, unsigned int &hltPrescaleKey, std::string &configSource)
read the HLT configuration keys from a coral::AttributeList
Definition: TrigConfCoolHLTPayloadConverters.cxx:241
TrigConf::METSigParam::print
virtual void print(const std::string &indent="", unsigned int detail=1) const
Definition: METSigParam.cxx:64
covarianceTool.mc
mc
Definition: covarianceTool.py:554
TrigConf::HLTFrame::setConfigSource
void setConfigSource(const std::string &src)
Definition: HLTFrame.h:59
python.PyAthena.obj
obj
Definition: PyAthena.py:135
TrigConf::TrigConfCoolL1PayloadConverters::readLvl1TIPMap
TrigConf::TIP * readLvl1TIPMap(const coral::AttributeList &al)
Definition: TrigConfCoolL1PayloadConverters.cxx:645
TrigConf::TriggerThreshold
Definition: TriggerThreshold.h:20
TrigConf::HLTPrescaleSet::setIOV
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
Definition: HLTPrescaleSet.cxx:65
TrigConf::HLTFrame::configSource
const std::string & configSource() const
Definition: HLTFrame.h:54
TrigConf::TrigConfCoolWriter::writeL1PrescalePayload
void writeL1PrescalePayload(unsigned int runNumber, unsigned int lumiblockNumber, unsigned int lvl1PrescaleKey, const TrigConf::PrescaleSet &prescale)
Writing luminosityblock-wise configuration information the COOL database.
Definition: TrigConfCoolWriter.cxx:1187
Example_ReadSampleNoise.pointInTime
pointInTime
Definition: Example_ReadSampleNoise.py:14
TrigConf::TriggerItem
Definition: TriggerItem.h:25
TrigConf::TrigConfCoolWriter::writeL1CTPCoreInputMapping
void writeL1CTPCoreInputMapping(ValidityRange vr, const Menu &lvl1Menu)
Definition: TrigConfCoolWriter.cxx:894
READ_WRITE
#define READ_WRITE
Definition: TrigConfCoolWriter.cxx:60