ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
GeoPixelDetailedStaveSupport Class Reference

#include <GeoPixelDetailedStaveSupport.h>

Inheritance diagram for GeoPixelDetailedStaveSupport:
Collaboration diagram for GeoPixelDetailedStaveSupport:

Public Member Functions

 GeoPixelDetailedStaveSupport (InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * >> mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * >> mapAX)
 
virtual GeoVPhysVol * Build () override
 
virtual GeoVPhysVol * getPhysVol () override
 
virtual const GeoTrf::Transform3D & transform () const override
 
virtual double thicknessP () const override
 
virtual double thicknessN () const override
 
virtual GeoSimplePolygonBrep * computeStaveEnvelopShape (double safetyMargin) override
 
virtual GeoPhysVol * getEndblockEnvelopShape (int) override
 
virtual GeoTransform * getEndblockEnvelopShapeTrf (int) override
 
virtual double getEndblockZpos () const override
 
virtual double getServiceZpos () const override
 
virtual double getEndblockLength () const override
 
virtual void computeStaveEnvelopTransformAndSize (double moduleThickN, double moduleThickP, double moduleWidth, double moduleThickN3D, double moduleThickP3D, double moduleWidth3D) override
 
virtual int PixelNModule () const override
 
virtual int PixelNPlanarModule () const override
 
virtual int PixelN3DModule () const override
 
 GeoVPixelFactory (InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * >> mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * >> mapAX)
 

Protected Attributes

PixelGeometryManagerm_gmt_mgr
 
InDetMaterialManagerm_mat_mgr
 
InDetDD::PixelDetectorManagerm_DDmgr
 
GeoModelIO::ReadGeoModel * m_sqliteReader
 
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
 
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
 
const double m_epsilon
 

Private Member Functions

void RemoveCoincidentAndColinearPointsFromShape (std::vector< double > &xPoint, std::vector< double > &yPoint)
 
void GetSurroundingConvexShape (std::vector< double > &xPoint, std::vector< double > &yPoint, std::vector< int > iExcept=std::vector< int >())
 
void AddSurroundingXYMargin (double vMarginX, double vMarginY, std::vector< double > &xPoint, std::vector< double > &yPoint)
 
void ComputeStaveExternalShape ()
 
GeoTrf::Vector3D IntersectionPoint (double Ax, double Ay, double Bx, double By, double Cx, double Cy, double Dx, double Dy)
 
GeoTrf::Vector3D NormalizeDir (GeoTrf::Vector3D v)
 
GeoTrf::Vector3D NeighbourPoint_Rad (GeoTrf::Vector3D p, GeoTrf::Vector3D v, double delta)
 
GeoTrf::Vector3D NeighbourPoint_Perp (GeoTrf::Vector3D p, GeoTrf::Vector3D v, double delta, int iDir)
 
double ComputeAngle (double ux, double uy, double vx, double vy)
 
double ComputeDistance (GeoTrf::Vector3D p, GeoTrf::Vector3D q)
 

Private Attributes

GeoNodePtr< GeoVPhysVol > m_physVol
 
GeoNodePtr< GeoSimplePolygonBrep > m_staveEnvelopShape
 
GeoNodePtr< GeoSimplePolygonBrep > m_basicStaveEnvelopShape
 
GeoPhysVol * m_endblockAPhysVol = nullptr
 
GeoPhysVol * m_endblockCPhysVol = nullptr
 
double m_endblockZpos = 0.0
 
double m_endblockLength = 0.0
 
double m_serviceZpos = 0.0
 
double m_endblockSrvLength = 0.0
 
GeoPhysVol * m_endblockFlexPhysVol = nullptr
 
GeoNodePtr< GeoTransform > m_endblockFlexTrf
 
GeoPhysVol * m_serviceCoolPipePhysVol = nullptr
 
GeoNodePtr< GeoTransform > m_serviceCoolPipeTrfA
 
GeoNodePtr< GeoTransform > m_serviceCoolPipeTrfC
 
GeoTrf::Transform3D m_transform
 
double m_thicknessP = 0.0
 
double m_thicknessN = 0.0
 
double m_thicknessN_svc = 0.0
 
double m_width_svc = 0.0
 
double m_SafetyMargin = 0.0
 
bool m_bVerbose {}
 
int m_PlanarModuleNumber = 0
 
int m_3DModuleNumber = 0
 
double m_StaveLength = 0.0
 
double m_FoamEdgePointX = 0.0
 
double m_FoamEdgePointY = 0.0
 
double m_FoamMiddleThick = 0.0
 
double m_OmegaEndStaveThick = 0.0
 
double m_OmegaEndStavePointX = 0.0
 
double m_OmegaEndStavePointY = 0.0
 
double m_OmegaMidStaveThick = 0.0
 
double m_MidStaveSidePointX = 0.0
 
double m_MidStaveSidePointY = 0.0
 

Static Private Attributes

static constexpr double m_oneDegree = 180.0/M_PI
 

Detailed Description

Definition at line 15 of file GeoPixelDetailedStaveSupport.h.

Constructor & Destructor Documentation

◆ GeoPixelDetailedStaveSupport()

GeoPixelDetailedStaveSupport::GeoPixelDetailedStaveSupport ( InDetDD::PixelDetectorManager ddmgr,
PixelGeometryManager mgr,
GeoModelIO::ReadGeoModel *  sqliteReader,
std::shared_ptr< std::map< std::string, GeoFullPhysVol * >>  mapFPV,
std::shared_ptr< std::map< std::string, GeoAlignableTransform * >>  mapAX 
)

Definition at line 32 of file GeoPixelDetailedStaveSupport.cxx.

37  : GeoPixelStaveSupport (ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX)),
38  m_transform(GeoTrf::Transform3D::Identity())
39 {
42 
43 }

Member Function Documentation

◆ AddSurroundingXYMargin()

void GeoPixelDetailedStaveSupport::AddSurroundingXYMargin ( double  vMarginX,
double  vMarginY,
std::vector< double > &  xPoint,
std::vector< double > &  yPoint 
)
private

Definition at line 1434 of file GeoPixelDetailedStaveSupport.cxx.

1435 {
1436 
1437  // For each segment (Pi-1,Pi) define parallel segment (newPi-1,newPi)
1438  // Parallel direction is defined by the greatest compenent of the vector perpendicular
1439  // to (Pi-1,Pi)
1440  int nbPoint=xPoint.size();
1441  std::vector<double> xEndPoint1,yEndPoint1,xEndPoint2,yEndPoint2;
1442  for(int iPt=0; iPt<nbPoint; iPt++)
1443  {
1444  int i1=(iPt-1); if(i1<0) i1=nbPoint-1;
1445  int i2=iPt;
1446 
1447  // Perpendicular directrion
1448  double xPt1=xPoint[i1]; double yPt1=yPoint[i1];
1449  double xPt2=xPoint[i2]; double yPt2=yPoint[i2];
1450  double vDirX=(xPt2-xPt1), vDirY=(yPt2-yPt1);
1451  double invNorm=1.0/sqrt(vDirX*vDirX+vDirY*vDirY);
1452  vDirX*=invNorm; vDirY*=invNorm;
1453  double vPerpDirX=vDirY, vPerpDirY=-vDirX;
1454 
1455  // Compute parallel segment
1456  double xNewPt1, yNewPt1, xNewPt2, yNewPt2;
1457  if(fabs(vDirX)<fabs(vDirY)) // X direcion is valid
1458  {
1459  double coeffDir=1.0; if(vPerpDirX<0)coeffDir=-1.0;
1460  xNewPt1=xPt1+coeffDir*vMarginX;
1461  yNewPt1=yPt1;
1462  xNewPt2=xPt2+coeffDir*vMarginX;
1463  yNewPt2=yPt2;
1464  }
1465  else // Y direction is valid
1466  {
1467  double coeffDir=1.0; if(vPerpDirY<0)coeffDir=-1.0;
1468  xNewPt1=xPt1;
1469  yNewPt1=yPt1+coeffDir*vMarginY;
1470  xNewPt2=xPt2;
1471  yNewPt2=yPt2+coeffDir*vMarginY;
1472  }
1473 
1474  xEndPoint1.push_back(xNewPt1); yEndPoint1.push_back(yNewPt1);
1475  xEndPoint2.push_back(xNewPt2); yEndPoint2.push_back(yNewPt2);
1476 
1477  }
1478 
1479  // Compute intersection points of succesive (newPi-1,newPi) segments
1480  // (colinear points were previously removed from shape)
1481  std::vector<double> xInter, yInter;
1482  for(int iPt=0; iPt<nbPoint; iPt++)
1483  {
1484  int i1=iPt;
1485  int i2=(iPt+1)%nbPoint;
1486 
1487  double Ax=xEndPoint1[i1], Ay=yEndPoint1[i1];
1488  double Bx=xEndPoint2[i1], By=yEndPoint2[i1];
1489 
1490  double Cx=xEndPoint1[i2], Cy=yEndPoint1[i2];
1491  double Dx=xEndPoint2[i2], Dy=yEndPoint2[i2];
1492 
1493  double tmp=(Bx-Ax)*(Dy-Cy)-(By-Ay)*(Dx-Cx);
1494  double invTmp=1.0/tmp;
1495 
1496  double r=((Ay-Cy)*(Dx-Cx)-(Ax-Cx)*(Dy-Cy))*invTmp;
1497  // double s=((Ay-Cy)*(Bx-Ax)-(Ax-Cx)*(By-Ay))*invTmp;
1498 
1499  double xInter1=Ax+r*(Bx-Ax);
1500  double yInter1=Ay+r*(By-Ay);
1501  // double xInter2=Cx+s*(Dx-Cx);
1502  // double yInter2=Cy+s*(Dy-Cy);
1503 
1504  xInter.push_back(xInter1); yInter.push_back(yInter1);
1505  }
1506 
1507 
1508  // New shape is definied by the intersection points defined above
1509  for(int iPt=0; iPt<nbPoint; iPt++)
1510  {
1511  xPoint[iPt]=xInter[iPt];
1512  yPoint[iPt]=yInter[iPt];
1513  }
1514 
1515 }

◆ Build()

GeoVPhysVol * GeoPixelDetailedStaveSupport::Build ( )
overridevirtual

Implements GeoVPixelFactory.

Definition at line 45 of file GeoPixelDetailedStaveSupport.cxx.

45  {
46 
47  m_gmt_mgr->msg(MSG::INFO) <<"Build detailed stave support description : layout "<<m_gmt_mgr->PixelStaveLayout()<<endmsg;
48 
49  bool isBLayer = m_gmt_mgr->GetLD() == 0;
50  int staveLayout = m_gmt_mgr->PixelStaveLayout();
51 
52  // Module geometry
55  double pmThicknessN=pm.ThicknessN_noSvc();
56  double pmThicknessP=pm.ThicknessP();
57  double pmWidth=pm.Width();
58 
59  // double tmp = pm.ThicknessN();
60  m_thicknessN_svc = pm.ModuleServiceThickness();
61  m_width_svc = pm.ModuleServiceWidth();
62 
63  // Module geometry - Si3D
64  double pmThicknessN3D=-1;
65  double pmThicknessP3D=-1.;
66  double pmWidth3D=-1;
67  double pmShilftLateral3D=0.;
68  double radialShift=0.;
69  double radialShiftThickN=0.;
70  if(staveLayout==5||staveLayout==6||staveLayout==7) // 75/25 or 50/50
71  {
72  GeoPixelSiCrystal theSensor3D(m_DDmgr, m_gmt_mgr, m_sqliteReader, m_mapFPV, m_mapAX, isBLayer,true);
74 
75  pmThicknessN3D=pm3D.ThicknessN();
76  pmThicknessP3D=pm3D.ThicknessP();
77 
78  if(pmThicknessP3D>pmThicknessP) radialShift = -(pmThicknessP3D-pmThicknessP);
79  m_gmt_mgr->msg(MSG::INFO)<<"Si3D/SiPl radial shift : "<<radialShift<<endmsg;
80 
81  pmThicknessN3D=pm3D.ThicknessN()-radialShift; // /!\ thicknesses in SiPl referential
82  pmThicknessP3D=pm3D.ThicknessP()+radialShift;
83  pmWidth3D=pm3D.Width();
84 
85  m_gmt_mgr->msg(MSG::INFO) <<"Module thicknesses : SiPl P/N "<<pmThicknessP<<" "<<pmThicknessN<<" "<<pmWidth<<
86  " SiPl P/N "<<pmThicknessP3D<<" "<<pmThicknessN3D<<" "<<pmWidth3D<<
87  " // "<<pm3D.ThicknessP()<<" "<<pm3D.ThicknessN()<<endmsg;
88 
89  double MechanicalStaveOffset = m_gmt_mgr->IBLStaveMechanicalStaveOffset();
90  double MechanicalStaveOffset3D = m_gmt_mgr->IBLStaveMechanicalStaveOffset(true);
91  pmShilftLateral3D= -(MechanicalStaveOffset3D-MechanicalStaveOffset);
92 
93  radialShiftThickN=fabs(radialShift)+(pmThicknessN3D-pmThicknessN)*.5;
94  }
95 
96  int ModuleNumber= m_gmt_mgr->IBLStaveModuleNumber_AllPlanar();
97  int ModuleNumber_allPlanar=ModuleNumber;
98  double ModuleGap= m_gmt_mgr->IBLStaveModuleGap();
99  double ModuleLength=pm.Length();
100  double MechanicalStaveEndBlockLength = m_gmt_mgr->IBLStaveMechanicalStaveEndBlockLength();
101  double totalStaveLength = m_gmt_mgr->IBLStaveLength();
102  int Module3DNumber= 0;
103  double Module3DLength=0;
104 
105  // ------------------------------------------------------------------------------------------------------------
106  // ------------------------------------------------------------------------------------------------------------
107  // Module 3D geometry
108  // ------------------------------------------------------------------------------------------------------------
109  // ------------------------------------------------------------------------------------------------------------
110 
111  if(staveLayout==5||staveLayout==6||staveLayout==7) // 75/25 or 50/50 or 75/25 review
112  {
113  // Get the 3D module description
114  bool isModule3D=true;
115  GeoPixelSiCrystal theSensor3D(m_DDmgr, m_gmt_mgr, m_sqliteReader, m_mapFPV, m_mapAX, isBLayer,isModule3D);
117  Module3DLength=pm3D.Length();
118 
119  if(staveLayout==5||staveLayout==7) // 75/25
120  {
121  Module3DNumber=(ModuleNumber/4)*2;
122  ModuleNumber=ModuleNumber*0.75;
123  }
124  else if(staveLayout==6) // 50/50
125  {
126  ModuleNumber=ModuleNumber/2;
127  Module3DNumber=ModuleNumber*2;
128  }
129  }
130 
131  m_PlanarModuleNumber = ModuleNumber;
132  m_3DModuleNumber = Module3DNumber;
133  m_gmt_mgr->msg(MSG::INFO) <<"Pixel modules "<<ModuleNumber<<" -> planar/3D : "<<m_PlanarModuleNumber<<" "<<m_3DModuleNumber<<endmsg;
134 
135  // ------------------------------------------------------------------------------------------------------------
136  // ------------------------------------------------------------------------------------------------------------
137  // Compute stave length : is identical for all the configration ( = IBL one)
138  // ------------------------------------------------------------------------------------------------------------
139  // ------------------------------------------------------------------------------------------------------------
140  double lgPlanar=ModuleLength*m_PlanarModuleNumber+ModuleGap*(m_PlanarModuleNumber-1);
141  double lg3D=Module3DLength*m_3DModuleNumber+ModuleGap*m_3DModuleNumber;
142  double lgEndBlock=2.0*MechanicalStaveEndBlockLength;
143 
144  m_StaveLength=totalStaveLength;
145  double compStaveLength=lgPlanar+lg3D+lgEndBlock;
146  double lgNAStave=(totalStaveLength-compStaveLength)*0.5;
147 
148 // int ModuleNumber_allplanar= m_gmt_mgr->IBLStaveModuleNumber_AllPlanar();
149 // double ModuleGap_allplanar= m_gmt_mgr->IBLStaveModuleGap();
150 // m_StaveLength=ModuleLength*ModuleNumber_allplanar+ModuleGap_allplanar*(ModuleNumber_allplanar-1)+2.0*MechanicalStaveEndBlockLength;
151 
152 
153  m_gmt_mgr->msg(MSG::INFO) <<"Module length/gap : "<<ModuleLength<<" / "<<Module3DLength<<" "<<ModuleGap<<" -> Stave length : "<<m_StaveLength<<endmsg;
154  m_gmt_mgr->msg(MSG::INFO) <<" planar/3D/endblock/NonActive lengths : "<<lgPlanar<<" "<<lg3D<<" "<<lgEndBlock<<" "<<lgNAStave<<endmsg;
155 
157 
158  if(m_sqliteReader) {
159  // No more actions required when building from SQLite file
160  return nullptr;
161  }
162 
163  // ------------------------------------------------------------------------------------------------------------
164  // ------------------------------------------------------------------------------------------------------------
165  // Stave geometry
166  // ------------------------------------------------------------------------------------------------------------
167  // ------------------------------------------------------------------------------------------------------------
168  double FacePlateThick = m_gmt_mgr->IBLStaveFacePlateThickness();
169  double FacePlateGreaseThick = m_gmt_mgr->IBLStaveFacePlateGreaseThickness();
170  if(FacePlateGreaseThick>0.001) FacePlateThick+=FacePlateGreaseThick;
171 
172  double MechanicalStaveWidth = m_gmt_mgr->IBLStaveMechanicalStaveWidth();
173  double MechanicalStaveLength = m_StaveLength;
174  double MechanicalStaveOffset = m_gmt_mgr->IBLStaveMechanicalStaveOffset();
175  double StaveModuleOffset = m_gmt_mgr->IBLStaveMechanicalStaveModuleOffset();
176 
177  double TubeOuterDiam = m_gmt_mgr->IBLStaveTubeOuterDiameter();
178  double TubeInnerDiam = m_gmt_mgr->IBLStaveTubeInnerDiameter();
179  double TubeMiddlePos = m_gmt_mgr->IBLStaveTubeMiddlePos();
180 
181  double FlexLayerThick = m_gmt_mgr->IBLStaveFlexLayerThickness();
182  double FlexBaseThick = m_gmt_mgr->IBLStaveFlexBaseThickness();
183  double FlexWidth = m_gmt_mgr->IBLStaveFlexWidth();
184  double FlexOffset = m_gmt_mgr->IBLStaveFlexOffset();
185  double FlexStaveMiddleGap = m_gmt_mgr->IBLFlexMiddleGap();
186  double FlexEOS_zpos = m_gmt_mgr->IBLFlexPP0Z(0);
187  double FlexDogLeg_length = m_gmt_mgr->IBLFlexDoglegLength();
188  double WingWidth = m_gmt_mgr->IBLStaveFlexWingWidth();
189  double WingThick = m_gmt_mgr->IBLStaveFlexWingThick();
190  bool bFlexAndWing = m_gmt_mgr->IBLFlexAndWingDefined();
191 
192  bool bFlexConstantThickness = true;
193  if(!bFlexAndWing) bFlexConstantThickness = false;
194 
195  double layerRadius = m_gmt_mgr->PixelLayerRadius();
196 
197  double OmegaThick = m_gmt_mgr->IBLStaveOmegaThickness();
198 
199  double FacePlateGlueThick = m_gmt_mgr->IBLStaveFacePlateGlueThickness();
200  double TubeGlueThick = m_gmt_mgr->IBLStaveTubeGlueThickness();
201  double OmegaGlueThick = m_gmt_mgr->IBLStaveOmegaGlueThickness();
202 
203  double MaxFlexThickness;
204  if (!bFlexConstantThickness){
205  if(ModuleNumber_allPlanar%2==0)
206  MaxFlexThickness=FlexBaseThick+(ModuleNumber_allPlanar/2-1)*FlexLayerThick;
207  else
208  MaxFlexThickness=FlexBaseThick+((ModuleNumber_allPlanar-1)/2)*FlexLayerThick;
209  }
210  else
211  MaxFlexThickness=FlexBaseThick;
212 
213  m_gmt_mgr->msg(MSG::INFO) <<"Flex thickness (max) : "<<MaxFlexThickness<<" computed for "<<ModuleNumber_allPlanar<<" modules "<<endmsg;
214 
215  double halfMecStaveWidth=MechanicalStaveWidth*0.5;
216 
217  // SafetyMargin
218  double xGblOffset=FacePlateThick+m_SafetyMargin;
219  double safetyMarginZ=.001*Gaudi::Units::mm;
220 
221  // Compute approximated stave shape based on DB parameters
223 
224  // if no flex width is defined, take foam module side length as default value
225  if (FlexWidth<0.001)
226  {
228  double yDelta=-m_FoamEdgePointY;
229  FlexWidth = sqrt(xDelta*xDelta+yDelta*yDelta);
230  }
231 
232  m_gmt_mgr->msg(MSG::INFO)<<" MechanicalStaveWidth = "<<MechanicalStaveWidth <<endmsg;
233  m_gmt_mgr->msg(MSG::INFO)<<" MechanicalStaveLength = "<<MechanicalStaveLength <<endmsg;
234  m_gmt_mgr->msg(MSG::INFO)<<" MechanicalStaveOffset = "<<MechanicalStaveOffset <<endmsg;
235  m_gmt_mgr->msg(MSG::INFO)<<" StaveModuleOffset = "<<StaveModuleOffset <<endmsg;
236  m_gmt_mgr->msg(MSG::INFO)<<" MechanicalStaveEndBlockLength = "<<MechanicalStaveEndBlockLength <<endmsg;
237  m_gmt_mgr->msg(MSG::INFO)<<" FacePlateThick = "<<FacePlateThick <<endmsg;
238  m_gmt_mgr->msg(MSG::INFO)<<" TubeOuterDiam = "<< TubeOuterDiam <<endmsg;
239  m_gmt_mgr->msg(MSG::INFO)<<" TubeInnerDiam = "<< TubeInnerDiam <<endmsg;
240  m_gmt_mgr->msg(MSG::INFO)<<" TubeMiddlePos = "<< TubeMiddlePos <<endmsg;
241  m_gmt_mgr->msg(MSG::INFO)<<" FlexBaseThick = "<< FlexBaseThick <<endmsg;
242  m_gmt_mgr->msg(MSG::INFO)<<" FlexLayerThick = "<< FlexLayerThick <<endmsg;
243  m_gmt_mgr->msg(MSG::INFO)<<" FlexWidth = "<< FlexWidth <<endmsg;
244  m_gmt_mgr->msg(MSG::INFO)<<" FlexOffset = "<< FlexOffset <<endmsg;
245  m_gmt_mgr->msg(MSG::INFO)<<" XOffset / ladder = "<< StaveModuleOffset <<endmsg;
246 
247  // Adjust length of face plate/foam depending on end block
248  double MiddleSectionLength=MechanicalStaveLength-2.0*MechanicalStaveEndBlockLength;
249 
250  // Coordinate system
251  //
252  // (0,0) = middle point of the face plate side near to the module
253  // x axis : perpendicular to face plate
254  // y axis : along face plate
255 
256 
257  // ------------------------------------------------------------------------------------------------------------
258  // ------------------------------------------------------------------------------------------------------------
259  // Foam shape
260  // ------------------------------------------------------------------------------------------------------------
261  // ------------------------------------------------------------------------------------------------------------
262 
263  double foam1x = 0.0, foam1y = -halfMecStaveWidth+m_OmegaEndStaveThick;
264  double foam2x = m_FoamEdgePointX, foam2y = -m_FoamEdgePointY;
265  double foam3x = m_FoamMiddleThick, foam3y = 0.0;
266  double foam4x = m_FoamEdgePointX, foam4y = m_FoamEdgePointY;
267  double foam5x = 0.0, foam5y = halfMecStaveWidth-m_OmegaEndStaveThick;
268 
269  foam1x += xGblOffset;
270  foam2x += xGblOffset;
271  foam3x += xGblOffset;
272  foam4x += xGblOffset;
273  foam5x += xGblOffset;
274 
275  double FoamBaseWidth=sqrt((foam5x-foam1x)*(foam5x-foam1x)+(foam5y-foam1y)*(foam5y-foam1y));
276 
277  // ------------------------------------------------------------------------------------------------------------
278  // ------------------------------------------------------------------------------------------------------------
279  // Omega shape
280  // ------------------------------------------------------------------------------------------------------------
281  // ------------------------------------------------------------------------------------------------------------
282  // other 5 points are common with Foam shape (foam 5-4-3-2-1)
283 
284  double omega1x, omega1y, omega2x, omega2y, omega3x, omega3y;
285  double omega4x, omega4y, omega5x, omega5y;
286  omega1x=omega1y=omega2x=omega2y=omega3x=omega3y=omega4x=omega4y=omega5x=omega5y=0.0;
287 
288  omega1x = 0.0; omega1y = -halfMecStaveWidth;
289  omega2x = m_OmegaEndStavePointX; omega2y = -m_OmegaEndStavePointY;
290  omega3x = m_FoamMiddleThick+m_OmegaMidStaveThick; omega3y = 0.0;
291  omega4x = m_OmegaEndStavePointX; omega4y = m_OmegaEndStavePointY;
292  omega5x = 0.0; omega5y = halfMecStaveWidth;
293 
294  omega1x += xGblOffset;
295  omega2x += xGblOffset;
296  omega3x += xGblOffset;
297  omega4x += xGblOffset;
298  omega5x += xGblOffset;
299 
300  // ------------------------------------------------------------------------------------------------------------
301  // ------------------------------------------------------------------------------------------------------------
302  // Face plate shape
303  // other 2 points are common with Foam Shape (foam1x and foam5x)
304  // ------------------------------------------------------------------------------------------------------------
305  // ------------------------------------------------------------------------------------------------------------
306 
307  double plate1x =0.0, plate1y= foam1y;
308  double plate2x =FacePlateThick, plate2y= foam1y;
309  double plate3x =FacePlateThick, plate3y= foam5y;
310  double plate4x =0.0, plate4y= foam5y;
311 
312  plate1y=omega1y; plate4y=omega5y;
313 
314  // ------------------------------------------------------------------------------------------------------------
315  // ------------------------------------------------------------------------------------------------------------
316  // Cableflex shape
317  // vPerpDir perpendicular direction to (foam3,foam4)
318  // ------------------------------------------------------------------------------------------------------------
319  // ------------------------------------------------------------------------------------------------------------
320 
321  double seg1x, seg2x, seg1y, seg2y;
322  seg1x=omega3x; seg1y=omega3y;
323  seg2x=omega4x; seg2y=omega4y;
324 
325  double vDirX=(seg2x-seg1x), vDirY=(seg2y-seg1y);
326  double invNorm=1.0/sqrt(vDirX*vDirX+vDirY*vDirY);
327  vDirX*=invNorm; vDirY*=invNorm;
328  double vPerpDirX=vDirY, vPerpDirY=-vDirX;
329 
330  double foamMidX=m_MidStaveSidePointX+xGblOffset, foamMidY=m_MidStaveSidePointY;
331  foamMidX+=(vPerpDirX*m_SafetyMargin);
332  foamMidY+=(vPerpDirY*m_SafetyMargin);
333  double flexHalfWidth=FlexWidth*0.5;
334  double wingHalfWidth = WingWidth*.5;
335 
336  double flexWingMaxR=0.;
337  double maxFlex1x = foamMidX-(FlexOffset+flexHalfWidth)*vDirX;
338  double maxFlex1y = foamMidY-(FlexOffset+flexHalfWidth)*vDirY;
339  double maxFlex2x = maxFlex1x+MaxFlexThickness*vPerpDirX;
340  double maxFlex2y = maxFlex1y+MaxFlexThickness*vPerpDirY;
341  double maxFlex4x = foamMidX+(-FlexOffset+flexHalfWidth)*vDirX;
342  double maxFlex4y = foamMidY+(-FlexOffset+flexHalfWidth)*vDirY;
343  // double maxFlex3x = maxFlex4x+MaxFlexThickness*vPerpDirX;
344  // double maxFlex3y = maxFlex4y+MaxFlexThickness*vPerpDirY;
345  double maxFlex4x_wings = foamMidX+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirX;
346  double maxFlex4y_wings = foamMidY+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirY;
347  double maxFlex3x_wings = maxFlex4x_wings+MaxFlexThickness*vPerpDirX;
348  double maxFlex3y_wings = maxFlex4y_wings+MaxFlexThickness*vPerpDirY;
349 
350  if(m_gmt_mgr->PixelStaveAxe()==1){
351  wingHalfWidth = WingWidth*.5*.6;
352  maxFlex4x_wings = foamMidX+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirX;
353  maxFlex4y_wings = foamMidY+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirY;
354  maxFlex3x_wings = maxFlex4x_wings+MaxFlexThickness*vPerpDirX;
355  maxFlex3y_wings = maxFlex4y_wings+MaxFlexThickness*vPerpDirY;
356  }
357 
358  // ------------------------------------------------------------------------------------------------------------
359  // ------------------------------------------------------------------------------------------------------------
360  // Stave shape : face plate + foam + cableflex + omega
361  // corresponding physical volume is returned at the end of Build()
362  // ------------------------------------------------------------------------------------------------------------
363  // ------------------------------------------------------------------------------------------------------------
364 
365  // create shape
366  m_basicStaveEnvelopShape = new GeoSimplePolygonBrep(MiddleSectionLength*.5+safetyMarginZ);
367  std::vector<double> xShape, yShape;
368  std::vector<int>iShapeExcept;
369 
370  double yStaveOffset = m_gmt_mgr->IBLStaveMechanicalStaveOffset();
371  double plate1y_tmp = std::min(plate1y,-pm.Width()*.5-yStaveOffset);
372  double omega1y_tmp = std::min(omega1y,-pm.Width()*.5-yStaveOffset);
373 
374  xShape.push_back(plate1x); yShape.push_back(plate1y_tmp); iShapeExcept.push_back(1);
375  xShape.push_back(omega1x); yShape.push_back(omega1y_tmp); iShapeExcept.push_back(0);
376  xShape.push_back(omega2x); yShape.push_back(omega2y); iShapeExcept.push_back(0);
377  xShape.push_back(omega3x); yShape.push_back(omega3y); iShapeExcept.push_back(0);
378 
379  xShape.push_back(maxFlex1x); yShape.push_back(maxFlex1y); iShapeExcept.push_back(0);
380  xShape.push_back(maxFlex2x); yShape.push_back(maxFlex2y); iShapeExcept.push_back(0);
381 
382  xShape.push_back(maxFlex3x_wings); yShape.push_back(maxFlex3y_wings); iShapeExcept.push_back(0);
383  xShape.push_back(maxFlex4x_wings); yShape.push_back(maxFlex4y_wings); iShapeExcept.push_back(0);
384 
385  if(bFlexAndWing){
386  xShape.push_back(maxFlex4x); yShape.push_back(maxFlex4y); iShapeExcept.push_back(1);
387  flexWingMaxR=sqrt((maxFlex3x_wings+layerRadius)*(maxFlex3x_wings+layerRadius)+maxFlex3y_wings*maxFlex3y_wings);
388  }
389 
390  xShape.push_back(omega4x); yShape.push_back(omega4y); iShapeExcept.push_back(0);
391  xShape.push_back(omega5x); yShape.push_back(omega5y); iShapeExcept.push_back(0);
392 
393  xShape.push_back(plate4x); yShape.push_back(plate4y); iShapeExcept.push_back(1);
394 
395  // clean up shape and store points to Brep structure
396 
397  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"Remove points "<<endmsg;
398  GetSurroundingConvexShape(xShape, yShape, std::move(iShapeExcept));
400 
401  for(unsigned int iPt=0; iPt<xShape.size(); iPt++)
402  m_basicStaveEnvelopShape->addVertex(xShape[iPt],yShape[iPt]);
403 
404  // create log and phys volumes
405  const GeoMaterial* envelop_material = m_mat_mgr->getMaterial("std::Air");
406  GeoLogVol * logVol = new GeoLogVol("StaveSupport",m_basicStaveEnvelopShape,envelop_material);
407  GeoPhysVol * logVolPV = new GeoPhysVol(logVol);
408 
409 
410  // ------------------------------------------------------------------------------------------------------------
411  // ------------------------------------------------------------------------------------------------------------
412  // Carbon Foam
413  // ------------------------------------------------------------------------------------------------------------
414  // ------------------------------------------------------------------------------------------------------------
415  GeoSimplePolygonBrep * foam_shape = new GeoSimplePolygonBrep(MiddleSectionLength*.5);
416  foam_shape->addVertex(foam1x,foam1y);
417  foam_shape->addVertex(foam2x,foam2y);
418  foam_shape->addVertex(foam3x,foam3y);
419  foam_shape->addVertex(foam4x,foam4y);
420  foam_shape->addVertex(foam5x,foam5y);
421 
422  const GeoMaterial* foam_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("CarbonFoam",0,0));
423  GeoNameTag* foam_tag = new GeoNameTag("CarbonFoam");
424  GeoTransform* foam_xform = new GeoTransform(GeoTrf::Transform3D::Identity());
425 
426  GeoLogVol * foam_logVol = new GeoLogVol("CarbonFoam",foam_shape,foam_material);
427  GeoPhysVol * foam_logVolPV = new GeoPhysVol(foam_logVol);
428 
429  // ------------------------------------------------------------------------------------------------------------
430  // ------------------------------------------------------------------------------------------------------------
431  // Omega
432  // ------------------------------------------------------------------------------------------------------------
433  // ------------------------------------------------------------------------------------------------------------
434 
435  GeoSimplePolygonBrep * omega_shape = new GeoSimplePolygonBrep(MiddleSectionLength*.5);
436  omega_shape->addVertex(omega1x,omega1y);
437  omega_shape->addVertex(omega2x,omega2y);
438  omega_shape->addVertex(omega3x,omega3y);
439  omega_shape->addVertex(omega4x,omega4y);
440  omega_shape->addVertex(omega5x,omega5y);
441  omega_shape->addVertex(foam5x,foam5y);
442  omega_shape->addVertex(foam4x,foam4y);
443  omega_shape->addVertex(foam3x,foam3y);
444  omega_shape->addVertex(foam2x,foam2y);
445  omega_shape->addVertex(foam1x,foam1y);
446 
447  GeoLogVol * omega_logVol = nullptr;
448  // Create composite material made of omega+glue if a thickness of glue is defined is DB
449  if(OmegaGlueThick<0.0001)
450  {
451  m_gmt_mgr->msg(MSG::INFO)<<"** OMEGA : without Stycast "<<OmegaGlueThick<<endmsg;
452  const GeoMaterial* omega_material = m_mat_mgr->getMaterial("pix::Omega_IBL");
453  // const GeoMaterial* omega_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("Omega",0,0));
454  omega_logVol = new GeoLogVol("Omega",omega_shape,omega_material);
455  }
456  else
457  {
458  m_gmt_mgr->msg(MSG::INFO)<<"** OMEGA : with Stycast "<<OmegaGlueThick<<endmsg;
459  double omegaVolume = omega_shape->volume();
460  double glueVolume = omegaVolume*(OmegaGlueThick/OmegaThick);
461  const std::string compMatName="OmegaGlue_IBL";
462  const GeoMaterial* omega_material = m_mat_mgr->getCompositeMaterialForVolume(compMatName,
463  omegaVolume,
464  omegaVolume,"pix::Omega_IBL",
465  glueVolume,"pix::Stycast2850FT");
466  m_gmt_mgr->msg(MSG::INFO)<<"***> new material : "<<omega_material->getName()<<" "<<omega_material->getDensity()/(GeoModelKernelUnits::gram/Gaudi::Units::cm3)<<endmsg;
467  omega_logVol = new GeoLogVol("Omega",omega_shape,omega_material);
468  }
469 
470  GeoNameTag* omega_tag = new GeoNameTag("Omega");
471  GeoTransform* omega_xform = new GeoTransform(GeoTrf::Transform3D::Identity());
472 
473  // const GeoMaterial* omega_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("Omega",0,0));
474  // GeoNameTag* omega_tag = new GeoNameTag("Omega");
475  // GeoTransform* omega_xform = new GeoTransform(GeoTrf::Transform3D(Gaudi::Units::HepRotation(),GeoTrf::Vector3D()));
476  // GeoLogVol * omega_logVol = new GeoLogVol("Omega",omega_shape,omega_material);
477 
478  GeoPhysVol * omega_logVolPV = new GeoPhysVol(omega_logVol);
479  logVolPV->add(omega_tag);
480  logVolPV->add(omega_xform);
481  logVolPV->add(omega_logVolPV);
482 
483 
484  // ------------------------------------------------------------------------------------------------------------
485  // ------------------------------------------------------------------------------------------------------------
486  // Face plate
487  // ------------------------------------------------------------------------------------------------------------
488  // ------------------------------------------------------------------------------------------------------------
489 
490  GeoBox * faceplate_shape = new GeoBox(FacePlateThick*0.5,MechanicalStaveWidth*0.5,MiddleSectionLength*.5);
491  GeoTrf::Translate3D faceplate_pos((plate1x+plate2x+plate3x+plate4x)*0.25,(plate1y+plate2y+plate3y+plate4y)*0.25,0.0);
492  GeoTransform* faceplate_xform = new GeoTransform(faceplate_pos);
493 
494  std::string faceplateMatName;
495  const GeoMaterial* faceplate_material;
496 
497  // Create composite material made of face plate +glue if a thickness of glue is defined is DB
498  if(FacePlateGlueThick<0.0001)
499  {
500  m_gmt_mgr->msg(MSG::INFO)<<"** FacePlate : without Stycast "<<FacePlateGlueThick<<endmsg;
501  faceplateMatName = "pix::FacePlate_IBL";
502  faceplate_material = m_mat_mgr->getMaterial(faceplateMatName);
503  }
504  else
505  {
506  m_gmt_mgr->msg(MSG::INFO)<<" ** FacePlate : with Stycast "<<FacePlateGlueThick<<" grease : "<<FacePlateGreaseThick<<endmsg;
507  // /!\ : faceplate thickness is already set to faceplate thickness + grease thickness
508  double glueVolume = FacePlateGlueThick*MechanicalStaveWidth*MiddleSectionLength;
509  double facePlateVolume = (FacePlateThick-FacePlateGreaseThick)*MechanicalStaveWidth*MiddleSectionLength;
510 
511  faceplateMatName="FacePlateGlue_IBL";
512  faceplate_material = m_mat_mgr->getCompositeMaterialForVolume(faceplateMatName,
513  facePlateVolume,
514  facePlateVolume,"pix::FacePlate_IBL",
515  glueVolume,"pix::Stycast2850FT");
516  m_gmt_mgr->msg(MSG::INFO)<<"***> new material : "<<faceplate_material->getName()<<" "<<faceplate_material->getDensity()/(GeoModelKernelUnits::gram/Gaudi::Units::cm3)<<endmsg;
517  }
518 
519  // Create composite material made of faceplate + grease if a thickness of grease is defined is DB
520  GeoLogVol * faceplate_logVol = nullptr;
521  if(FacePlateGreaseThick<0.0001)
522  {
523  m_gmt_mgr->msg(MSG::INFO)<<"** FacePlate : without grease"<<endmsg;
524  // const GeoMaterial* faceplate_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("FacePlate",0,0));
525  faceplate_logVol = new GeoLogVol("FacePlate",faceplate_shape,faceplate_material);
526  }
527  else
528  {
529  m_gmt_mgr->msg(MSG::INFO)<<"** FacePlate : with grease"<<endmsg;
530  // /!\ : faceplate thickness is already set to faceplate thickness + grease thickness
531  double greaseVolume = FacePlateGreaseThick*MechanicalStaveWidth*MiddleSectionLength;
532  double facePlateVolume = (FacePlateThick-FacePlateGreaseThick)*MechanicalStaveWidth*MiddleSectionLength;
533 
534  std::string compMatName="FacePlateGrease_IBL";
535  if(FacePlateGlueThick>0.0001) compMatName="FacePlateGlueGrease_IBL";
536  const GeoMaterial* faceplate_material = m_mat_mgr->getCompositeMaterialForVolume(compMatName,
537  facePlateVolume+greaseVolume,
538  facePlateVolume,faceplateMatName,
539  greaseVolume,"pix::ThermGrease_IBL");
540  faceplate_logVol = new GeoLogVol("FacePlate",faceplate_shape,faceplate_material);
541  m_gmt_mgr->msg(MSG::INFO)<<"***> new material : "<<faceplate_material->getName()<<" "<<faceplate_material->getDensity()/(GeoModelKernelUnits::gram/Gaudi::Units::cm3)<<endmsg;
542  }
543 
544  // const GeoMaterial* faceplate_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("FacePlate",0,0));
545  // GeoLogVol * faceplate_logVol = new GeoLogVol("FacePlate",faceplate_shape,faceplate_material);
546  GeoPhysVol * faceplate_logVolPV = new GeoPhysVol(faceplate_logVol);
547  GeoNameTag* faceplate_tag = new GeoNameTag("FacePlate");
548  logVolPV->add(faceplate_tag);
549  logVolPV->add(faceplate_xform);
550  logVolPV->add(faceplate_logVolPV);
551 
552 
553  // ------------------------------------------------------------------------------------------------------------
554  // ------------------------------------------------------------------------------------------------------------
555  // Stave Flex
556  // ------------------------------------------------------------------------------------------------------------
557  // ------------------------------------------------------------------------------------------------------------
558 
559  int ModuleNumber_flex= m_gmt_mgr->IBLStaveModuleNumber_AllPlanar();
560  double ModuleGap_flex= m_gmt_mgr->IBLStaveModuleGap();
561  double ModuleLength_flex=pm.Length();
562 
563  double ModuleTotLength=ModuleLength_flex+ModuleGap_flex;
564  double ModulePosZ=ModuleTotLength*0.5;
565  int NbModuleRL=ModuleNumber_flex/2;
566  if(ModuleNumber_flex%2==1)
567  {
568  ModulePosZ=0.0;
569  NbModuleRL+=1;
570  }
571  double FlexThicknessRL=FlexBaseThick;
572  double flex_angle=((maxFlex1x-maxFlex4x)*(foam1x-foam5x)+(maxFlex1y-maxFlex4y)*(foam1y-foam5y))/(FlexWidth*FoamBaseWidth);
573  flex_angle=acos(flex_angle);
574  const GeoMaterial* cableflex_material = m_mat_mgr->getMaterial("pix::CableFlex_IBL");
575  //double flexDensity=cableflex_material->getDensity();
576 
577  m_gmt_mgr->msg(MSG::INFO)<<"Flex angle : "<<flex_angle<<" Flex pos. in Z : ";
578  double EndblockFlexXpos=0.;
579  double EndblockFlexYpos=0.;
580  double EndblockFlexThickness=0.;
581 
582  double wingZmin=0., wingZmax=0.;
583  int nbModuleSvc = m_gmt_mgr->PixelModuleServiceNumber();
584  GeoLogVol * wingflex_logVol = nullptr;
585  double wingFlexPosX = 0.;
586  double wingFlexPosY = 0.;
587 
588  for(int iModule=0; iModule<NbModuleRL; iModule++)
589  {
590 
591  double flexGapZ=0.;
592 
593  // Add flex over stave end block
594  if(iModule==NbModuleRL-1)
595  {
596  wingZmax=ModulePosZ+ModuleTotLength*0.5;
597  double delta=MiddleSectionLength*0.5-(ModulePosZ+ModuleTotLength*0.5);
598  ModulePosZ+=delta*0.5;
599  ModuleTotLength+=delta;
600  // ModulePosZ+=(MechanicalStaveEndBlockLength+lgNAStave)*0.5;
601  // ModuleTotLength+=MechanicalStaveEndBlockLength+lgNAStave;
602  }
603  else if(iModule==0){
604  flexGapZ = FlexStaveMiddleGap;
605  wingZmin = flexGapZ;
606  }
607 
608  // Box and coordinates
609  GeoBox * cableflex_shape = new GeoBox(FlexThicknessRL*0.5,FlexWidth*0.5,(ModuleTotLength-m_SafetyMargin-flexGapZ)*.5);
610 
611  double flex1x = foamMidX-(FlexOffset+flexHalfWidth)*vDirX;
612  double flex1y = foamMidY-(FlexOffset+flexHalfWidth)*vDirY;
613  double flex2x = flex1x+FlexThicknessRL*vPerpDirX;
614  double flex2y = flex1y+FlexThicknessRL*vPerpDirY;
615  double flex4x = foamMidX+(-FlexOffset+flexHalfWidth)*vDirX;
616  double flex4y = foamMidY+(-FlexOffset+flexHalfWidth)*vDirY;
617  double flex3x = flex4x+FlexThicknessRL*vPerpDirX;
618  double flex3y = flex4y+FlexThicknessRL*vPerpDirY;
619 
620  // flex name
621  std::ostringstream lname;
622  int iFlexModule=(ModuleNumber_flex%2==0)?(iModule+1):iModule;
623  lname << "StaveFlex_"<<iFlexModule;
624  if(!(ModuleNumber_flex%2==1&&iModule==0))lname<<"A";
625 
626  // scaled material
627  const GeoMaterial* scaledFlexMaterial=nullptr;
628  if(bFlexAndWing){
629  std::string flexMatName=m_gmt_mgr->IBLFlexMaterial(iModule+1,"staveA");
630  scaledFlexMaterial= m_mat_mgr->getMaterial(flexMatName);
631  }
632 //They are commented off due to the judgement in Line 177 about bFlexAndWing and bFlexConstantThickness.
633 //But we keep it here in case they are needed in the future.
634 // else if(bFlexConstantThickness){
635 // std::ostringstream tmp;
636 // tmp<<"Staveflex"<<iModule+1<<"_IBL";
637 // scaledFlexMaterial= m_mat_mgr->getMaterial("pix::CableFlex_IBL", flexDensity*(iModule+1), tmp.str());
638 // }
639 
640  // Add flex in 3D model : A component
641  GeoTrf::Translation3D cableflex_pos((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,ModulePosZ+flexGapZ*0.5);
642  // GeoTransform* cableflex_xform = new GeoTransform(GeoTrf::Transform3D(Gaudi::Units::HepRotation(0.0,0.0,-fabs(flex_angle)),cableflex_pos));
643  GeoTransform* cableflex_xform = new GeoTransform(GeoTrf::Transform3D(cableflex_pos*GeoTrf::RotateZ3D(fabs(flex_angle))));
644 
645  GeoLogVol * cableflex_logVol = nullptr;
646  if(bFlexAndWing||bFlexConstantThickness)
647  cableflex_logVol= new GeoLogVol(lname.str(),cableflex_shape,scaledFlexMaterial);
648  else
649  cableflex_logVol= new GeoLogVol(lname.str(),cableflex_shape,cableflex_material);
650 
651  // Wing flex ( second version - not smeared )
652  if(nbModuleSvc>0)
653  {
654  std::ostringstream wingName;
655  wingName << "WingFlex";
656 
657  if(iModule==0)
658  {
659  WingThick = 0.06;
660  double flex1x_tmp = flex4x;
661  double flex1y_tmp = flex4y;
662  double flex2x_tmp = flex4x+2.*wingHalfWidth*vDirX;
663  double flex2y_tmp = flex4y+2.*wingHalfWidth*vDirY;
664  double flex4x_tmp = flex1x_tmp+WingThick*vPerpDirX;
665  double flex4y_tmp = flex1y_tmp+WingThick*vPerpDirY;
666  double flex3x_tmp = flex2x_tmp+WingThick*vPerpDirX;
667  double flex3y_tmp = flex2y_tmp+WingThick*vPerpDirY;
668 
669  maxFlex3x_wings = flex3x_tmp;
670  maxFlex3y_wings = flex3y_tmp;
671  maxFlex4x_wings = flex4x_tmp;
672  maxFlex4y_wings = flex4y_tmp;
673  wingFlexPosX = (flex1x_tmp+flex2x_tmp+flex3x_tmp+flex4x_tmp)*0.25;
674  wingFlexPosY = (flex1y_tmp+flex2y_tmp+flex3y_tmp+flex4y_tmp)*0.25;
675 
676  double wingHalfLength = 12.15*.5;
677  GeoBox* wingflex_shape = new GeoBox(WingThick*0.5,wingHalfWidth,wingHalfLength);
678 
679  // flex name
680  const GeoMaterial* wingflex_material= m_mat_mgr->getMaterialForVolume("pix::WingFlexTop",wingflex_shape->volume()) ;
681  wingflex_logVol = new GeoLogVol(wingName.str(),wingflex_shape,wingflex_material);
682  }
683 
684 
685  // Add flex in 3D model : A component
686 
687  double zPos = (iModule+.5)*ModuleLength_flex+(iModule+.5)*ModuleGap_flex;
688  GeoTrf::Translation3D wingflex_posA(wingFlexPosX, wingFlexPosY , zPos-ModuleLength_flex*.25);
689  GeoTransform* wingflex_xformA = new GeoTransform(GeoTrf::Transform3D(wingflex_posA*GeoTrf::RotateZ3D(fabs(flex_angle))));
690 
691  GeoPhysVol * wingflex_logVolPV_1 = new GeoPhysVol(wingflex_logVol);
692  GeoNameTag* wingflex_tag = new GeoNameTag(wingName.str());
693  logVolPV->add(wingflex_tag);
694  logVolPV->add(wingflex_xformA);
695  logVolPV->add(wingflex_logVolPV_1);
696 
697  GeoTrf::Translation3D wingflex_posA_2(wingFlexPosX, wingFlexPosY , zPos+ModuleLength_flex*.25);
698  GeoTransform* wingflex_xformA_2 = new GeoTransform(GeoTrf::Transform3D(wingflex_posA_2*GeoTrf::RotateZ3D(fabs(flex_angle))));
699 
700  GeoPhysVol * wingflex_logVolPV_2 = new GeoPhysVol(wingflex_logVol);
701  logVolPV->add(wingflex_tag);
702  logVolPV->add(wingflex_xformA_2);
703  logVolPV->add(wingflex_logVolPV_2);
704 
705 
706  // Add flex in 3D model : C component
707  GeoTrf::Translation3D wingflex_posC(wingFlexPosX, wingFlexPosY , -zPos-ModuleLength_flex*.25);
708  GeoTransform* wingflex_xformC = new GeoTransform(GeoTrf::Transform3D(wingflex_posC*GeoTrf::RotateZ3D(fabs(flex_angle))));
709 
710  GeoPhysVol * wingflex_logVolPV_C1 = new GeoPhysVol(wingflex_logVol);
711  logVolPV->add(wingflex_tag);
712  logVolPV->add(wingflex_xformC);
713  logVolPV->add(wingflex_logVolPV_C1);
714 
715  GeoTrf::Translation3D wingflex_posC_2(wingFlexPosX, wingFlexPosY , -zPos+ModuleLength_flex*.25);
716  GeoTransform* wingflex_xformC_2 = new GeoTransform(GeoTrf::Transform3D(wingflex_posC_2*GeoTrf::RotateZ3D(fabs(flex_angle))));
717 
718  GeoPhysVol * wingflex_logVolPV_C2 = new GeoPhysVol(wingflex_logVol);
719  logVolPV->add(wingflex_tag);
720  logVolPV->add(wingflex_xformC_2);
721  logVolPV->add(wingflex_logVolPV_C2);
722 
723  }
724 
725  GeoPhysVol * cableflex_logVolPV = new GeoPhysVol(cableflex_logVol);
726  GeoNameTag* cableflex_tag = new GeoNameTag(lname.str());
727  logVolPV->add(cableflex_tag);
728  logVolPV->add(cableflex_xform);
729  logVolPV->add(cableflex_logVolPV);
730 
731  m_gmt_mgr->msg(MSG::INFO)
732  << "(" << cableflex_pos.x() << "," << cableflex_pos.y() << "," << cableflex_pos.z() << ")"
733  << " " << FlexThicknessRL<<" / ";
734 
735  // Add flex in 3D model : C component
736  if((ModuleNumber_flex%2==1&&iModule>0)||ModuleNumber_flex%2==0)
737  {
738  std::ostringstream lname;
739  lname << "StaveFlex_"<<iFlexModule<<"C";
740 
741  GeoTrf::Translation3D cableflex_pos2((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,-ModulePosZ-flexGapZ*0.5);
742  GeoTransform* cableflex_xform2 = new GeoTransform(GeoTrf::Transform3D(cableflex_pos2*GeoTrf::RotateZ3D(fabs(flex_angle))));
743  GeoLogVol * cableflex_logVol = nullptr;
744 
745  const GeoMaterial* scaledFlexMaterial=nullptr;
746  if(bFlexAndWing){
747  std::string flexMatName=m_gmt_mgr->IBLFlexMaterial(iModule+1,"staveC");
748  scaledFlexMaterial= m_mat_mgr->getMaterial(flexMatName);
749  }
750  //They are commented off due to the judgement in Line 177 about bFlexAndWing and bFlexConstantThickness.
751  //But we keep it here in case they are needed in the future.
752  //else if(bFlexConstantThickness){
753  // std::ostringstream tmp;
754  // tmp<<"Staveflex"<<iModule+1<<"_IBL";
755  // scaledFlexMaterial= m_mat_mgr->getMaterial("pix::CableFlex_IBL", flexDensity*(iModule+1), tmp.str());
756  //}
757 
758  if(bFlexAndWing||bFlexConstantThickness)
759  cableflex_logVol= new GeoLogVol(lname.str(),cableflex_shape,scaledFlexMaterial);
760  else
761  cableflex_logVol= new GeoLogVol(lname.str(),cableflex_shape,cableflex_material);
762  GeoPhysVol * cableflex_logVolPV = new GeoPhysVol(cableflex_logVol);
763  GeoNameTag* cableflex_tag = new GeoNameTag(lname.str());
764  logVolPV->add(cableflex_tag);
765  logVolPV->add(cableflex_xform2);
766  logVolPV->add(cableflex_logVolPV);
767  }
768 
769  // Save data for endblock flex
770  if(iModule==NbModuleRL-1)
771  {
772  EndblockFlexXpos=(flex1x+flex2x+flex3x+flex4x)*0.25;
773  EndblockFlexYpos=(flex1y+flex2y+flex3y+flex4y)*0.25;
774  EndblockFlexThickness=FlexThicknessRL;
775  }
776 
777  ModulePosZ+=ModuleTotLength;
778  if(!bFlexConstantThickness)
779  FlexThicknessRL+=FlexLayerThick;
780  }
781 
782  m_gmt_mgr->msg(MSG::INFO)<<endmsg;
783 
784  // ------------------------------------------------------------------------------------------------------------
785  // ------------------------------------------------------------------------------------------------------------
786  // Wings Flex
787  // ------------------------------------------------------------------------------------------------------------
788  // ------------------------------------------------------------------------------------------------------------
789 
790  if(bFlexAndWing&&nbModuleSvc==0) // old wing flex definition
791  {
792  m_gmt_mgr->msg(MSG::INFO)<<"Wings : "<< FlexOffset<<" "<<flexHalfWidth<<endmsg;
793 
794  double wingPos = FlexOffset+flexHalfWidth+2.*m_SafetyMargin+0.5; // SES - fixme
795  double flex1x = foamMidX+(wingPos+wingHalfWidth)*vDirX;
796  double flex1y = foamMidY+(wingPos+wingHalfWidth)*vDirY;
797  double flex2x = flex1x+WingThick*vPerpDirX;
798  double flex2y = flex1y+WingThick*vPerpDirY;
799  double flex4x = foamMidX+(wingPos)*vDirX;
800  double flex4y = foamMidY+(wingPos)*vDirY;
801  double flex3x = flex4x+WingThick*vPerpDirX;
802  double flex3y = flex4y+WingThick*vPerpDirY;
803 
804  GeoBox* wingflex_shape = new GeoBox(WingThick*0.5,wingHalfWidth-m_SafetyMargin,(wingZmax-wingZmin)*.5);
805 
806  // flex name
807  std::ostringstream wingName;
808  wingName << "WingFlex";
809 
810  // Add flex in 3D model : A component
811  GeoTrf::Vector3D wingflex_posA((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,(wingZmax-wingZmin)*.5+FlexStaveMiddleGap);
812  GeoTransform* wingflex_xformA = new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(0.0,0.0,std::abs(flex_angle)),wingflex_posA));
813 
814  const GeoMaterial* wingflex_material= m_mat_mgr->getMaterial("pix::WingFlexA");
815  GeoLogVol * wingflex_logVol = new GeoLogVol(wingName.str(),wingflex_shape,wingflex_material);
816 
817  GeoPhysVol * wingflex_logVolPV = new GeoPhysVol(wingflex_logVol);
818  GeoNameTag* wingflex_tag = new GeoNameTag(wingName.str());
819  logVolPV->add(wingflex_tag);
820  logVolPV->add(wingflex_xformA);
821  logVolPV->add(wingflex_logVolPV);
822 
823  GeoTrf::Vector3D wingflex_posC((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,-((wingZmax-wingZmin)*.5+FlexStaveMiddleGap));
824  GeoTransform* wingflex_xformC = new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(0.0,0.0,std::abs(flex_angle)),wingflex_posC));
825  logVolPV->add(wingflex_tag);
826  logVolPV->add(wingflex_xformC);
827  logVolPV->add(wingflex_logVolPV);
828  }
829 
830  // ------------------------------------------------------------------------------------------------------------
831  // ------------------------------------------------------------------------------------------------------------
832  // Cooling pipe
833  // ------------------------------------------------------------------------------------------------------------
834  // ------------------------------------------------------------------------------------------------------------
835  const GeoTube* coolingPipe = new GeoTube(0.0,TubeOuterDiam*0.5,MiddleSectionLength*0.5);
836  const GeoTube* coolingPipeInner = new GeoTube(0.0,TubeInnerDiam*0.5,MiddleSectionLength*0.5);
837 
838  GeoLogVol * cp_logVol = nullptr;
839  // Create composite material made of omega+glue if a thickness of glue is defined is DB
840  if(TubeGlueThick<0.0001)
841  {
842  m_gmt_mgr->msg(MSG::INFO)<<"** TUBE : without Stycast "<<TubeGlueThick<<endmsg;
843  const GeoMaterial* cp_material = m_mat_mgr->getMaterial("pix::CoolingPipe_IBL");
844  cp_logVol = new GeoLogVol("CoolingPipe",coolingPipe,cp_material);
845  }
846  else
847  {
848  m_gmt_mgr->msg(MSG::INFO)<<"** TUBE : with Stycast "<<TubeGlueThick<<" diam "<<TubeOuterDiam*0.5<<" "<<TubeInnerDiam*0.5<<endmsg;
849  double glueVolume = (TubeOuterDiam*0.5+TubeGlueThick)*(TubeOuterDiam*0.5+TubeGlueThick)*M_PI*MiddleSectionLength;
850  double tubeOuterVolume = TubeOuterDiam*TubeOuterDiam*0.25*M_PI*MiddleSectionLength;
851  double tubeInnerVolume = TubeInnerDiam*TubeInnerDiam*0.25*M_PI*MiddleSectionLength;
852 
853  const std::string compMatName="CoolingPipeGlue_IBL";
854  const GeoMaterial* cp_material = m_mat_mgr->getCompositeMaterialForVolume(compMatName,
855  tubeOuterVolume-tubeInnerVolume,
856  tubeOuterVolume-tubeInnerVolume,"pix::CoolingPipe_IBL",
857  glueVolume-tubeOuterVolume,"pix::Stycast2850FT");
858  m_gmt_mgr->msg(MSG::INFO)<<"***> new material : "<<cp_material->getName()<<" "<<cp_material->getDensity()/(GeoModelKernelUnits::gram/Gaudi::Units::cm3)<<endmsg;
859  cp_logVol = new GeoLogVol("CoolingPipe",coolingPipe,cp_material);
860  }
861 
862  GeoPhysVol * cp_logPV = new GeoPhysVol(cp_logVol);
863 
864 // const GeoMaterial* cp_material = m_mat_mgr->getMaterial("std::Titanium");
865 // GeoLogVol * cp_log = new GeoLogVol("CoolingPipe",coolingPipe,cp_material);
866 // GeoPhysVol * cp_logPV = new GeoPhysVol(cp_log);
867 
868  GeoNameTag* cp_tag = new GeoNameTag("CoolingPipe");
869  GeoTrf::Translate3D cp_pos(xGblOffset+TubeMiddlePos,0.0,0.0);
870  GeoTransform* cp_xform = new GeoTransform(cp_pos);
871  foam_logVolPV->add(cp_tag);
872  foam_logVolPV->add(cp_xform);
873  foam_logVolPV->add(cp_logPV);
874 
875  // const GeoTube* coolingPipeInner = new GeoTube(0.0,TubeInnerDiam*0.5,MiddleSectionLength*0.5);
876  const GeoMaterial* cp_inner_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("CoolingFluid",0,0));
877  GeoLogVol * cp_inner_log = new GeoLogVol("CoolingPipeInner",coolingPipeInner,cp_inner_material);
878  GeoPhysVol * cp_inner_logPV = new GeoPhysVol(cp_inner_log);
879 
880  GeoNameTag* cp_inner_tag = new GeoNameTag("CoolingPipeInner");
881  GeoTransform* cp_inner_xform = new GeoTransform(GeoTrf::Transform3D::Identity());
882  cp_logPV->add(cp_inner_tag);
883  cp_logPV->add(cp_inner_xform);
884  cp_logPV->add(cp_inner_logPV);
885 
886  logVolPV->add(foam_tag);
887  logVolPV->add(foam_xform);
888  logVolPV->add(foam_logVolPV);
889 
890 
891 
892  // ------------------------------------------------------------------------------------------------------------
893  // ------------------------------------------------------------------------------------------------------------
894  // ------------------------------------------------------------------------------------------------------------
895  // Stave end blocks and services in stave ring support area ( GeoModel volume build in GeoPixelLayer class)
896  // ------------------------------------------------------------------------------------------------------------
897  // ------------------------------------------------------------------------------------------------------------
898  // ------------------------------------------------------------------------------------------------------------
899 
900  m_endblockAPhysVol=nullptr;
901  m_endblockCPhysVol=nullptr;
902  m_endblockZpos=0.;
903  m_endblockLength=0.;
904  m_endblockFlexPhysVol=nullptr;
905  m_endblockFlexTrf=nullptr;
906 
907  m_endblockLength=MechanicalStaveEndBlockLength-safetyMarginZ*4.;
908 
910  double doglegFlexLength=FlexDogLeg_length;
911  if(bFlexAndWing)
912  m_endblockSrvLength=FlexEOS_zpos-totalStaveLength*.5;
913 
914  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"FLEX PP0 srv : "<< m_endblockSrvLength<<" + "<<doglegFlexLength<<endmsg;
915 
916 
917 
918  // ----------- End block : Carbon Foam
919  // ------------------------------------------------------------------------------------------------------------
920 
921  GeoSimplePolygonBrep * endblock_shape = new GeoSimplePolygonBrep(m_endblockLength*.5+safetyMarginZ);
922  endblock_shape->addVertex(plate1x,plate1y);
923  endblock_shape->addVertex(omega1x,omega1y);
924  endblock_shape->addVertex(omega2x,omega2y);
925  endblock_shape->addVertex(omega3x,omega3y);
926  endblock_shape->addVertex(omega4x,omega4y);
927  endblock_shape->addVertex(omega5x,omega5y);
928  endblock_shape->addVertex(plate4x,plate4y);
929 
930  const GeoMaterial* endblock_material_weight = m_mat_mgr->getMaterialForVolume("pix::EndblockA_IBLwght",endblock_shape->volume());
931  GeoLogVol * endblock_logVol = nullptr;
932  GeoLogVol * endblockA_logVol = nullptr;
933  GeoLogVol * endblockC_logVol = nullptr;
934  if(endblock_material_weight){
935  double endblockOmegaOverlap=m_gmt_mgr->IBLStaveMechanicalStaveEndBlockOmegaOverlap();
936  double omegaStaveVolume = omega_shape->volume();
937  double omegaVolume = omegaStaveVolume*endblockOmegaOverlap/omegaStaveVolume;
938  double endblockVolume = endblock_shape->volume();
939 
940  const std::string compMatNameA="EndblockOgA_IBL";
941  const GeoMaterial* endblockA_omega_material = m_mat_mgr->getCompositeMaterialForVolume(compMatNameA,
942  endblockVolume+omegaVolume,
943  omegaVolume,"pix::Omega_IBL",
944  endblockVolume,"pix::EndblockA_IBLwght");
945 
946  endblockA_logVol = new GeoLogVol("EndBlock",endblock_shape,endblockA_omega_material);
947  m_endblockAPhysVol = new GeoPhysVol(endblockA_logVol);
948 
949  const std::string compMatNameC="EndblockOgC_IBL";
950  const GeoMaterial* endblockC_omega_material = m_mat_mgr->getCompositeMaterialForVolume(compMatNameC,
951  endblockVolume+omegaVolume,
952  omegaVolume,"pix::Omega_IBL",
953  endblockVolume,"pix::EndblockC_IBLwght");
954  endblockC_logVol = new GeoLogVol("EndBlock",endblock_shape,endblockC_omega_material);
955  m_endblockCPhysVol = new GeoPhysVol(endblockC_logVol);
956 
957  }
958  else {
959  const GeoMaterial* endblock_material = m_mat_mgr->getMaterial("pix::EndBlock_IBL");
960  endblock_logVol = new GeoLogVol("EndBlock",endblock_shape,endblock_material);
961  m_endblockAPhysVol = new GeoPhysVol(endblock_logVol);
962  }
963 
964  // const GeoMaterial* endblock_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("EndBlock",0,0));
965  // GeoNameTag* endblock_tag = new GeoNameTag("EndBlock");
966  // GeoLogVol * endblock_logVol = new GeoLogVol("EndBlock",endblock_shape,endblock_material);
967  // GeoPhysVol * endblock_logVolPV = new GeoPhysVol(endblock_logVol);
968 
969 
970  // ----------- End block : Cooling pipe
971  // ------------------------------------------------------------------------------------------------------------
972 
973  const GeoTube* endblock_coolingPipe = new GeoTube(0.0,TubeOuterDiam*0.5,m_endblockLength*.5);
974 
975  const GeoMaterial* cp_endblock_material = m_mat_mgr->getMaterial("pix::CoolingPipe_IBL");
976  GeoLogVol * cp_endblock_log = new GeoLogVol("EndBlockCoolingPipe",endblock_coolingPipe,cp_endblock_material);
977  GeoPhysVol * cp_endblock_logPV = new GeoPhysVol(cp_endblock_log);
978 
979  GeoNameTag* cp_endblock_tag = new GeoNameTag("EndBlockCoolingPipe");
980  GeoTrf::Translate3D cp_endblock_pos(xGblOffset+TubeMiddlePos,0.0,0.0);
981  GeoTransform* cp_endblock_xform = new GeoTransform(cp_endblock_pos);
982  m_endblockAPhysVol->add(cp_endblock_tag);
983  m_endblockAPhysVol->add(cp_endblock_xform);
984  m_endblockAPhysVol->add(cp_endblock_logPV);
985  if(m_endblockCPhysVol){
986  m_endblockCPhysVol->add(cp_endblock_tag);
987  m_endblockCPhysVol->add(cp_endblock_xform);
988  m_endblockCPhysVol->add(cp_endblock_logPV);
989  }
990 
991  const GeoTube* endblock_coolingPipeInner = new GeoTube(0.0,TubeInnerDiam*0.5,m_endblockLength*.5);
992  const GeoMaterial* cp_endblock_inner_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("CoolingFluid",0,0));
993  GeoLogVol * cp_endblock_inner_log = new GeoLogVol("EndBlockCoolingPipeInner",endblock_coolingPipeInner,cp_endblock_inner_material);
994  GeoPhysVol * cp_endblock_inner_logPV = new GeoPhysVol(cp_endblock_inner_log);
995 
996  GeoNameTag* cp_endblock_inner_tag = new GeoNameTag("EndBlockCoolingPipeInner");
997  GeoTransform* cp_endblock_inner_xform = new GeoTransform(GeoTrf::Transform3D::Identity());
998  cp_endblock_logPV->add(cp_endblock_inner_tag);
999  cp_endblock_logPV->add(cp_endblock_inner_xform);
1000  cp_endblock_logPV->add(cp_endblock_inner_logPV);
1001 
1002  m_serviceZpos=MechanicalStaveLength*0.5-m_endblockLength+(m_endblockLength+m_endblockSrvLength)*0.5;
1003  m_endblockZpos=MechanicalStaveLength*0.5-m_endblockLength*0.5;
1004 
1005  m_gmt_mgr->msg(MSG::INFO)<<"IBL EOS : mechanical stave length : "<<MechanicalStaveLength*0.5<<endmsg;
1006  m_gmt_mgr->msg(MSG::INFO)<<"IBL EOS : service Zpos : "<<m_serviceZpos<<endmsg;
1007  m_gmt_mgr->msg(MSG::INFO)<<"IBL EOS : endblock Zpos : "<<m_endblockZpos<<endmsg;
1008  m_gmt_mgr->msg(MSG::INFO)<<"IBL EOS : endblock length : "<<m_endblockLength<<endmsg;
1009  m_gmt_mgr->msg(MSG::INFO)<<"IBL EOS : endblock srv length : "<<m_endblockSrvLength<<endmsg;
1010 
1011 
1012  // ----------- Flex running on the top of End block & service
1013  // ------------------------------------------------------------------------------------------------------------
1014 
1015  // Box and coordinates
1016  GeoBox * cableflex_shape = new GeoBox(EndblockFlexThickness*0.5,FlexWidth*0.5,(m_endblockLength+m_endblockSrvLength)*.5);
1017 
1018  const GeoMaterial* scaledFlexMaterial=nullptr;
1019  if(bFlexAndWing){
1020  std::string flexMatName=m_gmt_mgr->IBLFlexMaterial(1,"doglegA");
1021  scaledFlexMaterial= m_mat_mgr->getMaterial(flexMatName);
1022  }
1023  //They are commented off due to the judgement in Line 177 about bFlexAndWing and bFlexConstantThickness.
1024  //But we keep it here in case they are needed in the future.
1025  //else if(bFlexConstantThickness){
1026  // std::ostringstream tmp;
1027  // tmp<<"CableFlex_IBL";
1028  // scaledFlexMaterial= m_mat_mgr->getMaterial("pix::CableFlex_IBL", flexDensity*(ModuleNumber_flex/2+1), tmp.str());
1029  //}
1030  else{
1031  scaledFlexMaterial= m_mat_mgr->getMaterial("pix::CableFlex_IBL");
1032  }
1033 
1034  // flex name
1035  std::ostringstream lname;
1036  lname << "SrvEndblockFlex";
1037 
1038  // Add flex in 3D model : A component
1039  // GeoNameTag* cableflex_tag = new GeoNameTag(lname.str());
1040  GeoTrf::Vector3D cableflex_pos(EndblockFlexXpos,EndblockFlexYpos,0.);
1041  m_endblockFlexTrf = new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(0.0,0.0, std::abs(flex_angle)),cableflex_pos));
1042  GeoLogVol * cableflex_logVol = new GeoLogVol(lname.str(),cableflex_shape,scaledFlexMaterial);
1043  m_endblockFlexPhysVol = new GeoPhysVol(cableflex_logVol);
1044 
1045  m_gmt_mgr->msg(MSG::INFO)<<"Flex half thickness srv : "<<EndblockFlexThickness<<endmsg;
1046 
1047  // ----------- service cooling pipe
1048  // ------------------------------------------------------------------------------------------------------------
1049 
1050  m_serviceCoolPipePhysVol = nullptr;
1051  m_serviceCoolPipeTrfA = nullptr;
1052  m_serviceCoolPipeTrfC = nullptr;
1053 
1054  if(bFlexAndWing){
1055 
1056  const GeoTube* service_coolingPipe = new GeoTube(0.0,TubeOuterDiam*0.5,m_endblockSrvLength*.5+doglegFlexLength*.5-2*safetyMarginZ);
1057 
1058  const GeoMaterial* cp_service_material = m_mat_mgr->getMaterial("pix::CoolingPipe_IBL");
1059  GeoLogVol * cp_service_log = new GeoLogVol("SrvCoolingPipe",service_coolingPipe,cp_service_material);
1060  m_serviceCoolPipePhysVol = new GeoPhysVol(cp_service_log);
1061 
1062 // GeoNameTag* cp_service_tag = new GeoNameTag("ServiceCoolingPipe");
1063 // GeoTrf::Vector3D cp_service_pos(xGblOffset+TubeMiddlePos,0.0,0.0);
1064 // GeoTransform* cp_service_xform = new GeoTransform(GeoTrf::Transform3D(Gaudi::Units::HepRotation(),cp_service_pos));
1065 // // service_logVolPV->add(cp_service_tag);
1066 // // service_logVolPV->add(cp_service_xform);
1067 // // service_logVolPV->add(cp_service_logPV);
1068 // m_serviceCoolPipePhysVol->add(cp_service_tag);
1069 // m_serviceCoolPipePhysVol->add(cp_service_xform);
1070 // m_serviceCoolPipePhysVol->add(cp_service_logPV);
1071 
1072  const GeoTube* service_coolingPipeInner = new GeoTube(0.0,TubeInnerDiam*0.5,m_endblockSrvLength*.5+doglegFlexLength*.5-2*safetyMarginZ);
1073  const GeoMaterial* cp_service_inner_material = m_mat_mgr->getMaterial(m_gmt_mgr->getMaterialName("CoolingFluid",0,0));
1074  GeoLogVol * cp_service_inner_log = new GeoLogVol("SrvCoolingPipeInner",service_coolingPipeInner,cp_service_inner_material);
1075  GeoPhysVol * cp_service_inner_logPV = new GeoPhysVol(cp_service_inner_log);
1076 
1077  GeoNameTag* cp_service_inner_tag = new GeoNameTag("SrvCoolingPipeInner");
1078  GeoTransform* cp_service_inner_xform = new GeoTransform(GeoTrf::Transform3D::Identity());
1079  m_serviceCoolPipePhysVol->add(cp_service_inner_tag);
1080  m_serviceCoolPipePhysVol->add(cp_service_inner_xform);
1081  m_serviceCoolPipePhysVol->add(cp_service_inner_logPV);
1082 
1083  GeoTrf::Translate3D cpipe_posA(xGblOffset+TubeMiddlePos,0.0,(MechanicalStaveLength*0.5+m_endblockSrvLength*0.5)-m_serviceZpos);
1084  m_serviceCoolPipeTrfA = new GeoTransform(GeoTrf::Transform3D(std::move(cpipe_posA)));
1085 
1086  GeoTrf::Translate3D cpipe_posC(xGblOffset+TubeMiddlePos,0.0,-((MechanicalStaveLength*0.5+m_endblockSrvLength*0.5)-m_serviceZpos));
1087  m_serviceCoolPipeTrfC = new GeoTransform(GeoTrf::Transform3D(std::move(cpipe_posC)));
1088  }
1089 
1090  // ------------------------------------------------------------------------------------------------------------
1091  // ------------------------------------------------------------------------------------------------------------
1092  // Compute (stave + module) envelopp, stave HEPtransform and stave thickness N&P
1093  // ------------------------------------------------------------------------------------------------------------
1094  // ------------------------------------------------------------------------------------------------------------
1095  computeStaveEnvelopTransformAndSize(pmThicknessN,pmThicknessP,pmWidth,
1096  pmThicknessN3D,pmThicknessP3D,pmShilftLateral3D);
1097 
1098  if(m_bVerbose){
1099  m_gmt_mgr->msg(MSG::DEBUG)<<"Max thickness N/P : "<<m_thicknessN<<" "<<m_thicknessP<<endmsg;
1100  m_gmt_mgr->msg(MSG::DEBUG)<<"Max thickness P : "<<m_thicknessP+layerRadius<<" "<<flexWingMaxR<<endmsg;
1101  m_gmt_mgr->msg(MSG::DEBUG)<<"Max thickness N : "<<-m_thicknessN+layerRadius<<" "<<-m_thicknessN-radialShiftThickN+layerRadius<<" "<<radialShiftThickN<<endmsg;
1102  }
1103 
1104  if(bFlexAndWing){
1105  if(flexWingMaxR>layerRadius+m_thicknessP)m_thicknessP=flexWingMaxR-layerRadius;
1106  m_thicknessP+=0.11; // SES - fixme
1107  }
1108  m_thicknessN+=radialShiftThickN+.11; // SES - fixme
1109 
1110  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"Max thickness -> output N/P : "<<m_thicknessN<<" "<<m_thicknessP<<endmsg;
1111 
1112  //********** return stave phys. vol. (= face plate + foam + cable flex + end blocks) *********************
1113 
1114  return logVolPV;
1115 
1116 }

◆ ComputeAngle()

double GeoPixelDetailedStaveSupport::ComputeAngle ( double  ux,
double  uy,
double  vx,
double  vy 
)
private

Definition at line 1677 of file GeoPixelDetailedStaveSupport.cxx.

1678 {
1679 
1680  GeoTrf::Vector3D u(ux,uy,0.0);
1681  GeoTrf::Vector3D v(vx,vy,0.0);
1682 
1683  GeoTrf::Vector3D uNorm=NormalizeDir(std::move(u));
1684  GeoTrf::Vector3D vNorm=NormalizeDir(std::move(v));
1685 
1686  double pScal=uNorm.x()*vNorm.x()+uNorm.y()*vNorm.y();
1687  double angle=acos(pScal);
1688 
1689  return angle;
1690 }

◆ ComputeDistance()

double GeoPixelDetailedStaveSupport::ComputeDistance ( GeoTrf::Vector3D  p,
GeoTrf::Vector3D  q 
)
private

Definition at line 1692 of file GeoPixelDetailedStaveSupport.cxx.

1693 {
1694  return sqrt((q.x()-p.x())*(q.x()-p.x())+(q.y()-p.y())*(q.y()-p.y()));
1695 }

◆ computeStaveEnvelopShape()

GeoSimplePolygonBrep * GeoPixelDetailedStaveSupport::computeStaveEnvelopShape ( double  safetyMargin)
overridevirtual

Implements GeoPixelStaveSupport.

Definition at line 1233 of file GeoPixelDetailedStaveSupport.cxx.

1234 {
1235 
1236  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"GeoSimplePolygonBrep* GeoPixelDetailedStaveSupport::computeStaveEnvelopShape( double safetyMargin )"<<endmsg;
1237 
1238  if(safetyMargin<0 || m_staveEnvelopShape==nullptr || m_staveEnvelopShape->getNVertices()<=0)
1239  return m_staveEnvelopShape;
1240 
1241  // stave envelop shape (translated vs stave offsets / module)
1242  int nbVertices=m_staveEnvelopShape->getNVertices();
1243  double shapeDZ=m_staveEnvelopShape->getDZ();
1244  std::vector<double> xVertices, yVertices;
1245  for(int iPt=0; iPt<nbVertices; iPt++)
1246  {
1247  xVertices.push_back(m_staveEnvelopShape->getXVertex(iPt));
1248  yVertices.push_back(m_staveEnvelopShape->getYVertex(iPt));
1249 
1250  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<" "<<iPt<<" "<<m_staveEnvelopShape->getXVertex(iPt)<<" "<<m_staveEnvelopShape->getYVertex(iPt)<<endmsg;
1251 
1252  }
1253 
1254  // Extract convex shape from stave envelopp
1255  GetSurroundingConvexShape(xVertices, yVertices);
1256  // Clean up shape points
1257  RemoveCoincidentAndColinearPointsFromShape(xVertices, yVertices);
1258  // Add margin
1259  // AddSurroundingXYMargin(safetyMargin, safetyMargin, xVertices, yVertices);
1260 
1261  // Create and return stave envelop
1262  GeoSimplePolygonBrep* convexStaveEnvelopShape = new GeoSimplePolygonBrep(shapeDZ);
1263 
1264  if(m_thicknessN_svc<.01)
1265  for(unsigned int iPt=0; iPt<xVertices.size(); iPt++)
1266  {
1267  convexStaveEnvelopShape->addVertex(xVertices[iPt],yVertices[iPt]);
1268  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<" "<<xVertices[iPt]<<" "<<yVertices[iPt]<<endmsg;
1269  }
1270  else {
1271  for(unsigned int iPt=1; iPt<xVertices.size()-1; iPt++)
1272  {
1273  convexStaveEnvelopShape->addVertex(xVertices[iPt],yVertices[iPt]);
1274  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<" "<<xVertices[iPt]<<" "<<yVertices[iPt]<<endmsg;
1275  }
1276 
1277  xVertices[0]+=m_thicknessN_svc;
1278  double delta = 0.4;
1279  unsigned int iPoint = xVertices.size()-1;
1280  // double xMid = xVertices[iPoint]+(xVertices[0]-xVertices[iPoint])*.45;
1281  // double yMid = yVertices[iPoint]+(yVertices[0]-yVertices[iPoint])*.45;
1282 
1283  double xDir = xVertices[0]-xVertices[iPoint];
1284  double yDir = yVertices[0]-yVertices[iPoint];
1285  double tmp = 1./sqrt(xDir*xDir+yDir*yDir);
1286  xDir*=tmp; yDir*=tmp;
1287 
1288  double xMid = xVertices[0]-m_width_svc*xDir;
1289  double yMid = yVertices[0]-m_width_svc*yDir+1.;
1290  convexStaveEnvelopShape->addVertex(xMid, yMid);
1291  convexStaveEnvelopShape->addVertex(xMid-delta*m_thicknessN_svc, yMid);
1292 
1293  xMid = xVertices[0]-m_width_svc*xDir;
1294  yMid = yVertices[0]-m_width_svc*.25*yDir+1.;
1295  convexStaveEnvelopShape->addVertex(xMid-delta*m_thicknessN_svc, yMid);
1296  convexStaveEnvelopShape->addVertex(xMid-delta*m_thicknessN_svc*.5, yMid);
1297  convexStaveEnvelopShape->addVertex(xMid-delta*m_thicknessN_svc*.5, yVertices[0]);
1298 
1299  // convexStaveEnvelopShape->addVertex(xVertices[0], yVertices[0]);
1300  }
1301 
1302  return convexStaveEnvelopShape;
1303 
1304 }

◆ computeStaveEnvelopTransformAndSize()

void GeoPixelDetailedStaveSupport::computeStaveEnvelopTransformAndSize ( double  moduleThickN,
double  moduleThickP,
double  moduleWidth,
double  moduleThickN3D,
double  moduleThickP3D,
double  moduleWidth3D 
)
overridevirtual

Implements GeoPixelStaveSupport.

Definition at line 1118 of file GeoPixelDetailedStaveSupport.cxx.

1120 {
1121 
1122  // **** Global envelop including module and stave *****************************************************
1123 
1124  // Offsets have to be defined at the begnning of Build process
1125  // -> these parameters are used to compute staveEnvelopShape
1126 
1127  double MechanicalStaveOffset = m_gmt_mgr->IBLStaveMechanicalStaveOffset();
1128  double StaveModuleOffset = m_gmt_mgr->IBLStaveMechanicalStaveModuleOffset();
1129  double FacePlateThick = m_gmt_mgr->IBLStaveFacePlateThickness();
1130  double FacePlateGreaseThick = m_gmt_mgr->IBLStaveFacePlateGreaseThickness();
1131  if(FacePlateGreaseThick>0.001) FacePlateThick+=FacePlateGreaseThick;
1132 
1133  double stave_xOffset=StaveModuleOffset+moduleThickP, stave_yOffset=MechanicalStaveOffset;
1134  m_gmt_mgr->msg(MSG::INFO)<<" stave xoffset = "<< stave_xOffset <<endmsg;
1135  m_gmt_mgr->msg(MSG::INFO)<<" stave yoffset = "<< stave_yOffset <<endmsg;
1136  m_transform = GeoTrf::Translate3D(stave_xOffset,stave_yOffset,0);
1137 
1138  double staveSupportThickness=FacePlateThick+m_FoamMiddleThick;
1139  m_thicknessP = staveSupportThickness;
1140  m_thicknessN = (moduleThickN3D>moduleThickN)?moduleThickN3D:moduleThickN;
1141 
1142 // double innerRadius = m_gmt_mgr->IBLSupportRingInnerRadius();
1143 // double outerRadius = m_gmt_mgr->IBLSupportMidRingOuterRadius();
1144 // if(m_thicknessP<outerRadius)m_thicknessP=outerRadius;
1145 // if(m_thicknessN>innerRadius)m_thicknessN=innerRadius;
1146 
1147  // stave envelop shape (translated vs stave offsets / module)
1148  int nbVertices=m_basicStaveEnvelopShape->getNVertices();
1149  std::vector<double> xVertices, yVertices;
1150  for(int iPt=0; iPt<nbVertices; iPt++)
1151  {
1152  xVertices.push_back(m_basicStaveEnvelopShape->getXVertex(iPt)+stave_xOffset);
1153  yVertices.push_back(m_basicStaveEnvelopShape->getYVertex(iPt)+stave_yOffset);
1154  }
1155 
1156  // module shape (supposed to be rectangular)
1157  double moduleThicknessN=max(moduleThickN,moduleThickN3D);
1158  double moduleThicknessP=moduleThickP;
1159 
1160  // m_gmt_mgr->msg(MSG::INFO)<<"Stave envelop : module thicknesses P/N "<<moduleThicknessP<<" "<<moduleThicknessN<<endmsg;
1161 
1162  double module1x =-moduleThicknessN, module1y= -moduleWidth*0.5;
1163  double module2x =moduleThicknessP, module2y= -moduleWidth*0.5;
1164  double module3x =moduleThicknessP, module3y= moduleWidth*0.5;
1165  double module4x =-moduleThicknessN, module4y= moduleWidth*0.5;
1166 
1167  // in case 3D module is laterally shifted (in Y)
1168  if(pmShilftLateral3D<0){
1169  module1y+=pmShilftLateral3D;
1170  module2y+=pmShilftLateral3D;
1171  }
1172  else{
1173  module3y+=pmShilftLateral3D;
1174  module4y+=pmShilftLateral3D;
1175  }
1176 
1177  // stick module and stave envelop together
1178  double halfLadderLength=m_basicStaveEnvelopShape->getDZ();
1179  m_gmt_mgr->msg(MSG::INFO)<<"Stave envelop length : "<<m_StaveLength<<" -> "<<halfLadderLength<<endmsg;
1180  m_staveEnvelopShape = new GeoSimplePolygonBrep(halfLadderLength);
1181 
1182  bool bFlex=m_gmt_mgr->IBLFlexAndWingDefined();
1183  // bFlex=false;
1184  if(!bFlex){
1185  m_staveEnvelopShape->addVertex(module1x, module1y);
1186  if (fabs(sqrt((xVertices[0]-module2x)*(xVertices[0]-module2x)+(yVertices[0]-module2y)*(yVertices[0]-module2y)))>0.01)
1187  m_staveEnvelopShape->addVertex(module2x, module2y);
1188  for(int iPt=0; iPt<nbVertices; iPt++)
1189  m_staveEnvelopShape->addVertex(xVertices[iPt],yVertices[iPt]);
1190  if (fabs(sqrt((xVertices[nbVertices-1]-module3x)*(xVertices[nbVertices-1]-module3x)+(yVertices[nbVertices-1]-module3y)*(yVertices[nbVertices-1]-module3y)))>0.01)
1191  m_staveEnvelopShape->addVertex(module3x, module3y);
1192  m_staveEnvelopShape->addVertex(module4x, module4y);
1193  }
1194  else{
1195  for(int iPt=0; iPt<nbVertices; iPt++)
1196  if(iPt==0||iPt==nbVertices-1)
1197  m_staveEnvelopShape->addVertex(module1x,yVertices[iPt]);
1198  else
1199  m_staveEnvelopShape->addVertex(xVertices[iPt],yVertices[iPt]);
1200  }
1201 
1202 }

◆ ComputeStaveExternalShape()

void GeoPixelDetailedStaveSupport::ComputeStaveExternalShape ( )
private

Definition at line 1518 of file GeoPixelDetailedStaveSupport.cxx.

1519 {
1520 
1521  GeoTrf::Vector3D midStaveCenter(m_gmt_mgr->IBLStaveOmegaMidCenterX(),0.0,0.0);
1522  double midStaveRadius=m_gmt_mgr->IBLStaveOmegaMidRadius();
1523  double midStaveAngle=90.0*Gaudi::Units::deg-m_gmt_mgr->IBLStaveOmegaMidAngle();
1524 
1526  double endStaveRadius=m_gmt_mgr->IBLStaveOmegaEndRadius();
1527  double endStaveAngle=90.0*Gaudi::Units::deg+m_gmt_mgr->IBLStaveOmegaEndAngle();
1528 
1529  double omegaThick = m_gmt_mgr->IBLStaveOmegaThickness();
1530  double omegaEndStavePointY = m_gmt_mgr->IBLStaveMechanicalStaveWidth()*0.5;
1531 
1532  m_gmt_mgr->msg(MSG::INFO)<<" Omega MidStaveCenterX = "<<midStaveCenter.x()<<endmsg;
1533  m_gmt_mgr->msg(MSG::INFO)<<" Omega MidStaveAngle = "<<midStaveAngle<<endmsg;
1534  m_gmt_mgr->msg(MSG::INFO)<<" Omega MidStaveRadius = "<<midStaveRadius<<endmsg;
1535  m_gmt_mgr->msg(MSG::INFO)<<" Omega EndStaveCenterX = "<<endStaveCenter.x()<<endmsg;
1536  m_gmt_mgr->msg(MSG::INFO)<<" Omega EndStaveCenterY = "<<endStaveCenter.y()<<endmsg;
1537  m_gmt_mgr->msg(MSG::INFO)<<" Omega EndStaveAngle = "<<endStaveAngle<<endmsg;
1538  m_gmt_mgr->msg(MSG::INFO)<<" Omega EndStaveRadius = "<<endStaveRadius<<endmsg;
1539  m_gmt_mgr->msg(MSG::INFO)<<" Omega Thickness = "<<omegaThick<<endmsg;
1540 
1541  // Sines and cosines
1542  double midCos=cos(midStaveAngle);
1543  double midSin=sin(midStaveAngle);
1544 
1545 // double endCos=cos(endStaveAngle);
1546 // double endSin=sin(endStaveAngle);
1547 
1548  // End stave thickness
1549  double endStavePt1=sqrt(endStaveRadius*endStaveRadius-endStaveCenter.x()*endStaveCenter.x())+endStaveCenter.y();
1550  double endStavePt2=-sqrt(endStaveRadius*endStaveRadius-endStaveCenter.x()*endStaveCenter.x())+endStaveCenter.y();
1551  double endStavePt=endStavePt1;
1552  if(fabs(endStavePt2-omegaEndStavePointY)<fabs(endStavePt1-omegaEndStavePointY))endStavePt=endStavePt2;
1553  GeoTrf::Vector3D endStavePoint(0.0,endStavePt,0.0);
1554  m_OmegaEndStaveThick=omegaEndStavePointY-endStavePt;
1555  m_gmt_mgr->msg(MSG::DEBUG)<<"End stave Y point : "<<endStavePt<<" "<<omegaEndStavePointY<<" -> "<<m_OmegaEndStaveThick<<endmsg;
1556  m_gmt_mgr->msg(MSG::DEBUG)<<"Angles : "<<midStaveAngle<<" "<<endStaveAngle<<endmsg;
1557 
1558  // ***** compute points coordinates defining stave long side
1559  // midSidePt : point next to cooling pipe
1560 
1561  GeoTrf::Vector3D midSidePt(midStaveCenter.x()+midStaveRadius*midCos, midStaveCenter.y()+midStaveRadius*midSin, 0.0);
1562  m_gmt_mgr->msg(MSG::DEBUG)<< "midSidePt : "<<midSidePt.x()<<" "<<midSidePt.y()<<endmsg;
1563  m_gmt_mgr->msg(MSG::DEBUG)<< "-> verif : "<<(midSidePt.x()-midStaveCenter.x())*(midSidePt.x()-midStaveCenter.x())+(midSidePt.y()-midStaveCenter.y())*(midSidePt.y()-midStaveCenter.y())-midStaveRadius*midStaveRadius<<" ps : "<<(midSidePt.x()-midStaveCenter.x())*midSin+(midSidePt.y()-midStaveCenter.y())*midCos<<endmsg;
1564 
1565  GeoTrf::Vector3D midSidePt_omega(0.0,0.0,0.0);
1566  GeoTrf::Vector3D midSideDir(midSidePt.x()-midStaveCenter.x(),midSidePt.y()-midStaveCenter.y(),0.0);
1567  midSidePt_omega=NeighbourPoint_Rad(midSidePt,std::move(midSideDir),omegaThick);
1568 
1569  // endSidePt : point next to end of stave
1570  GeoTrf::Vector3D endSidePt(0.0,0.0,0.0);
1571  endSidePt=GeoTrf::Vector3D(endStaveCenter.x()+endStaveRadius*midCos, endStaveCenter.y()+endStaveRadius*midSin, 0.0);
1572  m_gmt_mgr->msg(MSG::DEBUG)<< "endSidePt : "<<endSidePt.x()<<" "<<endSidePt.y()<<endmsg;
1573  m_gmt_mgr->msg(MSG::DEBUG)<< "-> verif : "<<(endSidePt.x()-endStaveCenter.x())*(endSidePt.x()-endStaveCenter.x())+(endSidePt.y()-endStaveCenter.y())*(endSidePt.y()-endStaveCenter.y())-endStaveRadius*endStaveRadius<<" ps : "<<(endSidePt.x()-endStaveCenter.x())*midSin-(endSidePt.y()-endStaveCenter.y())*midCos<<endmsg;
1574 
1575  GeoTrf::Vector3D endSidePt_omega(0.0,0.0,0.0);
1576  GeoTrf::Vector3D endSideDir(endSidePt.x()-endStaveCenter.x(),endSidePt.y()-endStaveCenter.y(),0.0);
1577  endSidePt_omega=NeighbourPoint_Rad(endSidePt,std::move(endSideDir),omegaThick);
1578 
1579 
1580  // ***** Points defining the vertex of foam module and omega module
1581 
1582  // Foam module
1583  GeoTrf::Vector3D midStavePoint(0.0,0.0,0.0);
1584  midStavePoint=IntersectionPoint(midSidePt.x(),midSidePt.y(),endSidePt.x(),endSidePt.y(),
1585  midSidePt.x(),-midSidePt.y(),endSidePt.x(),-endSidePt.y());
1586  m_FoamMiddleThick=midStavePoint.x();
1587  m_gmt_mgr->msg(MSG::DEBUG)<< "Foam thickness (middle) "<<m_FoamMiddleThick<<" ("<<midStavePoint.y()<<") "<<endmsg;
1588 
1589  // Omega module
1590  GeoTrf::Vector3D midStavePoint_omega(0.0,0.0,0.0);
1591  midStavePoint_omega=IntersectionPoint(midSidePt_omega.x(),midSidePt_omega.y(),endSidePt_omega.x(),endSidePt_omega.y(),
1592  midSidePt_omega.x(),-midSidePt_omega.y(),endSidePt_omega.x(),-endSidePt_omega.y());
1593  m_OmegaMidStaveThick=midStavePoint_omega.x()-midStavePoint.x();
1594  m_gmt_mgr->msg(MSG::DEBUG)<< "Omega thickness (middle) "<<m_OmegaMidStaveThick<<" ("<<midStavePoint_omega.y()<<") "<<endmsg;
1595 
1596 
1597  // ***** Points defining the rounded shape at the edge of the stave
1598 
1599  // Neighbour endstave point (without omega)
1600  GeoTrf::Vector3D endStavePoint_omega(0.0,0.0,0.0);
1601  GeoTrf::Vector3D endStaveDir(endStavePoint.x()-endStaveCenter.x(),endStavePoint.y()-endStaveCenter.y(),0.0);
1602  endStavePoint_omega=NeighbourPoint_Rad(endStavePoint,std::move(endStaveDir),omegaThick);
1603 
1604  GeoTrf::Vector3D endSidePt_omega2(0.0,0.0,0.0);
1605  endSidePt_omega2=IntersectionPoint(midSidePt_omega.x(),midSidePt_omega.y(),endSidePt_omega.x(),endSidePt_omega.y(),
1606  endStavePoint_omega.x(),endStavePoint_omega.y(),endStavePoint.x(),endStavePoint.y()+m_OmegaEndStaveThick);
1607  m_gmt_mgr->msg(MSG::DEBUG)<< "EndStave + omega par intersection X/Y "<<endSidePt_omega2.x()<<" "<<endSidePt_omega2.y()<<endmsg;
1608  m_OmegaEndStavePointX=endSidePt_omega2.x();
1609  m_OmegaEndStavePointY=endSidePt_omega2.y();
1610 
1611  GeoTrf::Vector3D endSidePt_inner(0.0,0.0,0.0);
1612  GeoTrf::Vector3D endSidePt_vec(endSidePt_omega2.x()-endStavePoint.x(),endSidePt_omega2.y()-(endStavePoint.y()+m_OmegaEndStaveThick),0.0);
1613  endSidePt_inner=NeighbourPoint_Perp(std::move(endSidePt_omega2),std::move(endSidePt_vec),omegaThick,-1);
1614 
1615  // Compute Rx3,Ry3 coordinates
1616  GeoTrf::Vector3D endSidePt_inter(0.0,0.0,0.0);
1617  endSidePt_inter=IntersectionPoint(midSidePt.x(),midSidePt.y(),endSidePt.x(),endSidePt.y(),
1618  endSidePt_inner.x(),endSidePt_inner.y(),endStavePoint.x(),endStavePoint.y());
1619  m_FoamEdgePointX=endSidePt_inter.x();
1620  m_FoamEdgePointY=endSidePt_inter.y();
1621  m_gmt_mgr->msg(MSG::DEBUG)<< "EndStave sans omega X/Y "<<m_FoamEdgePointX<<" "<<m_FoamEdgePointY<<endmsg;
1622 
1623 
1624  // Check angles
1625  double angle1=ComputeAngle(0.0,1.0,endSidePt.x()-midSidePt.x(),endSidePt.y()-midSidePt.y());
1626  double angle2=ComputeAngle(0.0,1.0,m_OmegaEndStavePointX-midSidePt_omega.x(),m_OmegaEndStavePointY-midSidePt_omega.y());
1627  double angle3=ComputeAngle(0.0,1.0,m_FoamEdgePointX-midSidePt.x(),m_FoamEdgePointY-midSidePt.y());
1628 
1629  m_gmt_mgr->msg(MSG::DEBUG)<< "Verfi angles : "<<angle1<<" "<<angle2<<" "<<angle3<<" / "<<angle1*m_oneDegree<<" "<<angle2*m_oneDegree<<endmsg;
1630 
1631  // Compute mid stave side point
1632  GeoTrf::Vector3D midSidePoint(0.0,0.0,0.0);
1633  midSidePoint=IntersectionPoint(midSidePt_omega.x(),midSidePt_omega.y(),endSidePt_omega.x(),endSidePt_omega.y(),
1634  0.0,(endStavePoint.y()+m_OmegaEndStaveThick)*0.5,10.0,(endStavePoint.y()+m_OmegaEndStaveThick)*0.5);
1635  m_MidStaveSidePointX=midSidePoint.x();
1636  m_MidStaveSidePointY=midSidePoint.y();
1637 
1638 }

◆ GeoVPixelFactory()

GeoVPixelFactory::GeoVPixelFactory
inherited

Definition at line 33 of file GeoVPixelFactory.cxx.

16  : m_gmt_mgr (mgr)
18  , m_DDmgr (ddmgr)
19  , m_sqliteReader(sqliteReader)
20  , m_mapFPV(std::move(mapFPV))
21  , m_mapAX(std::move(mapAX))
22  , m_epsilon(0.0001)
23 {
24 }

◆ getEndblockEnvelopShape()

GeoPhysVol * GeoPixelDetailedStaveSupport::getEndblockEnvelopShape ( int  iObject)
overridevirtual

Implements GeoPixelStaveSupport.

Definition at line 1204 of file GeoPixelDetailedStaveSupport.cxx.

1205 {
1206  if(iObject==1)
1207  return m_endblockFlexPhysVol;
1208  else if(iObject==2)
1209  return m_endblockAPhysVol;
1210  else if(iObject==-2){
1212  return m_endblockAPhysVol;
1213  }
1214 
1215  return m_serviceCoolPipePhysVol;
1216 }

◆ getEndblockEnvelopShapeTrf()

GeoTransform * GeoPixelDetailedStaveSupport::getEndblockEnvelopShapeTrf ( int  iObject)
overridevirtual

Implements GeoPixelStaveSupport.

Definition at line 1218 of file GeoPixelDetailedStaveSupport.cxx.

1219 {
1220  if(iObject==0)
1221  return nullptr;
1222  else if(iObject==1)
1223  return m_endblockFlexTrf;
1224  else if(iObject==2)
1225  return m_serviceCoolPipeTrfA;
1226 
1227  return m_serviceCoolPipeTrfC;
1228 
1229 }

◆ getEndblockLength()

virtual double GeoPixelDetailedStaveSupport::getEndblockLength ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 33 of file GeoPixelDetailedStaveSupport.h.

◆ getEndblockZpos()

virtual double GeoPixelDetailedStaveSupport::getEndblockZpos ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 31 of file GeoPixelDetailedStaveSupport.h.

31 { return m_endblockZpos; };

◆ getPhysVol()

virtual GeoVPhysVol* GeoPixelDetailedStaveSupport::getPhysVol ( )
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 24 of file GeoPixelDetailedStaveSupport.h.

24 {return m_physVol;}

◆ getServiceZpos()

virtual double GeoPixelDetailedStaveSupport::getServiceZpos ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 32 of file GeoPixelDetailedStaveSupport.h.

32 { return m_serviceZpos; };

◆ GetSurroundingConvexShape()

void GeoPixelDetailedStaveSupport::GetSurroundingConvexShape ( std::vector< double > &  xPoint,
std::vector< double > &  yPoint,
std::vector< int >  iExcept = std::vector<int>() 
)
private

Definition at line 1364 of file GeoPixelDetailedStaveSupport.cxx.

1366 {
1367 
1368  // Get convex envelop = remove points that are "inside shape"
1369  bool bEndPointReached=false;
1370  int iMaxWhileLoop=xVertices.size();
1371  int iWhileLoop=0;
1372 
1373  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"Convex shape "<<iException.size()<<endmsg;
1374 
1375  if(iException.empty()) iException.assign(xVertices.size(), 0);
1376 
1377  std::vector<int>iRemoved( xVertices.size(), 0);
1378 
1379  // removing process is based on the sign of Z component of vector product (Pi-1,Pi)x(Pi,Pi+1)
1380  // for each set of successive points Pi-1, Pi, Pi+1
1381  // => if Z component >0 : point Pi is removed
1382  std::vector<double> xTmp, yTmp;
1383  std::vector<int> iTmp;
1384  while(!bEndPointReached&&iWhileLoop<iMaxWhileLoop)
1385  {
1386  bool bRemovedPoint=false;
1387  iWhileLoop++;
1388 
1389  xTmp.clear(); yTmp.clear(); iTmp.clear();
1390  for(int i=0; i<(int)xVertices.size(); i++)
1391  if(iRemoved[i]==0){
1392  xTmp.push_back(xVertices[i]);
1393  yTmp.push_back(yVertices[i]);
1394  iTmp.push_back(i);
1395  }
1396 
1397  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<"---> # points "<<xTmp.size()<<endmsg;
1398 
1399  int nbTmp=xTmp.size();
1400  int iPt;
1401  for(iPt=0; iPt<nbTmp&&!bRemovedPoint; iPt++)
1402  if(iException[iTmp[iPt]]==0)
1403  {
1404  int i1=(iPt-1); if(i1<0)i1=nbTmp-1;
1405  int i=iPt;
1406  int i2=(iPt+1)%(nbTmp);
1407 
1408  double zProdVect=(xTmp[i1]-xTmp[i])*(yTmp[i2]-yTmp[i])-(xTmp[i2]-xTmp[i])*(yTmp[i1]-yTmp[i]);
1409 
1410  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<" => "<<iPt<<" "<<zProdVect<<endmsg;
1411 
1412  if(zProdVect>0)
1413  {
1414  bRemovedPoint=true;
1415  iRemoved[iTmp[iPt]]++;
1416 
1417 // xVertices.erase(xVertices.begin()+iPt);
1418 // yVertices.erase(yVertices.begin()+iPt);
1419 // iException.erase(iException.begin()+iPt);
1420  if(m_bVerbose)m_gmt_mgr->msg(MSG::DEBUG)<<" -> remove point "<<iPt<<endmsg;
1421 
1422  }
1423  }
1424  if(!bRemovedPoint)bEndPointReached=true;
1425  // bEndPointReached=true;
1426  }
1427 
1428  xVertices = std::move(xTmp);
1429  yVertices = std::move(yTmp);
1430 
1431 }

◆ IntersectionPoint()

GeoTrf::Vector3D GeoPixelDetailedStaveSupport::IntersectionPoint ( double  Ax,
double  Ay,
double  Bx,
double  By,
double  Cx,
double  Cy,
double  Dx,
double  Dy 
)
private

Definition at line 1641 of file GeoPixelDetailedStaveSupport.cxx.

1642 {
1643  double tmp=(Bx-Ax)*(Dy-Cy)-(By-Ay)*(Dx-Cx);
1644  double invTmp=1.0/tmp;
1645 
1646  double r=((Ay-Cy)*(Dx-Cx)-(Ax-Cx)*(Dy-Cy))*invTmp;
1647 
1648  GeoTrf::Vector3D inter(Ax+r*(Bx-Ax),Ay+r*(By-Ay),0.0);
1649 
1650  return inter;
1651 }

◆ NeighbourPoint_Perp()

GeoTrf::Vector3D GeoPixelDetailedStaveSupport::NeighbourPoint_Perp ( GeoTrf::Vector3D  p,
GeoTrf::Vector3D  v,
double  delta,
int  iDir 
)
private

Definition at line 1669 of file GeoPixelDetailedStaveSupport.cxx.

1670 {
1671  GeoTrf::Vector3D vNorm=NormalizeDir(std::move(v));
1672  double xnew=p.x()-iDir*delta*vNorm.y();
1673  double ynew=p.y()+iDir*delta*vNorm.x();
1674  return GeoTrf::Vector3D(xnew,ynew,0.0);
1675 }

◆ NeighbourPoint_Rad()

GeoTrf::Vector3D GeoPixelDetailedStaveSupport::NeighbourPoint_Rad ( GeoTrf::Vector3D  p,
GeoTrf::Vector3D  v,
double  delta 
)
private

Definition at line 1661 of file GeoPixelDetailedStaveSupport.cxx.

1662 {
1663  GeoTrf::Vector3D vNorm=NormalizeDir(std::move(v));
1664  double xnew=p.x()+delta*vNorm.x();
1665  double ynew=p.y()+delta*vNorm.y();
1666  return GeoTrf::Vector3D(xnew,ynew,0.0);
1667 }

◆ NormalizeDir()

GeoTrf::Vector3D GeoPixelDetailedStaveSupport::NormalizeDir ( GeoTrf::Vector3D  v)
private

Definition at line 1654 of file GeoPixelDetailedStaveSupport.cxx.

1655 {
1656  double tmp=1.0/sqrt(v.x()*v.x()+v.y()*v.y());
1657  return GeoTrf::Vector3D(v.x()*tmp,v.y()*tmp,0.0);
1658 }

◆ PixelN3DModule()

virtual int GeoPixelDetailedStaveSupport::PixelN3DModule ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 38 of file GeoPixelDetailedStaveSupport.h.

38 { return m_3DModuleNumber; }

◆ PixelNModule()

virtual int GeoPixelDetailedStaveSupport::PixelNModule ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 36 of file GeoPixelDetailedStaveSupport.h.

◆ PixelNPlanarModule()

virtual int GeoPixelDetailedStaveSupport::PixelNPlanarModule ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 37 of file GeoPixelDetailedStaveSupport.h.

37 { return m_PlanarModuleNumber; }

◆ RemoveCoincidentAndColinearPointsFromShape()

void GeoPixelDetailedStaveSupport::RemoveCoincidentAndColinearPointsFromShape ( std::vector< double > &  xPoint,
std::vector< double > &  yPoint 
)
private

Definition at line 1307 of file GeoPixelDetailedStaveSupport.cxx.

1308 {
1309 
1310  bool bRemovedPoint=true;
1311  int iMaxWhileLoop=xPoint.size();
1312  int iWhileLoop=0;
1313 
1314  // Remove coincident points from shape ( dist < 0.01 mm)
1315  while(bRemovedPoint&&iWhileLoop<iMaxWhileLoop)
1316  {
1317  bRemovedPoint=false;
1318  int nbPoint=xPoint.size();
1319  for(int iPt=0; iPt<nbPoint&&!bRemovedPoint; iPt++)
1320  {
1321  int i1=iPt;
1322  int i2=(iPt+1)%(nbPoint);
1323 
1324  double zDist=fabs(sqrt((xPoint[i1]-xPoint[i2])*(xPoint[i1]-xPoint[i2])+(yPoint[i1]-yPoint[i2])*(yPoint[i1]-yPoint[i2])));
1325  if(zDist<0.01*Gaudi::Units::mm){
1326  xPoint.erase(xPoint.begin()+i1);
1327  yPoint.erase(yPoint.begin()+i1);
1328  bRemovedPoint=true;
1329  }
1330  }
1331  iWhileLoop++;
1332  }
1333 
1334  // Remove colinear points (scalar product < 0.0017 (~ 0.1 deg) )
1335  bRemovedPoint=true;
1336  iMaxWhileLoop=xPoint.size();
1337  iWhileLoop=0;
1338  while(bRemovedPoint&&iWhileLoop<iMaxWhileLoop)
1339  {
1340  bRemovedPoint=false;
1341  int nbPoint=xPoint.size();
1342  for(int iPt=0; iPt<nbPoint&&!bRemovedPoint; iPt++)
1343  {
1344  int i1=(iPt-1); if(i1<0)i1=nbPoint-1;
1345  int i=iPt;
1346  int i2=(iPt+1)%(nbPoint);
1347 
1348  double zScalProd=(xPoint[i1]-xPoint[i])*(xPoint[i2]-xPoint[i])+(yPoint[i1]-yPoint[i])*(yPoint[i2]-yPoint[i]);
1349  double vNorm1=sqrt((xPoint[i1]-xPoint[i])*(xPoint[i1]-xPoint[i])+(yPoint[i1]-yPoint[i])*(yPoint[i1]-yPoint[i]));
1350  double vNorm2=sqrt((xPoint[i2]-xPoint[i])*(xPoint[i2]-xPoint[i])+(yPoint[i2]-yPoint[i])*(yPoint[i2]-yPoint[i]));
1351  if(fabs(zScalProd/(vNorm1*vNorm2))>1.0-0.0017)
1352  {
1353  xPoint.erase(xPoint.begin()+i);
1354  yPoint.erase(yPoint.begin()+i);
1355  bRemovedPoint=true;
1356  }
1357  }
1358  iWhileLoop++;
1359  }
1360 
1361 }

◆ thicknessN()

virtual double GeoPixelDetailedStaveSupport::thicknessN ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 27 of file GeoPixelDetailedStaveSupport.h.

27 {return m_thicknessN;}

◆ thicknessP()

virtual double GeoPixelDetailedStaveSupport::thicknessP ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 26 of file GeoPixelDetailedStaveSupport.h.

26 {return m_thicknessP;}

◆ transform()

virtual const GeoTrf::Transform3D& GeoPixelDetailedStaveSupport::transform ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 25 of file GeoPixelDetailedStaveSupport.h.

25 {return m_transform;}

Member Data Documentation

◆ m_3DModuleNumber

int GeoPixelDetailedStaveSupport::m_3DModuleNumber = 0
private

Definition at line 68 of file GeoPixelDetailedStaveSupport.h.

◆ m_basicStaveEnvelopShape

GeoNodePtr<GeoSimplePolygonBrep> GeoPixelDetailedStaveSupport::m_basicStaveEnvelopShape
private

Definition at line 43 of file GeoPixelDetailedStaveSupport.h.

◆ m_bVerbose

bool GeoPixelDetailedStaveSupport::m_bVerbose {}
private

Definition at line 61 of file GeoPixelDetailedStaveSupport.h.

◆ m_DDmgr

InDetDD::PixelDetectorManager* GeoVPixelFactory::m_DDmgr
protectedinherited

Definition at line 45 of file GeoVPixelFactory.h.

◆ m_endblockAPhysVol

GeoPhysVol* GeoPixelDetailedStaveSupport::m_endblockAPhysVol = nullptr
private

Definition at line 45 of file GeoPixelDetailedStaveSupport.h.

◆ m_endblockCPhysVol

GeoPhysVol* GeoPixelDetailedStaveSupport::m_endblockCPhysVol = nullptr
private

Definition at line 46 of file GeoPixelDetailedStaveSupport.h.

◆ m_endblockFlexPhysVol

GeoPhysVol* GeoPixelDetailedStaveSupport::m_endblockFlexPhysVol = nullptr
private

Definition at line 49 of file GeoPixelDetailedStaveSupport.h.

◆ m_endblockFlexTrf

GeoNodePtr<GeoTransform> GeoPixelDetailedStaveSupport::m_endblockFlexTrf
private

Definition at line 50 of file GeoPixelDetailedStaveSupport.h.

◆ m_endblockLength

double GeoPixelDetailedStaveSupport::m_endblockLength = 0.0
private

Definition at line 47 of file GeoPixelDetailedStaveSupport.h.

◆ m_endblockSrvLength

double GeoPixelDetailedStaveSupport::m_endblockSrvLength = 0.0
private

Definition at line 48 of file GeoPixelDetailedStaveSupport.h.

◆ m_endblockZpos

double GeoPixelDetailedStaveSupport::m_endblockZpos = 0.0
private

Definition at line 47 of file GeoPixelDetailedStaveSupport.h.

◆ m_epsilon

const double GeoVPixelFactory::m_epsilon
protectedinherited

Definition at line 49 of file GeoVPixelFactory.h.

◆ m_FoamEdgePointX

double GeoPixelDetailedStaveSupport::m_FoamEdgePointX = 0.0
private

Definition at line 71 of file GeoPixelDetailedStaveSupport.h.

◆ m_FoamEdgePointY

double GeoPixelDetailedStaveSupport::m_FoamEdgePointY = 0.0
private

Definition at line 72 of file GeoPixelDetailedStaveSupport.h.

◆ m_FoamMiddleThick

double GeoPixelDetailedStaveSupport::m_FoamMiddleThick = 0.0
private

Definition at line 73 of file GeoPixelDetailedStaveSupport.h.

◆ m_gmt_mgr

PixelGeometryManager* GeoVPixelFactory::m_gmt_mgr
protectedinherited

Definition at line 43 of file GeoVPixelFactory.h.

◆ m_mapAX

std::shared_ptr<std::map<std::string, GeoAlignableTransform*> > GeoVPixelFactory::m_mapAX
protectedinherited

Definition at line 48 of file GeoVPixelFactory.h.

◆ m_mapFPV

std::shared_ptr<std::map<std::string, GeoFullPhysVol*> > GeoVPixelFactory::m_mapFPV
protectedinherited

Definition at line 47 of file GeoVPixelFactory.h.

◆ m_mat_mgr

InDetMaterialManager* GeoVPixelFactory::m_mat_mgr
protectedinherited

Definition at line 44 of file GeoVPixelFactory.h.

◆ m_MidStaveSidePointX

double GeoPixelDetailedStaveSupport::m_MidStaveSidePointX = 0.0
private

Definition at line 78 of file GeoPixelDetailedStaveSupport.h.

◆ m_MidStaveSidePointY

double GeoPixelDetailedStaveSupport::m_MidStaveSidePointY = 0.0
private

Definition at line 79 of file GeoPixelDetailedStaveSupport.h.

◆ m_OmegaEndStavePointX

double GeoPixelDetailedStaveSupport::m_OmegaEndStavePointX = 0.0
private

Definition at line 75 of file GeoPixelDetailedStaveSupport.h.

◆ m_OmegaEndStavePointY

double GeoPixelDetailedStaveSupport::m_OmegaEndStavePointY = 0.0
private

Definition at line 76 of file GeoPixelDetailedStaveSupport.h.

◆ m_OmegaEndStaveThick

double GeoPixelDetailedStaveSupport::m_OmegaEndStaveThick = 0.0
private

Definition at line 74 of file GeoPixelDetailedStaveSupport.h.

◆ m_OmegaMidStaveThick

double GeoPixelDetailedStaveSupport::m_OmegaMidStaveThick = 0.0
private

Definition at line 77 of file GeoPixelDetailedStaveSupport.h.

◆ m_oneDegree

constexpr double GeoPixelDetailedStaveSupport::m_oneDegree = 180.0/M_PI
staticconstexprprivate

Definition at line 89 of file GeoPixelDetailedStaveSupport.h.

◆ m_physVol

GeoNodePtr<GeoVPhysVol> GeoPixelDetailedStaveSupport::m_physVol
private

Definition at line 41 of file GeoPixelDetailedStaveSupport.h.

◆ m_PlanarModuleNumber

int GeoPixelDetailedStaveSupport::m_PlanarModuleNumber = 0
private

Definition at line 68 of file GeoPixelDetailedStaveSupport.h.

◆ m_SafetyMargin

double GeoPixelDetailedStaveSupport::m_SafetyMargin = 0.0
private

Definition at line 60 of file GeoPixelDetailedStaveSupport.h.

◆ m_serviceCoolPipePhysVol

GeoPhysVol* GeoPixelDetailedStaveSupport::m_serviceCoolPipePhysVol = nullptr
private

Definition at line 51 of file GeoPixelDetailedStaveSupport.h.

◆ m_serviceCoolPipeTrfA

GeoNodePtr<GeoTransform> GeoPixelDetailedStaveSupport::m_serviceCoolPipeTrfA
private

Definition at line 52 of file GeoPixelDetailedStaveSupport.h.

◆ m_serviceCoolPipeTrfC

GeoNodePtr<GeoTransform> GeoPixelDetailedStaveSupport::m_serviceCoolPipeTrfC
private

Definition at line 53 of file GeoPixelDetailedStaveSupport.h.

◆ m_serviceZpos

double GeoPixelDetailedStaveSupport::m_serviceZpos = 0.0
private

Definition at line 47 of file GeoPixelDetailedStaveSupport.h.

◆ m_sqliteReader

GeoModelIO::ReadGeoModel* GeoVPixelFactory::m_sqliteReader
protectedinherited

Definition at line 46 of file GeoVPixelFactory.h.

◆ m_staveEnvelopShape

GeoNodePtr<GeoSimplePolygonBrep> GeoPixelDetailedStaveSupport::m_staveEnvelopShape
private

Definition at line 42 of file GeoPixelDetailedStaveSupport.h.

◆ m_StaveLength

double GeoPixelDetailedStaveSupport::m_StaveLength = 0.0
private

Definition at line 70 of file GeoPixelDetailedStaveSupport.h.

◆ m_thicknessN

double GeoPixelDetailedStaveSupport::m_thicknessN = 0.0
private

Definition at line 57 of file GeoPixelDetailedStaveSupport.h.

◆ m_thicknessN_svc

double GeoPixelDetailedStaveSupport::m_thicknessN_svc = 0.0
private

Definition at line 58 of file GeoPixelDetailedStaveSupport.h.

◆ m_thicknessP

double GeoPixelDetailedStaveSupport::m_thicknessP = 0.0
private

Definition at line 56 of file GeoPixelDetailedStaveSupport.h.

◆ m_transform

GeoTrf::Transform3D GeoPixelDetailedStaveSupport::m_transform
private

Definition at line 55 of file GeoPixelDetailedStaveSupport.h.

◆ m_width_svc

double GeoPixelDetailedStaveSupport::m_width_svc = 0.0
private

Definition at line 59 of file GeoPixelDetailedStaveSupport.h.


The documentation for this class was generated from the following files:
GeoPixelDetailedStaveSupport::m_width_svc
double m_width_svc
Definition: GeoPixelDetailedStaveSupport.h:59
beamspotman.r
def r
Definition: beamspotman.py:676
PixelGeometryManager::IBLStaveModuleGap
virtual double IBLStaveModuleGap()=0
PixelGeometryManager::IBLStaveMechanicalStaveEndBlockOmegaOverlap
virtual double IBLStaveMechanicalStaveEndBlockOmegaOverlap()=0
GeoPixelDetailedStaveSupport::m_thicknessP
double m_thicknessP
Definition: GeoPixelDetailedStaveSupport.h:56
GeoPixelDetailedStaveSupport::m_oneDegree
static constexpr double m_oneDegree
Definition: GeoPixelDetailedStaveSupport.h:89
GeoPixelDetailedStaveSupport::m_OmegaEndStavePointY
double m_OmegaEndStavePointY
Definition: GeoPixelDetailedStaveSupport.h:76
PixelGeometryManager::IBLStaveOmegaEndCenterY
virtual double IBLStaveOmegaEndCenterY()=0
max
#define max(a, b)
Definition: cfImp.cxx:41
GeoPixelDetailedStaveSupport::m_endblockFlexPhysVol
GeoPhysVol * m_endblockFlexPhysVol
Definition: GeoPixelDetailedStaveSupport.h:49
GeoPixelDetailedStaveSupport::m_OmegaEndStaveThick
double m_OmegaEndStaveThick
Definition: GeoPixelDetailedStaveSupport.h:74
GeoPixelDetailedStaveSupport::m_SafetyMargin
double m_SafetyMargin
Definition: GeoPixelDetailedStaveSupport.h:60
GeoPixelDetailedStaveSupport::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelDetailedStaveSupport.cxx:45
PixelGeometryManager::IBLStaveFlexWingWidth
virtual double IBLStaveFlexWingWidth()=0
PixelGeometryManager::msg
MsgStream & msg(MSG::Level lvl) const
Definition: PixelGeometryManager.h:611
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PixelGeometryManager::IBLStaveOmegaEndCenterX
virtual double IBLStaveOmegaEndCenterX()=0
PixelGeometryManager::IBLStaveFlexLayerThickness
virtual double IBLStaveFlexLayerThickness()=0
GeoPixelDetailedStaveSupport::m_endblockFlexTrf
GeoNodePtr< GeoTransform > m_endblockFlexTrf
Definition: GeoPixelDetailedStaveSupport.h:50
GeoPixelDetailedStaveSupport::m_endblockAPhysVol
GeoPhysVol * m_endblockAPhysVol
Definition: GeoPixelDetailedStaveSupport.h:45
cm3
#define cm3
M_PI
#define M_PI
Definition: ActiveFraction.h:11
deg
#define deg
Definition: SbPolyhedron.cxx:17
PixelGeometryManager::msgLvl
bool msgLvl(MSG::Level lvl) const
Definition: PixelGeometryManager.h:614
PixelGeometryManager::IBLStaveFacePlateGreaseThickness
virtual double IBLStaveFacePlateGreaseThickness()=0
GeoPixelDetailedStaveSupport::m_serviceCoolPipePhysVol
GeoPhysVol * m_serviceCoolPipePhysVol
Definition: GeoPixelDetailedStaveSupport.h:51
PixelGeometryManager::IBLStaveFacePlateThickness
virtual double IBLStaveFacePlateThickness()=0
PixelGeometryManager::IBLStaveTubeMiddlePos
virtual double IBLStaveTubeMiddlePos()=0
GeoPixelDetailedStaveSupport::m_endblockCPhysVol
GeoPhysVol * m_endblockCPhysVol
Definition: GeoPixelDetailedStaveSupport.h:46
python.SystemOfUnits.gram
int gram
Definition: SystemOfUnits.py:165
GeoPixelDetailedStaveSupport::m_serviceCoolPipeTrfA
GeoNodePtr< GeoTransform > m_serviceCoolPipeTrfA
Definition: GeoPixelDetailedStaveSupport.h:52
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
PixelGeometryManager::IBLStaveFlexBaseThickness
virtual double IBLStaveFlexBaseThickness()=0
GeoPixelDetailedStaveSupport::m_FoamEdgePointY
double m_FoamEdgePointY
Definition: GeoPixelDetailedStaveSupport.h:72
GeoVPixelFactory::m_mapAX
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
Definition: GeoVPixelFactory.h:48
GeoVPixelFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition: GeoVPixelFactory.h:46
GeoPixelDetailedStaveSupport::m_serviceZpos
double m_serviceZpos
Definition: GeoPixelDetailedStaveSupport.h:47
GeoPixelDetailedStaveSupport::m_endblockSrvLength
double m_endblockSrvLength
Definition: GeoPixelDetailedStaveSupport.h:48
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
GeoVPixelFactory::m_DDmgr
InDetDD::PixelDetectorManager * m_DDmgr
Definition: GeoVPixelFactory.h:45
GeoVPixelFactory::m_gmt_mgr
PixelGeometryManager * m_gmt_mgr
Definition: GeoVPixelFactory.h:43
GeoVPixelFactory::m_mapFPV
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
Definition: GeoVPixelFactory.h:47
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
GeoPixelSiCrystal
Definition: GeoPixelSiCrystal.h:20
GeoPixelDetailedStaveSupport::ComputeStaveExternalShape
void ComputeStaveExternalShape()
Definition: GeoPixelDetailedStaveSupport.cxx:1518
PixelGeometryManager::IBLStaveOmegaEndRadius
virtual double IBLStaveOmegaEndRadius()=0
PixelGeometryManager::IBLStaveFlexOffset
virtual double IBLStaveFlexOffset()=0
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
GeoPixelDetailedStaveSupport::m_thicknessN_svc
double m_thicknessN_svc
Definition: GeoPixelDetailedStaveSupport.h:58
GeoPixelDetailedStaveSupport::m_MidStaveSidePointX
double m_MidStaveSidePointX
Definition: GeoPixelDetailedStaveSupport.h:78
GeoPixelDetailedStaveSupport::NormalizeDir
GeoTrf::Vector3D NormalizeDir(GeoTrf::Vector3D v)
Definition: GeoPixelDetailedStaveSupport.cxx:1654
GeoPixelDetailedStaveSupport::m_endblockZpos
double m_endblockZpos
Definition: GeoPixelDetailedStaveSupport.h:47
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
GeoPixelDetailedStaveSupport::m_MidStaveSidePointY
double m_MidStaveSidePointY
Definition: GeoPixelDetailedStaveSupport.h:79
PixelGeometryManager::IBLStaveTubeGlueThickness
virtual double IBLStaveTubeGlueThickness()=0
PixelGeometryManager::IBLFlexDoglegLength
virtual double IBLFlexDoglegLength()=0
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
PixelGeometryManager::IBLStaveOmegaMidCenterX
virtual double IBLStaveOmegaMidCenterX()=0
PixelGeometryManager::PixelModuleServiceNumber
virtual int PixelModuleServiceNumber()=0
InDetMaterialManager::getMaterialForVolume
const GeoMaterial * getMaterialForVolume(const std::string &materialName, double volume, const std::string &newName="")
Create and get material with a density calculated to give weight in predefined weight table.
Definition: InDetMaterialManager.cxx:460
PixelGeometryManager::IBLStaveMechanicalStaveOffset
virtual double IBLStaveMechanicalStaveOffset(bool isModule3D=false)=0
GeoPixelDetailedStaveSupport::m_endblockLength
double m_endblockLength
Definition: GeoPixelDetailedStaveSupport.h:47
PixelGeometryManager::IBLStaveTubeInnerDiameter
virtual double IBLStaveTubeInnerDiameter()=0
GeoPixelDetailedStaveSupport::m_StaveLength
double m_StaveLength
Definition: GeoPixelDetailedStaveSupport.h:70
PixelGeometryManager::IBLStaveMechanicalStaveEndBlockLength
virtual double IBLStaveMechanicalStaveEndBlockLength()=0
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
GeoPixelDetailedStaveSupport::m_bVerbose
bool m_bVerbose
Definition: GeoPixelDetailedStaveSupport.h:61
PixelGeometryManager::IBLStaveFacePlateGlueThickness
virtual double IBLStaveFacePlateGlueThickness()=0
min
#define min(a, b)
Definition: cfImp.cxx:40
GeoPixelDetailedStaveSupport::m_3DModuleNumber
int m_3DModuleNumber
Definition: GeoPixelDetailedStaveSupport.h:68
GeoPixelDetailedStaveSupport::RemoveCoincidentAndColinearPointsFromShape
void RemoveCoincidentAndColinearPointsFromShape(std::vector< double > &xPoint, std::vector< double > &yPoint)
Definition: GeoPixelDetailedStaveSupport.cxx:1307
GeoPixelDetailedStaveSupport::m_FoamEdgePointX
double m_FoamEdgePointX
Definition: GeoPixelDetailedStaveSupport.h:71
PixelGeometryManager::IBLStaveLength
virtual double IBLStaveLength()=0
PixelGeometryManager::PixelStaveLayout
virtual int PixelStaveLayout()=0
GeoVPixelFactory::m_epsilon
const double m_epsilon
Definition: GeoVPixelFactory.h:49
GeoPixelDetailedStaveSupport::m_serviceCoolPipeTrfC
GeoNodePtr< GeoTransform > m_serviceCoolPipeTrfC
Definition: GeoPixelDetailedStaveSupport.h:53
PixelGeometryManager::IBLStaveModuleNumber_AllPlanar
virtual int IBLStaveModuleNumber_AllPlanar()=0
GeoPixelDetailedStaveSupport::m_PlanarModuleNumber
int m_PlanarModuleNumber
Definition: GeoPixelDetailedStaveSupport.h:68
PixelGeometryManager::IBLStaveOmegaGlueThickness
virtual double IBLStaveOmegaGlueThickness()=0
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
GeoPixelDetailedStaveSupport::m_physVol
GeoNodePtr< GeoVPhysVol > m_physVol
Definition: GeoPixelDetailedStaveSupport.h:41
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
PixelGeometryManager::PixelStaveAxe
virtual int PixelStaveAxe()=0
GeoPixelDetailedStaveSupport::IntersectionPoint
GeoTrf::Vector3D IntersectionPoint(double Ax, double Ay, double Bx, double By, double Cx, double Cy, double Dx, double Dy)
Definition: GeoPixelDetailedStaveSupport.cxx:1641
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
python.PyAthena.v
v
Definition: PyAthena.py:154
GeoPixelDetailedStaveSupport::NeighbourPoint_Rad
GeoTrf::Vector3D NeighbourPoint_Rad(GeoTrf::Vector3D p, GeoTrf::Vector3D v, double delta)
Definition: GeoPixelDetailedStaveSupport.cxx:1661
PixelGeometryManager::IBLStaveMechanicalStaveModuleOffset
virtual double IBLStaveMechanicalStaveModuleOffset()=0
PixelGeometryManager::IBLStaveFlexWingThick
virtual double IBLStaveFlexWingThick()=0
PixelGeometryManager::IBLStaveMechanicalStaveWidth
virtual double IBLStaveMechanicalStaveWidth()=0
DEBUG
#define DEBUG
Definition: page_access.h:11
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
PixelGeometryManager::IBLStaveOmegaMidRadius
virtual double IBLStaveOmegaMidRadius()=0
GeoPixelStaveSupport
Definition: GeoPixelStaveSupport.h:14
PixelGeometryManager::PixelLayerRadius
virtual double PixelLayerRadius()=0
PixelGeometryManager::IBLFlexAndWingDefined
virtual bool IBLFlexAndWingDefined()=0
GeoPixelDetailedStaveSupport::m_OmegaMidStaveThick
double m_OmegaMidStaveThick
Definition: GeoPixelDetailedStaveSupport.h:77
extractSporadic.q
list q
Definition: extractSporadic.py:98
GeoPixelDetailedStaveSupport::m_OmegaEndStavePointX
double m_OmegaEndStavePointX
Definition: GeoPixelDetailedStaveSupport.h:75
GeoPixelModule
Definition: GeoPixelModule.h:14
GeoPixelDetailedStaveSupport::m_basicStaveEnvelopShape
GeoNodePtr< GeoSimplePolygonBrep > m_basicStaveEnvelopShape
Definition: GeoPixelDetailedStaveSupport.h:43
PixelGeometryManager::IBLStaveTubeOuterDiameter
virtual double IBLStaveTubeOuterDiameter()=0
GeoPixelDetailedStaveSupport::m_transform
GeoTrf::Transform3D m_transform
Definition: GeoPixelDetailedStaveSupport.h:55
PixelGeometryManager::getMaterialName
virtual std::string getMaterialName(const std::string &volumeName, int layerdisk=0, int typenum=0)=0
GeoPixelDetailedStaveSupport::m_staveEnvelopShape
GeoNodePtr< GeoSimplePolygonBrep > m_staveEnvelopShape
Definition: GeoPixelDetailedStaveSupport.h:42
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDetMaterialManager::getCompositeMaterialForVolume
const GeoMaterial * getCompositeMaterialForVolume(const std::string &newMatName, const double volumeTot, const double volume1, const std::string &matName1, const double volume2, const std::string &matName2)
Definition: InDetMaterialManager.cxx:134
InDetMaterialManager::getMaterial
const GeoMaterial * getMaterial(const std::string &materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
Definition: InDetMaterialManager.cxx:96
GeoPixelDetailedStaveSupport::NeighbourPoint_Perp
GeoTrf::Vector3D NeighbourPoint_Perp(GeoTrf::Vector3D p, GeoTrf::Vector3D v, double delta, int iDir)
Definition: GeoPixelDetailedStaveSupport.cxx:1669
GeoPixelDetailedStaveSupport::computeStaveEnvelopTransformAndSize
virtual void computeStaveEnvelopTransformAndSize(double moduleThickN, double moduleThickP, double moduleWidth, double moduleThickN3D, double moduleThickP3D, double moduleWidth3D) override
Definition: GeoPixelDetailedStaveSupport.cxx:1118
PixelGeometryManager::IBLFlexMaterial
virtual std::string IBLFlexMaterial(int iPos, const std::string &flexType)=0
PixelGeometryManager::IBLFlexMiddleGap
virtual double IBLFlexMiddleGap()=0
PixelGeometryManager::IBLFlexPP0Z
virtual double IBLFlexPP0Z(int iPos)=0
PixelGeometryManager::IBLStaveFlexWidth
virtual double IBLStaveFlexWidth()=0
GeoPixelDetailedStaveSupport::m_FoamMiddleThick
double m_FoamMiddleThick
Definition: GeoPixelDetailedStaveSupport.h:73
PixelGeometryManager::IBLStaveOmegaThickness
virtual double IBLStaveOmegaThickness()=0
GeoPixelDetailedStaveSupport::GetSurroundingConvexShape
void GetSurroundingConvexShape(std::vector< double > &xPoint, std::vector< double > &yPoint, std::vector< int > iExcept=std::vector< int >())
Definition: GeoPixelDetailedStaveSupport.cxx:1364
GeoPixelDetailedStaveSupport::m_thicknessN
double m_thicknessN
Definition: GeoPixelDetailedStaveSupport.h:57
PixelGeometryManager::IBLStaveOmegaEndAngle
virtual double IBLStaveOmegaEndAngle()=0
GeoPixelDetailedStaveSupport::ComputeAngle
double ComputeAngle(double ux, double uy, double vx, double vy)
Definition: GeoPixelDetailedStaveSupport.cxx:1677
PixelGeometryManager::GetLD
virtual int GetLD()=0
PixelGeometryManager::IBLStaveOmegaMidAngle
virtual double IBLStaveOmegaMidAngle()=0
PixelGeometryManager::getMaterialManager
virtual InDetMaterialManager * getMaterialManager()=0