31 for(
const std::string path : {
"thresholds",
"thresholds.legacyCalo" } ) {
32 for(
auto & thrByType :
data().get_child( path ) ) {
33 const std::string & thrType = thrByType.first;
34 if (thrType ==
"legacyCalo")
38 auto extraInfo =
m_thrExtraInfo.addExtraInfo(thrByType.first,thrByType.second);
40 auto & v =
m_thresholdsByType[thrType] = std::vector<std::shared_ptr<TrigConf::L1Threshold>>();
41 if(thrType ==
"internal") {
42 for(
auto & thr :
data().get_child( path +
".internal.names") ) {
43 const std::string thrName = thr.second.data();
47 for(
auto & thr :
data().get_child( path +
"." + thrType +
".thresholds") ) {
48 const std::string thrName = thr.first;
52 for(
auto & thr : v ) {
61 catch(std::exception & ex) {
62 std::cerr <<
"ERROR: problem when building L1 menu structure (thresholds). " << ex.what() << std::endl;
68 for(
auto &
board :
data().get_child(
"boards" ) ) {
69 m_boards.emplace( std::piecewise_construct,
70 std::forward_as_tuple(
board.first),
71 std::forward_as_tuple(
board.first,
board.second) );
74 catch(std::exception & ex) {
75 std::cerr <<
"ERROR: problem when building L1 menu structure (boards). " << ex.what() << std::endl;
81 for(
auto & conn :
data().get_child(
"connectors" ) ) {
83 std::forward_as_tuple(conn.first),
84 std::forward_as_tuple(conn.first, conn.second) );
85 for(
auto & tl :
res.first->second.triggerLineNames() ) {
87 std::forward_as_tuple(tl),
88 std::forward_as_tuple(conn.first));
92 catch(std::exception & ex) {
93 std::cerr <<
"ERROR: problem when building L1 menu structure (connectors). " << ex.what() << std::endl;
100 auto topoCategories =
isRun2() ? std::vector<std::string> {
"R2TOPO"} : std::vector<std::string> {
"TOPO",
"MUTOPO",
"MULTTOPO",
"R2TOPO"};
101 for(
const std::string& algoCategory : topoCategories ) {
103 m_algorithmsByName.emplace(algoCategory, std::map<std::string, TrigConf::L1TopoAlgorithm*>());
104 m_algorithmsByOutput.emplace(algoCategory, std::map<std::string, TrigConf::L1TopoAlgorithm*>());
105 if(algoCategory ==
"MULTTOPO") {
106 for(
auto & alg :
data().get_child(
"topoAlgorithms." + algoCategory +
".multiplicityAlgorithms" ) ) {
117 for(
auto & algo : v ) {
119 std::cerr <<
"ERROR : Topo algorithm with name " << algo.name() <<
" and of type " << algoCategory <<
" already exists" << std::endl;
120 throw std::runtime_error(
"Found duplicate topo algorithm name " + algo.name() +
" of type " + algoCategory);
123 for(
const std::string & output : algo.outputs() ) {
125 std::cerr <<
"ERROR : Topo algorithm output " << output <<
" already exists" << std::endl;
126 throw std::runtime_error(
"Found duplicate topo algorithm output " + output +
" of type " + algoCategory);
133 catch(std::exception & ex) {
134 std::cerr <<
"ERROR: problem when building L1 menu structure (algorithms). " << ex.what() << std::endl;
143 catch(std::exception & ex) {
144 std::cerr <<
"ERROR: problem when building L1 menu structure (CTP). " << ex.what() << std::endl;
396 std::string category {
"MULTTOPO"};
397 std::string outputName {triggerlineName};
398 if( std::size_t pos = triggerlineName.find(
'_'); pos != std::string::npos ) {
399 category = triggerlineName.substr(0,pos);
400 outputName = triggerlineName.substr(pos+1);
402 const static std::vector<string> topoTypes {
"TOPO",
"R2TOPO",
"MULTTOPO",
"MUTOPO"};
403 if( std::none_of(cbegin(topoTypes), cend(topoTypes), [&category](
const std::string &
str){
return str==category;}) ) {
404 std::string
msg =
"L1Menu::algorithmFromTriggerLine(" + triggerlineName +
"): triggerline " + triggerlineName +
" is not produced by a topo algorithm.";
405 throw std::runtime_error(
msg);
410 catch(std::exception & ex) {
411 std::cerr <<
"L1Menu::algorithmFromTriggerLine(): No output " << outputName <<
" defined by any algorithm of category " << category <<
" in the L1 menu. (It was asked for " << triggerlineName <<
")" << std::endl;
static std::shared_ptr< L1Threshold > createThreshold(const std::string &name, const std::string &type, std::weak_ptr< L1ThrExtraInfoBase > extraInfo, const ptree &data)
static method to create type-specific L1Thresholds