CMS 3D CMS Logo

Public Member Functions | Protected Attributes

Counters Class Reference

#include <Counters.h>

Inheritance diagram for Counters:
TrackerCounters

List of all members.

Public Member Functions

 Counters ()
 Build the counters map.
virtual align::Counter get (align::StructureType) const
 Get a counter based on its structure type.
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:
2013/01/07 19:28:55
Revision:
1.3
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.

{}
virtual Counters::~Counters ( ) [inline, virtual]

Definition at line 37 of file Counters.h.

{}

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 n.

Referenced by AlignableBuilder::index().

{
  auto n = theCounters.find(type);

  if (theCounters.end() == n)
    {
      throw cms::Exception("SetupError")
        << "Cannot find counter corresponding to the structure "
        << AlignableObjectId::idToString(type);
    }

  return n->second;
}

Member Data Documentation

Definition at line 43 of file Counters.h.