29 copy(chainList.begin(), chainList.end(), std::inserter(*
this, begin()));
41 HLTChainContainer::clear();
46 pair<iterator, bool> ins = insert(
chain);
48 throw runtime_error(
"Can't insert chain '" +
chain->name() +
"', because a uniqueness constraint is violated");
58 if(ch == byname.end())
return 0;
67 if(ch == bycounter.end())
return 0;
80 ch->set_prescales(
sc );
83 if(ch->mergeCounter.l2==0 && ch->mergeCounter.ef==0) {
84 throw runtime_error(
"Merged HLT chain has no info about L2 or EF counter");
85 }
else if(ch->mergeCounter.l2==0) {
87 ch->set_prescales( efps );
88 }
else if(ch->mergeCounter.ef==0) {
90 ch->set_prescales( l2ps );
100 ch->set_prescales(
sc );
110 pss->
setPrescale(ch->prescales(), ch->chain_counter(), ch->level_enum());
120 throw runtime_error(
"setL2LowerChainCounter: no CTPConfig object available");
124 std::map<std::string,int> ctpFromName;
126 ctpFromName[item->name()] = item->ctpId();
129 if(ch->level() ==
"EF")
continue;
130 std::string low_chain_names = ch->lower_chain_name();
131 std::erase(low_chain_names,
' ');
132 vector<string> low_chain_names_V =
tokenize(low_chain_names,
",");
133 std::vector<int> lccs;
134 for(
const std::string& lowerChainName : low_chain_names_V)
135 lccs.push_back(ctpFromName[lowerChainName]);
136 ch->set_lower_chain_counter(low_chain_names_V.size()==1 ? lccs[0] : -1);
137 ch->set_lower_chain_counters(lccs);
146 if(ch->level()!=
"EF" || ch->lower_chain_name()==
"")
continue;
149 cerr <<
"ERROR: Did not find lower chain name '" << ch->lower_chain_name() <<
"' for chain '" << ch->chain_name() <<
"'" << endl;
162 ds->addSub( ch->compareTo(o_ch) );
164 ds->addLeftOnlySub(
"CHAIN", ch->name() );
170 ds->addRightOnlySub(
"CHAIN", o_ch->name() );
182 cout << indent <<
"HLTChainList has " <<
size() <<
" chains" << endl;
185 ch->print(indent +
" ",
detail);
186 cout << indent <<
"- ---------------------------------------------------------- " << endl;
194 o <<
"- -- HLTChainList [" << cl.size() <<
" chains] -------------------------------- " << std::endl;
197 o <<
"- ---------------------------------------------------------- " << std::endl;
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.
size_t size() const
Number of registered mappings.
void clear()
Empty the pool.
const Menu & menu() const
list of all HLT chains in a trigger menu
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
void setL2LowerChainCounter(const CTPConfig *ctpcfg)
HLTChain * chain(const std::string &chainname) const
access the chain by name returns null-pointer if chain not found
HLTChainList()
default constructor
void applyPrescaleSet(const HLTPrescaleSet *pss)
set prescales of all chains
void print(const std::string &indent="", unsigned int detail=1) const
accessors to list of chains, for backward compatibility, use HLTChainList directly
~HLTChainList()
default destructor
DiffStruct * compareTo(const HLTChainList *o) const
HLTPrescaleSet * extractPrescaleSet() const
extract prescales from all chains
void setEFLowerChainCounter()
HLT chain configuration information.
int chain_counter() const
HLT chain configuration information.
bool hasPrescale(unsigned int counter, TrigConf::HLTLevel level=HLT) const
HLTPrescale & setPrescale(const HLTPrescale &sc, unsigned int chain_counter, HLTLevel level=HLT)
const HLTPrescale & getPrescale(unsigned int chain_counter, HLTLevel level=HLT) const
static void mergeL2EFPrescales(TrigConf::HLTChain *hltchain, const TrigConf::HLTPrescale &l2ps, const TrigConf::HLTPrescale &efps)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.
HLTLevel str2lvl(const std::string &level)
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)