15 #include "CLHEP/Units/PhysicalConstants.h"
16 #include "CLHEP/Units/SystemOfUnits.h"
66 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo info: Creating an instance";
79 genMat = sArgs[
"GeneralMaterial"];
81 layerDz = nArgs[
"LayerDz"];
82 coolDz = nArgs[
"CoolDz"];
83 coolThick = nArgs[
"CoolThick"];
84 coolRadius = nArgs[
"CoolRadius"];
85 coolDist = nArgs[
"CoolDist"];
86 cool1Offset = nArgs[
"Cool1Offset"];
87 cool2Offset = nArgs[
"Cool2Offset"];
88 coolMat = sArgs[
"CoolMaterial"];
89 tubeMat = sArgs[
"CoolTubeMaterial"];
90 coolMatHalf = sArgs[
"CoolMaterialHalf"];
91 tubeMatHalf = sArgs[
"CoolTubeMaterialHalf"];
92 phiFineTune = nArgs[
"PitchFineTune"];
93 rOuterFineTune = nArgs[
"OuterOffsetFineTune"];
94 rInnerFineTune = nArgs[
"InnerOffsetFineTune"];
96 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo debug: Parent " << parentName <<
" NameSpace " << idNameSpace
98 <<
"\tLadders " <<
number <<
"\tGeneral Material " << genMat <<
"\tLength " << layerDz
99 <<
"\tSpecification of Cooling Pieces:\n"
100 <<
"\tLength " << coolDz <<
" Thickness of Shell " << coolThick <<
" Radial distance "
101 << coolDist <<
" Materials " << coolMat <<
", " << tubeMat;
103 ladder = sArgs[
"LadderName"];
104 ladderWidth = nArgs[
"LadderWidth"];
105 ladderThick = nArgs[
"LadderThick"];
106 ladderOffset = nArgs[
"LadderOffset"];
107 outerFirst =
int(nArgs[
"OuterFirst"]);
109 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo debug: Full Ladder " <<
ladder <<
" width/thickness "
110 << ladderWidth <<
", " << ladderThick;
117 double dphi = CLHEP::twopi /
number;
118 double x2 = coolDist *
sin(0.5 * dphi);
119 double rtmi = coolDist *
cos(0.5 * dphi) - (coolRadius + ladderThick) + rInnerFineTune;
120 double rmxh = coolDist *
cos(0.5 * dphi) + (coolRadius + ladderThick + ladderOffset) + rOuterFineTune;
121 double rtmx =
sqrt(rmxh * rmxh + ladderWidth * ladderWidth / 4);
123 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " <<
DDName(
idName, idNameSpace) <<
" Tubs made of "
124 << genMat <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rtmi <<
" Rout "
125 << rtmx <<
" ZHalf " << 0.5 * layerDz;
133 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMat
134 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius <<
" ZHalf "
142 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMatHalf
143 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius <<
" ZHalf "
151 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMat
152 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius - coolThick
153 <<
" ZHalf " << 0.5 * coolDz;
157 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << cool.name() <<
" number 1 positioned in "
158 << coolTube.name() <<
" at (0,0,0) with no rotation";
163 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMatHalf
164 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius - coolThick
165 <<
" ZHalf " << 0.5 * coolDz;
169 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << cool.name() <<
" number 1 positioned in "
170 << coolTube.name() <<
" at (0,0,0) with no rotation";
173 int copy = 1, iup = (-1) * outerFirst;
174 int copyoffset =
number + 2;
176 double phi =
i * dphi + 90 * CLHEP::deg - 0.5 * dphi + phiFineTune;
177 double phix, phiy, rrr, rrroffset;
183 if ((
i == 1) || (
i ==
number / 2 + 1)) {
184 dr = coolRadius + 0.5 * ladderThick + ladderOffset;
186 dr = coolRadius + 0.5 * ladderThick;
189 rrr = coolDist *
cos(0.5 * dphi) + iup *
dr + rOuterFineTune;
191 rrr = coolDist *
cos(0.5 * dphi) + iup *
dr + rInnerFineTune;
196 phix = phi - 90 * CLHEP::deg;
198 phix = phi + 90 * CLHEP::deg;
199 phiy = phix + 90. * CLHEP::deg;
200 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: Creating a new "
201 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
203 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
205 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << ladderFull <<
" number " <<
copy <<
" positioned in "
206 <<
layer.name() <<
" at " << tran <<
" with " <<
rot;
208 rrr = coolDist *
cos(0.5 * dphi) + coolRadius / 2.;
209 rots =
idName + to_string(
i + 100);
210 phix = phi + 90. * CLHEP::deg;
213 phiy = phix + 90. * CLHEP::deg;
214 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: Creating a new "
215 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
218 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
220 if ((
i == 1) || (
i ==
number / 2 + 1)) {
221 rrroffset = coolDist *
cos(0.5 * dphi) + iup * ladderOffset + rOuterFineTune;
223 rrroffset *
cos(phi) - cool1Offset *
sin(phi), rrroffset *
sin(phi) + cool1Offset *
cos(phi), 0);
227 rrroffset *
cos(phi) - cool2Offset *
sin(phi), rrroffset *
sin(phi) + cool2Offset *
cos(phi), 0);
231 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << coolTube.name() <<
" number " <<
i + 1
232 <<
" positioned in " <<
layer.name() <<
" at " << tran <<
" with " <<
rot;