15 #include "CLHEP/Units/GlobalPhysicalConstants.h"
16 #include "CLHEP/Units/GlobalSystemOfUnits.h"
70 genMat = sArgs[
"GeneralMaterial"];
72 layerDz = nArgs[
"LayerDz"];
73 sensorEdge = nArgs[
"SensorEdge"];
74 coolDz = nArgs[
"CoolDz"];
75 coolWidth = nArgs[
"CoolWidth"];
76 coolSide = nArgs[
"CoolSide"];
77 coolThick = nArgs[
"CoolThick"];
78 coolDist = nArgs[
"CoolDist"];
79 coolMat = sArgs[
"CoolMaterial"];
80 tubeMat = sArgs[
"CoolTubeMaterial"];
82 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo debug: Parent " << parentName <<
" NameSpace " << idNameSpace <<
"\n"
83 <<
"\tLadders " <<
number <<
"\tGeneral Material " << genMat <<
"\tLength " << layerDz
84 <<
"\tSensorEdge " << sensorEdge <<
"\tSpecification of Cooling Pieces:\n"
85 <<
"\tLength " << coolDz <<
" Width " << coolWidth <<
" Side " << coolSide
86 <<
" Thickness of Shell " << coolThick <<
" Radial distance " << coolDist <<
" Materials "
87 << coolMat <<
", " << tubeMat;
89 ladder = vsArgs[
"LadderName"];
90 ladderWidth = vArgs[
"LadderWidth"];
91 ladderThick = vArgs[
"LadderThick"];
93 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo debug: Full Ladder " <<
ladder[0] <<
" width/thickness " << ladderWidth[0]
94 <<
", " << ladderThick[0] <<
"\tHalf Ladder " <<
ladder[1] <<
" width/thickness "
95 << ladderWidth[1] <<
", " << ladderThick[1];
102 double dphi = CLHEP::twopi /
number;
103 double d2 = 0.5 * coolWidth;
104 double d1 = d2 - coolSide *
sin(0.5 * dphi);
105 double x1 = (
d1 + d2) / (2. *
sin(0.5 * dphi));
106 double x2 = coolDist *
sin(0.5 * dphi);
107 double rmin = (coolDist - 0.5 * (
d1 + d2)) *
cos(0.5 * dphi) - 0.5 * ladderThick[0];
108 double rmax = (coolDist + 0.5 * (
d1 + d2)) *
cos(0.5 * dphi) + 0.5 * ladderThick[0];
109 double rmxh = rmax - 0.5 * ladderThick[0] + ladderThick[1];
110 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Rmin/Rmax " << rmin <<
", " << rmax <<
" d1/d2 " <<
d1 <<
", " << d2
111 <<
" x1/x2 " <<
x1 <<
", " <<
x2;
113 double rtmi = rmin + 0.5 * ladderThick[0] - ladderThick[1];
114 double rtmx =
sqrt(rmxh * rmxh + ladderWidth[1] * ladderWidth[1]);
116 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " <<
DDName(
idName, idNameSpace) <<
" Tubs made of " << genMat
117 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rtmi <<
" Rout " << rtmx
118 <<
" ZHalf " << 0.5 * layerDz;
123 double rr = 0.5 * (rmax + rmin);
124 double dr = 0.5 * (rmax - rmin);
125 double h1 = 0.5 * coolSide *
cos(0.5 * dphi);
127 solid =
DDSolidFactory::trap(
DDName(
name, idNameSpace), 0.5 * coolDz, 0, 0, h1, d2,
d1, 0, h1, d2,
d1, 0);
128 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << solid.
name() <<
" Trap made of " << tubeMat
129 <<
" of dimensions " << 0.5 * coolDz <<
", 0, 0, " << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0, "
130 << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0";
138 solid =
DDSolidFactory::trap(
DDName(
name, idNameSpace), 0.5 * coolDz, 0, 0, h1, d2,
d1, 0, h1, d2,
d1, 0);
139 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << solid.
name() <<
" Trap made of " << coolMat
140 <<
" of dimensions " << 0.5 * coolDz <<
", 0, 0, " << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0, "
141 << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0";
145 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << cool.name() <<
" number 1 positioned in " << coolTube.name()
146 <<
" at (0,0,0) with no rotation";
152 double phi0 = 90 * CLHEP::deg;
154 double phi = phi0 +
i * dphi;
155 double phix, phiy, rrr,
xx;
159 if (
i == 0 ||
i ==
nphi) {
160 rrr =
rr +
dr + 0.5 * (ladderThick[1] - ladderThick[0]);
161 xx = (0.5 * ladderWidth[1] - sensorEdge) *
sin(phi);
164 phix = phi - 90 * CLHEP::deg;
165 phiy = 90 * CLHEP::deg + phix;
166 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
167 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
169 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
171 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderHalf <<
" number " <<
copy <<
" positioned in "
172 << layer.name() <<
" at " << tran <<
" with " <<
rot;
175 rrr =
rr -
dr - 0.5 * (ladderThick[1] - ladderThick[0]);
178 phix = phi + 90 * CLHEP::deg;
179 phiy = 90 * CLHEP::deg + phix;
180 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
181 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
183 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
185 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderHalf <<
" number " <<
copy <<
" positioned in "
186 << layer.name() <<
" at " << tran <<
" with " <<
rot;
194 phix = phi - 90 * CLHEP::deg;
196 phix = phi + 90 * CLHEP::deg;
197 phiy = phix + 90. * CLHEP::deg;
198 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
199 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
201 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
203 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderFull <<
" number " <<
copy <<
" positioned in "
204 << layer.name() <<
" at " << tran <<
" with " <<
rot;
207 rrr = coolDist *
cos(0.5 * dphi);
209 rots =
idName + to_string(
i + 100);
210 phix = phi + 0.5 * dphi;
212 phix += 180 * CLHEP::deg;
213 phiy = phix + 90. * CLHEP::deg;
214 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
215 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
217 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
219 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << coolTube.name() <<
" number " <<
i + 1 <<
" positioned in "
220 << layer.name() <<
" at " << tran <<
" with " <<
rot;