18 const std::vector<std::string>& fvec =
val.strings();
20 throw cms::Exception(
"HGCalGeom") <<
"getGeometryMode::Failed to get " <<
s <<
" tag.";
27 throw cms::Exception(
"HGCalGeom") <<
"getGeometryMode::Failed to fetch " <<
s <<
" tag";
38 const std::vector<std::string>& fvec =
val.strings();
40 throw cms::Exception(
"HGCalGeom") <<
"getGeometryWaferMode::Failed to get " <<
s <<
" tag.";
47 throw cms::Exception(
"HGCalGeom") <<
"getGeometryWaferMode::Failed to fetch " <<
s <<
" tag";
64 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DDD)::build called with " 65 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet;
81 php.
mode_ = getGeometryMode(
"GeometryMode",
sv);
98 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
100 attribute =
"OnlyForHGCalNumbering";
108 mode = getGeometryWaferMode(
"WaferMode", sv2);
122 php.
levelZSide_ =
static_cast<int>(getDDDValue(
"LevelZSide",
sv));
129 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
131 php.
useSimWt_ =
static_cast<int>(getDDDValue(
"UseSimWt",
sv));
145 attribute =
"OnlyForHGCalNumbering";
153 mode = getGeometryWaferMode(
"WaferMode", sv2);
154 php.
nCellsFine_ =
static_cast<int>(getDDDValue(
"NumberOfCellsFine", sv2));
155 php.
nCellsCoarse_ =
static_cast<int>(getDDDValue(
"NumberOfCellsCoarse", sv2));
171 for (
int k = 0;
k < 2; ++
k)
172 getCellPosition(php,
k);
178 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
180 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
182 geom->loadCellParsHexagon(cpv, php);
188 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
190 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
192 geom->loadWaferHexagon(php);
194 geom->loadCellParsHexagon(cpv, php);
199 geom->loadSpecParsHexagon8(fv, php);
201 geom->loadGeometryHexagon8(fv, php, 1);
205 geom->loadWaferHexagon8(php);
208 geom->loadSpecParsHexagon8(fv, php);
210 geom->loadGeometryHexagon8(fv, php, 1);
214 geom->loadWaferHexagon8(php);
217 geom->loadSpecParsHexagon8(fv, php);
219 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
223 geom->loadWaferHexagon8(php);
237 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
239 php.
useSimWt_ =
static_cast<int>(getDDDValue(
"UseSimWt",
sv));
250 geom->loadSpecParsTrapezoid(fv, php);
254 geom->loadCellTrapezoid(php);
256 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
259 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
262 edm::LogError(
"HGCalGeom") <<
" Attribute " <<
val <<
" not found but needed.";
263 throw cms::Exception(
"DDException") <<
"Attribute " <<
val <<
" not found but needed.";
267 <<
" with flag " <<
ok;
280 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DD4hep)::build called with " 281 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet <<
":" <<
name2;
286 std::vector<std::string> tempS;
287 std::vector<double> tempD;
289 tempS = fv.
get<std::vector<std::string> >(
name2,
"GeometryMode");
291 tempS = fv.
get<std::vector<std::string> >(
name,
"GeometryMode");
293 std::string sv = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Hexagon8Full";
300 php.
mode_ = getGeometryMode(
sv);
316 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
318 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
319 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Polyhedra";
320 mode = getGeometryWaferMode(sv2);
333 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
337 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
339 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
342 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
344 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
347 tempD = fv.
get<std::vector<double> >(
name,
"LayerRotation");
349 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
354 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
366 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
367 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::ExtrudedPolygon";
368 mode = getGeometryWaferMode(sv2);
369 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsFine");
371 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsCoarse");
373 tempD = fv.
get<std::vector<double> >(namet,
"WaferSize");
375 tempD = fv.
get<std::vector<double> >(namet,
"WaferThickness");
377 tempD = fv.
get<std::vector<double> >(namet,
"SensorSeparation");
379 tempD = fv.
get<std::vector<double> >(namet,
"MouseBite");
392 for (
int k = 0;
k < 2; ++
k)
393 getCellPosition(php,
k);
398 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
400 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
402 geom->loadCellParsHexagon(vmap, php);
408 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
410 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
412 geom->loadWaferHexagon(php);
414 geom->loadCellParsHexagon(vmap, php);
419 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
421 geom->loadGeometryHexagon8(cpv, php,
name, 1);
425 geom->loadWaferHexagon8(php);
428 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
430 geom->loadGeometryHexagon8(cpv, php,
name, 1);
434 geom->loadWaferHexagon8(php);
437 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
439 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
443 geom->loadWaferHexagon8(php);
449 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
452 tempD = fv.
get<std::vector<double> >(
name,
"FirstLayer");
454 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
456 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
458 tempD = fv.
get<std::vector<double> >(
name,
"WaferThickness");
460 tempD = fv.
get<std::vector<double> >(
name,
"MinimumTileSize");
464 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
466 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
469 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
473 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
485 geom->loadSpecParsTrapezoid(fv, vmap, php,
name);
489 geom->loadCellTrapezoid(php);
491 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
494 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
497 edm::LogError(
"HGCalGeom") <<
" Attribute Volume:" <<
name <<
" not found but needed.";
498 throw cms::Exception(
"DDException") <<
"Attribute Volume:" <<
name <<
" not found but needed.";
502 <<
" with flag " <<
ok;
517 std::vector<int> indtypes;
521 double r = 0.5 *
R *
sqrt(3.0);
524 for (
int u = 0; u < 2 *
N; ++u) {
525 for (
int v = 0;
v < 2 *
N; ++
v) {
526 if (((
v - u) <
N) && (u -
v) <=
N) {
527 double yp = (u - 0.5 *
v - n2) * 2 * r;
528 double xp = (1.5 * (
v -
N) + 1.0) *
R;
529 int id =
v * 100 + u;
531 indtypes.emplace_back(
id);
540 cellIndex[
id] = ipos;
555 int id = indtypes[
k];
562 int id = indtypes[
k];
573 const std::vector<double>& fvec =
val.doubles();
575 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to get " <<
s <<
" tag.";
579 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to fetch " <<
s <<
" tag";
586 const std::vector<double>& fvec =
val.doubles();
588 throw cms::Exception(
"HGCalGeom") <<
"getDDDArray::Failed to get " <<
s <<
" tag.";
592 throw cms::Exception(
"HGCalGeom") <<
"getDDDArray:Failed to fetch " <<
s <<
" tag";
Log< level::Info, true > LogVerbatim
static constexpr int scintillatorCassette
T parseString(const std::string &value)
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
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
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)