Loader of trigger configurations from Json files.
More...
#include <TrigDBJobOptionsLoader.h>
Loader of trigger configurations from Json files.
Definition at line 28 of file TrigDBJobOptionsLoader.h.
◆ TrigDBJobOptionsLoader()
TrigConf::TrigDBJobOptionsLoader::TrigDBJobOptionsLoader |
( |
const std::string & |
connection | ) |
|
Constructor.
Definition at line 8 of file TrigDBJobOptionsLoader.cxx.
14 q.addToTableList (
"SUPER_MASTER_TABLE",
"SMT" );
15 q.addToTableList (
"JO_MASTER_TABLE",
"JOMT" );
17 q.extendBinding<
int>(
"smk");
19 q.extendCondition(
"SMT.SMT_ID = :smk");
20 q.extendCondition(
" AND SMT.SMT_JO_MASTER_TABLE_ID = JOMT.JO_ID");
22 q.extendOutput<std::string>(
"SMT.SMT_NAME" );
23 q.extendOutput<
int> (
"SMT.SMT_JO_MASTER_TABLE_ID" );
26 q.setDataName(
"JOMT.JO_CONTENT");
31 q.addToTableList (
"SUPER_MASTER_TABLE",
"SMT" );
32 q.addToTableList (
"HLT_JOBOPTIONS",
"HJO" );
34 q.extendBinding<
int>(
"smk");
36 q.extendCondition(
"SMT.SMT_ID = :smk");
37 q.extendCondition(
"AND HJO.HJO_ID=SMT.SMT_HLT_JOBOPTIONS_ID");
39 q.extendOutput<std::string>(
"SMT.SMT_NAME" );
40 q.extendOutput<
int> (
"SMT.SMT_HLT_JOBOPTIONS_ID" );
43 q.setDataName(
"HJO.HJO_DATA");
◆ ~TrigDBJobOptionsLoader()
TrigConf::TrigDBJobOptionsLoader::~TrigDBJobOptionsLoader |
( |
| ) |
|
|
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);
◆ loadJobOptions() [1/2]
bool TrigConf::TrigDBJobOptionsLoader::loadJobOptions |
( |
unsigned int |
smk, |
|
|
boost::property_tree::ptree & |
jobOptions, |
|
|
const std::string & |
outFileName = "" |
|
) |
| const |
Load content from the Trigger DB into two ptrees for a given SuperMasterKey (SMK)
- Parameters
-
smk | [in] the SMK that should be loaded |
jobOptions | [out] the loaded job options |
Definition at line 51 of file TrigDBJobOptionsLoader.cxx.
56 session->transaction().start(
true);
60 qdef.setBoundValue<
int>(
"smk",
smk);
61 auto q = qdef.createQuery( session.get() );
64 TRG_MSG_ERROR(
"Tried reading HLT job options, but SuperMasterKey " <<
smk <<
" is not available" );
72 catch(coral::QueryException & ex) {
73 TRG_MSG_ERROR(
"When reading HLT job options for SMK " <<
smk <<
" a coral::QueryException was caught ( " << ex.what() <<
" )" );
◆ loadJobOptions() [2/2]
bool TrigConf::TrigDBJobOptionsLoader::loadJobOptions |
( |
unsigned int |
smk, |
|
|
DataStructure & |
jobOptions, |
|
|
const std::string & |
outFileName = "" |
|
) |
| const |
Load content from the Trigger DB into an L1Menu and an HLTMenu for a given SuperMasterKey (SMK)
- Parameters
-
smk | [in] the SMK that should be loaded |
jobOptions | [out] the loaded job options |
Definition at line 81 of file TrigDBJobOptionsLoader.cxx.
93 TRG_MSG_ERROR(
"When reading HLT job options for SMK " <<
smk <<
" 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::TrigDBJobOptionsLoader::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.