CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
APVCyclePhaseCollection Class Reference

#include <APVCyclePhaseCollection.h>

Public Types

enum  { nopartition = -91, multiphase = -92, empty = -98, 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 8 of file APVCyclePhaseCollection.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Constructor & Destructor Documentation

◆ APVCyclePhaseCollection()

APVCyclePhaseCollection::APVCyclePhaseCollection ( )
inline

Definition at line 10 of file APVCyclePhaseCollection.h.

10 : _apvmap(){};
std::map< std::string, int > _apvmap

◆ ~APVCyclePhaseCollection()

APVCyclePhaseCollection::~APVCyclePhaseCollection ( )
inline

Definition at line 11 of file APVCyclePhaseCollection.h.

11 {};

Member Function Documentation

◆ get() [1/2]

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

◆ get() [2/2]

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

◆ getPhase()

const int APVCyclePhaseCollection::getPhase ( const std::string  partition) const

Definition at line 5 of file APVCyclePhaseCollection.cc.

References _apvmap, empty, multiphase, nopartition, and l1ctLayer1_patternWriters_cff::partition.

Referenced by SiStripMonitorDigi::analyze(), SiStripMonitorCluster::analyze(), APVCyclePhaseMonitor::analyze(), EventTimeDistribution::analyze(), CommonModeAnalyzer::analyze(), and APVShotsAnalyzer::analyze().

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

◆ getPhases()

const std::vector< int > APVCyclePhaseCollection::getPhases ( const std::string  partition) const

Definition at line 23 of file APVCyclePhaseCollection.cc.

References _apvmap, empty, invalid, l1ctLayer1_patternWriters_cff::partition, and configurableapvcyclephaseproducer_CRAFT08_cfi::phases.

Referenced by APVCyclePhaseMonitor::analyze(), and EventWithHistoryFilter::getAPVPhase().

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

Member Data Documentation

◆ _apvmap

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

Definition at line 24 of file APVCyclePhaseCollection.h.

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