TriggerDB loader of the HLT signatures.
More...
#include <HLTChainLoader.h>
TriggerDB loader of the HLT signatures.
Definition at line 17 of file HLTChainLoader.h.
◆ HLTChainLoader()
TrigConf::HLTChainLoader::HLTChainLoader |
( |
StorageMgr & |
sm, |
|
|
coral::ISessionProxy & |
session |
|
) |
| |
|
inline |
constructor
- Parameters
-
sm | reference to storage manager |
session | reference to the database session |
Definition at line 25 of file HLTChainLoader.h.
26 DBLoader(
"HLTChainLoader", sm, session) {}
◆ ~HLTChainLoader()
virtual TrigConf::HLTChainLoader::~HLTChainLoader |
( |
| ) |
|
|
overridevirtualdefault |
◆ commitSession()
void TrigConf::DBLoader::commitSession |
( |
| ) |
|
|
inherited |
commit session if not already done
Definition at line 45 of file DBLoader.cxx.
◆ isRun1()
bool TrigConf::DBLoader::isRun1 |
( |
| ) |
|
|
inlineinherited |
◆ isRun2()
bool DBLoader::isRun2 |
( |
| ) |
|
|
inherited |
◆ load()
bool TrigConf::HLTChainLoader::load |
( |
HLTFrame & |
frame | ) |
|
|
virtual |
Definition at line 21 of file HLTChainLoader.cxx.
27 HLTChainList&
chains = frame.theHLTChainList();
38 catch(
const coral::Exception&
e ) {
44 chains.setEFLowerChainCounter();
◆ loadChains()
void TrigConf::HLTChainLoader::loadChains |
( |
HLTChainList & |
chainlist | ) |
|
Definition at line 51 of file HLTChainLoader.cxx.
55 std::unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().newQuery() );
58 q->addToTableList (
"SUPER_MASTER_TABLE",
"SM" );
59 q->addToTableList (
"HLT_MASTER_TABLE",
"HM" );
60 q->addToTableList (
"HLT_TRIGGER_MENU",
"TM" );
61 q->addToTableList (
"HLT_TM_TO_TC",
"TM2TC" );
62 q->addToTableList (
"HLT_TRIGGER_CHAIN",
"TC" );
66 bindList.extend<
int>(
"smid");
67 bindList[0].data<
int>() = (
int)
m_smk;
69 string theCondition =
"";
70 theCondition += string(
" SM.SMT_ID = :smid");
71 theCondition += string(
" AND HM.HMT_ID = SM.SMT_HLT_MASTER_TABLE_ID" );
72 theCondition += string(
" AND TM.HTM_ID = HM.HMT_TRIGGER_MENU_ID" );
73 theCondition += string(
" AND TM.HTM_ID = TM2TC.HTM2TC_TRIGGER_MENU_ID " );
74 theCondition += string(
" AND TC.HTC_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
76 q->setCondition( theCondition, bindList );
80 attList.extend<
long> (
"TC.HTC_ID" );
81 attList.extend<
string>(
"TC.HTC_NAME" );
82 attList.extend<
string>(
"TC.HTC_LOWER_CHAIN_NAME" );
84 attList.extend<
string>(
"TC.HTC_L2_OR_EF" );
85 attList.extend<
string>(
"TC.HTC_RERUN_PRESCALE" );
87 attList.extend<
int> (
"TC.HTC_CHAIN_COUNTER" );
88 attList.extend<
int> (
"TC.HTC_VERSION" );
94 theOrder +=
" TC.HTC_L2_OR_EF DESC, ";
96 theOrder +=
" TC.HTC_CHAIN_COUNTER ASC";
97 q->addToOrderList( theOrder );
101 coral::ICursor&
cursor =
q->execute();
106 long chainId =
row[
"TC.HTC_ID"].data<
long>();
107 int counter =
row[
"TC.HTC_CHAIN_COUNTER"].data<
int>();
108 int version =
row[
"TC.HTC_VERSION"].data<
int>();
110 string lower_chain_name =
rmtilde(
row[
"TC.HTC_LOWER_CHAIN_NAME"].data<string>());
113 string level =
"HLT";
124 string rerunps_s =
rmtilde(
row[
"TC.HTC_RERUN_PRESCALE"].data<string>());
125 rerunps = boost::lexical_cast<float,string>(rerunps_s);
127 ch->set_rerun_prescale(rerunps);
131 chainlist.addHLTChain(
ch);
135 TRG_MSG_INFO(
"Loaded " << chainlist.size() <<
" chains");
◆ loadGroups()
void TrigConf::HLTChainLoader::loadGroups |
( |
HLTChainList & |
chainlist | ) |
|
Definition at line 164 of file HLTChainLoader.cxx.
166 std::unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().newQuery() );
167 string theCondition(
"");
170 defineChainSubQuery(
q.get(), theCondition, bindings,
m_smk,
output);
172 q->addToTableList (
"HLT_TRIGGER_GROUP",
"GR" );
174 theCondition += string(
" AND GR.HTG_TRIGGER_CHAIN_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
176 q->setCondition( theCondition, bindings );
178 output.extend<
string>(
"GR.HTG_NAME" );
183 coral::ICursor&
cursor =
q->execute();
190 string grname =
rmtilde(
row[
"GR.HTG_NAME"].data<string>());
191 chainlist.chain(
name)->addGroup(grname);
◆ loadL1MasterKey()
bool TrigConf::DBLoader::loadL1MasterKey |
( |
int |
SuperMasterKey, |
|
|
int & |
Lvl1MasterKey |
|
) |
| |
|
inherited |
get l1 master from super master
Definition at line 128 of file DBLoader.cxx.
132 unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().tableHandle(
"SUPER_MASTER_TABLE").newQuery() );
133 q->setRowCacheSize( 5 );
137 bindings.extend<
int>(
"smtid");
138 bindings[0].data<
int>() =
smk;
139 q->setCondition(
"SMT_ID = :smtid", bindings );
143 attList.extend<
int>(
"SMT_L1_MASTER_TABLE_ID" );
146 coral::ICursor&
cursor =
q->execute();
148 msg() <<
"DBLoader: No such SuperMaster key exists " <<
smk << endl;
149 throw runtime_error(
"DBLoader: SuperMasterKey not available" );
153 Lvl1MasterKey =
row[
"SMT_L1_MASTER_TABLE_ID"].data<
int>();
157 msg() <<
"DBLoader: C++ exception: " <<
e.what() << std::endl;
◆ loadL1MenuKey()
bool TrigConf::DBLoader::loadL1MenuKey |
( |
int |
SuperMasterKey, |
|
|
int & |
Lvl1MenuKey |
|
) |
| |
|
inherited |
get l1 menu id from super master
Definition at line 167 of file DBLoader.cxx.
175 unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().tableHandle(
"L1_MASTER_TABLE").newQuery() );
176 q->setRowCacheSize( 5 );
180 bindings.extend<
int>(
"l1mtid");
181 bindings[0].data<
int>() = l1Master;
182 q->setCondition(
"L1MT_ID = :l1mtid" , bindings );
186 attList.extend<
int>(
"L1MT_TRIGGER_MENU_ID" );
187 q->defineOutput(attList);
188 q->addToOutputList(
"L1MT_TRIGGER_MENU_ID" );
190 coral::ICursor&
cursor =
q->execute();
192 msg() <<
"DBLoader >> No such L1 Master key exists " << l1Master << std::endl;
193 throw std::runtime_error(
"DBLoader >> L1MasterKey not available" );
198 Lvl1MenuKey =
row[
"L1MT_TRIGGER_MENU_ID"].data<
int>();
204 msg() <<
"DBLoader >> Standard C++ exception: " <<
e.what() << std::endl;
◆ loadSchemaVersion()
std::tuple< unsigned int, unsigned int > DBLoader::loadSchemaVersion |
( |
| ) |
const |
|
privateinherited |
get DB schema version and run number
Definition at line 81 of file DBLoader.cxx.
83 const static auto versions = [&]() -> std::tuple<unsigned int,unsigned int> {
84 bool mySession =
false;
85 if ( !
m_session.transaction().isActive() ) {
90 std::unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().tableHandle(
"TRIGGER_SCHEMA").newQuery() );
91 q->setRowCacheSize( 1 );
95 attList.extend<
int>(
"TS_ID" );
96 q->defineOutput(attList);
97 q->addToOutputList(
"TS_ID" );
99 q->addToOrderList(
"TS_ID desc");
100 coral::ICursor&
cursor =
q->execute();
104 if ( mySession )
m_session.transaction().commit();
105 throw std::runtime_error(
"DBLoader::loadSchemaVersion() >> Table TRIGGER_SCHEMA is not filled" );
113 const unsigned int run =
m_session.nominalSchema().existsTable(
"ACTIVE_MASTERS" ) ? 2 : 1;
119 if ( mySession )
m_session.transaction().commit();
◆ loadSignatures()
void TrigConf::HLTChainLoader::loadSignatures |
( |
HLTChainList & |
chainlist | ) |
|
Definition at line 288 of file HLTChainLoader.cxx.
290 std::unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().newQuery() );
291 string theCondition(
"");
294 defineChainSubQuery(
q.get(), theCondition, bindings,
m_smk,
output);
296 q->addToTableList (
"HLT_TC_TO_TS",
"TC2TS" );
297 q->addToTableList (
"HLT_TRIGGER_SIGNATURE",
"TS" );
298 q->addToTableList (
"HLT_TS_TO_TE",
"TS2TE" );
299 q->addToTableList (
"HLT_TRIGGER_ELEMENT",
"TE" );
302 theCondition += string(
" AND TC2TS.HTC2TS_TRIGGER_CHAIN_ID = TC.HTC_ID" );
303 theCondition += string(
" AND TC2TS.HTC2TS_TRIGGER_SIGNATURE_ID = TS.HTS_ID" );
304 theCondition += string(
" AND TC2TS.HTC2TS_TRIGGER_SIGNATURE_ID = TS2TE.HTS2TE_TRIGGER_SIGNATURE_ID" );
305 theCondition += string(
" AND TE.HTE_ID = TS2TE.HTS2TE_TRIGGER_ELEMENT_ID" );
306 theCondition += string(
" AND TS2TE.HTS2TE_ELEMENT_COUNTER>=0" );
308 output.extend<
int>(
"TC2TS.HTC2TS_SIGNATURE_COUNTER" );
309 output.extend<
int>(
"TS2TE.HTS2TE_ELEMENT_COUNTER" );
310 output.extend<
int>(
"TS.HTS_LOGIC" );
311 output.extend<
int>(
"TE.HTE_ID" );
312 output.extend<
string>(
"TE.HTE_NAME" );
315 q->setCondition( theCondition, bindings );
319 q->addToOrderList(
"TC.HTC_NAME" );
320 q->addToOrderList(
"TC2TS.HTC2TS_SIGNATURE_COUNTER" );
321 q->addToOrderList(
"TS2TE.HTS2TE_ELEMENT_COUNTER" );
323 coral::ICursor&
cursor =
q->execute();
331 string chainname =
rmtilde(
row[
"TC.HTC_NAME"].data<string>());
332 vector<HLTSignature*>& sig_list = chainlist.chain(chainname)->signatureList();
334 unsigned int sig_counter = (
unsigned int)
row[
"TC2TS.HTC2TS_SIGNATURE_COUNTER"].data<int>();
335 if( sig_list.size() < sig_counter+1 )
336 sig_list.resize( sig_counter+1, 0 );
338 if( sig_list[sig_counter] == 0) {
339 int logic =
row[
"TS.HTS_LOGIC"].data<
int>();
340 sig_list[sig_counter] =
new HLTSignature(sig_counter, logic, std::vector<HLTTriggerElement*>());
341 sig_list[sig_counter]->set_label( chainname +
"_" + boost::lexical_cast<string,int>(sig_counter) );
344 HLTSignature*
sig = sig_list[sig_counter];
345 vector<HLTTriggerElement*>& te_list =
sig->outputTEs();
347 unsigned int te_counter = (
unsigned int)
row[
"TS2TE.HTS2TE_ELEMENT_COUNTER"].data<int>();
348 if( te_list.size() < te_counter+1 )
349 te_list.resize( te_counter+1, 0 );
351 if( te_list[te_counter] == 0) {
352 int te_id =
row[
"TE.HTE_ID"].data<
int>();
353 string te_name =
row[
"TE.HTE_NAME"].data<
string>();
354 te_list[te_counter] =
new HLTTriggerElement(te_id, te_name);
366 vector<HLTSignature*>&
s =
ch->signatureList();
367 s.erase(
remove(
s.begin(),
s.end(), (HLTSignature*)0),
s.end());
◆ loadStreams()
void TrigConf::HLTChainLoader::loadStreams |
( |
HLTChainList & |
chainlist | ) |
|
Definition at line 239 of file HLTChainLoader.cxx.
241 std::unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().newQuery() );
242 string theCondition(
"");
245 defineChainSubQuery(
q.get(), theCondition, bindings,
m_smk,
output);
247 q->addToTableList (
"HLT_TC_TO_TR",
"TC2TR" );
248 q->addToTableList (
"HLT_TRIGGER_STREAM",
"TR" );
250 theCondition += string(
" AND TC2TR.HTC2TR_TRIGGER_CHAIN_ID = TC.HTC_ID" );
251 theCondition += string(
" AND TC2TR.HTC2TR_TRIGGER_STREAM_ID = TR.HTR_ID" );
253 output.extend<
string>(
"TC2TR.HTC2TR_TRIGGER_STREAM_PRESCALE");
254 output.extend<
string>(
"TR.HTR_NAME" );
255 output.extend<
string>(
"TR.HTR_TYPE" );
256 output.extend<
int>(
"TR.HTR_OBEYLB" );
260 q->setCondition( theCondition, bindings );
263 coral::ICursor&
cursor =
q->execute();
269 string chainname =
rmtilde(
row[
"TC.HTC_NAME"].data<string>());
270 string prescale_str =
rmtilde(
row[
"TC2TR.HTC2TR_TRIGGER_STREAM_PRESCALE"].data<string>());
271 string streamname =
rmtilde(
row[
"TR.HTR_NAME"].data<string>());
273 bool obeyLB =
row[
"TR.HTR_OBEYLB"].data<
int>();
276 prescale = boost::lexical_cast<int,string>(prescale_str);
278 catch(boost::bad_lexical_cast &
e) {}
279 chainlist.chain(chainname)->addStream(
new HLTStreamTag(streamname,
type, obeyLB, prescale) );
◆ loadTypes()
void TrigConf::HLTChainLoader::loadTypes |
( |
HLTChainList & |
chainlist | ) |
|
Definition at line 203 of file HLTChainLoader.cxx.
205 std::unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().newQuery() );
206 string theCondition(
"");
209 defineChainSubQuery(
q.get(), theCondition, bindings,
m_smk,
output);
211 q->addToTableList (
"HLT_TRIGGER_TYPE",
"TT" );
213 theCondition += string(
" AND TT.HTT_TRIGGER_CHAIN_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
215 q->setCondition( theCondition, bindings );
217 output.extend<
int>(
"TT.HTT_TYPEBIT" );
222 coral::ICursor&
cursor =
q->execute();
229 int triggertype =
row[
"TT.HTT_TYPEBIT"].data<
int>();
230 chainlist.chain(
name)->triggerTypeList().push_back(
new HLTTriggerType(triggertype));
◆ 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()
virtual MSGTC::Level TrigConf::DBLoader::outputLevel |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ setLevel()
◆ setVerbose()
virtual void TrigConf::DBLoader::setVerbose |
( |
int |
v | ) |
|
|
inlineoverridevirtualinherited |
◆ startSession()
void TrigConf::DBLoader::startSession |
( |
| ) |
|
|
inherited |
start session if not already active
Definition at line 35 of file DBLoader.cxx.
37 if ( !
m_session.transaction().isActive() ) {
◆ triggerDBSchemaVersion()
unsigned int DBLoader::triggerDBSchemaVersion |
( |
| ) |
|
|
inherited |
◆ verbose()
virtual int TrigConf::DBLoader::verbose |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls |
|
mutableprivateinherited |
◆ m_name
std::string TrigConf::TrigConfMessaging::m_name |
|
privateinherited |
◆ m_schemaversion
unsigned int TrigConf::HLTChainLoader::m_schemaversion {0} |
|
private |
◆ m_session
coral::ISessionProxy& TrigConf::DBLoader::m_session |
|
protectedinherited |
CORAL interface to database session.
Definition at line 68 of file DBLoader.h.
◆ m_sessionOwner
bool TrigConf::DBLoader::m_sessionOwner {false} |
|
protectedinherited |
remember if the loader started the session in the first place
Definition at line 69 of file DBLoader.h.
◆ m_smk
unsigned int TrigConf::HLTChainLoader::m_smk {0} |
|
private |
◆ m_storageMgr
reference to the storage manager
Definition at line 67 of file DBLoader.h.
◆ m_verbose
int TrigConf::DBLoader::m_verbose {1} |
|
privateinherited |
The documentation for this class was generated from the following files: