32 double moduleThick =
args.value<
double>(
"ModuleThick");
34 std::vector<std::string> tagsector;
38 std::vector<std::string> tagpos;
39 std::vector<int> xsignpos;
41 tagpos.emplace_back(
"PN");
42 xsignpos.emplace_back(-1);
44 tagpos.emplace_back(
"PP");
45 xsignpos.emplace_back(1);
47 double phi0 =
args.value<
double>(
"PhiStart");
48 double dphi = (2._pi) / tagsector.size();
50 std::ostringstream st0, st1;
51 for (
unsigned int k = 0;
k < tagsector.size(); ++
k)
52 st0 <<
": " << tagsector[
k];
53 for (
unsigned int k = 0;
k < tagpos.size(); ++
k)
54 st1 <<
" " << tagpos[
k] <<
":" << xsignpos[
k];
55 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << tagpos.size() <<
" Modules with base name " << parentName
56 <<
" made of " << moduleMaterial <<
" T " << moduleThick <<
" having " <<
sectors 57 <<
" sectors" << st0.str() <<
" phi0 " <<
convertRadToDeg(phi0) <<
" dphi " 60 std::vector<std::string> layerNames =
args.value<std::vector<std::string>>(
"LayerNames");
61 std::vector<std::string> layerMaterials =
62 args.value<std::vector<std::string>>(
"LayerMaterials");
63 std::vector<double> layerThick =
args.value<std::vector<double>>(
"LayerThickness");
64 std::vector<int> layerType =
args.value<std::vector<int>>(
"LayerType");
66 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << layerNames.size() <<
" types of volumes";
67 for (
unsigned int i = 0;
i < layerNames.size(); ++
i)
68 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << layerNames[
i] <<
" of thickness " << layerThick[
i]
69 <<
" filled with " << layerMaterials[
i];
70 std::ostringstream st2;
71 for (
unsigned int i = 0;
i < layerType.size(); ++
i)
72 st2 <<
" [" <<
i <<
"] " << layerType[
i];
73 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerType.size() <<
" blocks" << st2.str();
76 std::vector<std::string> absNames =
77 args.value<std::vector<std::string>>(
"AbsorberName");
78 std::vector<int> absN =
args.value<std::vector<int>>(
"AbsorberN");
79 std::vector<double> absX =
args.value<std::vector<double>>(
"AbsorberX");
80 std::vector<double> absY =
args.value<std::vector<double>>(
"AbsorberY");
82 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << absNames.size() <<
" basic absorber shapes:";
84 for (
unsigned int k = 0;
k < absNames.size(); ++
k) {
85 std::ostringstream st3;
86 st3 << absNames[
k] <<
" with " << absN[
k] <<
" points:";
87 for (
int i = 0;
i < absN[
k]; ++
i)
88 st3 <<
" (" << absX[
j +
i] <<
", " << absY[
j +
i] <<
")";
97 for (
unsigned int i1 = 0;
i1 < tagpos.size(); ++
i1) {
105 for (
unsigned i3 = 0;
i3 < absNames.size(); ++
i3) {
108 std::vector<double>
zw = {-0.5 * moduleThick, 0.5 * moduleThick};
109 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
110 std::vector<double> xM(absN[
i3], 0), yM(absN[
i3], 0);
111 for (
int k = 0;
k < absN[
i3]; ++
k) {
112 xM[
k] = xsignpos[
i1] * (cphi * absX[
j +
k] + sphi * absY[
j +
k]);
113 yM[
k] = -sphi * absX[
j +
k] + cphi * absY[
j +
k];
117 ns.addSolidNS(ns.prepend(parentname), solid);
121 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << solid.name() <<
" extruded polygon made of " 122 << matter.name() <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0]
123 <<
":" <<
scale[0] <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1]
124 <<
":" <<
scale[1] <<
" and " << xM.size() <<
" edges";
125 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
129 std::vector<dd4hep::Volume> glogs(layerMaterials.size());
130 std::vector<int> copyNumber(layerMaterials.size(), 1);
131 double zi(-0.5 * moduleThick), thickTot(0.0);
132 for (
unsigned int l = 0;
l < layerType.size();
l++) {
133 unsigned int i = layerType[
l];
134 if (copyNumber[
i] == 1) {
135 zw[0] = -0.5 * layerThick[
i];
136 zw[1] = 0.5 * layerThick[
i];
139 ns.addSolidNS(ns.prepend(layerName), solid);
140 matter = ns.material(layerMaterials[
i]);
144 <<
"DDHGCalPassive: Layer " <<
i <<
":" <<
l <<
":" << solid.name() <<
" extruded polygon made of " 145 << matter.name() <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
146 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1] <<
" and " << xM.size()
148 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
153 glogM.placeVolume(glogs[
i], copyNumber[
i], tran0);
156 <<
"DDHGCalPassive: " << glogs[
i].name() <<
" number " << copyNumber[
i] <<
" positioned in " 157 << glogM.name() <<
" at (0, 0, " <<
cms::convert2mm(zi + 0.5 * layerThick[
i]) <<
") with no rotation";
161 thickTot += layerThick[
i];
163 if ((
std::abs(thickTot - moduleThick) >= tol) && (!layerType.empty())) {
164 if (thickTot > moduleThick) {
165 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << moduleThick <<
" is smaller than " 166 << thickTot <<
": thickness of all its components **** ERROR ****";
168 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " << moduleThick <<
" does not match with " 169 << thickTot <<
" of the components";
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
constexpr NumType convert2mm(NumType length)
Sin< T >::type sin(const T &t)
Log< level::Error, false > LogError
static std::string to_string(const XMLCh *ch)
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
static int position[264][3]
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Log< level::Warning, false > LogWarning