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 (const std::string &levelName) const
 
int getCopyNumber (int level) 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() [1/2]

EcalBaseNumber::EcalBaseNumber ( )

Definition at line 3 of file EcalBaseNumber.cc.

3 : _theLevels(0) {}

◆ EcalBaseNumber() [2/2]

EcalBaseNumber::EcalBaseNumber ( const EcalBaseNumber aBaseNumber)

Definition at line 5 of file EcalBaseNumber.cc.

6  : _sortedName(aBaseNumber._sortedName),
8  _theLevels(aBaseNumber._theLevels) {}

◆ ~EcalBaseNumber()

EcalBaseNumber::~EcalBaseNumber ( )
inline

Definition at line 16 of file EcalBaseNumber.h.

16 {}

Member Function Documentation

◆ addLevel()

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

◆ getCapacity()

int EcalBaseNumber::getCapacity ( )

Definition at line 36 of file EcalBaseNumber.cc.

36 { return _sortedName.capacity(); }

References _sortedName.

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

◆ getCopyNumber() [1/2]

int EcalBaseNumber::getCopyNumber ( const std::string &  levelName) const

Definition at line 25 of file EcalBaseNumber.cc.

25  {
26  for (int iLevel = 0; iLevel < _theLevels; iLevel++) {
27  if (_sortedName[iLevel] == levelName) {
28  return _sortedCopyNumber[iLevel];
29  }
30  }
31  return 0;
32 }

References _sortedCopyNumber, _sortedName, _theLevels, and fwlog::levelName().

◆ getCopyNumber() [2/2]

int EcalBaseNumber::getCopyNumber ( int  level) const

◆ getLevelName()

std::string const & EcalBaseNumber::getLevelName ( int  level) const

◆ getLevels()

int EcalBaseNumber::getLevels ( ) const

◆ reset()

void EcalBaseNumber::reset ( void  )

Definition at line 38 of file EcalBaseNumber.cc.

38 { _theLevels = 0; }

References _theLevels.

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

◆ setSize()

void EcalBaseNumber::setSize ( const int &  size)

Member Data Documentation

◆ _sortedCopyNumber

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

Definition at line 31 of file EcalBaseNumber.h.

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

◆ _sortedName

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

Definition at line 30 of file EcalBaseNumber.h.

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

◆ _theLevels

int EcalBaseNumber::_theLevels
protected

Definition at line 32 of file EcalBaseNumber.h.

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

personalPlayback.level
level
Definition: personalPlayback.py:22
EcalBaseNumber::_sortedCopyNumber
std::vector< int > _sortedCopyNumber
Definition: EcalBaseNumber.h:31
EcalBaseNumber::_sortedName
std::vector< std::string > _sortedName
Definition: EcalBaseNumber.h:30
EcalBaseNumber::_theLevels
int _theLevels
Definition: EcalBaseNumber.h:32
fwlog::levelName
const char * levelName(LogLevel)
Definition: fwLog.cc:32
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443