18 const std::vector<std::string>& fvec =
val.strings();
38 const std::vector<std::string>& fvec =
val.strings();
64 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DDD)::build called with " 65 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet;
79 php.
mode_ = getGeometryMode(
"GeometryMode",
sv);
93 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
95 attribute =
"OnlyForHGCalNumbering";
103 mode = getGeometryWaferMode(
"WaferMode", sv2);
117 php.
levelZSide_ =
static_cast<int>(getDDDValue(
"LevelZSide",
sv));
124 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
137 attribute =
"OnlyForHGCalNumbering";
145 mode = getGeometryWaferMode(
"WaferMode", sv2);
146 php.
nCellsFine_ =
static_cast<int>(getDDDValue(
"NumberOfCellsFine", sv2));
147 php.
nCellsCoarse_ =
static_cast<int>(getDDDValue(
"NumberOfCellsCoarse", sv2));
163 for (
int k = 0;
k < 2; ++
k)
164 getCellPosition(php,
k);
170 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
172 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
174 geom->loadCellParsHexagon(cpv, php);
180 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
182 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
184 geom->loadWaferHexagon(php);
186 geom->loadCellParsHexagon(cpv, php);
191 geom->loadSpecParsHexagon8(fv, php);
193 geom->loadGeometryHexagon8(fv, php, 1);
197 geom->loadWaferHexagon8(php);
200 geom->loadSpecParsHexagon8(fv, php);
202 geom->loadGeometryHexagon8(fv, php, 1);
206 geom->loadWaferHexagon8(php);
209 geom->loadSpecParsHexagon8(fv, php);
211 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
215 geom->loadWaferHexagon8(php);
229 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
240 geom->loadSpecParsTrapezoid(fv, php);
244 geom->loadCellTrapezoid(php);
246 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
249 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
252 edm::LogError(
"HGCalGeom") <<
" Attribute " <<
val <<
" not found but needed.";
253 throw cms::Exception(
"DDException") <<
"Attribute " <<
val <<
" not found but needed.";
257 <<
" with flag " <<
ok;
270 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DD4hep)::build called with " 271 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet <<
":" <<
name2;
276 std::vector<std::string> tempS;
277 std::vector<double> tempD;
279 tempS = fv.
get<std::vector<std::string> >(
name2,
"GeometryMode");
281 tempS = fv.
get<std::vector<std::string> >(
name,
"GeometryMode");
283 std::string sv = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Hexagon8Full";
287 php.
mode_ = getGeometryMode(
sv);
302 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
304 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
305 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Polyhedra";
306 mode = getGeometryWaferMode(sv2);
319 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
323 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
325 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
328 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
330 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
333 tempD = fv.
get<std::vector<double> >(
name,
"LayerRotation");
338 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
349 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
350 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::ExtrudedPolygon";
351 mode = getGeometryWaferMode(sv2);
352 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsFine");
354 tempD = fv.
get<std::vector<double> >(namet,
"NumberOfCellsCoarse");
356 tempD = fv.
get<std::vector<double> >(namet,
"WaferSize");
358 tempD = fv.
get<std::vector<double> >(namet,
"WaferThickness");
360 tempD = fv.
get<std::vector<double> >(namet,
"SensorSeparation");
362 tempD = fv.
get<std::vector<double> >(namet,
"MouseBite");
375 for (
int k = 0;
k < 2; ++
k)
376 getCellPosition(php,
k);
381 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
383 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
385 geom->loadCellParsHexagon(vmap, php);
391 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
393 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
395 geom->loadWaferHexagon(php);
397 geom->loadCellParsHexagon(vmap, php);
402 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
404 geom->loadGeometryHexagon8(cpv, php,
name, 1);
408 geom->loadWaferHexagon8(php);
411 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
413 geom->loadGeometryHexagon8(cpv, php,
name, 1);
417 geom->loadWaferHexagon8(php);
420 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
422 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
426 geom->loadWaferHexagon8(php);
432 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
435 tempD = fv.
get<std::vector<double> >(
name,
"FirstLayer");
437 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
439 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
441 tempD = fv.
get<std::vector<double> >(
name,
"WaferThickness");
443 tempD = fv.
get<std::vector<double> >(
name,
"MinimumTileSize");
447 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
449 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
452 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
463 geom->loadSpecParsTrapezoid(fv, vmap, php,
name);
467 geom->loadCellTrapezoid(php);
469 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
472 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
475 edm::LogError(
"HGCalGeom") <<
" Attribute Volume:" <<
name <<
" not found but needed.";
476 throw cms::Exception(
"DDException") <<
"Attribute Volume:" <<
name <<
" not found but needed.";
480 <<
" with flag " <<
ok;
495 std::vector<int> indtypes;
499 double r = 0.5 *
R *
sqrt(3.0);
502 for (
int u = 0; u < 2 *
N; ++u) {
503 for (
int v = 0;
v < 2 *
N; ++
v) {
504 if (((
v - u) <
N) && (u -
v) <=
N) {
505 double yp = (u - 0.5 *
v - n2) * 2 *
r;
506 double xp = (1.5 * (
v -
N) + 1.0) *
R;
507 int id =
v * 100 + u;
509 indtypes.emplace_back(
id);
518 cellIndex[
id] = ipos;
533 int id = indtypes[
k];
540 int id = indtypes[
k];
551 const std::vector<double>& fvec =
val.doubles();
564 const std::vector<double>& fvec =
val.doubles();
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)