15 #include <boost/algorithm/string.hpp>
23 cout <<
"************************************************************" << endl;
24 cout <<
"** **" << endl;
25 cout <<
"** " << sec << setw(58-sec.size()) <<
"**" << endl;
26 cout <<
"** **" << endl;
27 cout <<
"************************************************************" << endl;
34 <<
"===========================" << endl
35 <<
"===== =====" << endl
36 <<
"===== Example L1 Calo =====" << endl
37 <<
"===== =====" << endl
38 <<
"===========================" << endl << endl;
42 cout <<
"Loaded the L1 menu " <<
l1menu.name() << endl;
43 cout <<
"Information to configure eFEX" << endl;
44 cout <<
"For producing eEM objects you need the working points" << endl;
45 auto & ei_eEM =
l1menu.thrExtraInfo().eEM();
46 for(
int ieta : { -30, -20, -10, 0, 10, 20, 30 } ) {
47 unsigned int ptMinToTopo = ei_eEM.ptMinToTopo();
48 cout <<
"ptmin=" << ptMinToTopo << endl;
52 int reta_loose_fw = iso_loose.reta_fw();
53 int rhad_loose_fw = iso_loose.rhad_fw();
54 int wstot_loose_fw = iso_loose.wstot_fw();
55 int reta_loose_d = iso_loose.reta_d();
56 int rhad_loose_d = iso_loose.rhad_d();
57 int wstot_loose_d = iso_loose.wstot_d();
58 cout <<
"ieta=" << ieta <<
" loose => reta_fw=" << reta_loose_fw <<
", rhad_fw=" << rhad_loose_fw <<
", wstot_fw=" << wstot_loose_fw << endl;
59 cout <<
"ieta=" << ieta <<
" loose => reta_d=" << reta_loose_d <<
", rhad_d=" << rhad_loose_d <<
", wstot_d=" << wstot_loose_d << endl;
60 int reta_medium_fw = iso_medium.reta_fw();
61 int rhad_medium_fw = iso_medium.rhad_fw();
62 int wstot_medium_fw = iso_medium.wstot_fw();
63 int reta_medium_d = iso_medium.reta_d();
64 int rhad_medium_d = iso_medium.rhad_d();
65 int wstot_medium_d = iso_medium.wstot_d();
66 cout <<
"ieta=" << ieta <<
" medium => reta_fw=" << reta_medium_fw <<
", rhad_fw=" << rhad_medium_fw <<
", wstot_fw=" << wstot_medium_fw << endl;
67 cout <<
"ieta=" << ieta <<
" medium => reta_d=" << reta_medium_d <<
", rhad_d=" << rhad_medium_d <<
", wstot_d=" << wstot_medium_d << endl;
68 int reta_tight_fw = iso_tight.reta_fw();
69 int rhad_tight_fw = iso_tight.rhad_fw();
70 int wstot_tight_fw = iso_tight.wstot_fw();
71 int reta_tight_d = iso_tight.reta_d();
72 int rhad_tight_d = iso_tight.rhad_d();
73 int wstot_tight_d = iso_tight.wstot_d();
74 cout <<
"ieta=" << ieta <<
" tight => reta_fw=" << reta_tight_fw <<
", rhad_fw=" << rhad_tight_fw <<
", wstot_fw=" << wstot_tight_fw << endl;
75 cout <<
"ieta=" << ieta <<
" tight => reta_d=" << reta_tight_d <<
", rhad_d=" << rhad_tight_d <<
", wstot_d=" << wstot_tight_d << endl;
88 cout << endl <<
"L1 menu has " <<
l1menu.size() <<
" items, going to print the first:" << endl;
91 cout <<
" " <<
item.name() <<
"(ctpId " <<
item.ctpId() <<
") has definition '" <<
item.definition() <<
"' and triggerType " <<
item.triggerType()<< endl;
92 cout <<
"Full printout:" << endl;
108 cout <<
"L1 menu has " <<
l1menu.boardNames().size() <<
" boards configured" << endl;
109 string boardName(
"Topo1");
110 auto & board =
l1menu.board(boardName);
111 cout <<
"Board " << boardName <<
" of type " << board.type() <<
" has " << board.size() <<
" connectors configured: ";
112 for(
auto & connName : board.connectorNames() ) { cout << connName <<
" "; }
126 cout <<
"L1 menu has " <<
l1menu.connectorNames().size() <<
" connectors configured" << endl;
127 for(
const string & connName :
l1menu.connectorNames() ) {
129 cout <<
"Connector " << connName << (
conn.legacy() ?
" (legacy)":
"") <<
" has " <<
conn.size() <<
" trigger lines configured:" << endl;
130 if( connName ==
"MuCTPiOpt0" ) {
131 for(
auto &
tl :
conn.triggerLines() ) {
132 cout <<
" Triggerline " <<
tl.name() <<
" bits=[" <<
tl.startbit() <<
".." <<
tl.endbit() <<
"] is a muon threshold " << endl;
134 }
else if( connName ==
"AlfaCtpin" ) {
135 for(
size_t clock : { 0, 1 } ) {
136 for(
auto &
tl :
conn.triggerLines(0, clock) ) {
137 cout <<
" Triggerline " <<
tl.name() <<
" (clock " << clock <<
", bit " <<
tl.startbit() <<
") is an ALFA threshold " << endl;
141 for(
auto &
tl :
conn.triggerLines() ) {
142 cout <<
" Triggerline " <<
tl.name() <<
" bits=[" <<
tl.startbit() <<
".." <<
tl.endbit() <<
"] is a legacy threshold " << endl;
145 for(
auto &
tl :
conn.triggerLines() ) {
146 const string & tlName =
tl.name();
148 cout <<
" Triggerline " << tlName <<
" bits=[" <<
tl.startbit() <<
".." <<
tl.endbit()
149 <<
"] is produced by topo algorithm " <<
topoAlg.name() << endl;
152 for(
size_t fpga : { 0, 1 } ) {
153 for(
size_t clock : { 0, 1 } ) {
154 for(
auto &
tl :
conn.triggerLines(fpga, clock) ) {
155 const string & tlName =
tl.name();
157 cout <<
" Triggerline " << tlName <<
" bits=[" <<
tl.startbit() <<
".." <<
tl.endbit()
158 <<
"] is produced by topo algorithm " <<
topoAlg.name() << endl;
178 cout <<
"Number of topo algorithms: " <<
l1menu.topoAlgorithmNames(
"TOPO").size() << endl;
179 cout <<
"Number of topo algorithm outputs: " <<
l1menu.topoAlgorithmOutputNames(
"TOPO").size() << endl;
181 auto tl =
l1menu.connector(
"LegacyTopo1").triggerLines(0,0)[0];
185 auto & topoAlgInvmassLeg =
l1menu.algorithmFromTriggerline(
"R2TOPO_900INVM9999-AJ30s6-AJ20s6");
186 topoAlgInvmassLeg.print();
187 cout <<
"Explicit access to 'NumResultBits' as unsigned int: " << topoAlgInvmassLeg.genericParameter<
unsigned int>(
"NumResultBits") << endl;
189 auto & topoAlgEMJ =
l1menu.algorithmFromOutput(
"0DR03-eEM7ab-CjJ15ab",
"TOPO");
192 auto & topoMultAlg =
l1menu.algorithm(
"Mult_eEM22M",
"MULTTOPO");
194 cout <<
" threshold definition: " << topoMultAlg.getAttribute(
"threshold") << endl;
199 cout <<
algName <<
" has inputs ";
200 for(
auto & inp :
alg.inputs() ) {
221 cout <<
"L1 menu has " <<
l1menu.thresholdTypes().size() <<
" threshold types configured: " << endl <<
" ";
222 for(
const string &
tt :
l1menu.thresholdTypes()) { cout <<
tt <<
" "; } cout << endl;
223 for(
const string &
tt :
l1menu.thresholdTypes()) {
224 cout <<
"L1 menu has " <<
l1menu.thresholds(
tt).size() <<
" thresholds of type " <<
tt;
226 cout <<
" thresholds, going to print the first three." << endl;
228 for(
const auto& thr :
l1menu.thresholds(
tt) ) {
229 cout <<
" " << thr->name() <<
" of type " << thr->type() <<
" (mapping " << thr->mapping() <<
") " << endl;
235 if(
tt !=
"internal") {
236 for(
const auto& thr :
l1menu.thresholds(
tt) ) {
237 if(thr->name().find(
"MULT-CMU") != std::string::npos){
continue; }
238 const std::string & connName =
l1menu.connectorNameFromThreshold(thr->name());
239 if(!
l1menu.connector(connName).hasLine(thr->name())) {
240 throw std::runtime_error(
"Threshold " + thr->name() +
" does not exist as triggerline of connector " + connName);
251 cout << thrTAU.
name() <<
":" << endl;
252 for(
int eta : {0, 10, 20, -10,-20}) {
253 cout <<
" value at eta = " <<
eta <<
": " << thrTAU.thrValue(
eta) <<
" GeV, "<< thrTAU.thrValueCounts(
eta) <<
" counts, iso " << thrTAU.isolationMask() << endl;
258 for (
const string & thrName :
l1menu.thresholdNames() ) {
259 cout << thrName <<
" threshold value: " <<
l1menu.threshold(thrName).thrValue() << endl;
263 cout <<
"XE30 cut: " <<
l1menu.threshold(
"XE30").thrValue() << endl;
265 if(thrjXE) cout <<
"jXESPARE1 cut [100 MeV]: " << thrjXE.
thrValue100MeV() << endl;
268 auto thrJET = dynamic_pointer_cast<TrigConf::L1Threshold_JET>(
l1menu.thresholds(
"JET")[0]);
270 cout << thrJET->name() <<
":" << endl;
271 for(
int eta : {0, 20, 30, 40}) {
272 cout <<
" value at eta = " <<
eta <<
": " << thrJET->thrValue(
eta) <<
" GeV, "
273 << thrJET->thrValueMeV(
eta) <<
" MeV, " << thrJET->thrValueCounts(
eta) <<
" counts" << endl;
277 auto thrXE = dynamic_pointer_cast<TrigConf::L1Threshold_XE>(
l1menu.thresholds(
"XE")[0]);
279 cout << thrXE->name() <<
": value " << thrXE->thrValue() <<
" GeV, " << thrXE->thrValueMeV() <<
" MeV, " << thrXE->thrValueCounts() <<
" counts" << endl;
290 cout <<
"eEM26M isolation: rhad = " << (
int)threEM.
rhad() <<
", reta = " << (
int)threEM.reta() <<
", wstot = " << (
int)threEM.wstot() << endl;
294 cout << threTAU.
name() <<
":" << endl;
295 for(
int eta : {0, 10, 20, -10,-20}) {
296 cout <<
" value at eta = " <<
eta <<
": " << threTAU.thrValue(
eta) <<
" GeV, " << threTAU.thrValueCounts(
eta) <<
" counts, iso " << (
int)threTAU.rCore() << endl;
301 cout <<
"jEM20M isolation: iso = " << (
int)thrjEM.
iso() <<
", frac = " << (
int)thrjEM.frac() <<
", frac2 = " << (
int)thrjEM.frac2() << endl;
305 cout << thrjJET.
name() <<
":" << endl;
306 for(
int eta : {0, 20, 30, 40}) {
307 cout <<
" value at eta = " <<
eta <<
": " << thrjJET.thrValue(
eta) <<
" GeV, "
308 << thrjJET.thrValueMeV(
eta) <<
" MeV, " << thrjJET.thrValueCounts(
eta) <<
" counts" << endl;
314 cout <<
"Threshold MU8VF with "
315 <<
"barrel pt=" << thrMU8VF.
ptBarrel() <<
" (idx " << thrMU8VF.idxBarrel() <<
"), "
316 <<
"endcap pt=" << thrMU8VF.ptEndcap() <<
" (idx " << thrMU8VF.idxEndcap() <<
"), and "
317 <<
"forward pt=" << thrMU8VF.ptForward() <<
" (idx " << thrMU8VF.idxForward() <<
")" << endl;
330 section(
"Extra information for threholds");
331 cout <<
"These threshold types have extra information" << endl <<
" ";
332 for(
const string &
tt :
l1menu.thresholdTypes()) {
333 if(
l1menu.thrExtraInfo().hasInfo(
tt) ) {
337 cout << endl <<
"going to print details of the extra threshold information" << endl;
339 auto & exEM =
l1menu.thrExtraInfo().EM();
340 cout <<
" EM" << endl;
341 cout <<
" energy resolution (MeV) " << exEM.resolutionMeV() << endl;
342 cout <<
" ptMinToTopo " << exEM.ptMinToTopo() << endl;
343 for(
const std::string
tt : {
"HAIsoForEMthr",
"EMIsoForEMthr"} ) {
344 cout <<
" Isolation " <<
tt << endl;
345 for(
size_t bit = 1; bit <= 5; bit++) {
346 auto & iso = exEM.isolation(
tt, bit);
347 cout <<
" " << iso << endl;
352 auto & ex =
l1menu.thrExtraInfo().JET();
353 cout <<
" JET" << endl;
354 cout <<
" jetScale " << ex.jetScale() << endl;
355 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
356 cout <<
" ptMinToTopoSmallWindow " << ex.ptMinToTopoSmallWindow() << endl;
357 cout <<
" ptMinToTopoLargeWindow " << ex.ptMinToTopoLargeWindow() << endl;
358 cout <<
" ptMinToTopoSmallWindow (MeV) " << ex.ptMinToTopoSmallWindowMeV() << endl;
359 cout <<
" ptMinToTopoLargeWindow (MeV) " << ex.ptMinToTopoLargeWindowMeV() << endl;
360 cout <<
" ptMinToTopoSmallWindow (counts) " << ex.ptMinToTopoSmallWindowCounts() << endl;
361 cout <<
" ptMinToTopoLargeWindow (counts) " << ex.ptMinToTopoLargeWindowCounts() << endl;
364 auto & ex =
l1menu.thrExtraInfo().TAU();
365 cout <<
" TAU" << endl;
366 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
367 cout <<
" ptMinToTopo " << ex.ptMinToTopo() << endl;
368 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV() << endl;
369 cout <<
" ptMinToTopo (counts)" << ex.ptMinToTopoCounts() << endl;
370 cout <<
" Isolation EMIsoForTAUthr" << endl;
371 for(
size_t bit = 1; bit <= 5; bit++) {
372 cout <<
" " << ex.isolation(
"EMIsoForTAUthr", bit) << endl;
376 auto & ex =
l1menu.thrExtraInfo().eEM();
377 cout <<
" eEM" << endl;
378 cout <<
" iso maxEt (GeV) " << ex.maxEt() << endl;
379 cout <<
" iso maxEt (MeV) " << ex.maxEtMeV() << endl;
380 cout <<
" iso maxEt (Counts) " << ex.maxEtCounts(ex.resolutionMeV()) << endl;
381 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
382 cout <<
" ptMinToTopo " << ex.ptMinToTopo() << endl;
383 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV() << endl;
384 cout <<
" ptMinToTopo (counts)" << ex.ptMinToTopoCounts() << endl;
385 cout <<
" working point Loose" << endl;
387 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
388 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
389 <<
", isolation=" << iso.value() << endl;
391 cout <<
" working point Medium" << endl;
393 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
394 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
395 <<
", isolation=" << iso.value() << endl;
397 cout <<
" working point Tight" << endl;
399 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
400 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
401 <<
", isolation=" << iso.value() << endl;
406 for(
int ieta : { -30, -20, -10, 0, 10, 20, 30 } ) {
408 int reta_loose_fw = iso_loose.reta_fw();
409 int rhad_loose_fw = iso_loose.rhad_fw();
410 int wstot_loose_fw = iso_loose.wstot_fw();
411 int reta_loose_d = iso_loose.reta_d();
412 int rhad_loose_d = iso_loose.rhad_d();
413 int wstot_loose_d = iso_loose.wstot_d();
414 cout <<
"ieta=" << ieta <<
" loose => reta_fw=" << reta_loose_fw <<
", rhad_fw=" << rhad_loose_fw <<
", wstot_fw=" << wstot_loose_fw << endl;
415 cout <<
"ieta=" << ieta <<
" loose => reta_d=" << reta_loose_d <<
", rhad_d=" << rhad_loose_d <<
", wstot_d=" << wstot_loose_d << endl;
420 auto & ex =
l1menu.thrExtraInfo().jEM();
421 cout <<
" jEM" << endl;
422 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
423 cout <<
" ptMinToTopo " << ex.ptMinToTopo(
"1A") << endl;
424 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV(
"1A") << endl;
425 cout <<
" ptMinToTopo (counts)" << ex.ptMinToTopoCounts(
"1A") << endl;
426 cout <<
" ptMinxTOB " << ex.ptMinxTOB(
"1A") << endl;
427 cout <<
" ptMinxTOB (MeV) " << ex.ptMinxTOBMeV(
"1A") << endl;
428 cout <<
" ptMinxTOB (counts) " << ex.ptMinxTOBCounts(
"1A") << endl;
429 cout <<
" working point Loose" << endl;
431 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
432 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
433 <<
", isolation=" << iso.value() << endl;
435 cout <<
" working point Medium" << endl;
437 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
438 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
439 <<
", isolation=" << iso.value() << endl;
441 cout <<
" working point Tight" << endl;
443 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
444 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
445 <<
", isolation=" << iso.value() << endl;
451 auto & ex =
l1menu.thrExtraInfo().jJ();
452 cout <<
" jJ" << endl;
453 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
454 cout <<
" ptMinToTopo " << ex.ptMinToTopo(
"1A") << endl;
455 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV(
"1A") << endl;
456 cout <<
" ptMinToTopo (counts) " << ex.ptMinToTopoCounts(
"1A") << endl;
457 cout <<
" ptMinxTOB " << ex.ptMinxTOB(
"1A") << endl;
458 cout <<
" ptMinxTOB (MeV) " << ex.ptMinxTOBMeV(
"1A") << endl;
459 cout <<
" ptMinxTOB (counts) " << ex.ptMinxTOBCounts(
"1A") << endl;
462 auto & ex =
l1menu.thrExtraInfo().jLJ();
463 cout <<
" jLJ" << endl;
464 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
465 cout <<
" ptMinToTopo " << ex.ptMinToTopo(
"1A") << endl;
466 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV(
"1A") << endl;
467 cout <<
" ptMinToTopo (counts) " << ex.ptMinToTopoCounts(
"1A") << endl;
468 cout <<
" ptMinxTOB " << ex.ptMinxTOB(
"1A") << endl;
469 cout <<
" ptMinxTOB (MeV) " << ex.ptMinxTOBMeV(
"1A") << endl;
470 cout <<
" ptMinxTOB (counts) " << ex.ptMinxTOBCounts(
"1A") << endl;
473 auto & ex =
l1menu.thrExtraInfo().gLJ();
474 cout <<
" gLJ" << endl;
475 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
476 cout <<
" ptMinToTopo (eta range "<<
std::to_string(1)<<
") in GeV " << ex.ptMinToTopo(1) << endl;
477 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV(1) << endl;
478 cout <<
" ptMinToTopo (counts) " << ex.ptMinToTopoCounts(1) << endl;
479 cout <<
" seedThr(A) " << ex.seedThr(
'A') << endl;
480 cout <<
" seedThr(A) (MeV) " << ex.seedThrMeV(
'A') << endl;
481 cout <<
" rhoTowerMin(B) " << ex.rhoTowerMin(
'B') << endl;
482 cout <<
" rhoTowerMin(B) (MeV) " << ex.rhoTowerMinMeV(
'B') << endl;
483 cout <<
" rhoTowerMax(C) " << ex.rhoTowerMax(
'C') << endl;
484 cout <<
" rhoTowerMax(C) (MeV) " << ex.rhoTowerMaxMeV(
'C') << endl;
487 auto & ex =
l1menu.thrExtraInfo().gXE();
488 cout <<
" gXE" << endl;
489 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
490 cout <<
" seedThr(A) " << ex.seedThr(
'A') << endl;
491 cout <<
" seedThr(A) (MeV) " << ex.seedThrMeV(
'A') << endl;
492 cout <<
" XERHO_sigmaPosA " << ex.XERHO_param(
'A',
true) << endl;
493 cout <<
" XERHO_sigmaNegB " << ex.XERHO_param(
'B',
false) << endl;
494 cout <<
" XEJWOJ_a_C " << ex.JWOJ_param(
'C',
'a') << endl;
495 cout <<
" XEJWOJ_b_B " << ex.JWOJ_param(
'B',
'b') << endl;
496 cout <<
" XEJWOJ_c_A " << ex.JWOJ_param(
'A',
'c') << endl;
499 auto & ex =
l1menu.thrExtraInfo().eTAU();
500 cout <<
" eTAU" << endl;
501 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
502 cout <<
" ptMinToTopo " << ex.ptMinToTopo() << endl;
503 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV() << endl;
504 cout <<
" ptMinToTopo (counts)" << ex.ptMinToTopoCounts() << endl;
505 cout <<
" working point Loose" << endl;
507 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
508 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
509 <<
", isolation=" << iso.value() << endl;
511 cout <<
" working point Medium" << endl;
513 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
514 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
515 <<
", isolation=" << iso.value() << endl;
517 cout <<
" working point Tight" << endl;
519 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
520 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
521 <<
", isolation=" << iso.value() << endl;
525 auto & ex =
l1menu.thrExtraInfo().jTAU();
526 cout <<
" jTAU" << endl;
527 cout <<
" energy resolution (MeV) " << ex.resolutionMeV() << endl;
528 cout <<
" ptMinToTopo " << ex.ptMinToTopo(
"1A") << endl;
529 cout <<
" ptMinToTopo (MeV) " << ex.ptMinToTopoMeV(
"1A") << endl;
530 cout <<
" ptMinToTopo (counts)" << ex.ptMinToTopoCounts(
"1A") << endl;
531 cout <<
" ptMinxTOB " << ex.ptMinxTOB(
"1A") << endl;
532 cout <<
" ptMinxTOB (MeV) " << ex.ptMinxTOBMeV(
"1A") << endl;
533 cout <<
" ptMinxTOB (counts) " << ex.ptMinxTOBCounts(
"1A") << endl;
534 cout <<
" working point Loose" << endl;
536 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
537 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
538 <<
", isolation=" << iso.value() << endl;
540 cout <<
" working point Medium" << endl;
542 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
543 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
544 <<
", isolation=" << iso.value() << endl;
546 cout <<
" working point Tight" << endl;
548 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
549 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
550 <<
", isolation=" << iso.value() << endl;
554 auto & ex =
l1menu.thrExtraInfo().cTAU();
555 cout <<
" cTAU" << endl;
556 cout <<
" working point Loose" << endl;
558 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
559 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
560 <<
", isolation=" << iso.value() << endl;
562 cout <<
" working point Medium" << endl;
564 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
565 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
566 <<
", isolation=" << iso.value() << endl;
568 cout <<
" working point Tight" << endl;
570 cout <<
" range etaMin=" << iso.etaMin() <<
", etaMax=" << iso.etaMax()
571 <<
", priority=" << iso.priority() <<
", symmetric=" << (iso.symmetric() ?
"yes" :
"no")
572 <<
", isolation=" << iso.value() << endl;
576 auto & exMU =
l1menu.thrExtraInfo().MU();
577 cout <<
" MU" << endl;
578 cout <<
" known pt values for rpc ";
579 for(
auto pt : exMU.knownRpcPtValues()) cout <<
pt <<
" ";
580 cout << endl <<
" known pt values for tgc ";
581 for(
auto pt : exMU.knownTgcPtValues()) cout <<
pt <<
" ";
583 cout <<
" RPC pt value for index 2: "<< exMU.ptForRpcIdx(2) << endl;
584 cout <<
" TGC pt value for index 2: "<< exMU.ptForTgcIdx(2) << endl;
585 cout <<
" TGC index for RPC index 2: "<< exMU.tgcIdxForRpcIdx(2) << endl;
587 cout <<
" exclusionList 'rpcFeet'" << endl;
588 for(
auto &
x : exMU.exclusionList(
"rpcFeet")) {
589 cout <<
" sector " <<
x.first <<
": ";
590 for(
auto roi :
x.second ) cout << roi <<
" ";
602 <<
"==========================" << endl
603 <<
"===== =====" << endl
604 <<
"===== Test L1 access =====" << endl
605 <<
"===== =====" << endl
606 <<
"==========================" << endl << endl;
608 cout <<
"Printing detail " << (printdetail ?
"yes" :
"no") << endl;
610 cout <<
"Loaded the L1 menu " <<
l1menu.name() << endl;
626 cout <<
"===========================" << endl
627 <<
"===== =====" << endl
628 <<
"===== Test HLT access =====" << endl
629 <<
"===== =====" << endl
630 <<
"===========================" << endl << endl;
632 cout <<
"Loaded the HLT menu " << hltmenu.
name() << endl;
633 cout <<
"Menu has " << hltmenu.
size() <<
" chains, going to print the first 3." << endl;
635 for(
auto &
ch : hltmenu ) {
636 cout << endl <<
"Chain '" <<
ch.name() <<
"' with counter " <<
ch[
"counter"] <<
" and seeded by " <<
ch[
"l1item"] << endl;
637 cout <<
"has the following L1 thresholds: " << endl <<
" ";
638 bool printComma =
false;
639 for(
auto & thr :
ch.l1thresholds() ) {
646 cout <<
"streams:" << endl <<
" ";
648 for(
auto &
s :
ch.streams() ) {
655 cout <<
"and groups:" << endl <<
" ";
657 for(
auto &
g :
ch.groups() ) {
666 vector<TrigConf::DataStructure>
streams = hltmenu.streams();
667 cout <<
"Menu has " <<
streams.size() <<
" streams, going to print the first 3." << endl;
670 cout <<
" " <<
s[
"type"] <<
"_" <<
s[
"name"]
671 << (
s[
"obeyLB"]==
"true" ?
" (obeys LB" :
" (does not obey LB") <<
")"
672 << (
s[
"forceFullEventBuilding"]==
"true" ?
" (forces FullEventBuilding" :
" (does not force FullEventBuilding") <<
")"
688 cout <<
"The program needs to be run with the following specifications:\n\n";
689 cout <<
"TestTriggerMenuAccess <options>\n";
691 cout <<
"[Input options]\n";
692 cout <<
" -f|--file file1 ... input json file to test\n";
693 cout <<
" --smk smk ... smk \n";
694 cout <<
" --db dbalias ... dbalias (default TRIGGERDB_RUN3) \n";
695 cout <<
"[Other options]\n";
696 cout <<
" -h|--help ... this help\n";
698 cout <<
"If no input is specified, the default Dev_pp_run3_v1 menu file will be taken from the release\n\n";
705 std::string
dbalias {
"TRIGGERDB_RUN3"};
706 std::vector<std::string> knownParameters {
"file",
"f",
"smk",
"db",
"help",
"h" };
708 std::string currentParameter(
"");
709 std::string listofUnknownParameters =
"";
710 std::string listofUnknownArguments =
"";
713 std::string currentWord(
argv[
i]);
714 bool isParam = currentWord[0]==
'-';
717 int firstChar = currentWord.find_first_not_of(
'-');
718 string paramName = currentWord.substr(firstChar);
721 if ( isParam &&
std::find(knownParameters.begin(), knownParameters.end(), paramName) == knownParameters.end() ) {
722 listofUnknownParameters +=
" " + currentWord;
727 currentParameter =
"";
729 if(paramName ==
"h" || paramName ==
"help" ) {
help =
true;
continue; }
730 currentParameter = paramName;
735 if(currentParameter ==
"file" || currentParameter ==
"f") {
739 if(currentParameter ==
"smk") {
740 smk = stoul(currentWord);
743 if(currentParameter ==
"db") {
747 listofUnknownArguments +=
" " + currentWord;
750 if ( not listofUnknownParameters.empty() ) {
751 cerr <<
"Unknown parameter(s):" << listofUnknownParameters << endl;
756 if ( not listofUnknownArguments.empty() ) {
757 cerr <<
"Unknown argument(s):" << listofUnknownArguments << endl;
766 if( env_AV !=
nullptr and env_xmlpath !=
nullptr ) {
767 vector<string>
paths;
768 string xmlpath(env_xmlpath);
770 for(
const string &
p :
paths) {
771 string testFN =
p +
"/TriggerMenuMT/L1Menu_Dev_pp_run3_v1_" + string(env_AV) +
".json";
780 cout <<
"No filename or smk specified and no default L1 menu file found in the release" << endl;
802 if(filetype ==
"l1menu") {
806 }
else if(filetype ==
"hltmenu") {
811 cout <<
"File " <<
filename <<
" is neither an L1 or an HLT menu json file" << endl;
815 cout <<
"Finished " << (success ?
"successfully" :
"with failures") << endl;
816 return success ? 0 : 1;