8 #include "DD4hep/DetFactoryHelper.h"
20 auto waferSize =
args.value<
double>(
"WaferSize");
21 auto waferT =
args.value<
double>(
"WaferThick");
22 auto waferSepar =
args.value<
double>(
"SensorSeparation");
23 auto nCells =
args.value<
int>(
"NCells");
24 auto cellType =
args.value<
int>(
"CellType");
26 auto cellNames =
args.value<std::vector<std::string>>(
"CellNames");
29 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWafer8: Wafer 2r " << waferSize <<
" T " << waferT <<
" Half Separation "
30 << waferSepar <<
" Cells/Wafer " << nCells <<
" Cell Type " << cellType <<
" Material "
31 << material <<
" Names " << motherName <<
" NameSpace " << ns.
name() <<
" # of cells "
33 for (
unsigned int k = 0;
k < cellNames.size(); ++
k)
37 static const double sqrt3 =
std::sqrt(3.0);
38 double rM = 0.5 * (waferSize + waferSepar);
39 double RM2 = rM / sqrt3;
40 double R = waferSize / (3.0 * nCells);
41 double r = 0.5 *
R * sqrt3;
44 std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
45 std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
46 std::vector<double>
zw = {-0.5 * waferT, 0.5 * waferT};
47 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
56 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWafer8: " << solid.name() <<
" extruded polygon made of " << material
57 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
58 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
59 <<
" and " << xM.size() <<
" edges";
60 for (
unsigned int k = 0;
k < xM.size(); ++
k)
68 for (
int u = 0; u < 2 * nCells; ++u) {
69 for (
int v = 0;
v < 2 * nCells; ++
v) {
70 if (((
v - u) < nCells) && (u -
v) <= nCells) {
75 double yp = (u - 0.5 *
v - n2) * 2 *
r;
76 double xp = (1.5 * (
v - nCells) + 1.0) *
R;
78 if ((u == 0) && (
v == 0))
80 else if ((u == 0) && (
v == nCells - 1))
82 else if ((u == nCells) && (
v == 2 * nCells - 1))
84 else if ((u == 2 * nCells - 1) && (
v == 2 * nCells - 1))
86 else if ((u == 2 * nCells - 1) && (
v == nCells - 1))
88 else if ((u == nCells) && (
v == 0))
92 else if ((
v - u) == (nCells - 1))
94 else if (
v == (2 * nCells - 1))
96 else if (u == (2 * nCells - 1))
98 else if ((u -
v) == nCells)
104 glog.placeVolume(ns.
volume(cellNames[cell]),
copy, dd4hep::Transform3D(
rotation, tran));
106 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWafer8: " << cellNames[cell] <<
" number " <<
copy <<
" position in "
107 << glog.name() <<
" at " << tran <<
" with " <<
rotation;
113 edm::LogVerbatim(
"HGCalGeom") <<
"\nDDHGCalWafer8::Counter : " <<
counter <<
"\n===============================\n";