#include <APVCyclePhaseCollection.h>
Public Types | |
enum | { nopartition = -91, multiphase = -92, empty = -98, invalid = -99 } |
Public Member Functions | |
APVCyclePhaseCollection () | |
std::map< std::string, int > & | get () |
const std::map< std::string, int > & | get () const |
const int | getPhase (const std::string partition) const |
const std::vector< int > | getPhases (const std::string partition) const |
~APVCyclePhaseCollection () | |
Private Attributes | |
std::map< std::string, int > | _apvmap |
Definition at line 9 of file APVCyclePhaseCollection.h.
anonymous enum |
Definition at line 23 of file APVCyclePhaseCollection.h.
{nopartition=-91,multiphase=-92,empty=-98,invalid=-99};
APVCyclePhaseCollection::APVCyclePhaseCollection | ( | ) | [inline] |
Definition at line 12 of file APVCyclePhaseCollection.h.
: _apvmap() { };
APVCyclePhaseCollection::~APVCyclePhaseCollection | ( | ) | [inline] |
Definition at line 13 of file APVCyclePhaseCollection.h.
{ };
const std::map<std::string,int>& APVCyclePhaseCollection::get | ( | void | ) | const [inline] |
Definition at line 15 of file APVCyclePhaseCollection.h.
References _apvmap.
Referenced by ConfigurableAPVCyclePhaseProducer::beginRun().
{ return _apvmap; };
std::map<std::string,int>& APVCyclePhaseCollection::get | ( | void | ) | [inline] |
const int APVCyclePhaseCollection::getPhase | ( | const std::string | partition | ) | const |
Definition at line 5 of file APVCyclePhaseCollection.cc.
References _apvmap, empty, multiphase, and nopartition.
{ int phase = empty; for(std::map<std::string,int>::const_iterator it=_apvmap.begin();it!=_apvmap.end();it++) { if(strstr(it->first.c_str(),partition.c_str())==it->first.c_str() || strcmp(partition.c_str(),"All")==0 ) { if(phase==empty ) { phase = it->second; } else if(phase!=it->second) { return multiphase; } } } if(phase==empty) return nopartition; return phase; }
const std::vector< int > APVCyclePhaseCollection::getPhases | ( | const std::string | partition | ) | const |
Definition at line 26 of file APVCyclePhaseCollection.cc.
References _apvmap, empty, and invalid.
{ std::set<int> phasesset; for(std::map<std::string,int>::const_iterator it=_apvmap.begin();it!=_apvmap.end();it++) { if(strstr(it->first.c_str(),partition.c_str())==it->first.c_str() || strcmp(partition.c_str(),"Any")==0 ) { if(it->second>=0 ) { phasesset.insert(it->second); } } } std::vector<int> phases; for(std::set<int>::const_iterator phase=phasesset.begin();phase!=phasesset.end();++phase) { if(*phase!=empty && *phase!=invalid) { phases.push_back(*phase); } } return phases; }
std::map<std::string,int> APVCyclePhaseCollection::_apvmap [private] |
Definition at line 28 of file APVCyclePhaseCollection.h.
Referenced by get(), getPhase(), and getPhases().