Geometry
MuonNumbering
src
DD4hep_MuonNumbering.cc
Go to the documentation of this file.
1
#include "
Geometry/MuonNumbering/interface/DD4hep_MuonNumbering.h
"
2
#include "
Geometry/MuonNumbering/interface/MuonBaseNumber.h
"
3
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
4
5
using namespace
cms
;
6
using namespace
edm
;
7
8
const
MuonBaseNumber
MuonNumbering::geoHistoryToBaseNumber
(
const
cms::ExpandedNodes
&
nodes
)
const
{
9
MuonBaseNumber
num
;
10
11
int
levelPart =
get
(
"level"
);
12
int
superPart =
get
(
"super"
);
13
int
basePart =
get
(
"base"
);
14
int
startCopyNo =
get
(
"xml_starts_with_copyno"
);
15
16
// some consistency checks
17
if
(basePart != 1) {
18
edm::LogError
(
"Geometry"
) <<
"MuonNumbering finds unusual base constant:"
<< basePart;
19
}
20
if
(superPart < 100) {
21
edm::LogError
(
"Geometry"
) <<
"MuonNumbering finds unusual super constant:"
<< superPart;
22
}
23
if
(levelPart < 10 * superPart) {
24
edm::LogError
(
"Geometry"
) <<
"MuonNumbering finds unusual level constant:"
<< levelPart;
25
}
26
if
((startCopyNo != 0) && (startCopyNo != 1)) {
27
edm::LogError
(
"Geometry"
) <<
"MuonNumbering finds unusual start value for copy numbers:"
<< startCopyNo;
28
}
29
int
ctr
(0);
30
for
(
auto
const
& it :
nodes
.tags) {
31
int
tag
= it / levelPart;
32
if
(
tag
> 0) {
33
int
offset
=
nodes
.offsets[
ctr
];
34
int
copyno =
nodes
.copyNos[
ctr
] +
offset
% superPart;
35
int
super =
offset
/ superPart;
36
num
.addBase(
tag
, super, copyno - startCopyNo);
37
}
38
++
ctr
;
39
}
40
return
num
;
41
}
42
43
const
int
MuonNumbering::get
(
const
char
*
key
)
const
{
44
int
result
(0);
45
auto
const
& it = values_.find(
key
);
46
if
(it !=
end
(values_))
47
result
= it->second;
48
return
result
;
49
}
50
51
void
MuonNumbering::put
(std::string_view
str
,
int
num
) { values_.emplace(
str
,
num
); }
52
53
#include "
FWCore/Utilities/interface/typelookup.h
"
54
55
TYPELOOKUP_DATA_REG
(
MuonNumbering
);
cms::MuonNumbering::geoHistoryToBaseNumber
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
Definition:
DD4hep_MuonNumbering.cc:8
MessageLogger.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
typelookup.h
end
#define end
Definition:
vmac.h:39
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
str
#define str(s)
Definition:
TestProcessor.cc:48
cms::MuonNumbering::put
void put(std::string_view, int)
Definition:
DD4hep_MuonNumbering.cc:51
class-composition.nodes
nodes
Definition:
class-composition.py:75
edm::LogError
Definition:
MessageLogger.h:183
dqmiodatasetharvest.ctr
ctr
Definition:
dqmiodatasetharvest.py:191
MuonBaseNumber.h
cms::ExpandedNodes
Definition:
ExpandedNodes.h:26
cms::MuonNumbering
Definition:
DD4hep_MuonNumbering.h:37
get
#define get
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition:
typelookup.h:102
DD4hep_MuonNumbering.h
EgammaValidation_cff.num
num
Definition:
EgammaValidation_cff.py:34
MuonBaseNumber
Definition:
MuonBaseNumber.h:21
mps_fire.result
result
Definition:
mps_fire.py:303
cms::MuonNumbering::get
const int get(const char *) const
Definition:
DD4hep_MuonNumbering.cc:43
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition:
hltrates_dqm_sourceclient-live_cfg.py:78
crabWrapper.key
key
Definition:
crabWrapper.py:19
cms
Namespace of DDCMS conversion namespace.
Definition:
ProducerAnalyzer.cc:21
Generated for CMSSW Reference Manual by
1.8.16