56 std::string railversion =
rdbAccessSvc()->
getChildTag(
"IDDetailedRail",indetVersionKey.tag(),indetVersionKey.node());
57 if(!railversion.empty()) {
88 double rminInt = (*cage)[0]->getDouble(
"RINGRMIN");
91 if(commonParameters->size()==0)
94 double yWidthUSP1 = (*commonParameters)[0]->getDouble(
"YWIDTHUSP1");
95 double yRailSup = (*commonParameters)[0]->getDouble(
"YRAILSUP");
96 double yRailSupPart3 = (*commonParameters)[0]->getDouble(
"YRAILSUPPART3");
97 double gapOfRSF = (*commonParameters)[0]->getDouble(
"GAPOFRSF");
98 double yWidthTRSB = (*commonParameters)[0]->getDouble(
"YWIDTHTRSB");
100 double coordY = yWidthUSP1/2. - yRailSup + (yRailSupPart3 - gapOfRSF/2.);
102 double phiTop = asin((yWidthTRSB + coordY) / (rminInt));
103 double phiBot = asin((yWidthTRSB/2. - coordY) / (rminInt));
105 GeoIntrusivePtr<const GeoShape> railGap1{
new GeoTubs( rminInt, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
106 -phiBot, phiBot + phiTop)};
107 GeoIntrusivePtr<const GeoShape> railGap2{
new GeoTubs( rminInt, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
108 -phiTop +
M_PI, phiBot + phiTop)};
109 GeoIntrusivePtr<const GeoShape> railGap12{
new GeoTubs( rminInt, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
110 -phiTop, phiBot + phiTop)};
114 std::string NameOfService;
115 for (
unsigned int ii =0; ii < sctGenServices->size(); ii++) {
117 NameOfService = (*sctGenServices)[ii]->getString(
"NAME");
120 const GeoShape * serviceTubeTmp = tubeHelper.buildShape();
122 std::string logName = tubeHelper.name();
123 if (logName.empty()) {
124 std::ostringstream o; o << ii;
125 logName =
"ServMat"+o.str();
127 logName =
"Sct" + logName;
129 double volumeCut = 0;
130 const GeoShape* serviceTube = serviceTubeTmp;
131 const GeoShape* serviceTube2 = serviceTubeTmp;
132 if( tubeHelper.volData().maxRadius() > minRofGap && tubeHelper.volData().phiStart()*
Gaudi::Units::radian < phiTop) {
134 if (NameOfService ==
"PPB1EFEG" || NameOfService ==
"CableTrayEFEG")
136 serviceTube = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap1);
137 serviceTube2 = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap12);
140 serviceTube = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap2).subtract(*railGap1);
146 double rminCut =
std::max(minRofGap, tubeHelper.volData().rmin());
147 double rmaxCut = tubeHelper.volData().maxRadius();
148 volumeCut = 0.5*phiWid*(rmaxCut+rminCut)*(rmaxCut-rminCut) * tubeHelper.volData().length();
153 std::string materialName = tubeHelper.materialName();
161 const GeoLogVol* servLog =
new GeoLogVol(logName,serviceTube,material);
162 GeoVPhysVol* servPhys =
new GeoPhysVol(servLog);
164 if (NameOfService ==
"PPB1EFEG" || NameOfService ==
"CableTrayEFEG")
166 const GeoLogVol* serv2Log =
new GeoLogVol(logName,serviceTube2,material);
167 GeoVPhysVol* serv2Phys =
new GeoPhysVol(serv2Log);
169 GeoTrf::TranslateZ3D trans(tubeHelper.volData().zMid());
170 GeoTrf::TranslateZ3D trans2(-tubeHelper.volData().zMid());
172 GeoTransform * xform1 =
new GeoTransform(trans);
173 GeoTransform * xform1Neg =
new GeoTransform(trans2);
174 GeoTransform * xform2 =
new GeoTransform(GeoTrf::RotateZ3D(180*
Gaudi::Units::deg)*trans);
175 GeoTransform * xform2Neg =
new GeoTransform(GeoTrf::RotateZ3D(180*
Gaudi::Units::deg)*trans2);
179 mother->add(xform1); mother->add(servPhys); mother->add(xform1Neg); mother->add(servPhys);
180 mother->add(xform2); mother->add(serv2Phys); mother->add(xform2Neg); mother->add(serv2Phys);
183 tubeHelper.placeVolume(mother, servPhys);
194 double RMinW, RMaxW, ZHalfLengthW, ZStartW, WidI, WidO, DPhi;
195 std::string matName,logName;
197 std::string NameOfMaterial;
199 for (
unsigned int ii =0; ii < sctsup->size(); ii++) {
207 NameOfMaterial = (*sctsup)[ii]->getString(
"MATERIAL");
208 DPhi = asin(WidI/2./RMinW);
210 if (NameOfMaterial !=
"sct::FwdMechanism")
212 const GeoShape* pTub1 =
new GeoTubs(RMinW, RMaxW, ZHalfLengthW, 0.-DPhi, 2.*DPhi);
213 const GeoShape* wing = pTub1;
215 double wingVolume = -1;
217 double H1=sqrt(RMinW*RMinW - WidI*WidI/4.);
218 double H2=sqrt(RMaxW*RMaxW - WidO*WidO/4.);
219 double Shift = H1 + (
H2-H1)*WidI/(WidI-WidO);
220 double RMaxDop = sqrt(WidI*WidI/4. + (
Shift-H1)*(
Shift-H1));
222 double DPhiDop =
atan(WidI/2./(
Shift-H1));
223 const GeoShape* pTub2 =
new GeoTubs(0., RMaxDop, ZHalfLengthW,
M_PI-DPhiDop, 2.*DPhiDop);
224 const GeoShape* pTub3 = (GeoShape*) & ((*pTub2) << GeoTrf::TranslateX3D(
Shift));
225 wing = (GeoShape*) & (*pTub1).intersect(*pTub3);
229 double trapArea = 0.5 * (
H2-H1)*(WidI+WidO);
230 double upperSeg =
atan(0.5*WidO/
H2)*RMaxW*RMaxW - 0.5*
H2*WidO;
231 double lowerSeg =
atan(0.5*WidI/H1)*RMinW*RMinW - 0.5*H1*WidI;
232 wingVolume = (trapArea + upperSeg - lowerSeg) * 2 * ZHalfLengthW;
236 matName = (*sctsup)[ii]->getString(
"MATERIAL");
237 logName =
"SctSupportGeneral";
238 std::string newMatName;
239 std::ostringstream o; o << ii;
240 if(matName.find(
"rWing") != std::string::npos) logName=
"FwdRearWing";
241 if(matName.find(
"tWing") != std::string::npos) logName=
"FwdFrontWing";
242 if(matName.find(
"Mech") != std::string::npos) {
243 logName=
"FwdMechanism"+o.str();
244 newMatName = matName + o.str();
247 if (wingVolume < 0) wingVolume = wing->volume();
255 const GeoLogVol* wingLog =
new GeoLogVol(logName,wing,wingMat);
256 GeoVPhysVol* wingPhys =
new GeoPhysVol(wingLog);
257 GeoTransform* wPos1 =
new GeoTransform(GeoTrf::Translate3D(0.,0., ZStartW+ZHalfLengthW));
258 GeoTransform* wPos2 =
new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(-
M_PI,0,0),
GeoTrf::Vector3D(0.,0., ZStartW+ZHalfLengthW)));
259 GeoTransform* wPos3 =
new GeoTransform(GeoTrf::Translate3D(0.,0.,-ZStartW-ZHalfLengthW));
260 GeoTransform* wPos4 =
new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(-
M_PI,0,0),
GeoTrf::Vector3D(0.,0.,-ZStartW-ZHalfLengthW)));
262 mother->add(wingPhys);
264 mother->add(wingPhys);
266 mother->add(wingPhys);
268 mother->add(wingPhys);
298 GeoIntrusivePtr<const GeoShape> railGap1{
new GeoTubs( minRofGap, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
300 GeoIntrusivePtr<const GeoShape> railGap2{
new GeoTubs( minRofGap, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
301 -phiWid/2.+
M_PI,phiWid)};
306 for (
unsigned int ii =0; ii < sctGenServices->size(); ii++) {
309 const GeoShape * serviceTubeTmp = tubeHelper.buildShape();
311 std::string logName = tubeHelper.name();
312 if (logName.empty()) {
313 std::ostringstream o; o << ii;
314 logName =
"ServMat"+o.str();
316 logName =
"Sct" + logName;
318 double volumeCut = 0;
319 const GeoShape* serviceTube = serviceTubeTmp;
320 if( tubeHelper.volData().maxRadius() > minRofGap && tubeHelper.volData().phiStart() < phiWid/2.) {
322 serviceTube = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap2).subtract(*railGap1);
328 double rminCut =
std::max(minRofGap, tubeHelper.volData().rmin());
329 double rmaxCut = tubeHelper.volData().maxRadius();
330 volumeCut = 0.5*phiWid*(rmaxCut+rminCut)*(rmaxCut-rminCut) * tubeHelper.volData().length();
335 std::string materialName = tubeHelper.materialName();
343 const GeoLogVol* servLog =
new GeoLogVol(logName,serviceTube,material);
344 GeoVPhysVol* servPhys =
new GeoPhysVol(servLog);
346 tubeHelper.placeVolume(mother, servPhys);
352 double RMinW, RMaxW, ZHalfLengthW, ZStartW, WidI, WidO, DPhi;
353 std::string matName,logName;
355 for (
unsigned int ii =0; ii < sctsup->size(); ii++) {
363 DPhi = asin(WidI/2./RMinW);
365 const GeoShape* pTub1 =
new GeoTubs(RMinW, RMaxW, ZHalfLengthW, 0.-DPhi, 2.*DPhi);
366 const GeoShape* wing = pTub1;
368 double wingVolume = -1;
370 double H1=sqrt(RMinW*RMinW - WidI*WidI/4.);
371 double H2=sqrt(RMaxW*RMaxW - WidO*WidO/4.);
372 double Shift = H1 + (
H2-H1)*WidI/(WidI-WidO);
373 double RMaxDop = sqrt(WidI*WidI/4. + (
Shift-H1)*(
Shift-H1));
375 double DPhiDop =
atan(WidI/2./(
Shift-H1));
376 const GeoShape* pTub2 =
new GeoTubs(0., RMaxDop, ZHalfLengthW,
M_PI-DPhiDop, 2.*DPhiDop);
377 const GeoShape* pTub3 = (GeoShape*) & ((*pTub2) << GeoTrf::TranslateX3D(
Shift));
378 wing = (GeoShape*) & (*pTub1).intersect(*pTub3);
382 double trapArea = 0.5 * (
H2-H1)*(WidI+WidO);
383 double upperSeg =
atan(0.5*WidO/
H2)*RMaxW*RMaxW - 0.5*
H2*WidO;
384 double lowerSeg =
atan(0.5*WidI/H1)*RMinW*RMinW - 0.5*H1*WidI;
385 wingVolume = (trapArea + upperSeg - lowerSeg) * 2 * ZHalfLengthW;
389 matName = (*sctsup)[ii]->getString(
"MATERIAL");
390 logName =
"SctSupportGeneral";
391 std::string newMatName;
392 std::ostringstream o; o << ii;
393 if(matName.find(
"rWing") != std::string::npos) logName=
"FwdRearWing";
394 if(matName.find(
"tWing") != std::string::npos) logName=
"FwdFrontWing";
395 if(matName.find(
"Mech") != std::string::npos) {
396 logName=
"FwdMechanism"+o.str();
397 newMatName = matName + o.str();
400 if (wingVolume < 0) wingVolume = wing->volume();
408 const GeoLogVol* wingLog =
new GeoLogVol(logName,wing,wingMat);
409 GeoVPhysVol* wingPhys =
new GeoPhysVol(wingLog);
410 GeoTransform* wPos1 =
new GeoTransform(GeoTrf::Translate3D(0.,0., ZStartW+ZHalfLengthW));
412 GeoTransform* wPos3 =
new GeoTransform(GeoTrf::Translate3D(0.,0.,-ZStartW-ZHalfLengthW));
415 mother->add(wingPhys);
417 mother->add(wingPhys);
419 mother->add(wingPhys);
421 mother->add(wingPhys);