21 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DDD)::build called with " 22 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet;
60 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
62 attribute =
"OnlyForHGCalNumbering";
84 php.
levelZSide_ =
static_cast<int>(getDDDValue(
"LevelZSide",
sv));
91 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
94 php.
useSimWt_ =
static_cast<int>(getDDDValue(
"UseSimWt",
sv));
108 attribute =
"OnlyForHGCalNumbering";
117 php.
nCellsFine_ =
static_cast<int>(getDDDValue(
"NumberOfCellsFine", sv2));
118 php.
nCellsCoarse_ =
static_cast<int>(getDDDValue(
"NumberOfCellsCoarse", sv2));
125 php.
useOffset_ =
static_cast<int>(getDDDValue(
"UseOffset", sv2));
140 for (
int k = 0;
k < 2; ++
k)
141 getCellPosition(php,
k);
147 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
149 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
151 geom->loadCellParsHexagon(cpv, php);
157 geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
159 geom->loadGeometryHexagon(fv, php,
name, cpv, namew, namec,
mode);
161 geom->loadWaferHexagon(php);
163 geom->loadCellParsHexagon(cpv, php);
168 geom->loadSpecParsHexagon8(fv, php);
170 geom->loadGeometryHexagon8(fv, php, 1);
174 geom->loadWaferHexagon8(php);
177 geom->loadSpecParsHexagon8(fv, php);
179 geom->loadGeometryHexagon8(fv, php, 1);
183 geom->loadWaferHexagon8(php);
187 geom->loadSpecParsHexagon8(fv, php);
189 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
193 geom->loadWaferHexagon8(php);
200 php.
levelZSide_ =
static_cast<int>(getDDDValue(
"LevelZSide",
sv));
211 php.
waferZSide_ =
static_cast<int>(getDDDValue(
"WaferZside",
sv));
214 php.
useSimWt_ = static_cast<int>(getDDDValue(
"UseSimWt",
sv));
226 geom->loadSpecParsTrapezoid(fv, php);
230 geom->loadCellTrapezoid(php);
232 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
235 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
238 edm::LogError(
"HGCalGeom") <<
" Attribute " <<
val <<
" not found but needed.";
239 throw cms::Exception(
"DDException") <<
"Attribute " <<
val <<
" not found but needed.";
243 <<
" with flag " <<
ok;
256 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalParametersFromDD (DD4hep)::build called with " 257 <<
"names " <<
name <<
":" << namew <<
":" << namec <<
":" << namet <<
":" <<
name2;
262 std::vector<std::string> tempS;
263 std::vector<double> tempD;
265 tempS = fv.
get<std::vector<std::string> >(
name2,
"GeometryMode");
267 tempS = fv.
get<std::vector<std::string> >(
name,
"GeometryMode");
269 std::string sv = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Hexagon8Full";
298 std::unique_ptr<HGCalGeomParameters>
geom = std::make_unique<HGCalGeomParameters>();
300 tempS = fv.
get<std::vector<std::string> >(namet,
"WaferMode");
301 std::string sv2 = (!tempS.empty()) ? tempS[0] :
"HGCalGeometryMode::Polyhedra";
315 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
319 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
321 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
324 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
326 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
330 tempD = fv.
get<std::vector<double> >(
name,
"LayerRotation");
332 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
337 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";
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,
"SensorSizeOffset");
364 tempD = fv.
get<std::vector<double> >(namet,
"GuardRingOffset");
366 tempD = fv.
get<std::vector<double> >(namet,
"MouseBite");
368 tempD = fv.
get<std::vector<double> >(namet,
"UseOffset");
384 for (
int k = 0;
k < 2; ++
k)
385 getCellPosition(php,
k);
390 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
392 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
394 geom->loadCellParsHexagon(vmap, php);
400 geom->loadSpecParsHexagon(fv, php,
name, namew, namec,
name2);
402 geom->loadGeometryHexagon(cpv, php,
name, namew, namec,
mode);
404 geom->loadWaferHexagon(php);
406 geom->loadCellParsHexagon(vmap, 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->loadGeometryHexagon8(cpv, php,
name, 1);
426 geom->loadWaferHexagon8(php);
430 geom->loadSpecParsHexagon8(fv, vmap, php,
name);
432 geom->loadGeometryHexagonModule(cpv, php,
name, namec, 1);
436 geom->loadWaferHexagon8(php);
443 tempD = fv.
get<std::vector<double> >(
name,
"LevelZSide");
445 tempD = fv.
get<std::vector<double> >(
name,
"FirstLayer");
447 tempD = fv.
get<std::vector<double> >(
name,
"FirstMixedLayer");
449 tempD = fv.
get<std::vector<double> >(
name,
"DetectorType");
451 tempD = fv.
get<std::vector<double> >(
name,
"WaferThickness");
453 tempD = fv.
get<std::vector<double> >(
name,
"MinimumTileSize");
459 tempD = fv.
get<std::vector<double> >(
name,
"WaferMaskMode");
461 tempD = fv.
get<std::vector<double> >(
name,
"WaferZside");
465 tempD = fv.
get<std::vector<double> >(
name,
"UseSimWt");
470 tempD = fv.
get<std::vector<double> >(
name,
"Cassettes");
482 geom->loadSpecParsTrapezoid(fv, vmap, php,
name);
486 geom->loadCellTrapezoid(php);
488 edm::LogError(
"HGCalGeom") <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew
491 <<
"Unknown Geometry type " << php.
mode_ <<
" for HGCal " <<
name <<
":" << namew <<
":" << namec;
494 edm::LogError(
"HGCalGeom") <<
" Attribute Volume:" <<
name <<
" not found but needed.";
495 throw cms::Exception(
"DDException") <<
"Attribute Volume:" <<
name <<
" not found but needed.";
499 <<
" with flag " <<
ok;
514 std::vector<int> indtypes;
519 double r = 0.5 *
R *
sqrt(3.0);
522 for (
int u = 0; u < 2 *
N; ++u) {
523 for (
int v = 0;
v < 2 *
N; ++
v) {
524 if (((
v - u) <
N) && (u -
v) <=
N) {
525 double yp = (u - 0.5 *
v - n2) * 2 * r;
526 double xp = (1.5 * (
v -
N) + 1.0) *
R;
527 int id =
v * 100 + u;
529 indtypes.emplace_back(
id);
538 cellIndex[
id] = ipos;
553 int id = indtypes[
k];
560 int id = indtypes[
k];
571 const std::vector<double>& fvec =
val.doubles();
573 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to get " <<
s <<
" tag.";
577 throw cms::Exception(
"HGCalGeom") <<
"getDDDValue::Failed to fetch " <<
s <<
" tag";
584 const std::vector<double>& fvec =
val.doubles();
586 throw cms::Exception(
"HGCalGeom") <<
"getDDDArray::Failed to get " <<
s <<
" tag.";
590 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)
static constexpr int scintillatorFineCell