12 #include "GeoModelKernel/GeoTubs.h"
13 #include "GeoModelKernel/GeoBox.h"
14 #include "GeoModelKernel/GeoPara.h"
15 #include "GeoModelKernel/GeoLogVol.h"
16 #include "GeoModelKernel/GeoPhysVol.h"
17 #include "GeoModelKernel/GeoMaterial.h"
18 #include "GeoModelKernel/GeoTransform.h"
19 #include "GeoModelKernel/GeoShapeShift.h"
20 #include "GeoModelKernel/GeoShapeUnion.h"
21 #include "GaudiKernel/PhysicalConstants.h"
29 GeoModelIO::ReadGeoModel* sqliteReader,
30 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
31 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
34 m_ladderType(ladderType)
55 double xOffsetConnC = xOffsetConnA;
68 double yPosConnC = yPosConnA;
70 double xWidthOmegaBase = xMaxOmegaBase - xBase;
71 double xWidthConnA = xMaxConnA - xBase;
72 double xWidthConnC = xMaxConnC - xBase;
75 const GeoBox* omegaBaseEnv =
new GeoBox(0.5*xWidthOmegaBase, 0.5*yWidthOmega, halflength);
76 const GeoBox* connAEnv =
new GeoBox(0.5*xWidthConnA, 0.5*yWidthConnA + safety, halflength);
77 const GeoBox* connCEnv =
new GeoBox(0.5*xWidthConnC, 0.5*yWidthConnC + safety, halflength);
78 GeoTrf::Transform3D omegaBaseShift = GeoTrf::Translate3D(xBase + 0.5*xWidthOmegaBase - xCenter, 0., 0.);
79 GeoTrf::Transform3D connAShift = GeoTrf::Translate3D(xBase + 0.5*xWidthConnA - xCenter, yPosConnA, 0.);
80 GeoTrf::Transform3D connCShift = GeoTrf::Translate3D(xBase + 0.5*xWidthConnC - xCenter, yPosConnC, 0.);
82 const GeoShape & ladderSvcShape = ((*omegaBaseEnv) << omegaBaseShift)
83 .
add(*connAEnv << connAShift)
84 .add(*connCEnv << connCShift);
125 double zpos = fluid.
posZ();
127 GeoVPhysVol* fluidPhys = fluid.
Build();
128 GeoTransform* xform =
new GeoTransform(GeoTrf::Translate3D(xpos,ypos,zpos));
129 ladderSvcPhys->add(xform);
130 ladderSvcPhys->add(fluidPhys);
144 GeoVPhysVol* phys = cable.
Build();
147 double zpos = cable.
zpos();
148 GeoTransform* xform =
new GeoTransform(GeoTrf::Translate3D(xpos,ypos,zpos));
149 ladderSvcPhys->add(xform);
150 ladderSvcPhys->add(phys);
153 return ladderSvcPhys;
185 double sepX = (xUpperBend - xLowerBend);
186 double sepY = (yUpperBend - yLowerBend);
187 double sep2 = sepX*sepX+sepY*sepY;
188 double sep = sqrt(sep2);
189 double radDist = radUpperBend+radLowerBend-thick;
190 double alpha =
atan(-sepY/sepX) - asin(radDist/
sep);
191 double upperStraightLength = sqrt(sep2 - radDist*radDist);
192 double xLowerStraight = xLowerBend - (radLowerBend-0.5*thick)*
sin(alpha);
193 double yLowerStraight = yLowerBend - (radLowerBend-0.5*thick)*
cos(alpha);
194 double xUpperStraight = xUpperBend + (radUpperBend-0.5*thick)*
sin(alpha);
195 double yUpperStraight = yUpperBend + (radUpperBend-0.5*thick)*
cos(alpha);
208 GeoBox * lowerStraightBoxP =
new GeoBox(0.5*thick, 0.5*(yStart - yLowerBend), 0.5*
length);
211 GeoBox * lowerStraightBoxM =
new GeoBox(0.5*thick, 0.5*(-yLowerBend - yEnd), 0.5*
length);
214 GeoBox * upperStraightBox =
new GeoBox(0.5*thick, 0.5*upperStraightLength, 0.5*
length);
217 const GeoShape & omegaShape =
218 (*lowerStraightBoxP << GeoTrf::Translate3D(xLowerBend-radLowerBend+0.5*thick,0.5*(yLowerBend+yStart),zOffset) )
219 .
add(*lowerBendShapeP << GeoTrf::Translate3D(xLowerBend,yLowerBend,zOffset) )
220 .
add(*upperStraightBox << GeoTrf::Translate3D(0.5*(xLowerStraight+xUpperStraight),0.5*(yLowerStraight+yUpperStraight),zOffset)*GeoTrf::RotateZ3D(0.5*
Gaudi::Units::pi-alpha) )
221 .
add(*upperBendShape << GeoTrf::Translate3D(xUpperBend,yUpperBend,zOffset) )
222 .
add(*upperStraightBox << GeoTrf::Translate3D(0.5*(xLowerStraight+xUpperStraight),-0.5*(yLowerStraight+yUpperStraight),zOffset)*GeoTrf::RotateZ3D(0.5*
Gaudi::Units::pi+alpha) )
223 .
add(*lowerBendShapeM << GeoTrf::Translate3D(xLowerBend,-yLowerBend,zOffset) )
224 .
add(*lowerStraightBoxM << GeoTrf::Translate3D(xLowerBend-radLowerBend+0.5*thick,0.5*(-yLowerBend+yEnd),zOffset) );
227 lowerStraightBoxP->volume()
228 + lowerBendShapeP->volume()
229 + 2*upperStraightBox->volume()
230 + upperBendShape->volume()
231 + lowerBendShapeM->volume()
232 + lowerStraightBoxM->volume();
236 GeoLogVol* omegaLV =
new GeoLogVol(
"Omega",&omegaShape,omegaMat);
237 return new GeoPhysVol(omegaLV);
268 double sepX = (xUpperBend - xLowerBend);
269 double sepY = (yUpperBend - yLowerBend);
270 double sep2 = sepX*sepX+sepY*sepY;
271 double sep = sqrt(sep2);
272 double radDist = radUpperBend-radLowerBend;
273 double alpha =
atan(-sepY/sepX) - asin(radDist/
sep);
274 double upperStraightLength = sqrt(sep2 - radDist*radDist);
275 double xLowerStraight = xLowerBend + (radLowerBend-0.5*thick)*
sin(alpha);
276 double yLowerStraight = yLowerBend + (radLowerBend-0.5*thick)*
cos(alpha);
277 double xUpperStraight = xUpperBend + (radUpperBend-0.5*thick)*
sin(alpha);
278 double yUpperStraight = yUpperBend + (radUpperBend-0.5*thick)*
cos(alpha);
291 GeoBox * lowerStraightBox =
new GeoBox(0.5*thick, yLowerBend, 0.5*
length);
294 GeoBox * upperStraightBox =
new GeoBox(0.5*thick, 0.5*upperStraightLength, 0.5*
length);
297 const GeoShape & alTubeShape =
298 (*lowerStraightBox << GeoTrf::Translate3D(xLowerBend-radLowerBend+0.5*thick,0,zOffset) )
299 .
add(*lowerBendShapeP << GeoTrf::Translate3D(xLowerBend,yLowerBend,zOffset) )
300 .
add(*upperStraightBox << GeoTrf::Translate3D(0.5*(xLowerStraight+xUpperStraight),0.5*(yLowerStraight+yUpperStraight),zOffset)*GeoTrf::RotateZ3D(0.5*
Gaudi::Units::pi-alpha) )
301 .
add(*upperBendShape << GeoTrf::Translate3D(xUpperBend,yUpperBend,zOffset) )
302 .
add(*upperStraightBox << GeoTrf::Translate3D(0.5*(xLowerStraight+xUpperStraight),-0.5*(yLowerStraight+yUpperStraight),zOffset)*GeoTrf::RotateZ3D(0.5*
Gaudi::Units::pi+alpha) )
303 .
add(*lowerBendShapeM << GeoTrf::Translate3D(xLowerBend,-yLowerBend,zOffset) );
306 lowerStraightBox->volume()
307 + lowerBendShapeP->volume()
308 + 2*upperStraightBox->volume()
309 + upperBendShape->volume()
310 + lowerBendShapeM->volume();
315 GeoLogVol* tubeLV =
new GeoLogVol(
"AlTube",&alTubeShape,alMat);
316 return new GeoPhysVol(tubeLV);
325 for (
int i = 0;
i < nGlueElements; ++
i) {
334 GeoBox * glueShape =
new GeoBox(0.5*thickness, 0.5*std::abs(
y1-
y2), 0.5*
length);
337 GeoLogVol* glueLV =
new GeoLogVol(
"Glue",glueShape,glueMat);
338 GeoPhysVol* gluePV =
new GeoPhysVol(glueLV);
340 GeoTransform * xform =
new GeoTransform(GeoTrf::Translate3D(
m_xOffset+
x1+0.5*thickness,
m_yOffset-0.5*(
y1+
y2), zOffset));
361 GeoBox * pigtailShape =
new GeoBox(0.5*xWidthPigtail, 0.5*yWidthPigtail, 0.5*zWidthPigtail);
363 GeoLogVol * pigtailLV =
new GeoLogVol(
"PigtailFlat",pigtailShape,pigtailMat);
364 GeoPhysVol * pigtailPhys =
new GeoPhysVol(pigtailLV);
368 std::vector<GeoPhysVol *> connectorPhysVols(numConn);
369 std::vector<GeoTrf::Transform3D> connectorTransforms(numConn);
370 for (
int iConn = 0; iConn < numConn; iConn++) {
378 GeoBox * connectorShape =
new GeoBox(0.5*xWidthConnector, 0.5*yWidthConnector, 0.5*zWidthConnector);
380 GeoLogVol * connectorLV =
new GeoLogVol(
"Connector",connectorShape,connectorMat);
381 connectorPhysVols[iConn] =
new GeoPhysVol(connectorLV);
382 connectorTransforms[iConn] = GeoTrf::Translate3D(xPosConnector, yPosConnector, zPosConnector);
390 GeoTransform * xformPigtail =
new GeoTransform(GeoTrf::Translate3D(xPosPigtail, yPosPigtail, zShift+zPosPigtail));
391 parent->add(xformPigtail);
395 for (
int iConn = 0; iConn < numConn; iConn++) {
396 GeoTransform * xformConnector =
new GeoTransform(GeoTrf::TranslateZ3D(zShift)*connectorTransforms[iConn]);
397 parent->add(xformConnector);
398 parent->add(connectorPhysVols[iConn]);