#include <EgHLTTrigCodes.h>
Public Member Functions | |
TrigBitSet | getCode (const char *descript) const |
void | getCodeName (TrigBitSet code, std::string &id) const |
void | printCodes () |
void | setCode (const char *descript, TrigBitSet code) |
void | setCode (const char *descript, int bitNr) |
size_t | size () const |
void | sort () |
TrigBitSetMap () | |
~TrigBitSetMap () | |
Static Public Member Functions | |
static bool | keyComp (const std::pair< std::string, TrigBitSet > &lhs, const std::pair< std::string, TrigBitSet > &rhs) |
Private Attributes | |
std::vector< std::pair < std::string, TrigBitSet > > | codeDefs_ |
Definition at line 27 of file EgHLTTrigCodes.h.
egHLT::TrigCodes::TrigBitSetMap::TrigBitSetMap | ( | ) | [inline] |
Definition at line 34 of file EgHLTTrigCodes.h.
{}
egHLT::TrigCodes::TrigBitSetMap::~TrigBitSetMap | ( | ) | [inline] |
Definition at line 35 of file EgHLTTrigCodes.h.
{}
TrigCodes::TrigBitSet TrigCodes::TrigBitSetMap::getCode | ( | const char * | descript | ) | const |
Definition at line 42 of file EgHLTTrigCodes.cc.
References first, newFWLiteAna::found, i, and NULL.
Referenced by egHLT::TrigCodes::getCode().
{ //first copy the character string to a local array so we can manipulate it char localDescript[512]; strcpy(localDescript,descript); TrigBitSet code; char* codeKey = strtok(localDescript,":"); // std::map<std::string,int> ::const_iterator mapIt; while(codeKey!=NULL){ bool found=false; for(size_t i=0;i<codeDefs_.size() && !found;i++){ if(codeDefs_[i].first.compare(codeKey)==0){ found=true; code |= codeDefs_[i].second; } } // if(!found) edm::LogError("TrigCodes::TrigBitSetMap") <<"TrigCodes::TrigBitSetMap::getCode : Error, Key "<<codeKey<<" not found"; codeKey = strtok(NULL,":"); //getting new substring } return code; }
void TrigCodes::TrigBitSetMap::getCodeName | ( | TrigBitSet | code, |
std::string & | id | ||
) | const |
Definition at line 74 of file EgHLTTrigCodes.cc.
References relativeConstraints::empty, i, and edm::second().
Referenced by egHLT::TrigCodes::getCodeName().
bool TrigCodes::TrigBitSetMap::keyComp | ( | const std::pair< std::string, TrigBitSet > & | lhs, |
const std::pair< std::string, TrigBitSet > & | rhs | ||
) | [static] |
Definition at line 69 of file EgHLTTrigCodes.cc.
Referenced by sort().
{
return lhs.first < rhs.first;
}
void TrigCodes::TrigBitSetMap::printCodes | ( | ) |
Definition at line 87 of file EgHLTTrigCodes.cc.
References first, i, lumiQueryAPI::msg, and edm::second().
Referenced by egHLT::TrigCodes::printCodes().
void TrigCodes::TrigBitSetMap::setCode | ( | const char * | descript, |
int | bitNr | ||
) |
Definition at line 19 of file EgHLTTrigCodes.cc.
References egHLT::TrigCodes::maxNrBits(), and setCode().
{ if(bitNr<maxNrBits()){ TrigBitSet code; code.set(bitNr); setCode(descript,code); }else{ edm::LogWarning("TrigCodes::TrigBitSetMap") <<" Warning, trying to store at bit "<<bitNr<<" but max nr bits is "<<maxNrBits(); } }
void TrigCodes::TrigBitSetMap::setCode | ( | const char * | descript, |
TrigBitSet | code | ||
) |
Definition at line 30 of file EgHLTTrigCodes.cc.
References first, newFWLiteAna::found, and i.
Referenced by setCode(), and egHLT::TrigCodes::setCodes().
size_t egHLT::TrigCodes::TrigBitSetMap::size | ( | void | ) | const [inline] |
Definition at line 48 of file EgHLTTrigCodes.h.
References codeDefs_.
Referenced by egHLT::TrigCodes::setCodes().
{return codeDefs_.size();}
void egHLT::TrigCodes::TrigBitSetMap::sort | ( | ) | [inline] |
Definition at line 47 of file EgHLTTrigCodes.h.
References codeDefs_, and keyComp().
Referenced by egHLT::TrigCodes::setCodes().
std::vector<std::pair<std::string,TrigBitSet> > egHLT::TrigCodes::TrigBitSetMap::codeDefs_ [private] |
Definition at line 31 of file EgHLTTrigCodes.h.