CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
APVCyclePhaseCollection Class Reference

#include <APVCyclePhaseCollection.h>

Public Types

enum  { nopartition =-91, multiphase =-92, invalid =-99 }
 

Public Member Functions

 APVCyclePhaseCollection ()
 
const std::map< std::string,
int > & 
get () const
 
std::map< std::string, int > & get ()
 
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
 

Detailed Description

Definition at line 9 of file APVCyclePhaseCollection.h.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

APVCyclePhaseCollection::APVCyclePhaseCollection ( )
inline

Definition at line 12 of file APVCyclePhaseCollection.h.

12 : _apvmap() { };
std::map< std::string, int > _apvmap
APVCyclePhaseCollection::~APVCyclePhaseCollection ( )
inline

Definition at line 13 of file APVCyclePhaseCollection.h.

13 { };

Member Function Documentation

const std::map<std::string,int>& APVCyclePhaseCollection::get ( void  ) const
inline

Definition at line 15 of file APVCyclePhaseCollection.h.

References _apvmap.

Referenced by Options.Options::__getitem__(), and ConfigurableAPVCyclePhaseProducer::beginRun().

15 { return _apvmap; };
std::map< std::string, int > _apvmap
std::map<std::string,int>& APVCyclePhaseCollection::get ( void  )
inline

Definition at line 17 of file APVCyclePhaseCollection.h.

References _apvmap.

Referenced by Options.Options::__getitem__().

17 { return _apvmap; };
std::map< std::string, int > _apvmap
const int APVCyclePhaseCollection::getPhase ( const std::string  partition) const

Definition at line 5 of file APVCyclePhaseCollection.cc.

References _apvmap, invalid, multiphase, and nopartition.

5  {
6 
7  int phase = invalid;
8 
9  for(std::map<std::string,int>::const_iterator it=_apvmap.begin();it!=_apvmap.end();it++) {
10  if(strstr(it->first.c_str(),partition.c_str())==it->first.c_str() || strcmp(partition.c_str(),"All")==0 ) {
11  if(phase==invalid ) {
12  phase = it->second;
13  }
14  else if(phase!=it->second) {
15  return multiphase;
16  }
17  }
18  }
19 
20  if(phase==invalid) return nopartition;
21  return phase;
22 
23 
24 }
std::map< std::string, int > _apvmap
const std::vector< int > APVCyclePhaseCollection::getPhases ( const std::string  partition) const

Definition at line 26 of file APVCyclePhaseCollection.cc.

References _apvmap.

26  {
27 
28  std::set<int> phasesset;
29 
30  for(std::map<std::string,int>::const_iterator it=_apvmap.begin();it!=_apvmap.end();it++) {
31  if(strstr(it->first.c_str(),partition.c_str())==it->first.c_str() || strcmp(partition.c_str(),"Any")==0 ) {
32  if(it->second>=0 ) {
33  phasesset.insert(it->second);
34  }
35  }
36  }
37 
38  std::vector<int> phases;
39 
40  for(std::set<int>::const_iterator phase=phasesset.begin();phase!=phasesset.end();++phase) {
41  phases.push_back(*phase);
42  }
43 
44  return phases;
45 
46 
47 }
std::map< std::string, int > _apvmap

Member Data Documentation

std::map<std::string,int> APVCyclePhaseCollection::_apvmap
private

Definition at line 28 of file APVCyclePhaseCollection.h.

Referenced by get(), getPhase(), and getPhases().