Loader of trigger configurations from Json files.
More...
#include <TrigDBL1BunchGroupSetLoader.h>
Loader of trigger configurations from Json files.
Definition at line 24 of file TrigDBL1BunchGroupSetLoader.h.
◆ TrigDBL1BunchGroupSetLoader()
TrigConf::TrigDBL1BunchGroupSetLoader::TrigDBL1BunchGroupSetLoader |
( |
const std::string & |
connection | ) |
|
Constructor.
Definition at line 6 of file TrigDBL1BunchGroupSetLoader.cxx.
12 q.addToTableList (
"L1_BUNCH_GROUP_SET" );
14 q.extendBinding<
int>(
"key");
16 q.extendCondition(
"L1BGS_ID = :key");
20 q.setDataName(
"L1BGS_DATA");
◆ ~TrigDBL1BunchGroupSetLoader()
TrigConf::TrigDBL1BunchGroupSetLoader::~TrigDBL1BunchGroupSetLoader |
( |
| ) |
|
|
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);
◆ loadBunchGroupSet()
bool TrigConf::TrigDBL1BunchGroupSetLoader::loadBunchGroupSet |
( |
unsigned int |
bgsk, |
|
|
TrigConf::L1BunchGroupSet & |
bgs, |
|
|
const std::string & |
outFileName = "" |
|
) |
| const |
Load content from the Trigger DB into an L1PrescalesSet for a given L1PrescaleKey (L1PSK)
- Parameters
-
l1psk | [in] the L1PSK that should be loaded |
l1pss | [out] the loaded L1PrescalesSet |
outFileName | [in] if set, an outputfile with the raw data blob is written |
Definition at line 28 of file TrigDBL1BunchGroupSetLoader.cxx.
35 session->transaction().start(
true);
39 qdef.setBoundValue<
int>(
"key", bgsk);
40 auto q = qdef.createQuery( session.get() );
43 TRG_MSG_ERROR(
"Tried reading L1 bunchgroup set, but L1 bunchgroup key " << bgsk <<
" is not available" );
51 catch(coral::QueryException & ex) {
52 TRG_MSG_ERROR(
"When reading L1 bunchgroup set for L1 bunchgroup key " << bgsk <<
" a coral::QueryException was caught ( " << ex.what() <<
" )" );
62 TRG_MSG_ERROR(
"When reading L1 bunchgroup set for L1 BGSK " << bgsk <<
" 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::TrigDBL1BunchGroupSetLoader::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.