CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 reverse ()
 
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 4 of file EcalBaseNumber.cc.

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

Definition at line 6 of file EcalBaseNumber.cc.

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

Definition at line 16 of file EcalBaseNumber.h.

16 {}

Member Function Documentation

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

Definition at line 37 of file EcalBaseNumber.cc.

References _sortedName.

Referenced by EcalDumpGeometry::dumpTouch(), EcalTBH4BeamSD::getBaseNumber(), ECalSD::getBaseNumber(), and CaloSteppingAction::update().

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

Definition at line 26 of file EcalBaseNumber.cc.

References _sortedCopyNumber, _sortedName, and _theLevels.

26  {
27  for (int iLevel = 0; iLevel < _theLevels; iLevel++) {
28  if (_sortedName[iLevel] == levelName) {
29  return _sortedCopyNumber[iLevel];
30  }
31  }
32  return 0;
33 }
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName
const char * levelName(LogLevel)
Definition: fwLog.cc:32
std::string const & EcalBaseNumber::getLevelName ( int  level) const
int EcalBaseNumber::getLevels ( ) const
void EcalBaseNumber::reset ( void  )
void EcalBaseNumber::reverse ( )

Definition at line 41 of file EcalBaseNumber.cc.

References _sortedCopyNumber, _sortedName, SplitLinear::begin, and dataset::end.

41  {
42  std::reverse(std::begin(_sortedName), std::end(_sortedName));
44 }
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName
string end
Definition: dataset.py:937
void EcalBaseNumber::setSize ( const int &  size)

Definition at line 11 of file EcalBaseNumber.cc.

References _sortedCopyNumber, and _sortedName.

Referenced by EcalDumpGeometry::dumpTouch(), EcalTBH4BeamSD::getBaseNumber(), ECalSD::getBaseNumber(), and CaloSteppingAction::update().

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

Member Data Documentation

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

Definition at line 32 of file EcalBaseNumber.h.

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

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

Definition at line 31 of file EcalBaseNumber.h.

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

int EcalBaseNumber::_theLevels
protected

Definition at line 33 of file EcalBaseNumber.h.

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