Loader of trigger configurations from Json files.
More...
#include <TrigDBHLTPrescalesSetLoader.h>
Loader of trigger configurations from Json files.
Definition at line 23 of file TrigDBHLTPrescalesSetLoader.h.
◆ TrigDBHLTPrescalesSetLoader()
TrigConf::TrigDBHLTPrescalesSetLoader::TrigDBHLTPrescalesSetLoader |
( |
const std::string & |
connection | ) |
|
Constructor.
Definition at line 6 of file TrigDBHLTPrescalesSetLoader.cxx.
12 q.addToTableList (
"HLT_PRESCALE_SET" );
14 q.extendBinding<
int>(
"key");
16 q.extendCondition(
"HPS_ID = :key");
20 q.setDataName(
"HPS_DATA");
◆ ~TrigDBHLTPrescalesSetLoader()
TrigConf::TrigDBHLTPrescalesSetLoader::~TrigDBHLTPrescalesSetLoader |
( |
| ) |
|
|
overridevirtualdefault |
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
◆ createDBSession()
std::unique_ptr< coral::ISessionProxy > TrigConf::TrigDBLoader::createDBSession |
( |
| ) |
const |
|
protectedinherited |
create (if needed) DB session and return the session proxy
Definition at line 94 of file TrigDBLoader.cxx.
96 coral::ConnectionService connSvc;
97 coral::IConnectionServiceConfiguration& csc = connSvc.configuration();
112 auto proxy = std::unique_ptr<coral::ISessionProxy>( connSvc.connect(
m_connection, coral::AccessMode::ReadOnly) );
◆ getQueryDefinition()
return query for given schemaVersion from possible queries
Definition at line 122 of file TrigDBLoader.cxx.
126 size_t maxDefVersion = 0;
127 for(
auto &
entry : queries) {
128 size_t vkey =
entry.first;
130 maxDefVersion = vkey;
134 if( maxDefVersion==0 ) {
138 return queries.at(maxDefVersion);
◆ loadHLTPrescales()
bool TrigConf::TrigDBHLTPrescalesSetLoader::loadHLTPrescales |
( |
unsigned int |
hltpsk, |
|
|
TrigConf::HLTPrescalesSet & |
pss, |
|
|
const std::string & |
outFileName = "" |
|
) |
| const |
Load content from the Trigger DB into an HLTPrescalesSet for a given HLTPrescaleKey (HLTPSK)
- Parameters
-
hltpsk | [in] the HLTPSK that should be loaded |
hltpss | [out] the loaded HLTPrescalesSet |
Definition at line 28 of file TrigDBHLTPrescalesSetLoader.cxx.
34 session->transaction().start(
true);
38 qdef.setBoundValue<
int>(
"key", psk);
39 auto q = qdef.createQuery( session.get() );
42 TRG_MSG_ERROR(
"Tried reading HLT prescales, but HLT prescale key " << psk <<
" is not available" );
50 catch(coral::QueryException & ex) {
51 TRG_MSG_ERROR(
"When reading HLT prescales for HLT PSK " << psk <<
" a coral::QueryException was caught ( " << ex.what() <<
" )" );
61 TRG_MSG_ERROR(
"When reading HLT prescales for HLT PSK " << psk <<
" a parsing error occured ( " << ex.what() <<
" )" );
◆ msg() [1/2]
MsgStreamTC & TrigConf::TrigConfMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 81 of file TrigConfMessaging.h.
◆ msg() [2/2]
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 91 of file TrigConfMessaging.h.
◆ msgLvl()
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 70 of file TrigConfMessaging.h.
◆ outputLevel()
◆ schemaVersion()
size_t TrigConf::TrigDBLoader::schemaVersion |
( |
coral::ISessionProxy * |
session | ) |
const |
|
inherited |
access to TriggerDB schema version
- Returns
- version of the DB schema (0 - no version, >0 - schema version)
Definition at line 38 of file TrigDBLoader.cxx.
40 static const std::string versionTagPrefix(
"Trigger-Run3-Schema-v");
43 if(! session->nominalSchema().existsTable(
"TRIGGER_SCHEMA") ) {
44 throw std::runtime_error(
"Trigger schema has no schema version table" );
56 throw std::runtime_error(
"Trigger schema has schema version table but it is empty" );
60 std::string versionTag =
row[
"TS_TAG"].data<std::string>();
61 if( ! startswith(versionTag, versionTagPrefix)) {
62 throw std::runtime_error(
"Tag format error: Trigger schema version tag " + versionTag +
"does not start with " + versionTagPrefix);
65 std::string vstr = versionTag.substr(versionTagPrefix.size());
70 catch (
const std::invalid_argument& ia) {
71 TRG_MSG_ERROR(
"Invalid argument when interpreting the version part " << vstr <<
" of schema tag " << versionTag <<
". " << ia.what());
◆ setLevel()
◆ writeRawFile()
bool TrigConf::TrigDBLoader::writeRawFile |
( |
const coral::Blob & |
data, |
|
|
const std::string & |
outFileName |
|
) |
| const |
|
inherited |
write data blob into file This can be used to write the DB content to file without going through a ptree
Definition at line 80 of file TrigDBLoader.cxx.
87 outFile.write(
static_cast<const char*
> (
data.startingAddress()),
data.size() );
◆ m_connection
std::string TrigConf::TrigDBLoader::m_connection {"TRIGGERDB"} |
|
privateinherited |
◆ m_connectionTimeout
int TrigConf::TrigDBLoader::m_connectionTimeout {0} |
|
privateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls |
|
mutableprivateinherited |
◆ m_name
std::string TrigConf::TrigConfMessaging::m_name |
|
privateinherited |
◆ m_queries
std::map<size_t, QueryDefinition> TrigConf::TrigDBHLTPrescalesSetLoader::m_queries |
|
private |
◆ m_retrialPeriod
int TrigConf::TrigDBLoader::m_retrialPeriod {0} |
|
privateinherited |
◆ m_retrialTimeout
int TrigConf::TrigDBLoader::m_retrialTimeout {0} |
|
privateinherited |
The documentation for this class was generated from the following files:
outFile
Comment Out Those You do not wish to run.