21 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DDD)::build called with " 22 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet;
59 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
61 attribute =
"OnlyForHGCalNumbering";
83 php.
levelZSide_ =
static_cast<int>(getDDDValue(
"LevelZSide",
sv));
90 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
93 php.
useSimWt_ =
static_cast<int>(getDDDValue(
"UseSimWt",
sv));
107 attribute =
"OnlyForHGCalNumbering";
116 php.
nCellsFine_ =
static_cast<int>(getDDDValue(
"NumberOfCellsFine", sv2));
117 php.
nCellsCoarse_ =
static_cast<int>(getDDDValue(
"NumberOfCellsCoarse", sv2));
124 php.
useOffset_ =
static_cast<int>(getDDDValue(
"UseOffset", sv2));
137 for (
int k = 0;
k < 2; ++
k)
138 getCellPosition(php,
k);
144 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
146 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
148 geom->loadCellParsHexagon(cpv, php);
154 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
156 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
158 geom->loadWaferHexagon(php);
160 geom->loadCellParsHexagon(cpv, php);
165 geom->loadSpecParsHexagon8(fv, php);
167 geom->loadGeometryHexagon8(fv, php, 1);
171 geom->loadWaferHexagon8(php);
174 geom->loadSpecParsHexagon8(fv, php);
176 geom->loadGeometryHexagon8(fv, php, 1);
180 geom->loadWaferHexagon8(php);
184 geom->loadSpecParsHexagon8(fv, php);
186 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
190 geom->loadWaferHexagon8(php);
205 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
207 php.
useSimWt_ =
static_cast<int>(getDDDValue(
"UseSimWt",
sv));
218 geom->loadSpecParsTrapezoid(fv, php);
222 geom->loadCellTrapezoid(php);
224 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
227 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
230 edm::LogError(
"HGCalGeom") <<
" Attribute " <<
val <<
" not found but needed.";
231 throw cms::Exception(
"DDException") <<
"Attribute " <<
val <<
" not found but needed.";
235 <<
" with flag " <<
ok;
248 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DD4hep)::build called with " 249 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet <<
":" <<
name2;
254 std::vector<std::string> tempS;
255 std::vector<double> tempD;
257 tempS = fv.
get<std::vector<std::string> >(
name2,
"GeometryMode");
259 tempS = fv.
get<std::vector<std::string> >(
name,
"GeometryMode");
261 std::string sv = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Hexagon8Full";
285 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
287 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
288 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Polyhedra";
302 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
306 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
308 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
311 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
313 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
317 tempD = fv.
get<std::vector<double> >(
name,
"LayerRotation");
319 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
324 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
336 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
337 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::ExtrudedPolygon";
339 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsFine");
341 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsCoarse");
343 tempD = fv.
get<std::vector<double> >(namet,
"WaferSize");
345 tempD = fv.
get<std::vector<double> >(namet,
"WaferThickness");
347 tempD = fv.
get<std::vector<double> >(namet,
"SensorSeparation");
349 tempD = fv.
get<std::vector<double> >(namet,
"SensorSizeOffset");
351 tempD = fv.
get<std::vector<double> >(namet,
"GuardRingOffset");
353 tempD = fv.
get<std::vector<double> >(namet,
"MouseBite");
355 tempD = fv.
get<std::vector<double> >(namet,
"UseOffset");
369 for (
int k = 0;
k < 2; ++
k)
370 getCellPosition(php,
k);
375 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
377 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
379 geom->loadCellParsHexagon(vmap, php);
385 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
387 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
389 geom->loadWaferHexagon(php);
391 geom->loadCellParsHexagon(vmap, php);
396 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
398 geom->loadGeometryHexagon8(cpv, php,
name, 1);
402 geom->loadWaferHexagon8(php);
405 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
407 geom->loadGeometryHexagon8(cpv, php,
name, 1);
411 geom->loadWaferHexagon8(php);
415 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
417 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
421 geom->loadWaferHexagon8(php);
427 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
430 tempD = fv.
get<std::vector<double> >(
name,
"FirstLayer");
432 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
434 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
436 tempD = fv.
get<std::vector<double> >(
name,
"WaferThickness");
438 tempD = fv.
get<std::vector<double> >(
name,
"MinimumTileSize");
443 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
445 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
448 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
452 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
464 geom->loadSpecParsTrapezoid(fv, vmap, php,
name);
468 geom->loadCellTrapezoid(php);
470 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
473 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
476 edm::LogError(
"HGCalGeom") <<
" Attribute Volume:" <<
name <<
" not found but needed.";
477 throw cms::Exception(
"DDException") <<
"Attribute Volume:" <<
name <<
" not found but needed.";
481 <<
" with flag " <<
ok;
496 std::vector<int> indtypes;
500 double r = 0.5 *
R *
sqrt(3.0);
503 for (
int u = 0; u < 2 *
N; ++u) {
504 for (
int v = 0;
v < 2 *
N; ++
v) {
505 if (((
v - u) <
N) && (u -
v) <=
N) {
506 double yp = (u - 0.5 *
v - n2) * 2 * r;
507 double xp = (1.5 * (
v -
N) + 1.0) *
R;
508 int id =
v * 100 + u;
510 indtypes.emplace_back(
id);
519 cellIndex[
id] = ipos;
534 int id = indtypes[
k];
541 int id = indtypes[
k];
552 const std::vector<double>& fvec =
val.doubles();
554 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to get " <<
s <<
" tag.";
558 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to fetch " <<
s <<
" tag";
565 const std::vector<double>& fvec =
val.doubles();
567 throw cms::Exception(
"HGCalGeom") <<
"getDDDArray::Failed to get " <<
s <<
" tag.";
571 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)