ATLAS Offline Software
DBM_ModuleCage.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "DBM_ModuleCage.h"
6 #include "DBM_Module.h"
7 
8 #include "GeoModelKernel/GeoBox.h"
9 #include "GeoModelKernel/GeoTransform.h"
10 #include "GeoModelKernel/GeoNameTag.h"
11 #include "GeoModelKernel/GeoIdentifierTag.h"
12 #include "GeoModelKernel/GeoTrd.h"
13 #include "GeoModelKernel/GeoTrap.h"
14 #include "GeoModelKernel/GeoTube.h"
15 
16 #include "GeoModelKernel/GeoPhysVol.h"
17 #include "GaudiKernel/SystemOfUnits.h"
18 
20 
21 GeoVPhysVol* DBM_ModuleCage::Build() {
22 
23  // store initial value Eta value
24  int tempLD = m_gmt_mgr->GetLD();
25  GeoPhysVol* containerPhys{nullptr};
26 
27  if(m_sqliteReader) {
28  for (int i = 0; i < 3; i++) {
29  //**** Add volume to form the module cage
30  // add sensor module
31  // set telescope layer number
34  module.Build();
35  }
36  }
37  else {
38 
39  // safety, to make sure volumes don't overlap
40  double safety = 0.005*Gaudi::Units::mm;
41 
42  // Telescope dimension
43  double layerUnitY = m_gmt_mgr->DBMModuleCageY();
44  double layerUnitZ = m_gmt_mgr->DBMModuleCageZ();
45 
46  // layer spacing
47  double Zspacing = m_gmt_mgr->DBMSpacingZ();
48  double Rspacing = m_gmt_mgr->DBMSpacingRadial();
49  // gap between V-slide and first main plate
50  double layer1Space = m_gmt_mgr->DBMSpace();
51 
52  // main plate, on which is mounted the sensor module
53  double mainPlateX = m_gmt_mgr->DBMMainPlateX(); //dimension in x-direction or width
54  double mainPlateY = m_gmt_mgr->DBMMainPlateY(); //y-direction or height
55  double mainPlateZ = m_gmt_mgr->DBMMainPlateZ(); //z-direction or thickness
56  double mPlateWindowX = m_gmt_mgr->DBMMPlateWindowWidth(); // window width in the main plate
57  double mPlateWindowY = m_gmt_mgr->DBMMPlateWindowHeight(); // window height
58  double mPlateWindowPos = m_gmt_mgr->DBMMPlateWindowPos(); // window position from bottom of the main plate
59 
60  // DBM module
61  double diamondZ = m_gmt_mgr->DBMDiamondZ();
62  double FEI4Z = m_gmt_mgr->DBMFEI4Z();
63  double ceramicY = m_gmt_mgr->DBMCeramicY();
64  double ceramicZ = m_gmt_mgr->DBMCeramicZ();
65  double moduleAirGap = m_gmt_mgr->DBMAirGap(); // air gap between diamond and FE-I4 chip
66  double kaptonZ = m_gmt_mgr->DBMKaptonZ();
67 
68  // flex support
69  double flexSupportX = m_gmt_mgr->DBMFlexSupportX();
70  double flexSupportY = m_gmt_mgr->DBMFlexSupportY();
71  double flexSupportZ = m_gmt_mgr->DBMFlexSupportZ();
72  double flexSupportOffset = m_gmt_mgr->DBMFlexSupportOffset();
73 
74  // rods
75  double rodRadius = m_gmt_mgr->DBMRodRadius();
76  double mPlateRod2RodY = m_gmt_mgr->DBMMPlateRod2RodY(); // distance between center of top and bottom rods
77  double mPlateRod2RodX = m_gmt_mgr->DBMMPlateRod2RodX(); // distance between center of left and right rods
78 
79  // materials
80  const GeoMaterial* air = m_mat_mgr->getMaterial("std::Air");
81  const GeoMaterial* aluminium = m_mat_mgr->getMaterial("std::Aluminium");
82  const GeoMaterial* DBMRod_mat = m_mat_mgr->getMaterial("pix::DBMRod");
83 
84  //**** 3-layers unit volume forming the module cage
85  const GeoBox* containerBox = new GeoBox(mainPlateX/2. + safety, layerUnitY/2. + safety, layerUnitZ/2.);
86  const GeoLogVol* containerLog = new GeoLogVol("dbmTelescopeLog", containerBox, air);
87  containerPhys = new GeoPhysVol(containerLog);
88 
89  //**** blocks to form the main plate
90 
91  const GeoBox* mPSide = new GeoBox((mainPlateX - mPlateWindowX)/4., mainPlateY/2., mainPlateZ/2.);
92  const GeoMaterial* dbmAluminium1 = m_mat_mgr->getMaterialForVolume("pix::DBMAluminium1", mPSide->volume());
93  const GeoLogVol* mPSideLog = new GeoLogVol("dbmWallLogPlt", mPSide, dbmAluminium1);
94  GeoPhysVol* mPSidePhys = new GeoPhysVol(mPSideLog);
95 
96  const GeoBox* mPCenterBot = new GeoBox(mPlateWindowX/2., mPlateWindowPos/2., mainPlateZ/2.);
97  const GeoLogVol* mPCenterBotLog = new GeoLogVol("dbmWallLogPlt", mPCenterBot, aluminium);
98  GeoPhysVol* mPCenterBotPhys = new GeoPhysVol(mPCenterBotLog);
99 
100  const GeoBox* mPCenterTop = new GeoBox(mPlateWindowX/2., (mainPlateY - mPlateWindowY - mPlateWindowPos)/2., mainPlateZ/2.);
101  const GeoLogVol* mPCenterTopLog = new GeoLogVol("dbmWallLogPlt", mPCenterTop, aluminium);
102  GeoPhysVol* mPCenterTopPhys = new GeoPhysVol(mPCenterTopLog);
103 
104  //**** telescope rods
105 
106  // rod in front of the first layer
107  const GeoTube* rodA = new GeoTube(0., rodRadius, layer1Space/2. - safety);
108  const GeoLogVol* rodALog = new GeoLogVol("dbmWallLogPlt", rodA, DBMRod_mat);
109  GeoPhysVol* rodAPhys = new GeoPhysVol(rodALog);
110 
111  // top rods
112  const GeoTube* topRod = new GeoTube(0., rodRadius, (Zspacing - mainPlateZ - flexSupportZ)/2. - safety);
113  const GeoLogVol* topRodLog = new GeoLogVol("dbmWallLogPlt", topRod, DBMRod_mat);
114  GeoPhysVol* topRodPhys = new GeoPhysVol(topRodLog);
115 
116  // Bottom rods
117  const GeoTube* botRod = new GeoTube(0., rodRadius, (Zspacing - mainPlateZ)/2. - safety);
118  const GeoLogVol* botRodLog = new GeoLogVol("dbmWallLogPlt", botRod, DBMRod_mat);
119  GeoPhysVol* botRodPhys = new GeoPhysVol(botRodLog);
120 
121  //**** add volumes to the telescope box
122 
123  // position of the center of the main plates with respect to the front bottom telescope box
124  double mainPlatePosZ[3]; // Z coordinates
125  mainPlatePosZ[0] = -layerUnitZ/2. + layer1Space + mainPlateZ/2.;
126  mainPlatePosZ[1] = -layerUnitZ/2. + layer1Space + Zspacing + mainPlateZ/2.;
127  mainPlatePosZ[2] = -layerUnitZ/2. + layer1Space + 2.*Zspacing + mainPlateZ/2.;
128  // Y coordinate
129  double mainPlatePosY = -layerUnitY/2. + mainPlateY/2.;
130 
131  // strings for volume tag
132  std::string tag_mainPlate[3] = {"mainPlate1", "mainPlate2", "mainPlate3"};
133  std::string tag_flex[3] = {"flexSupport1", "flexSupport2", "flexSupport3"};
134  std::string tag_module[3] = {"module1", "module2", "module3"};
135  std::string tag_rod[3] = {"rod1", "rod2", "rod3"};
136 
137  for (int i = 0; i < 3; i++) {
138 
139  //**** Add volume to form the module cage
140 
141  // add sensor module
142 
143  // set telescope layer number
145 
147  GeoVPhysVol* modulePhys = module.Build();
148 
149  Rspacing = m_gmt_mgr->DBMSpacingRadial();
150  GeoTrf::Translate3D modulePos(0, -layerUnitY/2. + Rspacing + ceramicY/2., mainPlatePosZ[i]-mainPlateZ/2.-(ceramicZ+FEI4Z+moduleAirGap+diamondZ + kaptonZ)/2.-2*safety);
151  GeoTransform* xform = new GeoTransform(modulePos);
152  GeoNameTag* tag = new GeoNameTag(tag_module[i].c_str());
153  containerPhys->add(tag);
154  containerPhys->add(new GeoIdentifierTag(i));
155  containerPhys->add(xform);
156  containerPhys->add(modulePhys);
157 
158  // add main plate
159 
160  GeoTrf::Translate3D mPSideAPos((mainPlateX+mPlateWindowX)/4.+safety/2., mainPlatePosY, mainPlatePosZ[i]);
161  xform = new GeoTransform(mPSideAPos);
162  tag = new GeoNameTag(tag_mainPlate[i].c_str());
163  containerPhys->add(tag);
164  containerPhys->add(xform);
165  containerPhys->add(mPSidePhys);
166 
167  GeoTrf::Translate3D mPSideBPos(-(mainPlateX+mPlateWindowX)/4.-safety/2., mainPlatePosY, mainPlatePosZ[i]);
168  xform = new GeoTransform(mPSideBPos);
169  containerPhys->add(tag);
170  containerPhys->add(xform);
171  containerPhys->add(mPSidePhys);
172 
173  GeoTrf::Translate3D mPBotPos(0.0, (-layerUnitY + mPlateWindowPos)/2.-safety/2., mainPlatePosZ[i]);
174  xform = new GeoTransform(mPBotPos);
175  containerPhys->add(tag);
176  containerPhys->add(xform);
177  containerPhys->add(mPCenterBotPhys);
178 
179  GeoTrf::Translate3D mPTopPos(0.0, (-layerUnitY + mainPlateY + mPlateWindowY + mPlateWindowPos)/2.+safety/2., mainPlatePosZ[i]);
180  xform = new GeoTransform(mPTopPos);
181  containerPhys->add(tag);
182  containerPhys->add(xform);
183  containerPhys->add(mPCenterTopPhys);
184 
185 
186  //**** component of the flex support
187  // Additional material in the 3rd fex support from screws and the 4 rods
188  const GeoBox* flexSupp = new GeoBox(flexSupportX/2., flexSupportY/2., flexSupportZ/2.);
189 
190  // get mass of flex support material
191  std::string flexSupp_matName = "";
192  if (i == 0) {
193  flexSupp_matName = "pix::DBMPeek5";
194  } else if (i == 1) {
195  flexSupp_matName = "pix::DBMPeek6";
196  } else if (i == 2) {
197  flexSupp_matName = "pix::DBMPeek7";
198  }
199  const GeoMaterial* dbmFlexSupp_mat = m_mat_mgr->getMaterialForVolume(flexSupp_matName, flexSupp->volume());
200 
201  const GeoLogVol* flexSuppLog = new GeoLogVol("dbmWallLog", flexSupp, dbmFlexSupp_mat);
202  GeoPhysVol* flexSuppPhys = new GeoPhysVol(flexSuppLog);
203 
204  // Y position of flex support block
205  double flexSuppPosY = mainPlatePosY + mPlateRod2RodY/2. - flexSupportY/2. + flexSupportOffset;
206  // Z position of flex support blocks
207  double flexSuppPosZ = mainPlatePosZ[i] + mainPlateZ/2. + flexSupportZ/2. + safety;
208 
209  //**** add flex support
210 
211  GeoTrf::Translate3D flexSuppPos(0.0, flexSuppPosY, flexSuppPosZ);
212  xform = new GeoTransform(flexSuppPos);
213  tag = new GeoNameTag(tag_flex[i].c_str());
214  containerPhys->add(tag);
215  containerPhys->add(xform);
216  containerPhys->add(flexSuppPhys);
217 
218  //**** add rod
219 
220  // Y position of rods
221  double topRodPosY = mainPlatePosY + mPlateRod2RodY/2.;
222  double botRodPosY = mainPlatePosY - mPlateRod2RodY/2.;
223 
224  if (m_gmt_mgr->GetLD() == 0) { //first layer
225 
226  double rodPosZ = mainPlatePosZ[i] - mainPlateZ/2.0 - layer1Space/2.; // Z position of rod
227 
228  GeoTrf::Translate3D rodAPos(mPlateRod2RodX/2., topRodPosY, rodPosZ);
229  xform = new GeoTransform(rodAPos);
230  tag = new GeoNameTag(tag_rod[i].c_str());
231  containerPhys->add(tag);
232  containerPhys->add(xform);
233  containerPhys->add(rodAPhys);
234 
235  GeoTrf::Translate3D rodBPos(-mPlateRod2RodX/2., topRodPosY, rodPosZ);
236  xform = new GeoTransform(rodBPos);
237  containerPhys->add(tag);
238  containerPhys->add(xform);
239  containerPhys->add(rodAPhys);
240 
241  GeoTrf::Translate3D rodCPos(mPlateRod2RodX/2., botRodPosY, rodPosZ);
242  xform = new GeoTransform(rodCPos);
243  containerPhys->add(tag);
244  containerPhys->add(xform);
245  containerPhys->add(rodAPhys);
246 
247  GeoTrf::Translate3D rodDPos(-mPlateRod2RodX/2., botRodPosY, rodPosZ);
248  xform = new GeoTransform(rodDPos);
249  containerPhys->add(tag);
250  containerPhys->add(xform);
251  containerPhys->add(rodAPhys);
252 
253  } else if (m_gmt_mgr->GetLD() > 0 && m_gmt_mgr->GetLD() < 3) { //second and third layer
254 
255  //Z position of rods
256  double topRodPosZ = mainPlatePosZ[i] - mainPlateZ/2. - (Zspacing - mainPlateZ - flexSupportZ)/2.;
257  double botRodPosZ = mainPlatePosZ[i] - mainPlateZ/2. - (Zspacing - mainPlateZ)/2.;
258 
259  GeoTrf::Translate3D rodAPos(mPlateRod2RodX/2., topRodPosY, topRodPosZ);
260  xform = new GeoTransform(rodAPos);
261  tag = new GeoNameTag(tag_rod[i].c_str());
262  containerPhys->add(tag);
263  containerPhys->add(xform);
264  containerPhys->add(topRodPhys);
265 
266  GeoTrf::Translate3D rodBPos(-mPlateRod2RodX/2., topRodPosY, topRodPosZ);
267  xform = new GeoTransform(rodBPos);
268  containerPhys->add(tag);
269  containerPhys->add(xform);
270  containerPhys->add(topRodPhys);
271 
272  GeoTrf::Translate3D rodCPos(mPlateRod2RodX/2., botRodPosY, botRodPosZ);
273  xform = new GeoTransform(rodCPos);
274  containerPhys->add(tag);
275  containerPhys->add(xform);
276  containerPhys->add(botRodPhys);
277 
278  GeoTrf::Translate3D rodDPos(-mPlateRod2RodX/2., botRodPosY, botRodPosZ);
279  xform = new GeoTransform(rodDPos);
280  containerPhys->add(tag);
281  containerPhys->add(xform);
282  containerPhys->add(botRodPhys);
283 
284  }
285  else {
286  m_gmt_mgr->msg(MSG::WARNING) << "Module cage invalid layer value: " << m_gmt_mgr->GetLD() << endmsg;
287  }
288  }
289  }
290  // restore Eta value
291  m_gmt_mgr->SetCurrentLD(tempLD);
292 
293  return containerPhys;
294 }
295 
PixelGeometryManager::DBMFlexSupportOffset
virtual double DBMFlexSupportOffset()=0
DBM_ModuleCage.h
PixelGeometryManager::DBMDiamondZ
virtual double DBMDiamondZ()=0
PixelGeometryManager::DBMSpacingRadial
virtual double DBMSpacingRadial()=0
PixelGeometryManager::msg
MsgStream & msg(MSG::Level lvl) const
Definition: PixelGeometryManager.h:611
PixelGeometryManager::DBMMainPlateX
virtual double DBMMainPlateX()=0
PixelGeometryManager::DBMFlexSupportY
virtual double DBMFlexSupportY()=0
PixelGeometryManager::DBMCeramicY
virtual double DBMCeramicY()=0
PixelGeometryManager::DBMSpace
virtual double DBMSpace()=0
PixelGeometryManager::DBMMPlateWindowHeight
virtual double DBMMPlateWindowHeight()=0
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
DBM_Module.h
PixelGeometryManager::DBMMainPlateY
virtual double DBMMainPlateY()=0
GeoVPixelFactory::m_DDmgr
InDetDD::PixelDetectorManager * m_DDmgr
Definition: GeoVPixelFactory.h:45
PixelGeometryManager::DBMMPlateWindowPos
virtual double DBMMPlateWindowPos()=0
PixelGeometryManager::DBMAirGap
virtual double DBMAirGap()=0
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
python.PyAthena.module
module
Definition: PyAthena.py:134
PixelGeometryManager::DBMMainPlateZ
virtual double DBMMainPlateZ()=0
PixelDetectorManager.h
PixelGeometryManager::DBMFlexSupportZ
virtual double DBMFlexSupportZ()=0
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
PixelGeometryManager::DBMMPlateRod2RodY
virtual double DBMMPlateRod2RodY()=0
DBM_ModuleCage::Build
virtual GeoVPhysVol * Build() override
Definition: DBM_ModuleCage.cxx:21
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::DBMSpacingZ
virtual double DBMSpacingZ()=0
PixelGeometryManager::DBMKaptonZ
virtual double DBMKaptonZ()=0
PixelGeometryManager::DBMFlexSupportX
virtual double DBMFlexSupportX()=0
PixelGeometryManager::DBMCeramicZ
virtual double DBMCeramicZ()=0
PixelGeometryManager::DBMModuleCageY
virtual double DBMModuleCageY()=0
PixelGeometryManager::DBMModuleCageZ
virtual double DBMModuleCageZ()=0
PixelGeometryManager::SetCurrentLD
virtual void SetCurrentLD(int i)=0
DBM_Module
Definition: DBM_Module.h:26
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
PixelGeometryManager::DBMMPlateRod2RodX
virtual double DBMMPlateRod2RodX()=0
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
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
PixelGeometryManager::DBMFEI4Z
virtual double DBMFEI4Z()=0
PixelGeometryManager::DBMMPlateWindowWidth
virtual double DBMMPlateWindowWidth()=0
PixelGeometryManager::DBMRodRadius
virtual double DBMRodRadius()=0
PixelGeometryManager::GetLD
virtual int GetLD()=0