#include <Counters.h>
Public Member Functions | |
Counters () | |
Build the counters map. | |
Counters () | |
Counters (int) | |
void | evalCounters () |
virtual align::Counter | get (align::StructureType) const |
Get a counter based on its structure type. | |
void | incrementSector (int) |
void | printSummary () |
virtual | ~Counters () |
virtual | ~Counters () |
Public Attributes | |
int | m_farSide |
int | m_nearSide |
std::map< int, int > | m_sector |
int | m_wheel |
int | m_wheelid |
Protected Attributes | |
std::map< align::StructureType, align::Counter > | theCounters |
Class to store a list of counters.
A counter is a pointer to a function that returns the number of an alignable based on its id. The number of an alignable is given by its position within its parent. User gets a counter using its structure type via Counters::get(type). Each sub-system has its own concrete counter class implementation.
Definition at line 29 of file Counters.h.
Counters::Counters | ( | ) | [inline] |
Counters::~Counters | ( | ) | [inline, virtual] |
Definition at line 36 of file Counters.h.
{}
Counters::Counters | ( | int | wheel | ) |
virtual Counters::~Counters | ( | ) | [virtual] |
void Counters::evalCounters | ( | ) |
Definition at line 37 of file RPCData.cc.
References m_farSide, m_nearSide, m_sector, and m_wheel.
{ std::map<int,int>::iterator itr; for(itr = m_sector.begin(); itr != m_sector.end(); ++itr) m_wheel += (*itr).second; std::vector<int> far; std::vector<int> near; far.push_back(3); far.push_back(4); far.push_back(5); far.push_back(6); far.push_back(7); far.push_back(8); near.push_back(1); near.push_back(2); near.push_back(12); near.push_back(11); near.push_back(10); near.push_back(9); std::vector<int>::iterator sec; for( sec = far.begin(); sec != far.end(); ++sec) { std::map<int, int>::iterator sector; sector = m_sector.find( (*sec) ); m_farSide += (*sector).second; } for( sec = near.begin(); sec != near.end(); ++sec) { std::map<int, int>::iterator sector; sector = m_sector.find( (*sec) ); m_nearSide += (*sector).second; } }
Counter Counters::get | ( | align::StructureType | type | ) | const [virtual] |
Get a counter based on its structure type.
Definition at line 8 of file Counters.cc.
References Exception, n, and AlignableObjectId::typeToName().
Referenced by AlignableBuilder::index().
{ std::map<StructureType, Counter>::const_iterator n = theCounters.find(type); if (theCounters.end() == n) { throw cms::Exception("SetupError") << "Cannot find counter corresponding to the structure " << AlignableObjectId().typeToName(type); } return n->second; }
void Counters::incrementSector | ( | int | sector | ) |
void Counters::printSummary | ( | ) |
Definition at line 77 of file RPCData.cc.
References gather_cfg::cout, m_farSide, m_nearSide, m_sector, m_wheel, and m_wheelid.
{ std::cout << m_wheelid << std::endl; std::map<int,int>::iterator itr; for(itr = m_sector.begin(); itr != m_sector.end(); ++itr) std::cout << (*itr).first << ": " << (*itr).second << '\t'; std::cout << '\n'; std::cout << "total wheel: " << m_wheel << " " << m_farSide << " " << m_nearSide << '\n'; }
Definition at line 40 of file RPCData.h.
Referenced by Counters(), evalCounters(), and printSummary().
Definition at line 39 of file RPCData.h.
Referenced by Counters(), evalCounters(), and printSummary().
std::map<int,int> Counters::m_sector |
Definition at line 42 of file RPCData.h.
Referenced by Counters(), evalCounters(), incrementSector(), and printSummary().
Definition at line 41 of file RPCData.h.
Referenced by Counters(), evalCounters(), and printSummary().
Definition at line 38 of file RPCData.h.
Referenced by Counters(), and printSummary().
std::map<align::StructureType, align::Counter> Counters::theCounters [protected] |
Definition at line 42 of file Counters.h.