31 double thick =
args.value<
double>(
"ModuleThickness");
32 double waferSize =
args.value<
double>(
"WaferSize");
33 double waferSepar =
args.value<
double>(
"SensorSeparation");
35 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassiveFull: Module " << parentName <<
" made of " << material <<
" T " 39 std::vector<std::string> layerNames =
args.value<std::vector<std::string>>(
"LayerNames");
40 std::vector<std::string> materials =
args.value<std::vector<std::string>>(
"LayerMaterials");
41 std::vector<double> layerThick =
args.value<std::vector<double>>(
"LayerThickness");
42 std::vector<int> copyNumber;
43 copyNumber.resize(materials.size(), 1);
45 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassiveFull: " << layerNames.size() <<
" types of volumes";
46 for (
unsigned int i = 0;
i < layerNames.size(); ++
i)
47 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << layerNames[
i] <<
" of thickness " 50 std::vector<int> layerType =
args.value<std::vector<int>>(
"LayerType");
52 std::ostringstream st1;
53 for (
unsigned int i = 0;
i < layerType.size(); ++
i)
54 st1 <<
" [" <<
i <<
"] " << layerType[
i];
55 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerType.size() <<
" blocks" << st1.str();
61 static const double sqrt3 =
std::sqrt(3.0);
62 double rM = 0.5 * (waferSize + waferSepar);
63 double RM2 = rM / sqrt3;
66 std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
67 std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
68 std::vector<double>
zw = {-0.5 * thick, 0.5 * thick};
69 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
71 ns.addSolidNS(ns.prepend(parentName), solid);
74 ns.addVolumeNS(glogM);
76 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassiveFull: " << solid.name() <<
" extruded polygon made of " 81 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
86 std::vector<dd4hep::Volume> glogs(materials.size());
87 double zi(-0.5 * thick), thickTot(0.0);
88 for (
unsigned int l = 0;
l < layerType.size();
l++) {
89 unsigned int i = layerType[
l];
90 if (copyNumber[
i] == 1) {
91 zw[0] = -0.5 * layerThick[
i];
92 zw[1] = 0.5 * layerThick[
i];
95 ns.addSolidNS(ns.prepend(layerName), solid);
96 matter = ns.material(materials[
i]);
98 ns.addVolumeNS(glogs[
i]);
100 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassiveFull: Layer " <<
i <<
":" <<
l <<
":" << solid.name()
101 <<
" extruded polygon made of " << matter.name() <<
" z|x|y|s (0) " 106 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
112 glogM.placeVolume(glogs[
i], copyNumber[
i], tran0);
114 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassiveFull: " << glogs[
i].name() <<
" number " << copyNumber[
i]
115 <<
" positioned in " << glogM.name() <<
" at (0, 0, " 120 thickTot += layerThick[
i];
122 if ((
std::abs(thickTot - thick) >= tol) && (!layerType.empty())) {
123 if (thickTot > thick) {
124 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << thick <<
" is smaller than " << thickTot
125 <<
": thickness of all its components **** ERROR ****";
127 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " << thick <<
" does not match with " << thickTot
128 <<
" of the components";
Log< level::Info, true > LogVerbatim
constexpr NumType convert2mm(NumType length)
Log< level::Error, false > LogError
Abs< T >::type abs(const T &t)
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Log< level::Warning, false > LogWarning