10 #include "GeoModelKernel/GeoBox.h"
11 #include "GeoModelKernel/GeoTubs.h"
12 #include "GeoModelKernel/GeoTrap.h"
13 #include "GeoModelKernel/GeoLogVol.h"
14 #include "GeoModelKernel/GeoNameTag.h"
15 #include "GeoModelKernel/GeoIdentifierTag.h"
16 #include "GeoModelKernel/GeoPhysVol.h"
17 #include "GeoModelKernel/GeoMaterial.h"
19 #include "GeoModelKernel/GeoTransform.h"
20 #include "GeoModelKernel/GeoAlignableTransform.h"
21 #include "GeoModelKernel/GeoShapeShift.h"
22 #include "GeoModelKernel/GeoShapeUnion.h"
24 #include "GaudiKernel/PhysicalConstants.h"
30 GeoModelIO::ReadGeoModel* sqliteReader,
31 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
32 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
36 , m_theLadder(nullptr)
37 , m_theSensor(theSensor)
38 , m_staveSupport(staveSupport)
66 const GeoShape * ladderShape =
nullptr;
74 ladderShape =
new GeoBox(halfThickness,
m_width/2.,
length/2.);
91 double shift = 0.5*BentStaveThickness;
92 if (
angle > 0) shift *= -1.0;
93 const GeoShape & shiftedBox = (*box) << GeoTrf::TranslateX3D(shift);
94 ladderShape = &shiftedBox;
101 GeoBox * box =
new GeoBox(halfThickness,
m_width/2.,
length/2.);
102 const GeoShape & shiftedBox = (*box) << GeoTrf::TranslateX3D(shift);
103 ladderShape = &shiftedBox;
109 const GeoShape & staveShape = (*staveSupportShape);
110 ladderShape = &staveShape;
118 if(not ladderShape) {
124 m_theLadder =
new GeoLogVol(
"Ladder",ladderShape,air);
170 bool isModule3D=
true;
179 int nbPixelPlanarModule=0;
180 int nbPixel3DModule=0;
181 bool bDetailedStaveLayout=
false;
183 double zNegStavePos= 0.0;
184 double planarLength=0.0;
185 double v3DHalfLength=0.0;
186 double v3DLength=0.0;
191 double Si3DRadialShift=0.;
192 double Si3DLateralShift=0.;
197 if(Si3DThick>SiPlThick) Si3DRadialShift=-(Si3DThick-SiPlThick);
202 Si3DLateralShift= -(MechanicalStaveOffset3D-MechanicalStaveOffset);
211 bDetailedStaveLayout=
true;
212 nbPixelPlanarModule=nbPixelModule;
215 else if(staveLayout==5||staveLayout==6)
217 bDetailedStaveLayout=
true;
224 planarLength=nbPixelPlanarModule*pm.
Length()+(nbPixelPlanarModule-1)*pixelModuleGap;
225 v3DHalfLength=(nbPixel3DModule/2)*pm3D.
Length()+(nbPixel3DModule/2)*pixelModuleGap;
226 zNegStavePos=-planarLength*0.5-v3DHalfLength;
230 planarLength=nbPixelPlanarModule*pm.
Length()+(nbPixelPlanarModule-1)*pixelModuleGap;
231 v3DLength=(nbPixel3DModule)*pm3D.
Length()+(nbPixel3DModule-1)*pixelModuleGap+pixelModuleGap*0.5;
232 zNegStavePos=-v3DLength;
239 for(
int ii = 0; ii < nbPixelModule; ii++) {
256 bool b3DModule=
false;
272 if(ii<nbPixel3DModule/2)
277 xposShift=Si3DRadialShift;
278 yposShift=Si3DLateralShift;
281 else if(ii>nbPixelPlanarModule+nbPixel3DModule/2-1)
288 xposShift=Si3DRadialShift;
289 yposShift=Si3DLateralShift;
300 zpos=zNegStavePos+zpos;
306 if(ii<nbPixel3DModule)
310 zpos=(pm3D.
Length()+pixelModuleGap) * moduleIndex;
311 zpos=zNegStavePos+zpos+pm3D.
Length()*0.5;
312 xposShift=Si3DRadialShift;
313 yposShift=Si3DLateralShift;
319 zpos+=pm.
Length()*0.5+pixelModuleGap*0.5;
333 GeoVPhysVol* modulephys{
nullptr};
336 modulephys = pm.
Build();
338 modulephys = pm3D.
Build();
344 else id = theSensor3D.
getID();
348 std::ostringstream nameTag;
350 GeoNameTag *
tag =
new GeoNameTag(nameTag.str());
351 GeoAlignableTransform* xform;
354 ladderPhys->add(
tag);
355 ladderPhys->add(
new GeoIdentifierTag(
m_gmt_mgr->
Eta() ) );
356 ladderPhys->add(xform);
357 ladderPhys->add(modulephys );
362 else id = theSensor3D.
getID();
386 GeoBox * shapeSupBent =
new GeoBox(0.5*
thickness, 0.5*
width, bentStaveHalfLength);
394 double xst = xOffset - (bentStaveHalfLength *
sin(ang));
397 GeoLogVol* logVolBentNeg =
new GeoLogVol(
"StaveSupportBentNeg2",shapeSupBent,materialSup);
398 GeoPhysVol* physVolBentNeg =
new GeoPhysVol(logVolBentNeg);
399 GeoTrf::RotateY3D rmNeg(ang);
400 double zstneg = -
length/2.0 - (bentStaveHalfLength *
cos(ang));
403 ladderPhys->add(physVolBentNeg);
406 GeoLogVol* logVolBentPos =
new GeoLogVol(
"StaveSupportBentPos2",shapeSupBent,materialSup);
407 GeoPhysVol* physVolBentPos =
new GeoPhysVol(logVolBentPos);
408 GeoTrf::RotateY3D rmPos(-ang);
409 double zstpos =
length/2.0 + (bentStaveHalfLength *
cos(ang));
412 ladderPhys->add(physVolBentPos);
428 clearance =
std::max(clearance, safety);
432 double thick =
std::max(thickn, thickp);
458 width += 2*clearanceRphi;