11 #include "GeoModelKernel/GeoTube.h"
12 #include "GeoModelKernel/GeoTubs.h"
13 #include "GeoModelKernel/GeoSimplePolygonBrep.h"
14 #include "GeoModelKernel/GeoShape.h"
15 #include "GeoModelKernel/GeoShapeUnion.h"
16 #include "GeoModelKernel/GeoShapeShift.h"
17 #include "GeoModelKernel/GeoLogVol.h"
18 #include "GeoModelKernel/GeoPhysVol.h"
19 #include "GeoModelKernel/GeoMaterial.h"
20 #include "GeoModelKernel/GeoNameTag.h"
22 #include "GeoModelKernel/GeoTransform.h"
23 #include "GaudiKernel/SystemOfUnits.h"
34 GeoModelIO::ReadGeoModel* sqliteReader,
35 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
36 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
39 m_supportPhysA(nullptr),
40 m_supportPhysC(nullptr),
41 m_xformSupportA(nullptr),
42 m_xformSupportC(nullptr)
60 if(nSectors==0)
return nullptr;
64 double innerRadius = 33.;
65 double outerRadius = 42.499;
66 double zMin = 834.607;
67 double zMax = 3290.795;
69 double zLength = zMax-zMin;
70 double halfLength = zLength*.5;
71 double zMiddle = (zMin+zMax)*.5;
74 std::ostringstream lnameA;
75 lnameA<<
"Brl0A_FwdSvc";
76 std::ostringstream lnameC;
77 lnameC<<
"Brl0C_FwdSvc";
80 const GeoTube* supportShapeA =
new GeoTube(innerRadius,outerRadius,halfLength);
81 const GeoTube* supportShapeC =
new GeoTube(innerRadius,outerRadius,halfLength);
84 GeoLogVol* supportLogVol_A =
new GeoLogVol(lnameA.str(),supportShapeA,ether);
85 GeoLogVol* supportLogVol_C =
new GeoLogVol(lnameC.str(),supportShapeC,ether);
92 double devTotalLength = 2460.188;
95 double rminCable = 0.;
96 double rmaxCable = 8.*.5;
97 double surfCable = rmaxCable*rmaxCable*
pi;
100 double rminCooling = 0.;
101 double rmaxCooling = 1.75*.5;
102 double surfCooling = rmaxCooling*rmaxCooling*
pi;
111 double cooling_radius = 35.1;
116 cooling_radius = 34.7 + layerRadius-33.25;
120 double cable_radius = 36.501;
125 double etaSteps[3] = {3.8, 4.3, 4.8 };
129 std::vector<double> zSteps;
130 bool bFirstLin =
true;
131 for(
int i=0;
i<nbSteps;
i++){
134 double z = fabs(cable_radius/
tmp2);
138 zSteps.push_back(zMin+0.001);
143 zSteps.push_back(zMin+0.001);
144 zSteps.push_back(zMin+10.);
152 zSteps.push_back(zMax-0.001);
154 if(bFirstLin)nbSteps++;
157 const GeoShape * gblShapeCableA =
nullptr;
158 const GeoShape * gblShapeCoolingA =
nullptr;
159 const GeoShape * gblShapeCableC =
nullptr;
160 const GeoShape * gblShapeCoolingC =
nullptr;
166 double deltaMiddle_all = 18.;
173 for(
int iStep=0; iStep<nbSteps-1; iStep++)
175 double zInit = zSteps[iStep];
176 double zFinal = zSteps[iStep+1];
177 double zMid = (zInit+zFinal)*.5;
178 double zHalfLength = zMid-zInit;
179 double zLength = zFinal-zInit;
188 double deltaPhiLoc = fabs(
atan(deltaMiddle_all/zLength));
189 double cableHalfLength = (zLength /
cos(deltaPhiLoc))*.5;
190 double deltaMiddleLoc = deltaMiddle_all*.5;
194 if((iStep==0&&bFirstLin)||iStep==nbSteps-2) {
199 const GeoTube* cableShape =
new GeoTube(rminCable, rmaxCable, zHalfLength);
202 gblShapeCableA =
addShape(gblShapeCableA, cableShape, trfA1 );
204 gblShapeCableC =
addShape(gblShapeCableC, cableShape, trfC1 );
207 const GeoTube* coolingShape =
new GeoTube(rminCooling, rmaxCooling, zHalfLength);
208 gblShapeCoolingA =
addShape(gblShapeCoolingA, coolingShape, trfA1 );
209 gblShapeCoolingC =
addShape(gblShapeCoolingC, coolingShape, trfC1 );
219 const GeoTube* cableShape =
new GeoTube(rminCable, rmaxCable, cableHalfLength);
221 GeoTrf::Transform3D trfA1 = GeoTrf::RotateZ3D(
angle)*GeoTrf::TranslateY3D(deltaMiddleLoc)* GeoTrf::TranslateZ3D(zpos-zMiddle)*GeoTrf::RotateX3D(-angleSign*deltaPhiLoc);
222 gblShapeCableA =
addShape(gblShapeCableA, cableShape, trfA1 );
223 GeoTrf::Transform3D trfC1 = GeoTrf::RotateZ3D(
angle)*GeoTrf::TranslateY3D(deltaMiddleLoc)* GeoTrf::TranslateZ3D(zMax-(zpos-zMin)-zMiddle)*GeoTrf::RotateX3D(angleSign*deltaPhiLoc);
224 gblShapeCableC =
addShape(gblShapeCableC, cableShape, trfC1 );
227 const GeoTube* coolingShape =
new GeoTube(rminCooling, rmaxCooling, cableHalfLength);
228 gblShapeCoolingA =
addShape(gblShapeCoolingA, coolingShape, trfA1 );
229 gblShapeCoolingC =
addShape(gblShapeCoolingC, coolingShape, trfC1 );
245 GeoLogVol * cable_logA =
new GeoLogVol(
"IBL_Fwd02_Cable_A",gblShapeCableA,cableMat);
246 GeoLogVol * cable_logC =
new GeoLogVol(
"IBL_Fwd02_Cable_C",gblShapeCableC,cableMat);
250 GeoLogVol * cooling_logA =
new GeoLogVol(
"IBL_Fwd02_Cooling_A",gblShapeCoolingA,coolingMat);
251 GeoLogVol * cooling_logC =
new GeoLogVol(
"IBL_Fwd02_Cooling_C",gblShapeCoolingC,coolingMat);
258 GeoPhysVol* cablePhysVolA =
new GeoPhysVol(cable_logA);
259 GeoPhysVol* cablePhysVolC =
new GeoPhysVol(cable_logC);
260 GeoPhysVol* coolingPhysVolA =
new GeoPhysVol(cooling_logA);
261 GeoPhysVol* coolingPhysVolC =
new GeoPhysVol(cooling_logC);
268 for(
int ii=0; ii<nSectors; ii++)
273 double phiOfCooling = phiOfModuleZero+ cooling_angle + ii*
angle;
275 std::ostringstream tmp1;
276 tmp1 <<
"IBL_Fwd02_Cooling_AC" << ii;
277 GeoNameTag *
tag1 =
new GeoNameTag(tmp1.str());
278 GeoTransform* xformA1 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCooling)*GeoTrf::TranslateX3D(cooling_radius));
283 GeoTransform* xformC1 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCooling)*GeoTrf::TranslateX3D(cooling_radius));
288 double phiOfCable = phiOfCooling +
angle*.5;
290 std::ostringstream
tmp2;
291 tmp2 <<
"IBL_Fwd02_Cable_AC" << ii;
292 GeoNameTag *
tag2 =
new GeoNameTag(
tmp2.str());
293 GeoTransform* xformA2 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCable)*GeoTrf::TranslateX3D(cable_radius)*GeoTrf::RotateZ3D(breakAngle));
298 GeoTransform* xformC2 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCable)*GeoTrf::TranslateX3D(cable_radius)*GeoTrf::RotateZ3D(breakAngle));
305 double middleA = zMiddle+layerZshift;
306 double middleC = -zMiddle+layerZshift;
320 const GeoShape * shiftedShape = &(*nextShape << trans);
322 lastShape = &(lastShape->add(*shiftedShape));
324 lastShape = shiftedShape;