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);
48 char const *
const end = descript+strlen(descript);
49 char const * codeKey = descript;
50 char const * token =
nullptr;
55 if(0==
c.first.compare(0,std::string::npos,codeKey, token-codeKey)){
61 }
while(token != end);
65 bool TrigCodes::keyComp(
const std::pair<std::string,TrigBitSet>& lhs,
const std::pair<std::string,TrigBitSet>& rhs)
67 return lhs.first < rhs.first;
74 if((code&codeDef.second)==codeDef.second){
75 if(!
id.
empty())
id+=
":";
85 std::ostringstream
msg;
86 msg <<
" trig bits defined: "<<std::endl;
87 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)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
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)