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 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() [1/2]

EcalBaseNumber::EcalBaseNumber ( )

Definition at line 4 of file EcalBaseNumber.cc.

4 : _theLevels(0) {}

◆ EcalBaseNumber() [2/2]

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::~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 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

◆ getCopyNumber() [1/2]

int EcalBaseNumber::getCopyNumber ( int  level) const

◆ getCopyNumber() [2/2]

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

Definition at line 26 of file EcalBaseNumber.cc.

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

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

◆ getLevelName()

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

◆ getLevels()

int EcalBaseNumber::getLevels ( ) const

◆ reset()

void EcalBaseNumber::reset ( void  )

◆ reverse()

void EcalBaseNumber::reverse ( )

Definition at line 41 of file EcalBaseNumber.cc.

References _sortedCopyNumber, _sortedName, and groupFilesInBlocks::reverse.

41  {
42  std::reverse(std::begin(_sortedName), std::end(_sortedName));
43  std::reverse(std::begin(_sortedCopyNumber), std::end(_sortedCopyNumber));
44 }
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName

◆ setSize()

void EcalBaseNumber::setSize ( const int &  size)

Definition at line 11 of file EcalBaseNumber.cc.

References _sortedCopyNumber, _sortedName, and findQualityFiles::size.

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

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

Member Data Documentation

◆ _sortedCopyNumber

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

Definition at line 32 of file EcalBaseNumber.h.

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

◆ _sortedName

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

Definition at line 31 of file EcalBaseNumber.h.

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

◆ _theLevels

int EcalBaseNumber::_theLevels
protected

Definition at line 33 of file EcalBaseNumber.h.

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