13 for (
size_t i=0;
i<filterNames.size();
i++) {
14 p->setCode(filterNames[
i].c_str(),
i);
28 edm::LogWarning(
"TrigCodes::TrigBitSetMap") <<
" Warning, trying to store at bit "<<bitNr<<
" but max nr bits is "<<
maxNrBits_;
38 if(!found)
codeDefs_.emplace_back(descript,code);
47 char localDescript[512];
48 strcpy(localDescript,descript);
51 char* codeKey = strtok(localDescript,
":");
53 while(codeKey!=
nullptr){
65 codeKey = strtok(
nullptr,
":");
71 bool TrigCodes::keyComp(
const std::pair<std::string,TrigBitSet>& lhs,
const std::pair<std::string,TrigBitSet>& rhs)
73 return lhs.first < rhs.first;
80 if((code&codeDef.second)==codeDef.second){
81 if(!
id.
empty())
id+=
":";
91 std::ostringstream
msg;
92 msg <<
" trig bits defined: "<<std::endl;
93 for(
auto & codeDef :
codeDefs_) msg <<
" key : "<<codeDef.first<<
" bit "<<codeDef.second<<std::endl;
TrigBitSet getCode(const char *descript) const
void setCode(const char *descript, TrigBitSet code)
static TrigCodes * makeCodes(std::vector< std::string > &filterNames)
std::vector< std::pair< std::string, TrigBitSet > > codeDefs_
static const int maxNrBits_
void getCodeName(TrigBitSet code, std::string &id) const
std::bitset< maxNrBits_ > TrigBitSet
static bool keyComp(const std::pair< std::string, TrigBitSet > &lhs, const std::pair< std::string, TrigBitSet > &rhs)