11 #include "GeoModelKernel/GeoTube.h"
12 #include "GeoModelKernel/GeoTubs.h"
14 #if defined(GEOTORUS) && GEOTORUS==1
15 #include "GeoModelKernel/GeoTorus.h"
18 #include "GeoModelKernel/GeoSimplePolygonBrep.h"
19 #include "GeoModelKernel/GeoShape.h"
20 #include "GeoModelKernel/GeoShapeUnion.h"
21 #include "GeoModelKernel/GeoShapeShift.h"
22 #include "GeoModelKernel/GeoLogVol.h"
23 #include "GeoModelKernel/GeoPhysVol.h"
24 #include "GeoModelKernel/GeoMaterial.h"
25 #include "GeoModelKernel/GeoNameTag.h"
27 #include "GeoModelKernel/GeoTransform.h"
28 #include "GaudiKernel/PhysicalConstants.h"
38 GeoModelIO::ReadGeoModel* sqliteReader,
39 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
40 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
43 m_supportPhysA(nullptr),
44 m_supportPhysC(nullptr),
45 m_xformSupportA(nullptr),
46 m_xformSupportC(nullptr)
53 m_gmt_mgr->
msg(MSG::INFO) <<
"Build IBL fwd services - CAD tool design - Build()"<<
endmsg;
55 #if !defined(GEOTORUS) || GEOTORUS==0
57 m_gmt_mgr->
msg(MSG::INFO) <<
"Build IBL fwd services - CAD tool design - Torus object is not defined "<<GEOTORUS<<
endmsg;
62 m_gmt_mgr->
msg(MSG::INFO) <<
"Build IBL fwd services - CAD tool design - Torus object is defined"<<
endmsg;
73 if(nSectors==0)
return nullptr;
77 double innerRadius = 33.;
78 double outerRadius = 42.499;
79 double zMin = 834.607;
80 double zMax = 3290.795;
82 double zLength = zMax-zMin;
83 double halfLength = zLength*.5;
84 double zMiddle = (zMin+zMax)*.5;
87 std::ostringstream lnameA;
88 lnameA<<
"Brl0A_FwdSvc";
89 std::ostringstream lnameC;
90 lnameC<<
"Brl0C_FwdSvc";
93 const GeoTube* supportShapeA =
new GeoTube(innerRadius,outerRadius,halfLength);
94 const GeoTube* supportShapeC =
new GeoTube(innerRadius,outerRadius,halfLength);
96 GeoLogVol* supportLogVol_A =
new GeoLogVol(lnameA.str(),supportShapeA,ether);
97 GeoLogVol* supportLogVol_C =
new GeoLogVol(lnameA.str(),supportShapeC,ether);
101 double deltaJunction = 0.;
102 double lgFwdSvc[4]={511., 561., 560., 706. };
104 double devTotalLength = 2460.188;
108 double rminCable = 0.;
109 double rmaxCable = 8.*.5;
110 double surfCable = rmaxCable*rmaxCable*
pi;
113 double rminCooling = 0.;
114 double rmaxCooling = 1.75*.5;
115 double surfCooling = rmaxCooling*rmaxCooling*
pi;
120 double hermJunction = .4;
124 const GeoShape * gblShapeCableA =
nullptr;
125 const GeoShape * gblShapeCoolingA =
nullptr;
126 const GeoShape * gblShapeCableC =
nullptr;
127 const GeoShape * gblShapeCoolingC =
nullptr;
128 for(
int i=0;
i<4;
i++)
130 double initHalfLength = lgFwdSvc[
i]*.5;
131 zpos += initHalfLength;
132 double corHalfLength = initHalfLength-deltaJunction;
133 double radius = .5*(corHalfLength*corHalfLength+delta*delta)/delta;
137 double tubeLength=deltaJunction+zpos0-zMin+hermJunction;
139 const GeoTube* tubeShape =
new GeoTube(0., rmaxCable,
tubeLength*.5);
141 gblShapeCableA =
addShape(gblShapeCableA, tubeShape, trfA );
143 gblShapeCableC =
addShape(gblShapeCableC, tubeShape, trfC );
147 const GeoTube* tubeShape_cooling =
new GeoTube(0., rmaxCooling,
tubeLength*.5);
148 gblShapeCoolingA =
addShape(gblShapeCoolingA, tubeShape_cooling, trfA );
149 gblShapeCoolingC =
addShape(gblShapeCoolingC, tubeShape_cooling, trfC );
155 const GeoTorus* torusShape =
new GeoTorus(rminCable,rmaxCable,rtor,
pi*.5-
theta,2.*
theta);
156 double angle=(
i%2==0)?breakAngle:
pi-breakAngle;
157 GeoTrf::Transform3D trfA = GeoTrf::RotateZ3D(
angle)*GeoTrf::RotateY3D(-
pi*.5)*GeoTrf::TranslateY3D(-
radius+delta)* GeoTrf::TranslateX3D(zpos0+zpos-zMiddle);
158 gblShapeCableA =
addShape(gblShapeCableA, torusShape, trfA );
160 gblShapeCableC =
addShape(gblShapeCableC, torusShape, trfC );
162 const GeoTorus* torusShape_cooling =
new GeoTorus(rminCooling,rmaxCooling,rtor,
pi*.5-
theta,2.*
theta);
163 gblShapeCoolingA =
addShape(gblShapeCoolingA, torusShape_cooling, trfA );
164 gblShapeCoolingC =
addShape(gblShapeCoolingC, torusShape_cooling, trfC );
166 zpos += initHalfLength;
169 zpos=zpos0+zpos-deltaJunction;
172 const GeoTube* tubeShape =
new GeoTube(0., rmaxCable,
tubeLength*.5);
174 gblShapeCableA =
addShape(gblShapeCableA, tubeShape, trfA );
176 gblShapeCableC =
addShape(gblShapeCableC, tubeShape, trfC );
178 const GeoTube* tubeShape_cooling =
new GeoTube(0., rmaxCooling,
tubeLength*.5);
179 gblShapeCoolingA =
addShape(gblShapeCoolingA, tubeShape_cooling, trfA );
180 gblShapeCoolingC =
addShape(gblShapeCoolingC, tubeShape_cooling, trfC );
188 GeoLogVol * cable_logA =
new GeoLogVol(
"IBL_Fwd02_Cable_A",gblShapeCableA,cableMat);
189 GeoLogVol * cable_logC =
new GeoLogVol(
"IBL_Fwd02_Cable_C",gblShapeCableC,cableMat);
192 GeoLogVol * cooling_logA =
new GeoLogVol(
"IBL_Fwd02_Cooling_A",gblShapeCoolingA,coolingMat);
193 GeoLogVol * cooling_logC =
new GeoLogVol(
"IBL_Fwd02_Cooling_C",gblShapeCoolingC,coolingMat);
200 double cooling_radius = 35.1;
205 cooling_radius = 34.7 + layerRadius-33.25;
209 double cable_radius = 36.501;
210 GeoPhysVol* cablePhysVolA =
new GeoPhysVol(cable_logA);
211 GeoPhysVol* cablePhysVolC =
new GeoPhysVol(cable_logC);
212 GeoPhysVol* coolingPhysVolA =
new GeoPhysVol(cooling_logA);
213 GeoPhysVol* coolingPhysVolC =
new GeoPhysVol(cooling_logC);
218 for(
int ii=0; ii<nSectors; ii++)
223 double phiOfCooling = phiOfModuleZero+ cooling_angle + ii*
angle;
225 std::ostringstream tmp1;
226 tmp1 <<
"IBL_Fwd02_Cooling_A" << ii;
227 GeoNameTag *
tag1 =
new GeoNameTag(tmp1.str());
228 GeoTransform* xformA1 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCooling)*GeoTrf::TranslateX3D(cooling_radius));
233 std::ostringstream tmp1C;
234 tmp1C <<
"IBL_Fwd02_Cooling_C" << ii;
235 GeoNameTag * tag1C =
new GeoNameTag(tmp1C.str());
236 GeoTransform* xformC1 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCooling)*GeoTrf::TranslateX3D(cooling_radius));
241 double phiOfCable = phiOfCooling +
angle*.5;
243 std::ostringstream
tmp2;
244 tmp2 <<
"IBL_Fwd02_Cable_A" << ii;
245 GeoNameTag *
tag2 =
new GeoNameTag(
tmp2.str());
246 GeoTransform* xformA2 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCable)*GeoTrf::TranslateX3D(cable_radius));
251 std::ostringstream tmp2C;
252 tmp2C <<
"IBL_Fwd02_Cable_C" << ii;
253 GeoNameTag * tag2C =
new GeoNameTag(tmp2C.str());
254 GeoTransform* xformC2 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCable)*GeoTrf::TranslateX3D(cable_radius));
262 double middleA = zMiddle+layerZshift;
263 double middleC = -zMiddle+layerZshift;
280 const GeoShape * shiftedShape = &(*nextShape << trans);
282 lastShape = &(lastShape->add(*shiftedShape));
284 lastShape = shiftedShape;