Geometry
EcalCommonData
src
EcalBaseNumber.cc
Go to the documentation of this file.
1
#include "
Geometry/EcalCommonData/interface/EcalBaseNumber.h
"
2
#include <algorithm>
3
4
EcalBaseNumber::EcalBaseNumber
() : _theLevels(0) {}
5
6
EcalBaseNumber::EcalBaseNumber
(
const
EcalBaseNumber
& aBaseNumber)
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) {
17
_sortedName
[
_theLevels
] =
name
;
18
_sortedCopyNumber
[
_theLevels
] = copyNumber;
19
_theLevels
++;
20
}
21
22
int
EcalBaseNumber::getLevels
()
const
{
return
_theLevels
; }
23
24
int
EcalBaseNumber::getCopyNumber
(
int
level
)
const
{
return
_sortedCopyNumber
[
level
]; }
25
26
int
EcalBaseNumber::getCopyNumber
(
const
std::string
&
levelName
)
const
{
27
for
(
int
iLevel = 0; iLevel <
_theLevels
; iLevel++) {
28
if
(
_sortedName
[iLevel] ==
levelName
) {
29
return
_sortedCopyNumber
[iLevel];
30
}
31
}
32
return
0;
33
}
34
35
std::string
const
&
EcalBaseNumber::getLevelName
(
int
level
)
const
{
return
_sortedName
[
level
]; }
36
37
int
EcalBaseNumber::getCapacity
() {
return
_sortedName
.capacity(); }
38
39
void
EcalBaseNumber::reset
() {
_theLevels
= 0; }
40
41
void
EcalBaseNumber::reverse
() {
42
std::reverse
(std::begin(
_sortedName
),
std::end
(
_sortedName
));
43
std::reverse
(std::begin(
_sortedCopyNumber
),
std::end
(
_sortedCopyNumber
));
44
}
personalPlayback.level
level
Definition:
personalPlayback.py:22
EcalBaseNumber::_sortedCopyNumber
std::vector< int > _sortedCopyNumber
Definition:
EcalBaseNumber.h:32
EcalBaseNumber::getCopyNumber
int getCopyNumber(int level) const
Definition:
EcalBaseNumber.cc:24
EcalBaseNumber::getLevelName
std::string const & getLevelName(int level) const
Definition:
EcalBaseNumber.cc:35
EcalBaseNumber::getCapacity
int getCapacity()
Definition:
EcalBaseNumber.cc:37
EcalBaseNumber::addLevel
void addLevel(const std::string &name, const int ©Number)
Definition:
EcalBaseNumber.cc:16
EcalBaseNumber::_sortedName
std::vector< std::string > _sortedName
Definition:
EcalBaseNumber.h:31
EcalBaseNumber
Definition:
EcalBaseNumber.h:12
groupFilesInBlocks.reverse
reverse
Definition:
groupFilesInBlocks.py:131
mps_fire.end
end
Definition:
mps_fire.py:242
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
EcalBaseNumber::reset
void reset()
Definition:
EcalBaseNumber.cc:39
EcalBaseNumber::_theLevels
int _theLevels
Definition:
EcalBaseNumber.h:33
EcalBaseNumber.h
fwlog::levelName
const char * levelName(LogLevel)
Definition:
fwLog.cc:32
EcalBaseNumber::getLevels
int getLevels() const
Definition:
EcalBaseNumber.cc:22
EcalBaseNumber::EcalBaseNumber
EcalBaseNumber()
Definition:
EcalBaseNumber.cc:4
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
EcalBaseNumber::setSize
void setSize(const int &size)
Definition:
EcalBaseNumber.cc:11
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
EcalBaseNumber::reverse
void reverse()
Definition:
EcalBaseNumber.cc:41
Generated for CMSSW Reference Manual by
1.8.16