42{
43
45
46 double safety = 0.01*Gaudi::Units::mm;
47
48
49 double layerZshift =
m_gmt_mgr->PixelLayerGlobalShift();
50
51 double barrelZmax =
m_gmt_mgr->PixelBarrelHalfLength();
52 int nSectors =
m_gmt_mgr->NPixelSectors();
53
54
55 if(nSectors==0) return nullptr;
56 double angle=360./(
double)nSectors*Gaudi::Units::deg;
57
59 double deltaLength = 0.;
62 zmax=barrelZmax-0.001;
63 deltaLength=layerZshift;
64 }
66 zmin = barrelZmax+0.001;
68 deltaLength=-layerZshift;
69 }
73 }
77 }
78
79 double zStartPosA =
zmin+layerZshift;
80 double zStartPosC = -
zmax+layerZshift;
81
84 }
86
87 double innerRadius =
m_gmt_mgr->IBLServiceGetMaxRadialPosition(
"IPT",
"simple",zmin,zmax)+safety;
88 double outerRadius =
m_gmt_mgr->IBLServiceGetMinRadialPosition(
"IST",
"simple",zmin,zmax)-safety;
89 double phiOfModuleZero =
m_gmt_mgr->PhiOfModuleZero();
90 double layerRadius =
m_gmt_mgr->PixelLayerRadius();
91
92 double halfLengthA = (
zmax-
zmin)*0.5-deltaLength*.5;
93 double halfLengthC = (
zmax-
zmin)*0.5+deltaLength*.5;
94
95
96 std::ostringstream lnameA;
98 std::ostringstream lnameC;
100
101
102 const GeoTube* supportShapeA = new GeoTube(innerRadius,outerRadius,halfLengthA);
103 const GeoTube* supportShapeC = new GeoTube(innerRadius,outerRadius,halfLengthC);
104 const GeoMaterial* ether =
m_mat_mgr->getMaterial(
"special::Ether");
105
106
107 GeoLogVol* supportLogVol_A = new GeoLogVol(lnameA.str(),supportShapeA,ether);
108 GeoLogVol* supportLogVol_C = new GeoLogVol(lnameC.str(),supportShapeC,ether);
109
112
113
114
115
116 double cooling_radius = 35.1;
117 double TubeOuterDiam =
m_gmt_mgr->IBLStaveTubeOuterDiameter();
118 double TubeInnerDiam =
m_gmt_mgr->IBLStaveTubeInnerDiameter();
119 double cooling_angle = -2.154*Gaudi::Units::deg;
120
122 {
123 cooling_radius = 34.7 + layerRadius-33.25;
124 cooling_angle = -.1*Gaudi::Units::deg;
125 }
126
127 const GeoTube* service_coolingPipeA = new GeoTube(0.0,TubeOuterDiam*0.5,halfLengthA);
128 const GeoTube* service_coolingPipeC = new GeoTube(0.0,TubeOuterDiam*0.5,halfLengthC);
129
130 const GeoMaterial* cp_service_material =
m_mat_mgr->getMaterial(
"pix::CoolingPipe_IBL");
131 GeoLogVol * cp_service_logA = new GeoLogVol("PP0CoolingPipe",service_coolingPipeA,cp_service_material);
132 GeoLogVol * cp_service_logC = new GeoLogVol("PP0CoolingPipe",service_coolingPipeC,cp_service_material);
133 GeoPhysVol* cpPhysVolA = new GeoPhysVol(cp_service_logA);
134 GeoPhysVol* cpPhysVolC = new GeoPhysVol(cp_service_logC);
135
136 const GeoTube* service_coolingPipeInnerA = new GeoTube(0.0,TubeInnerDiam*0.5,halfLengthA);
137 const GeoTube* service_coolingPipeInnerC = new GeoTube(0.0,TubeInnerDiam*0.5,halfLengthC);
138 const GeoMaterial* cp_service_inner_material =
m_mat_mgr->getMaterial(
m_gmt_mgr->getMaterialName(
"CoolingFluid",0,0));
139 GeoLogVol * cp_service_inner_logA = new GeoLogVol("PP0CoolingPipeInner",service_coolingPipeInnerA,cp_service_inner_material);
140 GeoLogVol * cp_service_inner_logC = new GeoLogVol("PP0CoolingPipeInner",service_coolingPipeInnerC,cp_service_inner_material);
141 GeoPhysVol * cp_service_inner_logPVA = new GeoPhysVol(cp_service_inner_logA);
142 GeoPhysVol * cp_service_inner_logPVC = new GeoPhysVol(cp_service_inner_logC);
143
144 GeoNameTag* cp_service_inner_tag = new GeoNameTag("PP0CoolingPipeInner");
145 GeoTransform* cp_service_inner_xform = new GeoTransform(GeoTrf::Transform3D::Identity());
146 cpPhysVolA->add(cp_service_inner_tag);
147 cpPhysVolA->add(cp_service_inner_xform);
148 cpPhysVolA->add(cp_service_inner_logPVA);
149 cpPhysVolC->add(cp_service_inner_tag);
150 cpPhysVolC->add(cp_service_inner_xform);
151 cpPhysVolC->add(cp_service_inner_logPVC);
152
153 GeoLogVol* flex_logVolA = nullptr;
154 GeoLogVol* flex_logVolC = nullptr;
155
156 double flex_angle = -15.001*Gaudi::Units::deg;
158 flex_angle += 2.14*Gaudi::Units::deg;
159
160 double flex_rot=0.30265;
161 flex_rot=-0.30265*.5;
162 double flex_rmin=0, flex_rmax=0;
163 double flexYmidPos=0;
164 double flex_width =
m_gmt_mgr->IBLStaveFlexWidth();
165
167
168
169
171 flex_rmin =
m_gmt_mgr->IBLFlexPP0Rmin(secIdx);
172 flex_rmax =
m_gmt_mgr->IBLFlexPP0Rmax(secIdx);
173
174 std::string flexMatName="noFlexMatDefined";
176 flexMatName =
m_gmt_mgr->IBLFlexMaterial(2,
"doglegA");
178 flexMatName =
m_gmt_mgr->IBLFlexMaterial(3,
"doglegA");
180 flexMatName =
m_gmt_mgr->IBLFlexMaterial(1,
"PP0FlexA");
181
182 GeoBox * flex_shapeA = new GeoBox((flex_rmax-flex_rmin)*.5, flex_width*.5, halfLengthA);
183 GeoBox * flex_shapeC = new GeoBox((flex_rmax-flex_rmin)*.5, flex_width*.5, halfLengthC);
184 const GeoMaterial* flex_material =
m_mat_mgr->getMaterial(flexMatName);
185 if(flex_material==nullptr)
186 {
187 m_gmt_mgr->msg(MSG::ERROR)<<
"-> error while reading material "<<flexMatName<<__FILE__<<
":"<< __LINE__<<
endmsg;
188 std::abort();
189 } else{
190 flex_logVolA = new GeoLogVol("Flex",flex_shapeA,flex_material);
191 flex_logVolC = new GeoLogVol("Flex",flex_shapeC,flex_material);
192 }
193 }
194 else {
195
196
197
198 unsigned int nbFlexPoint=59;
199 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};
200 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
202 flexYmidPos=(yFlex[0]+yFlex[nbFlexPoint-1])*.5;
203
204 std::vector<double> xShape, yShape;
205 xShape.clear(); yShape.clear();
206 GeoSimplePolygonBrep* Iflex_shape = new GeoSimplePolygonBrep(flex_width*0.5);
207 for(unsigned int iPt=0; iPt<nbFlexPoint; iPt++) Iflex_shape->addVertex(xFlex[iPt],yFlex[iPt]-flexYmidPos);
208
209 std::string IflexMatName =
m_gmt_mgr->IBLFlexMaterial(1,
"IFlexA");
211 const GeoMaterial* Iflex_material =
m_mat_mgr->getMaterial(IflexMatName);
212
213 if(Iflex_material==nullptr)
214 {
215 m_gmt_mgr->msg(MSG::ERROR)<<
"-> error while reading material "<<IflexMatName<<__FILE__<<
":"<< __LINE__<<
endmsg;
216 std::abort();
217 } else{
218 flex_logVolA = new GeoLogVol("IFlex",Iflex_shape,Iflex_material);
219 flex_logVolC = new GeoLogVol("IFlex",Iflex_shape,Iflex_material);
220 }
221 }
222
223 GeoPhysVol * flexPhysVolA = new GeoPhysVol(flex_logVolA);
224 GeoPhysVol * flexPhysVolC = new GeoPhysVol(flex_logVolC);
225
226
227 for(int ii = 0; ii < nSectors; ii++) {
228
230
231
232 double phiOfCooling = phiOfModuleZero+ cooling_angle + ii*
angle;
233 std::ostringstream tmp1;
234 tmp1 << "fl" << ii;
235 GeoNameTag *
tag1 =
new GeoNameTag(tmp1.str());
236 GeoTransform* xform1 = new GeoTransform(GeoTrf::RotateZ3D(phiOfCooling)*GeoTrf::TranslateX3D(cooling_radius));
240
244
245
246
247 double phiOfFlex = phiOfModuleZero+ flex_angle + ii*
angle;
248 std::ostringstream
tmp2;
250 GeoNameTag *
tag2 =
new GeoNameTag(
tmp2.str());
251
253
254
255 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
260 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));
264
265 }
266 else {
267
268
269
270 GeoTransform* xform2 = new GeoTransform(GeoTrf::RotateZ3D(phiOfFlex)*GeoTrf::TranslateX3D((flex_rmin+flex_rmax)*.5)*GeoTrf::RotateZ3D(flex_rot));
271
275
279 }
280
281
282 }
283
284 double middleA = zStartPosA+halfLengthA;
285 double middleC = zStartPosC+halfLengthC;
286
287 GeoTrf::Transform3D supportTrfA = GeoTrf::TranslateZ3D(middleA);
289
290
291
292 GeoTrf::Transform3D supportTrfC = GeoTrf::TranslateZ3D(middleC);
294
295
296
297
298 return nullptr;
299}
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
PixelGeometryManager * m_gmt_mgr
InDetMaterialManager * m_mat_mgr