42 {
43
45
46 coral::ITable & teTable =
m_session.nominalSchema().tableHandle(
"HLT_TRIGGER_ELEMENT");
47
48 const coral::ITableDescription &
desc = teTable.description();
49
50 bool hasTopoStartsFrom = false;
51 try {
52 desc.columnDescription(
"HTE_TOPO_START_FROM");
53 hasTopoStartsFrom = true;
54 }
55 catch(coral::InvalidColumnNameException & ex) { }
56
57
58
59
60
61 TRG_MSG_INFO(
"Found HTE_TOPO_START_FROM : " << (hasTopoStartsFrom ?
"true" :
"false") );
62
63 unique_ptr< coral::IQuery >
q(
m_session.nominalSchema().newQuery() );
64
65 q->addToTableList (
"SUPER_MASTER_TABLE" ,
"SM");
66 q->addToTableList (
"HLT_MASTER_TABLE" ,
"HM");
67 q->addToTableList (
"HLT_TM_TO_TC" ,
"M2C");
68 q->addToTableList (
"HLT_TC_TO_TS" ,
"TC2TS");
69 q->addToTableList (
"HLT_TS_TO_TE" ,
"S2TE");
70 q->addToTableList (
"HLT_TRIGGER_ELEMENT" ,
"TE");
71 q->addToTableList (
"HLT_TE_TO_CP" ,
"TE2CP");
72 q->addToTableList (
"HLT_TE_TO_TE" ,
"TE2TE");
73 q->addToTableList (
"HLT_COMPONENT" ,
"CP");
74
75
76 coral::AttributeList bindings;
77 bindings.extend<int>("smid");
78 bindings[0].data<
int>() = (
int)
m_smk;
79
80 string theCondition = "";
81 theCondition += " SM.SMT_ID = :smid";
82 theCondition += " AND HM.HMT_ID = SM.SMT_HLT_MASTER_TABLE_ID";
83 theCondition += " AND HM.HMT_TRIGGER_MENU_ID = M2C.HTM2TC_TRIGGER_MENU_ID";
84 theCondition += " AND M2C.HTM2TC_TRIGGER_CHAIN_ID = TC2TS.HTC2TS_TRIGGER_CHAIN_ID";
85 theCondition += " AND TC2TS.HTC2TS_TRIGGER_SIGNATURE_ID = S2TE.HTS2TE_TRIGGER_SIGNATURE_ID";
86 theCondition += " AND TE.HTE_ID = S2TE.HTS2TE_TRIGGER_ELEMENT_ID";
87 theCondition += " AND TE.HTE_ID = TE2CP.HTE2CP_TRIGGER_ELEMENT_ID";
88 theCondition += " AND TE.HTE_ID = TE2TE.HTE2TE_TE_ID";
89 theCondition += " AND CP.HCP_ID = TE2CP.HTE2CP_COMPONENT_ID";
90
91 q->setCondition( theCondition, bindings );
92
93
94 coral::AttributeList attList;
95 attList.extend<int> ( "TE.HTE_ID" );
96 attList.extend<string>( "TE.HTE_NAME" );
97 if(hasTopoStartsFrom)
98 attList.extend<string>( "TE.HTE_TOPO_START_FROM" );
99 attList.extend<string>( "CP.HCP_NAME" );
100 attList.extend<string>( "CP.HCP_ALIAS" );
101 attList.extend<int> ( "TE2CP.HTE2CP_ALGORITHM_COUNTER" );
102 attList.extend<string>( "TE2TE.HTE2TE_TE_INP_ID" );
103 attList.extend<string>( "TE2TE.HTE2TE_TE_INP_TYPE" );
104 attList.extend<int> ( "TE2TE.HTE2TE_TE_COUNTER" );
106
107
108 q->addToOrderList(
"TE.HTE_ID ASC, TE2CP.HTE2CP_ALGORITHM_COUNTER DESC, TE2TE.HTE2TE_TE_COUNTER DESC" );
109
110
112 coral::ICursor&
cursor =
q->execute();
113
114
115
116
117
118
119
120
122 const coral::AttributeList&
row =
cursor.currentRow();
124 HLTSequence*
seq = seqlist.getSequence(te_name);
125 if(seq==0) {
126 seq =
new HLTSequence( vector<HLTTriggerElement*>(),
new HLTTriggerElement(te_name), vector<string>() );
127 seqlist.addHLTSequence(seq);
128 if(hasTopoStartsFrom) {
130 if( !topo_start_from.empty())
131 seq->set_topoStartTE(
new HLTTriggerElement(topo_start_from));
132 }
133 }
134
135
137 unsigned int alg_pos =
row[
"TE2CP.HTE2CP_ALGORITHM_COUNTER"].data<
int>();
138
139 vector<string>& alg_list =
seq->algorithms();
140 if( alg_list.size() < alg_pos+1 )
141 alg_list.resize( alg_pos+1, "" );
142
143 if(auto &algitem = alg_list[alg_pos]; algitem.empty()) {
144 algitem = std::move(alg_name);
145 } else {
146 if(algitem != alg_name) {
147 cerr << "Two different algs in the same position " << alg_pos << endl;
148 }
149 }
150
152 if(!input_te.empty()) {
153 unsigned int input_te_pos =
row[
"TE2TE.HTE2TE_TE_COUNTER"].data<
int>();
154
155 vector<HLTTriggerElement*>& inp_list =
seq->inputTEs();
156 if( inp_list.size() < input_te_pos+1 )
157 inp_list.resize( input_te_pos+1, (HLTTriggerElement*)0 );
158
159 if(
auto &item = inp_list[input_te_pos];
item == 0) {
160 item =
new HLTTriggerElement(input_te);
161 } else {
162 if(
item->name() != input_te ) {
163 cerr << "Two different input TE's at the same position " << input_te_pos << endl;
164 }
165 }
166 }
167 }
169
170 TRG_MSG_INFO(
"Loading " << seqlist.size() <<
" sequences");
171}
char data[hepevt_bytes_allocation_ATLAS]
std::string rmtilde(const std::string &input)
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...