39 catch(
const coral::Exception& e ) {
45 chains.setEFLowerChainCounter();
56 std::unique_ptr< coral::IQuery > q(
m_session.nominalSchema().newQuery() );
59 q->addToTableList (
"SUPER_MASTER_TABLE",
"SM" );
60 q->addToTableList (
"HLT_MASTER_TABLE",
"HM" );
61 q->addToTableList (
"HLT_TRIGGER_MENU",
"TM" );
62 q->addToTableList (
"HLT_TM_TO_TC",
"TM2TC" );
63 q->addToTableList (
"HLT_TRIGGER_CHAIN",
"TC" );
66 coral::AttributeList bindList;
67 bindList.extend<
int>(
"smid");
68 bindList[0].data<
int>() = (
int)
m_smk;
70 string theCondition =
"";
71 theCondition += string(
" SM.SMT_ID = :smid");
72 theCondition += string(
" AND HM.HMT_ID = SM.SMT_HLT_MASTER_TABLE_ID" );
73 theCondition += string(
" AND TM.HTM_ID = HM.HMT_TRIGGER_MENU_ID" );
74 theCondition += string(
" AND TM.HTM_ID = TM2TC.HTM2TC_TRIGGER_MENU_ID " );
75 theCondition += string(
" AND TC.HTC_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
77 q->setCondition( theCondition, bindList );
80 coral::AttributeList attList;
81 attList.extend<
long> (
"TC.HTC_ID" );
82 attList.extend<
string>(
"TC.HTC_NAME" );
83 attList.extend<
string>(
"TC.HTC_LOWER_CHAIN_NAME" );
85 attList.extend<
string>(
"TC.HTC_L2_OR_EF" );
86 attList.extend<
string>(
"TC.HTC_RERUN_PRESCALE" );
88 attList.extend<
int> (
"TC.HTC_CHAIN_COUNTER" );
89 attList.extend<
int> (
"TC.HTC_VERSION" );
95 theOrder +=
" TC.HTC_L2_OR_EF DESC, ";
97 theOrder +=
" TC.HTC_CHAIN_COUNTER ASC";
98 q->addToOrderList( theOrder );
102 coral::ICursor& cursor = q->execute();
104 while ( cursor.next() ) {
105 const coral::AttributeList& row = cursor.currentRow();
107 long chainId = row[
"TC.HTC_ID"].data<
long>();
108 int counter = row[
"TC.HTC_CHAIN_COUNTER"].data<
int>();
109 int version = row[
"TC.HTC_VERSION"].data<
int>();
114 string level =
"HLT";
117 if(level==
"HL") level=
"HLT";
126 std::string_view rerunps_sv = rerunps_s;
127 auto [ptr, ec] = std::from_chars(rerunps_sv.data(), rerunps_sv.data() + rerunps_sv.size(), rerunps, std::chars_format::general);
128 if (ec != std::errc()) {
132 ch->set_rerun_prescale(rerunps);
140 TRG_MSG_INFO(
"Loaded " << chainlist.size() <<
" chains");
147 defineChainSubQuery( coral::IQuery* q, std::string& theCondition, coral::AttributeList& bindings,
int smk, coral::AttributeList& output) {
149 q->addToTableList (
"SUPER_MASTER_TABLE",
"SM" );
150 q->addToTableList (
"HLT_MASTER_TABLE",
"HM" );
151 q->addToTableList (
"HLT_TM_TO_TC",
"TM2TC" );
152 q->addToTableList (
"HLT_TRIGGER_CHAIN",
"TC" );
154 theCondition += string(
" SM.SMT_ID = :smid" );
155 theCondition += string(
" AND SM.SMT_HLT_MASTER_TABLE_ID = HM.HMT_ID" );
156 theCondition += string(
" AND HM.HMT_TRIGGER_MENU_ID = TM2TC.HTM2TC_TRIGGER_MENU_ID " );
157 theCondition += string(
" AND TC.HTC_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
159 bindings.extend<
int>(
"smid");
160 bindings[0].data<
int>() = smk;
162 output.extend<
string>(
"TC.HTC_NAME" );
171 std::unique_ptr< coral::IQuery > q(
m_session.nominalSchema().newQuery() );
172 string theCondition(
"");
173 coral::AttributeList bindings, output;
175 defineChainSubQuery( q.get(), theCondition, bindings,
m_smk, output);
177 q->addToTableList (
"HLT_TRIGGER_GROUP",
"GR" );
179 theCondition += string(
" AND GR.HTG_TRIGGER_CHAIN_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
181 q->setCondition( theCondition, bindings );
183 output.extend<
string>(
"GR.HTG_NAME" );
188 coral::ICursor& cursor = q->execute();
191 while ( cursor.next() ) {
193 const coral::AttributeList& row = cursor.currentRow();
210 std::unique_ptr< coral::IQuery > q(
m_session.nominalSchema().newQuery() );
211 string theCondition(
"");
212 coral::AttributeList bindings, output;
214 defineChainSubQuery( q.get(), theCondition, bindings,
m_smk, output);
216 q->addToTableList (
"HLT_TRIGGER_TYPE",
"TT" );
218 theCondition += string(
" AND TT.HTT_TRIGGER_CHAIN_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
220 q->setCondition( theCondition, bindings );
222 output.extend<
int>(
"TT.HTT_TYPEBIT" );
227 coral::ICursor& cursor = q->execute();
230 while ( cursor.next() ) {
232 const coral::AttributeList& row = cursor.currentRow();
234 int triggertype = row[
"TT.HTT_TYPEBIT"].data<
int>();
246 std::unique_ptr< coral::IQuery > q(
m_session.nominalSchema().newQuery() );
247 string theCondition(
"");
248 coral::AttributeList bindings, output;
250 defineChainSubQuery( q.get(), theCondition, bindings,
m_smk, output);
252 q->addToTableList (
"HLT_TC_TO_TR",
"TC2TR" );
253 q->addToTableList (
"HLT_TRIGGER_STREAM",
"TR" );
255 theCondition += string(
" AND TC2TR.HTC2TR_TRIGGER_CHAIN_ID = TC.HTC_ID" );
256 theCondition += string(
" AND TC2TR.HTC2TR_TRIGGER_STREAM_ID = TR.HTR_ID" );
258 output.extend<
string>(
"TC2TR.HTC2TR_TRIGGER_STREAM_PRESCALE");
259 output.extend<
string>(
"TR.HTR_NAME" );
260 output.extend<
string>(
"TR.HTR_TYPE" );
261 output.extend<
int>(
"TR.HTR_OBEYLB" );
265 q->setCondition( theCondition, bindings );
268 coral::ICursor& cursor = q->execute();
271 while ( cursor.next() ) {
273 const coral::AttributeList& row = cursor.currentRow();
278 bool obeyLB = row[
"TR.HTR_OBEYLB"].data<
int>();
280 std::string_view prescale_str_view = prescale_str;
281 auto [ptr, ec] = std::from_chars(prescale_str_view.data(), prescale_str_view.data() + prescale_str_view.size(), prescale);
282 if (ec != std::errc()) {
296 std::unique_ptr< coral::IQuery > q(
m_session.nominalSchema().newQuery() );
297 string theCondition(
"");
298 coral::AttributeList bindings, output;
300 defineChainSubQuery( q.get(), theCondition, bindings,
m_smk, output);
302 q->addToTableList (
"HLT_TC_TO_TS",
"TC2TS" );
303 q->addToTableList (
"HLT_TRIGGER_SIGNATURE",
"TS" );
304 q->addToTableList (
"HLT_TS_TO_TE",
"TS2TE" );
305 q->addToTableList (
"HLT_TRIGGER_ELEMENT",
"TE" );
308 theCondition += string(
" AND TC2TS.HTC2TS_TRIGGER_CHAIN_ID = TC.HTC_ID" );
309 theCondition += string(
" AND TC2TS.HTC2TS_TRIGGER_SIGNATURE_ID = TS.HTS_ID" );
310 theCondition += string(
" AND TC2TS.HTC2TS_TRIGGER_SIGNATURE_ID = TS2TE.HTS2TE_TRIGGER_SIGNATURE_ID" );
311 theCondition += string(
" AND TE.HTE_ID = TS2TE.HTS2TE_TRIGGER_ELEMENT_ID" );
312 theCondition += string(
" AND TS2TE.HTS2TE_ELEMENT_COUNTER>=0" );
314 output.extend<
int>(
"TC2TS.HTC2TS_SIGNATURE_COUNTER" );
315 output.extend<
int>(
"TS2TE.HTS2TE_ELEMENT_COUNTER" );
316 output.extend<
int>(
"TS.HTS_LOGIC" );
317 output.extend<
int>(
"TE.HTE_ID" );
318 output.extend<
string>(
"TE.HTE_NAME" );
321 q->setCondition( theCondition, bindings );
325 q->addToOrderList(
"TC.HTC_NAME" );
326 q->addToOrderList(
"TC2TS.HTC2TS_SIGNATURE_COUNTER" );
327 q->addToOrderList(
"TS2TE.HTS2TE_ELEMENT_COUNTER" );
329 coral::ICursor& cursor = q->execute();
332 while ( cursor.next() ) {
335 const coral::AttributeList& row = cursor.currentRow();
340 unsigned int sig_counter = (
unsigned int)row[
"TC2TS.HTC2TS_SIGNATURE_COUNTER"].
data<int>();
341 if( sig_list.size() < sig_counter+1 )
342 sig_list.resize( sig_counter+1, 0 );
344 if( sig_list[sig_counter] == 0) {
345 int logic = row[
"TS.HTS_LOGIC"].data<
int>();
346 sig_list[sig_counter] =
new HLTSignature(sig_counter, logic, std::vector<HLTTriggerElement*>());
347 sig_list[sig_counter]->set_label( chainname +
"_" + std::to_string(sig_counter) );
351 vector<HLTTriggerElement*>& te_list = sig->outputTEs();
353 unsigned int te_counter = (
unsigned int)row[
"TS2TE.HTS2TE_ELEMENT_COUNTER"].
data<int>();
354 if( te_list.size() < te_counter+1 )
355 te_list.resize( te_counter+1, 0 );
357 if( te_list[te_counter] == 0) {
358 int te_id = row[
"TE.HTE_ID"].data<
int>();
359 string te_name = row[
"TE.HTE_NAME"].data<
string>();
372 vector<HLTSignature*>& s = ch->signatureList();
char data[hepevt_bytes_allocation_ATLAS]
void commitSession()
commit session if not already done
coral::ISessionProxy & m_session
CORAL interface to database session.
unsigned int triggerDBSchemaVersion()
void startSession()
start session if not already active
list of all HLT chains in a trigger menu
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
HLTChain * chain(const std::string &chainname) const
access the chain by name returns null-pointer if chain not found
void loadStreams(HLTChainList &chainlist)
void loadChains(HLTChainList &chainlist)
void loadTypes(HLTChainList &chainlist)
unsigned int m_schemaversion
void loadGroups(HLTChainList &chainlist)
void loadSignatures(HLTChainList &chainlist)
virtual bool load(HLTFrame &frame)
HLT chain configuration information.
std::vector< HLTSignature * > & signatureList()
std::vector< HLTTriggerType * > & triggerTypeList()
void addGroup(const std::string &group)
void addStream(HLTStreamTag *)
HLTChainList & theHLTChainList()
accessor to the list of HLT chains
HLT signature configuration information.
HLT stream configuration information.
HLT trigger element configuration information.
HLT trigger type configuration information.
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
void fillQuery(coral::IQuery *q, coral::AttributeList &attList)
std::string rmtilde(const std::string &input)
DataModel_detail::iterator< DVL > remove(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, const T &value)
Specialization of remove for DataVector/List.