11 #include "GeoModelKernel/GeoBox.h"
12 #include "GeoModelKernel/GeoTube.h"
13 #include "GeoModelKernel/GeoSimplePolygonBrep.h"
14 #include "GeoModelKernel/GeoLogVol.h"
15 #include "GeoModelKernel/GeoPhysVol.h"
16 #include "GeoModelKernel/GeoMaterial.h"
17 #include "GeoModelKernel/GeoNameTag.h"
19 #include "GeoModelKernel/GeoTransform.h"
20 #include "GaudiKernel/SystemOfUnits.h"
27 GeoModelIO::ReadGeoModel* sqliteReader,
28 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
29 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
33 m_supportPhysA(nullptr),
34 m_supportPhysC(nullptr),
35 m_xformSupportA(nullptr),
36 m_xformSupportC(nullptr)
54 if(nSectors==0)
return nullptr;
58 double deltaLength = 0.;
61 zmax=barrelZmax-0.001;
62 deltaLength=layerZshift;
65 zmin = barrelZmax+0.001;
67 deltaLength=-layerZshift;
78 double zStartPosA =
zmin+layerZshift;
79 double zStartPosC = -
zmax+layerZshift;
91 double halfLengthA = (
zmax-
zmin)*0.5-deltaLength*.5;
92 double halfLengthC = (
zmax-
zmin)*0.5+deltaLength*.5;
95 std::ostringstream lnameA;
97 std::ostringstream lnameC;
101 const GeoTube* supportShapeA =
new GeoTube(innerRadius,outerRadius,halfLengthA);
102 const GeoTube* supportShapeC =
new GeoTube(innerRadius,outerRadius,halfLengthC);
106 GeoLogVol* supportLogVol_A =
new GeoLogVol(lnameA.str(),supportShapeA,ether);
107 GeoLogVol* supportLogVol_C =
new GeoLogVol(lnameC.str(),supportShapeC,ether);
115 double cooling_radius = 35.1;
122 cooling_radius = 34.7 + layerRadius-33.25;
126 const GeoTube* service_coolingPipeA =
new GeoTube(0.0,TubeOuterDiam*0.5,halfLengthA);
127 const GeoTube* service_coolingPipeC =
new GeoTube(0.0,TubeOuterDiam*0.5,halfLengthC);
130 GeoLogVol * cp_service_logA =
new GeoLogVol(
"PP0CoolingPipe",service_coolingPipeA,cp_service_material);
131 GeoLogVol * cp_service_logC =
new GeoLogVol(
"PP0CoolingPipe",service_coolingPipeC,cp_service_material);
132 GeoPhysVol* cpPhysVolA =
new GeoPhysVol(cp_service_logA);
133 GeoPhysVol* cpPhysVolC =
new GeoPhysVol(cp_service_logC);
135 const GeoTube* service_coolingPipeInnerA =
new GeoTube(0.0,TubeInnerDiam*0.5,halfLengthA);
136 const GeoTube* service_coolingPipeInnerC =
new GeoTube(0.0,TubeInnerDiam*0.5,halfLengthC);
138 GeoLogVol * cp_service_inner_logA =
new GeoLogVol(
"PP0CoolingPipeInner",service_coolingPipeInnerA,cp_service_inner_material);
139 GeoLogVol * cp_service_inner_logC =
new GeoLogVol(
"PP0CoolingPipeInner",service_coolingPipeInnerC,cp_service_inner_material);
140 GeoPhysVol * cp_service_inner_logPVA =
new GeoPhysVol(cp_service_inner_logA);
141 GeoPhysVol * cp_service_inner_logPVC =
new GeoPhysVol(cp_service_inner_logC);
143 GeoNameTag* cp_service_inner_tag =
new GeoNameTag(
"PP0CoolingPipeInner");
144 GeoTransform* cp_service_inner_xform =
new GeoTransform(GeoTrf::Transform3D::Identity());
145 cpPhysVolA->add(cp_service_inner_tag);
146 cpPhysVolA->add(cp_service_inner_xform);
147 cpPhysVolA->add(cp_service_inner_logPVA);
148 cpPhysVolC->add(cp_service_inner_tag);
149 cpPhysVolC->add(cp_service_inner_xform);
150 cpPhysVolC->add(cp_service_inner_logPVC);
152 GeoLogVol* flex_logVolA =
nullptr;
153 GeoLogVol* flex_logVolC =
nullptr;
159 double flex_rot=0.30265;
160 flex_rot=-0.30265*.5;
161 double flex_rmin=0, flex_rmax=0;
162 double flexYmidPos=0;
173 std::string flexMatName=
"noFlexMatDefined";
181 GeoBox * flex_shapeA =
new GeoBox((flex_rmax-flex_rmin)*.5, flex_width*.5, halfLengthA);
182 GeoBox * flex_shapeC =
new GeoBox((flex_rmax-flex_rmin)*.5, flex_width*.5, halfLengthC);
184 if(flex_material==
nullptr)
186 m_gmt_mgr->
msg(MSG::ERROR)<<
"-> error while reading material "<<flexMatName<<__FILE__<<
":"<< __LINE__<<
endmsg;
189 flex_logVolA =
new GeoLogVol(
"Flex",flex_shapeA,flex_material);
190 flex_logVolC =
new GeoLogVol(
"Flex",flex_shapeC,flex_material);
197 unsigned int nbFlexPoint=59;
198 double xFlex[59]={-18.029,-15.546,-14.108,-12.832,-12.530,-11.770,-10.522,-9.285,-7.727,-6.132,-4.856,-3.906,-3.183,-1.643,-0.371,1.163,2.590,3.591,4.489,4.933,5.691,6.912,8.018,9.560,10.830,11.159,12.048,12.768,13.982,15.317,18.029,18.029,15.191,13.449,12.742,11.838,10.729,9.181,7.643,6.087,4.643,3.877,3.027,1.953,1.480,-0.071,-1.925,-3.102,-3.864,-5.065,-6.524,-7.999,-9.447,-10.867,-12.305,-13.289,-13.816,-15.377,-18.029};
199 double yFlex[59]={32.768,32.749,32.997,34.143,34.552,35.888,36.844,37.204,37.260,36.858,35.875,34.396,32.984,31.517,31.110,31.364,32.348,33.602,35.204,36.151,37.422,38.466,38.761,38.453,37.521,37.182,35.860,34.828,33.877,33.653,33.668,34.589,34.566,35.449,36.501,37.805,38.814,39.571,39.665,39.034,37.597,36.057,34.440,33.014,32.612,32.021,32.858,34.847,36.074,37.383,37.962,38.205,38.111,37.698,36.831,35.075,34.406,33.655,33.689};
201 flexYmidPos=(yFlex[0]+yFlex[nbFlexPoint-1])*.5;
203 std::vector<double> xShape, yShape;
204 xShape.clear(); yShape.clear();
205 GeoSimplePolygonBrep* Iflex_shape =
new GeoSimplePolygonBrep(flex_width*0.5);
206 for(
unsigned int iPt=0; iPt<nbFlexPoint; iPt++) Iflex_shape->addVertex(xFlex[iPt],yFlex[iPt]-flexYmidPos);
212 if(Iflex_material==
nullptr)
214 m_gmt_mgr->
msg(MSG::ERROR)<<
"-> error while reading material "<<IflexMatName<<__FILE__<<
":"<< __LINE__<<
endmsg;
217 flex_logVolA =
new GeoLogVol(
"IFlex",Iflex_shape,Iflex_material);
218 flex_logVolC =
new GeoLogVol(
"IFlex",Iflex_shape,Iflex_material);
222 GeoPhysVol * flexPhysVolA =
new GeoPhysVol(flex_logVolA);
223 GeoPhysVol * flexPhysVolC =
new GeoPhysVol(flex_logVolC);
226 for(
int ii = 0; ii < nSectors; ii++) {
231 double phiOfCooling = phiOfModuleZero+ cooling_angle + ii*
angle;
232 std::ostringstream tmp1;
234 GeoNameTag *
tag1 =
new GeoNameTag(tmp1.str());
235 GeoTransform* xform1 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfCooling)*GeoTrf::TranslateX3D(cooling_radius));
246 double phiOfFlex = phiOfModuleZero+ flex_angle + ii*
angle;
247 std::ostringstream
tmp2;
249 GeoNameTag *
tag2 =
new GeoNameTag(
tmp2.str());
254 GeoTransform* xformA2 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfFlex)*GeoTrf::TranslateX3D(flexYmidPos)*GeoTrf::RotateZ3D(-90.*
Gaudi::Units::deg)*GeoTrf::RotateY3D(-90.*
Gaudi::Units::deg)*GeoTrf::RotateX3D(flex_rot));
259 GeoTransform* xformC2 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfFlex)*GeoTrf::TranslateX3D(flexYmidPos)*GeoTrf::RotateZ3D(-90.*
Gaudi::Units::deg)*GeoTrf::RotateY3D(90.*
Gaudi::Units::deg)*GeoTrf::RotateX3D(-flex_rot));
269 GeoTransform* xform2 =
new GeoTransform(GeoTrf::RotateZ3D(phiOfFlex)*GeoTrf::TranslateX3D((flex_rmin+flex_rmax)*.5)*GeoTrf::RotateZ3D(flex_rot));
283 double middleA = zStartPosA+halfLengthA;
284 double middleC = zStartPosC+halfLengthC;