CMS 3D CMS Logo

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

#include <Counters.h>

Inheritance diagram for Counters:
TrackerCounters

Public Member Functions

 Counters ()
 Build the counters map. More...
 
virtual align::Counter get (align::StructureType) const
 Get a counter based on its structure type. More...
 
virtual ~Counters ()
 

Protected Attributes

std::map< align::StructureType,
align::Counter
theCounters
 

Detailed Description

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.

Date:
2007/10/18 09:41:07
Revision:
1.2
Author
Chung Khim Lae

Definition at line 30 of file Counters.h.

Constructor & Destructor Documentation

Counters::Counters ( )
inline

Build the counters map.

Definition at line 35 of file Counters.h.

35 {}
virtual Counters::~Counters ( )
inlinevirtual

Definition at line 37 of file Counters.h.

37 {}

Member Function Documentation

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, AlignableObjectId::idToString(), and gen::n.

Referenced by Options.Options::__getitem__(), and AlignableBuilder::index().

9 {
10  auto n = theCounters.find(type);
11 
12  if (theCounters.end() == n)
13  {
14  throw cms::Exception("SetupError")
15  << "Cannot find counter corresponding to the structure "
17  }
18 
19  return n->second;
20 }
type
Definition: HCALResponse.h:21
std::map< align::StructureType, align::Counter > theCounters
Definition: Counters.h:43
static const char * idToString(align::StructureType type)

Member Data Documentation

std::map<align::StructureType, align::Counter> Counters::theCounters
protected

Definition at line 43 of file Counters.h.