src
Geometry
HGCalCommonData
src
HGCalGeometryMode.cc
Go to the documentation of this file.
1
#include "
Geometry/HGCalCommonData/interface/HGCalGeometryMode.h
"
2
#include "
DetectorDescription/Core/interface/DDutils.h
"
3
4
template
<>
5
HGCalStringToEnumParser<HGCalGeometryMode::GeometryMode>::HGCalStringToEnumParser
() {
6
enumMap[
"HGCalGeometryMode::Square"
] =
HGCalGeometryMode::Square
;
7
enumMap[
"HGCalGeometryMode::Hexagon"
] =
HGCalGeometryMode::Hexagon
;
8
enumMap[
"HGCalGeometryMode::HexagonFull"
] =
HGCalGeometryMode::HexagonFull
;
9
enumMap[
"HGCalGeometryMode::Hexagon8"
] =
HGCalGeometryMode::Hexagon8
;
10
enumMap[
"HGCalGeometryMode::Hexagon8Full"
] =
HGCalGeometryMode::Hexagon8Full
;
11
enumMap[
"HGCalGeometryMode::Trapezoid"
] =
HGCalGeometryMode::Trapezoid
;
12
enumMap[
"HGCalGeometryMode::Hexagon8File"
] =
HGCalGeometryMode::Hexagon8File
;
13
enumMap[
"HGCalGeometryMode::TrapezoidFile"
] =
HGCalGeometryMode::TrapezoidFile
;
14
enumMap[
"HGCalGeometryMode::Hexagon8Module"
] =
HGCalGeometryMode::Hexagon8Module
;
15
enumMap[
"HGCalGeometryMode::TrapezoidModule"
] =
HGCalGeometryMode::TrapezoidModule
;
16
enumMap[
"HGCalGeometryMode::Hexagon8Cassette"
] =
HGCalGeometryMode::Hexagon8Cassette
;
17
enumMap[
"HGCalGeometryMode::TrapezoidCassette"
] =
HGCalGeometryMode::TrapezoidCassette
;
18
}
19
20
template
<>
21
HGCalStringToEnumParser<HGCalGeometryMode::WaferMode>::HGCalStringToEnumParser
() {
22
enumMap[
"HGCalGeometryMode::Polyhedra"
] =
HGCalGeometryMode::Polyhedra
;
23
enumMap[
"HGCalGeometryMode::ExtrudedPolygon"
] =
HGCalGeometryMode::ExtrudedPolygon
;
24
}
25
26
HGCalGeometryMode::GeometryMode
HGCalGeometryMode::getGeometryMode
(
const
char
*
s
,
const
DDsvalues_type
&
sv
) {
27
DDValue
val
(
s
);
28
if
(
DDfetch
(&
sv
,
val
)) {
29
const
std::vector<std::string>& fvec =
val
.strings();
30
if
(fvec.empty()) {
31
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryMode::Failed to get "
<<
s
<<
" tag."
;
32
}
33
34
HGCalStringToEnumParser<HGCalGeometryMode::GeometryMode>
eparser;
35
HGCalGeometryMode::GeometryMode
result
= (
HGCalGeometryMode::GeometryMode
)eparser.
parseString
(fvec[0]);
36
return
result
;
37
}
else
{
38
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryMode::Failed to fetch "
<<
s
<<
" tag"
;
39
}
40
};
41
42
HGCalGeometryMode::GeometryMode
HGCalGeometryMode::getGeometryMode
(
const
std::string
&
s
) {
43
HGCalStringToEnumParser<HGCalGeometryMode::GeometryMode>
eparser;
44
HGCalGeometryMode::GeometryMode
result
= (
HGCalGeometryMode::GeometryMode
)eparser.
parseString
(
s
);
45
return
result
;
46
};
47
48
HGCalGeometryMode::WaferMode
HGCalGeometryMode::getGeometryWaferMode
(
const
char
*
s
,
const
DDsvalues_type
&
sv
) {
49
DDValue
val
(
s
);
50
if
(
DDfetch
(&
sv
,
val
)) {
51
const
std::vector<std::string>& fvec =
val
.strings();
52
if
(fvec.empty()) {
53
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryWaferMode::Failed to get "
<<
s
<<
" tag."
;
54
}
55
56
HGCalStringToEnumParser<HGCalGeometryMode::WaferMode>
eparser;
57
HGCalGeometryMode::WaferMode
result
= (
HGCalGeometryMode::WaferMode
)eparser.
parseString
(fvec[0]);
58
return
result
;
59
}
else
{
60
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryWaferMode::Failed to fetch "
<<
s
<<
" tag"
;
61
}
62
};
63
64
HGCalGeometryMode::WaferMode
HGCalGeometryMode::getGeometryWaferMode
(
std::string
&
s
) {
65
HGCalStringToEnumParser<HGCalGeometryMode::WaferMode>
eparser;
66
HGCalGeometryMode::WaferMode
result
= (
HGCalGeometryMode::WaferMode
)eparser.
parseString
(
s
);
67
return
result
;
68
};
HGCalGeometryMode::Hexagon8
Definition:
HGCalGeometryMode.h:30
HGCalGeometryMode::Polyhedra
Definition:
HGCalGeometryMode.h:41
HGCalStringToEnumParser
Definition:
HGCalGeometryMode.h:11
DDValue
Definition:
DDValue.h:22
HGCalStringToEnumParser::parseString
T parseString(const std::string &value)
Definition:
HGCalGeometryMode.h:17
HGCalGeometryMode::Trapezoid
Definition:
HGCalGeometryMode.h:32
Exception
Definition:
hltDiff.cc:245
mps_fire.result
result
Definition:
mps_fire.py:311
HGCalGeometryMode::Hexagon8File
Definition:
HGCalGeometryMode.h:33
HGCalGeometryMode::WaferMode
WaferMode
Definition:
HGCalGeometryMode.h:41
HGCalGeometryMode::GeometryMode
GeometryMode
Definition:
HGCalGeometryMode.h:26
HGCalGeometryMode::Hexagon
Definition:
HGCalGeometryMode.h:28
DDutils.h
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition:
pfDeepBoostedJetPreprocessParams_cfi.py:352
HGCalGeometryMode.h
HGCalGeometryMode::Hexagon8Cassette
Definition:
HGCalGeometryMode.h:37
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition:
DDsvalues.cc:79
HGCalGeometryMode::ExtrudedPolygon
Definition:
HGCalGeometryMode.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalGeometryMode::getGeometryWaferMode
WaferMode getGeometryWaferMode(const char *s, const DDsvalues_type &sv)
Definition:
HGCalGeometryMode.cc:48
HGCalGeometryMode::Hexagon8Module
Definition:
HGCalGeometryMode.h:35
HGCalGeometryMode::TrapezoidCassette
Definition:
HGCalGeometryMode.h:38
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition:
DDsvalues.h:12
HGCalGeometryMode::Square
Definition:
HGCalGeometryMode.h:27
HGCalGeometryMode::Hexagon8Full
Definition:
HGCalGeometryMode.h:31
HGCalGeometryMode::getGeometryMode
GeometryMode getGeometryMode(const char *s, const DDsvalues_type &sv)
Definition:
HGCalGeometryMode.cc:26
HGCalGeometryMode::TrapezoidModule
Definition:
HGCalGeometryMode.h:36
HGCalStringToEnumParser::HGCalStringToEnumParser
HGCalStringToEnumParser(void)
HGCalGeometryMode::TrapezoidFile
Definition:
HGCalGeometryMode.h:34
HGCalGeometryMode::HexagonFull
Definition:
HGCalGeometryMode.h:29
heppy_batch.val
val
Definition:
heppy_batch.py:351
Generated for CMSSW Reference Manual by
1.8.14