CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
EcalBaseNumber Class Reference

#include <EcalBaseNumber.h>

Public Member Functions

void addLevel (const std::string &name, const int &copyNumber)
 
 EcalBaseNumber ()
 
 EcalBaseNumber (const EcalBaseNumber &aBaseNumber)
 
int getCapacity ()
 
int getCopyNumber (int level) const
 
int getCopyNumber (const std::string &levelName) const
 
std::string const & getLevelName (int level) const
 
int getLevels () const
 
void reset ()
 
void setSize (const int &size)
 
 ~EcalBaseNumber ()
 

Protected Attributes

std::vector< int > _sortedCopyNumber
 
std::vector< std::string > _sortedName
 
int _theLevels
 

Detailed Description

Author
Paolo Meridiani, INFN Roma1

Definition at line 12 of file EcalBaseNumber.h.

Constructor & Destructor Documentation

EcalBaseNumber::EcalBaseNumber ( )

Definition at line 3 of file EcalBaseNumber.cc.

3 :_theLevels(0) { }
EcalBaseNumber::EcalBaseNumber ( const EcalBaseNumber aBaseNumber)

Definition at line 5 of file EcalBaseNumber.cc.

5  :
6  _sortedName(aBaseNumber._sortedName),
8  _theLevels(aBaseNumber._theLevels) { }
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName
EcalBaseNumber::~EcalBaseNumber ( )
inline

Member Function Documentation

void EcalBaseNumber::addLevel ( const std::string &  name,
const int &  copyNumber 
)
int EcalBaseNumber::getCapacity ( )

Definition at line 45 of file EcalBaseNumber.cc.

References _sortedName.

Referenced by EcalTBH4BeamSD::getBaseNumber(), ECalSD::getBaseNumber(), and ~EcalBaseNumber().

46 {
47  return _sortedName.capacity();
48 }
std::vector< std::string > _sortedName
int EcalBaseNumber::getCopyNumber ( int  level) const
int EcalBaseNumber::getCopyNumber ( const std::string &  levelName) const

Definition at line 32 of file EcalBaseNumber.cc.

References _sortedCopyNumber, _sortedName, and _theLevels.

33 {
34  for ( int iLevel = 0; iLevel < _theLevels; iLevel++ ) {
35  if ( _sortedName[iLevel] == levelName ) { return _sortedCopyNumber[iLevel]; }
36  }
37  return 0;
38 }
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName
const char * levelName(LogLevel)
Definition: fwLog.cc:34
std::string const & EcalBaseNumber::getLevelName ( int  level) const
int EcalBaseNumber::getLevels ( ) const
void EcalBaseNumber::reset ( void  )

Definition at line 50 of file EcalBaseNumber.cc.

References _theLevels.

Referenced by EcalTBH4BeamSD::getBaseNumber(), ECalSD::getBaseNumber(), and ~EcalBaseNumber().

51 {
52  _theLevels = 0;
53 }
void EcalBaseNumber::setSize ( const int &  size)

Definition at line 10 of file EcalBaseNumber.cc.

References _sortedCopyNumber, and _sortedName.

Referenced by EcalTBH4BeamSD::getBaseNumber(), ECalSD::getBaseNumber(), and ~EcalBaseNumber().

10  {
11  _sortedName.resize(size);
12  _sortedCopyNumber.resize(size);
13 }
size
Write out results.
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName

Member Data Documentation

std::vector<int> EcalBaseNumber::_sortedCopyNumber
protected

Definition at line 32 of file EcalBaseNumber.h.

Referenced by addLevel(), getCopyNumber(), and setSize().

std::vector<std::string> EcalBaseNumber::_sortedName
protected

Definition at line 31 of file EcalBaseNumber.h.

Referenced by addLevel(), getCapacity(), getCopyNumber(), getLevelName(), and setSize().

int EcalBaseNumber::_theLevels
protected

Definition at line 33 of file EcalBaseNumber.h.

Referenced by addLevel(), getCopyNumber(), getLevels(), and reset().