161 {
162
163
164
166
167
168
170
172 bool isModule3D=true;
173 if (
m_gmt_mgr->PixelStaveLayout()<5) isModule3D=
false;
176
177
178
179 int staveLayout =
m_gmt_mgr->PixelStaveLayout();
180 int nbPixelModule=
m_gmt_mgr->PixelNModule();
181 int nbPixelPlanarModule=0;
182 int nbPixel3DModule=0;
183 bool bDetailedStaveLayout=false;
184 double pixelModuleGap=
m_gmt_mgr->IBLStaveModuleGap();
185 double zNegStavePos= 0.0;
186 double planarLength=0.0;
187 double v3DHalfLength=0.0;
188 double v3DLength=0.0;
189
190 bool bVerbose= (
m_gmt_mgr->msgLvl(MSG::DEBUG));
191
192
193 double Si3DRadialShift=0.;
194 double Si3DLateralShift=0.;
195 if(isModule3D)
196 {
197 double SiPlThick = pm.ThicknessP();
198 double Si3DThick = pm3D.ThicknessP();
199 if(Si3DThick>SiPlThick) Si3DRadialShift=-(Si3DThick-SiPlThick);
200
201
202 double MechanicalStaveOffset =
m_gmt_mgr->IBLStaveMechanicalStaveOffset();
203 double MechanicalStaveOffset3D =
m_gmt_mgr->IBLStaveMechanicalStaveOffset(
true);
204 Si3DLateralShift= -(MechanicalStaveOffset3D-MechanicalStaveOffset);
205 }
206
207
209 {
210 if(staveLayout==4)
211 {
212 nbPixelModule=
m_gmt_mgr->IBLStaveModuleNumber_AllPlanar();
213 bDetailedStaveLayout=true;
214 nbPixelPlanarModule=nbPixelModule;
215
216 }
217 else if(staveLayout==5||staveLayout==6)
218 {
219 bDetailedStaveLayout=true;
223
224 if(staveLayout==5)
225 {
226 planarLength=nbPixelPlanarModule*pm.Length()+(nbPixelPlanarModule-1)*pixelModuleGap;
227 v3DHalfLength=(nbPixel3DModule/2)*pm3D.Length()+(nbPixel3DModule/2)*pixelModuleGap;
228 zNegStavePos=-planarLength*0.5-v3DHalfLength;
229 }
230 else
231 {
232 planarLength=nbPixelPlanarModule*pm.Length()+(nbPixelPlanarModule-1)*pixelModuleGap;
233 v3DLength=(nbPixel3DModule)*pm3D.Length()+(nbPixel3DModule-1)*pixelModuleGap+pixelModuleGap*0.5;
234 zNegStavePos=-v3DLength;
235 }
236
237
238 }
239 }
240
241 for(int ii = 0; ii < nbPixelModule; ii++) {
242
243 int etaModule =
m_gmt_mgr->PixelModuleEtaFromIndex(ii);
245
246
247
248
249
250
251
252 double xpos =
m_gmt_mgr->PixelModuleStaggerDistance() *
m_gmt_mgr->PixelModuleStaggerSign(etaModule)
254
255
256
257 double zpos =
m_gmt_mgr->PixelModuleZPosition(etaModule);
258 bool b3DModule=false;
259 double xposShift=0.;
260 double yposShift=0.;
261
262
264 {
265 int moduleIndex =
m_gmt_mgr->PixelModuleIndexFromEta(etaModule);
266
268 zpos=(pm.Length()+
m_gmt_mgr->IBLStaveModuleGap()) * (moduleIndex - 0.5*(
m_gmt_mgr->IBLStaveModuleNumber_AllPlanar()-1));
269 else if(
m_gmt_mgr->PixelStaveLayout()==5)
270 {
271
272 if(bVerbose)
m_gmt_mgr->msg(MSG::DEBUG)<<
"Eta : cmpt/index "<<ii<<
" "<<moduleIndex<<
endmsg;
273
274 if(ii<nbPixel3DModule/2)
275 {
276 b3DModule=true;
277 zpos=(pm3D.Length()+
m_gmt_mgr->IBLStaveModuleGap()) * moduleIndex;
278 zpos+=pm3D.Length()*0.5;
279 xposShift=Si3DRadialShift;
280 yposShift=Si3DLateralShift;
281 if(bVerbose)
m_gmt_mgr->msg(MSG::DEBUG)<<
"left 3D module "<<pm3D.Length()<<
" "<<zpos<<
endmsg;
282 }
283 else if(ii>nbPixelPlanarModule+nbPixel3DModule/2-1)
284 {
285 if(bVerbose)
m_gmt_mgr->msg(MSG::DEBUG)<<
"right 3D module "<<pm3D.Length()<<
" "<<zpos<<
endmsg;
286 b3DModule=true;
287 zpos=v3DHalfLength+planarLength+
m_gmt_mgr->IBLStaveModuleGap();
288 zpos+=(pm3D.Length()+
m_gmt_mgr->IBLStaveModuleGap()) * (moduleIndex - nbPixel3DModule/2 - nbPixelPlanarModule);
289 zpos+=pm3D.Length()*0.5;
290 xposShift=Si3DRadialShift;
291 yposShift=Si3DLateralShift;
292 }
293 else
294 {
295 zpos=v3DHalfLength+(pm.Length()+
m_gmt_mgr->IBLStaveModuleGap()) * (moduleIndex - nbPixel3DModule/2);
296 zpos+=pm.Length()*0.5;
297 if(bVerbose)
m_gmt_mgr->msg(MSG::DEBUG)<<
"planar module "<<pm.Length()<<
" "<<zpos<<
endmsg;
298 xposShift=0.;
299 }
300
301
302 zpos=zNegStavePos+zpos;
303
304 }
305 else if(
m_gmt_mgr->PixelStaveLayout()==6)
306 {
307
308 if(ii<nbPixel3DModule)
309 {
310 if(bVerbose)
m_gmt_mgr->msg(MSG::DEBUG)<<
"left 3D module "<<pm3D.Length()<<
" "<<moduleIndex<<
endmsg;
311 b3DModule=true;
312 zpos=(pm3D.Length()+pixelModuleGap) * moduleIndex;
313 zpos=zNegStavePos+zpos+pm3D.Length()*0.5;
314 xposShift=Si3DRadialShift;
315 yposShift=Si3DLateralShift;
316 }
317 else
318 {
319 if(bVerbose)
m_gmt_mgr->msg(MSG::DEBUG)<<
"right plannar module "<<pm.Length()<<
" "<<moduleIndex<<
endmsg;
320 zpos=(pm.Length()+
m_gmt_mgr->IBLStaveModuleGap()) * (moduleIndex - nbPixel3DModule);
321 zpos+=pm.Length()*0.5+pixelModuleGap*0.5;
322 }
323 }
324 }
325
326
327 GeoTrf::Translation3D modulepos(xpos+xposShift,yposShift,zpos);
328
329
330
331 GeoTrf::RotateY3D rm(
m_gmt_mgr->PixelModuleAngle()*
m_gmt_mgr->PixelModuleAngleSign(etaModule) );
332
333
334
335 GeoVPhysVol* modulephys{nullptr};
336
337 if(!b3DModule)
338 modulephys = pm.Build();
339 else
340 modulephys = pm3D.Build();
341
346 else id = theSensor3D.getID();
348 }
349 else {
350 std::ostringstream nameTag;
351 nameTag <<
"ModuleBrl" <<
m_gmt_mgr->Eta();
352 GeoNameTag *
tag =
new GeoNameTag(nameTag.str());
353 GeoAlignableTransform* xform;
354
355 xform = new GeoAlignableTransform(GeoTrf::Transform3D(modulepos*rm));
356 ladderPhys->add(tag);
357 ladderPhys->add(
new GeoIdentifierTag(
m_gmt_mgr->Eta() ) );
358 ladderPhys->add(xform);
359 ladderPhys->add(modulephys );
360
361
364 else id = theSensor3D.getID();
365 m_DDmgr->addAlignableTransform(0,
id,xform,modulephys);
366 }
367 }
368
372 }
373
374
376 {
380 double xOffset =
m_gmt_mgr->PixelLadderServicesX();
381
382
383
384
385 double bentStaveHalfLength = 0.5 *
double(
m_gmt_mgr->PixelBentStaveNModule()) *
m_gmt_mgr->PixelLadderModuleDeltaZ();
386
387
388 GeoBox * shapeSupBent =
new GeoBox(0.5*
thickness, 0.5*
width, bentStaveHalfLength);
389
390
391
392
393 const GeoMaterial* materialSup =
m_mat_mgr->getMaterial(
"pix::StaveSupportBase");
394
395 double ang =
m_gmt_mgr->PixelLadderBentStaveAngle() * Gaudi::Units::pi / 180.0;
396 double xst = xOffset - (bentStaveHalfLength *
sin(ang));
397
398
399 GeoLogVol* logVolBentNeg = new GeoLogVol("StaveSupportBentNeg2",shapeSupBent,materialSup);
400 GeoPhysVol* physVolBentNeg = new GeoPhysVol(logVolBentNeg);
401 GeoTrf::RotateY3D rmNeg(ang);
402 double zstneg = -
length/2.0 - (bentStaveHalfLength *
cos(ang));
403 GeoTrf::Translation3D stavePosNeg(xst,0.,zstneg);
404 ladderPhys->add(new GeoTransform(GeoTrf::Transform3D(stavePosNeg*rmNeg)));
405 ladderPhys->add(physVolBentNeg);
406
407
408 GeoLogVol* logVolBentPos = new GeoLogVol("StaveSupportBentPos2",shapeSupBent,materialSup);
409 GeoPhysVol* physVolBentPos = new GeoPhysVol(logVolBentPos);
410 GeoTrf::RotateY3D rmPos(-ang);
411 double zstpos =
length/2.0 + (bentStaveHalfLength *
cos(ang));
412 GeoTrf::Translation3D stavePosPos(xst,0.,zstpos);
413 ladderPhys->add(new GeoTransform(GeoTrf::Transform3D(stavePosPos*rmPos)));
414 ladderPhys->add(physVolBentPos);
415 }
416
417
418 return ladderPhys;
419}
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
InDetDD::PixelDetectorManager * m_DDmgr