21 for (
PIT *pit : m_PITs)
25 for (
TIP *tip : m_TIPs)
41 std::vector<uint16_t> bgmask(512);
43 bgmask[
item->ctpId()] =
item->bunchgroupMask();
52 pair<ItemContainer::iterator, bool> ins = m_TriggerItemVector.push_back(ti);
54 cerr <<
"FATAL Menu: insertion of TriggerItem (" << ti->
name() <<
", ctp ID=" << ti->
ctpId() <<
") failed, uniqueness constraint violated." << endl;
55 throw runtime_error(
"Menu insertion of TriggerItem failed");
61 m_ThresholdMonitorVector.push_back(thrm);
65 m_PITs.push_back(pit);
70 m_TIPs.push_back(tip);
75 if( m_LUT.find(lutCounter) != m_LUT.end()) {
76 cerr <<
"WARNING Menu: insertion of LUT output (counter " << lutCounter <<
", name " << lutCounter <<
") failed, uniqueness constraint violated." << endl;
79 m_LUT[lutCounter] = lutCondition;
87 if(
item == byctpid.end())
return 0;
95 if(
item == byname.end())
return 0;
102 if( thrm->id()==
id )
return thrm;
108 for(
PIT* pit : m_PITs)
109 if( pit->id()==
id )
return pit;
115 for(
TIP* tip : m_TIPs)
116 if( tip->id()==
id )
return tip;
122 const std::vector<TrigConf::TriggerThreshold*>&
124 return m_ThresholdConfig.getThresholdVector();
129 m_ThresholdConfig.addTriggerThreshold(
tt);
140 ds->addSub(
item->compareTo(o_item) );
142 ds->addLeftOnlySub(
"TriggerItem",
item->name() );
148 ds->addRightOnlySub(
"TriggerItem", o_item->name() );
161 m_ThresholdConfig.clear();
164 m_TriggerItemVector.clear();
167 m_ThresholdMonitorVector.clear();
169 for(
PIT* pit : m_PITs)
delete pit;
180 return x->id() <
y->id();
184 if(
x->thresholdName() !=
y->thresholdName() )
185 return x->thresholdName() <
y->thresholdName();
186 return x->multiplicity() <
y->multiplicity();
190 return x->internalCounter() <
y->internalCounter();
194 if(
x->tipNumber() !=
y->tipNumber())
195 return x->tipNumber() <
y->tipNumber();
196 return x->thresholdBit()<
y->thresholdBit();
200 if(
x->pitNumber() !=
y->pitNumber())
201 return x->pitNumber() <
y->pitNumber();
202 return x->thresholdBit()<
y->thresholdBit();
213 cout <<
indent <<
"Trigger menu "; printNameIdV();
214 cout <<
indent <<
" number of pits : " << pitVector().size() << endl;
215 cout <<
indent <<
" number of tips : " << tipVector().size() << endl;
216 cout <<
indent <<
" number of thresholds : " << m_ThresholdConfig.size() << endl;
217 cout <<
indent <<
" number of items : " << m_TriggerItemVector.size() << endl;
218 cout <<
indent <<
" number of thr monitors: " << m_ThresholdMonitorVector.size() << endl;
222 cout <<
indent <<
"==================================" << endl;
223 cout <<
indent <<
"Trigger Items : " << m_TriggerItemVector.size() << endl;
224 cout <<
indent <<
"==================================" << endl;
228 cout <<
indent <<
"==================================" << endl;
229 cout <<
indent <<
"Trigger Thresholds:" << endl;
230 cout <<
indent <<
"==================================" << endl;
235 cout <<
indent <<
"==================================" << endl;
236 cout <<
indent <<
" The ThresholdMonitorVector:" << endl;
237 cout <<
indent <<
"==================================" << endl;
238 auto sortedMon = m_ThresholdMonitorVector;
239 sort(sortedMon.begin(),sortedMon.end(),compMonByID);
244 if(
detail>=3 && m_PITs.size()>0) {
245 cout <<
indent <<
"==================================" << endl;
246 cout <<
indent <<
" PITs:" << endl;
247 cout <<
indent <<
"==================================" << endl;
248 auto sortedPITs = m_PITs;
249 sort(sortedPITs.begin(),sortedPITs.end(),compPIT);
250 for(
PIT* pit : sortedPITs)
255 cout <<
indent <<
"==================================" << endl;
256 cout <<
indent <<
" TIPs:" << endl;
257 cout <<
indent <<
"==================================" << endl;
258 auto sortedTIPs = m_TIPs;
259 sort(sortedTIPs.begin(),sortedTIPs.end(),compTIP);
260 for(
TIP* tip : sortedTIPs)
265 cout <<
indent <<
"==================================" << endl;
266 cout <<
indent <<
" TriggerType summary:" << endl;
267 cout <<
indent <<
"==================================" << endl;
268 for (
int i=0;
i<8; ++
i) {
269 cout <<
indent <<
"TriggerType bit " <<
i << endl;
271 if (
item->isTriggerTypeBitOn(
i))
272 cout <<
indent <<
" " <<
item->name() << endl;
276 cout <<
indent <<
"==================================" << endl;
277 cout <<
indent <<
" BunchGroup mask summary:" << endl;
278 cout <<
indent <<
"==================================" << endl;
281 cout <<
indent <<
" ctpid=" << setw(3) <<
i++ <<
": bgmask=" <<
uint2bin(
m, 16) << endl;
290 indent(xmlfile, indentLevel, indentWidth)
291 <<
"<TriggerMenu name=\"" <<
name()
292 <<
"\" phase=\"lumi\">" << endl;
294 item->writeXML(xmlfile, indentLevel+1, indentWidth);
295 indent(xmlfile, indentLevel, indentWidth) <<
"</TriggerMenu>" << endl;
302 indent(xmlfile, indentLevel, indentWidth) <<
"<TriggerThresholdList>" << endl;
304 auto sortedThresholds = m_ThresholdConfig.getThresholdVector();
305 sort(sortedThresholds.begin(),sortedThresholds.end(),compThr);
308 if(!thr->isInternal())
309 thr->writeXML(xmlfile, indentLevel+1, indentWidth);
311 indent(xmlfile, indentLevel, indentWidth) <<
"</TriggerThresholdList>" << endl;
316 indent(xmlfile, indentLevel, indentWidth) <<
"<TriggerCounterList>" << endl;
318 auto sortedMonitors = m_ThresholdMonitorVector;
319 sort(sortedMonitors.begin(),sortedMonitors.end(),compMon);
322 mon->writeXML(xmlfile, indentLevel+1, indentWidth);
323 indent(xmlfile, indentLevel, indentWidth) <<
"</TriggerCounterList>" << endl;