21 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DDD)::build called with " 22 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet;
55 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
57 attribute =
"OnlyForHGCalNumbering";
79 php.
levelZSide_ =
static_cast<int>(getDDDValue(
"LevelZSide",
sv));
86 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
88 php.
useSimWt_ =
static_cast<int>(getDDDValue(
"UseSimWt",
sv));
102 attribute =
"OnlyForHGCalNumbering";
111 php.
nCellsFine_ =
static_cast<int>(getDDDValue(
"NumberOfCellsFine", sv2));
112 php.
nCellsCoarse_ =
static_cast<int>(getDDDValue(
"NumberOfCellsCoarse", sv2));
128 for (
int k = 0;
k < 2; ++
k)
129 getCellPosition(php,
k);
135 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
137 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
139 geom->loadCellParsHexagon(cpv, php);
145 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
147 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
149 geom->loadWaferHexagon(php);
151 geom->loadCellParsHexagon(cpv, php);
156 geom->loadSpecParsHexagon8(fv, php);
158 geom->loadGeometryHexagon8(fv, php, 1);
162 geom->loadWaferHexagon8(php);
165 geom->loadSpecParsHexagon8(fv, php);
167 geom->loadGeometryHexagon8(fv, php, 1);
171 geom->loadWaferHexagon8(php);
174 geom->loadSpecParsHexagon8(fv, php);
176 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
180 geom->loadWaferHexagon8(php);
194 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
196 php.
useSimWt_ =
static_cast<int>(getDDDValue(
"UseSimWt",
sv));
207 geom->loadSpecParsTrapezoid(fv, php);
211 geom->loadCellTrapezoid(php);
213 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
216 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
219 edm::LogError(
"HGCalGeom") <<
" Attribute " <<
val <<
" not found but needed.";
220 throw cms::Exception(
"DDException") <<
"Attribute " <<
val <<
" not found but needed.";
224 <<
" with flag " <<
ok;
237 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DD4hep)::build called with " 238 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet <<
":" <<
name2;
243 std::vector<std::string> tempS;
244 std::vector<double> tempD;
246 tempS = fv.
get<std::vector<std::string> >(
name2,
"GeometryMode");
248 tempS = fv.
get<std::vector<std::string> >(
name,
"GeometryMode");
250 std::string sv = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Hexagon8Full";
273 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
275 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
276 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Polyhedra";
290 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
294 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
296 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
299 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
301 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
304 tempD = fv.
get<std::vector<double> >(
name,
"LayerRotation");
306 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
311 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
323 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
324 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::ExtrudedPolygon";
326 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsFine");
328 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsCoarse");
330 tempD = fv.
get<std::vector<double> >(namet,
"WaferSize");
332 tempD = fv.
get<std::vector<double> >(namet,
"WaferThickness");
334 tempD = fv.
get<std::vector<double> >(namet,
"SensorSeparation");
336 tempD = fv.
get<std::vector<double> >(namet,
"MouseBite");
349 for (
int k = 0;
k < 2; ++
k)
350 getCellPosition(php,
k);
355 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
357 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
359 geom->loadCellParsHexagon(vmap, php);
365 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
367 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
369 geom->loadWaferHexagon(php);
371 geom->loadCellParsHexagon(vmap, php);
376 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
378 geom->loadGeometryHexagon8(cpv, php,
name, 1);
382 geom->loadWaferHexagon8(php);
385 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
387 geom->loadGeometryHexagon8(cpv, php,
name, 1);
391 geom->loadWaferHexagon8(php);
394 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
396 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
400 geom->loadWaferHexagon8(php);
406 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
409 tempD = fv.
get<std::vector<double> >(
name,
"FirstLayer");
411 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
413 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
415 tempD = fv.
get<std::vector<double> >(
name,
"WaferThickness");
417 tempD = fv.
get<std::vector<double> >(
name,
"MinimumTileSize");
421 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
423 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
426 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
430 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
442 geom->loadSpecParsTrapezoid(fv, vmap, php,
name);
446 geom->loadCellTrapezoid(php);
448 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
451 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
454 edm::LogError(
"HGCalGeom") <<
" Attribute Volume:" <<
name <<
" not found but needed.";
455 throw cms::Exception(
"DDException") <<
"Attribute Volume:" <<
name <<
" not found but needed.";
459 <<
" with flag " <<
ok;
474 std::vector<int> indtypes;
478 double r = 0.5 *
R *
sqrt(3.0);
481 for (
int u = 0; u < 2 *
N; ++u) {
482 for (
int v = 0;
v < 2 *
N; ++
v) {
483 if (((
v - u) <
N) && (u -
v) <=
N) {
484 double yp = (u - 0.5 *
v - n2) * 2 * r;
485 double xp = (1.5 * (
v -
N) + 1.0) *
R;
486 int id =
v * 100 + u;
488 indtypes.emplace_back(
id);
497 cellIndex[
id] = ipos;
512 int id = indtypes[
k];
519 int id = indtypes[
k];
530 const std::vector<double>& fvec =
val.doubles();
532 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to get " <<
s <<
" tag.";
536 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to fetch " <<
s <<
" tag";
543 const std::vector<double>& fvec =
val.doubles();
545 throw cms::Exception(
"HGCalGeom") <<
"getDDDArray::Failed to get " <<
s <<
" tag.";
549 throw cms::Exception(
"HGCalGeom") <<
"getDDDArray:Failed to fetch " <<
s <<
" tag";
Log< level::Info, true > LogVerbatim
static constexpr int scintillatorCassette
constexpr NumType convertRadToDeg(NumType radians)
std::vector< double > cellFineY_
const cms::DDDetector * detector() const
Log< level::Error, false > LogError
bool build(const DDCompactView *cpv, HGCalParameters &php, const std::string &name, const std::string &namew, const std::string &namec, const std::string &namet)
Compact representation of the geometrical detector hierarchy.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
HGCalGeometryMode::GeometryMode mode_
std::unordered_map< std::string, std::vector< double > > DDVectorsMap
WaferMode getGeometryWaferMode(const char *s, const DDsvalues_type &sv)
std::vector< double > cellCoarseX_
static constexpr int siliconCassetteHE
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::vector< double > cellSize_
static constexpr int siliconCassetteEE
GeometryMode getGeometryMode(const char *s, const DDsvalues_type &sv)
static constexpr double k_ScaleFromDD4hep
bool firstChild()
set the current node to the first child
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
DDsvalues_type mergedSpecifics() const
T get(const std::string &)
extract attribute value
static constexpr double k_ScaleToDDD
std::unordered_map< int32_t, int32_t > wafer_map
double getDDDValue(const char *s, const DDsvalues_type &sv)
wafer_map cellCoarseIndex_
std::vector< double > cellFineX_
static constexpr double k_ScaleFromDDD
bool firstChild()
set the current node to the first child ...
std::vector< int > levelT_
std::vector< double > cellCoarseY_
cms::DDVectorsMap const & vectors() const
std::vector< double > getDDDArray(const char *s, const DDsvalues_type &sv)
void getCellPosition(HGCalParameters &php, int type)