8 #include "DD4hep/DetFactoryHelper.h"
21 const auto& waferSize = args.
value<
double>(
"WaferSize");
22 const auto& waferT = args.
value<
double>(
"WaferThick");
23 const auto& waferSepar = args.
value<
double>(
"SensorSeparation");
25 const auto& cellType = args.
value<
int>(
"CellType");
27 const auto& cellNames = args.
value<std::vector<std::string>>(
"CellNames");
32 <<
" Cells/Wafer " << nCells <<
" Cell Type " << cellType <<
" Material " << material
33 <<
" Names " << motherName <<
" NameSpace " << ns.
name() <<
" # of cells "
35 for (
unsigned int k = 0;
k < cellNames.size(); ++
k)
39 static const double sqrt3 =
std::sqrt(3.0);
40 double rM = 0.5 * (waferSize + waferSepar);
41 double RM2 = rM / sqrt3;
42 double R = waferSize / (3.0 *
nCells);
43 double r = 0.5 * R * sqrt3;
46 std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
47 std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
48 std::vector<double>
zw = {-0.5 * waferT, 0.5 * waferT};
49 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
51 dd4hep::Material matter = ns.
material(material);
58 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWafer8: " << solid.name() <<
" extruded polygon made of " << material
62 <<
cms::convert2mm(zy[1]) <<
":" << scale[1] <<
" and " << xM.size() <<
" edges";
63 for (
unsigned int k = 0;
k < xM.size(); ++
k)
71 for (
int u = 0; u < 2 *
nCells; ++u) {
73 if (((
v - u) < nCells) && (u -
v) <= nCells) {
78 double yp = (u - 0.5 *
v - n2) * 2 * r;
79 double xp = (1.5 * (
v -
nCells) + 1.0) *
R;
81 if ((u == 0) && (
v == 0))
83 else if ((u == 0) && (
v == nCells - 1))
85 else if ((u == nCells) && (
v == 2 * nCells - 1))
87 else if ((u == 2 * nCells - 1) && (
v == 2 * nCells - 1))
89 else if ((u == 2 * nCells - 1) && (
v == nCells - 1))
91 else if ((u == nCells) && (
v == 0))
95 else if ((
v - u) == (nCells - 1))
97 else if (
v == (2 * nCells - 1))
99 else if (u == (2 * nCells - 1))
101 else if ((u -
v) == nCells)
107 glog.placeVolume(ns.
volume(cellNames[cell]),
copy, dd4hep::Transform3D(rotation, tran));
109 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWafer8: " << cellNames[cell] <<
" number " << copy <<
" position in "
111 <<
",0) with no rotation";
117 edm::LogVerbatim(
"HGCalGeom") <<
"\nDDHGCalWafer8::Counter : " << counter <<
"\n===============================\n";
dd4hep::Solid addSolidNS(const std::string &name, dd4hep::Solid solid) const
Log< level::Info, true > LogVerbatim
dd4hep::Volume volume(const std::string &name, bool exc=true) const
static int32_t packCellTypeUV(int type, int u, int v)
constexpr NumType convert2mm(NumType length)
dd4hep::Volume addVolumeNS(dd4hep::Volume vol) const
T value(const std::string &name) const
std::string_view name() const
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
dd4hep::Material material(const std::string &name) const
std::string prepend(const std::string &) const
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ nCells
static std::atomic< unsigned int > counter
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
std::string parentName() const
Access value of rParent child node.