CMS 3D CMS Logo

EcalBaseNumber.cc
Go to the documentation of this file.
2 #include <algorithm>
3 
4 EcalBaseNumber::EcalBaseNumber() : _theLevels(0) {}
5 
7  : _sortedName(aBaseNumber._sortedName),
8  _sortedCopyNumber(aBaseNumber._sortedCopyNumber),
9  _theLevels(aBaseNumber._theLevels) {}
10 
11 void EcalBaseNumber::setSize(const int& size) {
12  _sortedName.resize(size);
13  _sortedCopyNumber.resize(size);
14 }
15 
16 void EcalBaseNumber::addLevel(const std::string& name, const int& copyNumber) {
18  _sortedCopyNumber[_theLevels] = copyNumber;
19  _theLevels++;
20 }
21 
22 int EcalBaseNumber::getLevels() const { return _theLevels; }
23 
25 
27  for (int iLevel = 0; iLevel < _theLevels; iLevel++) {
28  if (_sortedName[iLevel] == levelName) {
29  return _sortedCopyNumber[iLevel];
30  }
31  }
32  return 0;
33 }
34 
36 
37 int EcalBaseNumber::getCapacity() { return _sortedName.capacity(); }
38 
40 
42  std::reverse(std::begin(_sortedName), std::end(_sortedName));
43  std::reverse(std::begin(_sortedCopyNumber), std::end(_sortedCopyNumber));
44 }
size
Write out results.
std::string const & getLevelName(int level) const
int getCopyNumber(int level) const
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName
void addLevel(const std::string &name, const int &copyNumber)
const char * levelName(LogLevel)
Definition: fwLog.cc:32
int getLevels() const
void setSize(const int &size)