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
enumMap[
"HGCalGeometryMode::Hexagon8CalibCell"
] =
HGCalGeometryMode::Hexagon8CalibCell
;
19
}
20
21
template
<>
22
HGCalStringToEnumParser<HGCalGeometryMode::WaferMode>::HGCalStringToEnumParser
() {
23
enumMap[
"HGCalGeometryMode::Polyhedra"
] =
HGCalGeometryMode::Polyhedra
;
24
enumMap[
"HGCalGeometryMode::ExtrudedPolygon"
] =
HGCalGeometryMode::ExtrudedPolygon
;
25
}
26
27
HGCalGeometryMode::GeometryMode
HGCalGeometryMode::getGeometryMode
(
const
char
*
s
,
const
DDsvalues_type
&
sv
) {
28
DDValue
val
(
s
);
29
if
(
DDfetch
(&
sv
,
val
)) {
30
const
std::vector<std::string>& fvec =
val
.strings();
31
if
(fvec.empty()) {
32
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryMode::Failed to get "
<<
s
<<
" tag."
;
33
}
34
35
HGCalStringToEnumParser<HGCalGeometryMode::GeometryMode>
eparser;
36
HGCalGeometryMode::GeometryMode
result
= (
HGCalGeometryMode::GeometryMode
)eparser.
parseString
(fvec[0]);
37
return
result
;
38
}
else
{
39
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryMode::Failed to fetch "
<<
s
<<
" tag"
;
40
}
41
};
42
43
HGCalGeometryMode::GeometryMode
HGCalGeometryMode::getGeometryMode
(
const
std::string
&
s
) {
44
HGCalStringToEnumParser<HGCalGeometryMode::GeometryMode>
eparser;
45
HGCalGeometryMode::GeometryMode
result
= (
HGCalGeometryMode::GeometryMode
)eparser.
parseString
(
s
);
46
return
result
;
47
};
48
49
HGCalGeometryMode::WaferMode
HGCalGeometryMode::getGeometryWaferMode
(
const
char
*
s
,
const
DDsvalues_type
&
sv
) {
50
DDValue
val
(
s
);
51
if
(
DDfetch
(&
sv
,
val
)) {
52
const
std::vector<std::string>& fvec =
val
.strings();
53
if
(fvec.empty()) {
54
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryWaferMode::Failed to get "
<<
s
<<
" tag."
;
55
}
56
57
HGCalStringToEnumParser<HGCalGeometryMode::WaferMode>
eparser;
58
HGCalGeometryMode::WaferMode
result
= (
HGCalGeometryMode::WaferMode
)eparser.
parseString
(fvec[0]);
59
return
result
;
60
}
else
{
61
throw
cms::Exception
(
"HGCalGeom"
) <<
"getGeometryWaferMode::Failed to fetch "
<<
s
<<
" tag"
;
62
}
63
};
64
65
HGCalGeometryMode::WaferMode
HGCalGeometryMode::getGeometryWaferMode
(
std::string
&
s
) {
66
HGCalStringToEnumParser<HGCalGeometryMode::WaferMode>
eparser;
67
HGCalGeometryMode::WaferMode
result
= (
HGCalGeometryMode::WaferMode
)eparser.
parseString
(
s
);
68
return
result
;
69
};
HGCalGeometryMode::Hexagon8
Definition:
HGCalGeometryMode.h:30
HGCalGeometryMode::Polyhedra
Definition:
HGCalGeometryMode.h:42
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:42
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:42
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalGeometryMode::getGeometryWaferMode
WaferMode getGeometryWaferMode(const char *s, const DDsvalues_type &sv)
Definition:
HGCalGeometryMode.cc:49
HGCalGeometryMode::Hexagon8Module
Definition:
HGCalGeometryMode.h:35
HGCalGeometryMode::Hexagon8CalibCell
Definition:
HGCalGeometryMode.h:39
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:27
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