CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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));
44 }
std::string const & getLevelName(int level) const
std::vector< int > _sortedCopyNumber
std::vector< std::string > _sortedName
int getCopyNumber(int level) const
void addLevel(const std::string &name, const int &copyNumber)
const char * levelName(LogLevel)
Definition: fwLog.cc:32
string end
Definition: dataset.py:937
tuple level
Definition: testEve_cfg.py:47
void setSize(const int &size)
int getLevels() const
tuple size
Write out results.