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