ATLAS Offline Software
DBM_Telescope.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "DBM_Telescope.h"
6 #include "DBM_ModuleCage.h"
7 
8 #include "GeoModelKernel/GeoPhysVol.h"
9 #include "GeoModelKernel/GeoTransform.h"
10 #include "GeoModelKernel/GeoNameTag.h"
11 #include "GeoModelKernel/GeoIdentifierTag.h"
12 #include "GeoModelKernel/GeoBox.h"
13 #include "GeoModelKernel/GeoTrd.h"
14 #include "GeoModelKernel/GeoTrap.h"
15 #include "GeoModelKernel/GeoPara.h"
16 #include "GeoModelKernel/GeoTube.h"
17 
18 #include "GeoModelKernel/GeoShapeShift.h"
19 #include "GeoModelKernel/GeoShapeSubtraction.h"
20 #include "GeoModelKernel/GeoShapeUnion.h"
21 #include "GaudiKernel/SystemOfUnits.h"
22 
24 
25 GeoVPhysVol* DBM_Telescope::Build() {
26 
28 
29  if(m_sqliteReader) {
30  moduleCage.Build();
31  return nullptr;
32  }
33 
34  double safety = 0.005*Gaudi::Units::mm;
35 
36  // telescope tilting angle in degree
37  double angle = m_gmt_mgr->DBMAngle();
38 
39  // Telescope dimension
40  double telescopeX = m_gmt_mgr->DBMTelescopeX();
41  double telescopeY = m_gmt_mgr->DBMTelescopeY();
42  double telescopeZ = m_gmt_mgr->DBMTelescopeZ();
43 
44  // module cage forming of three layers of plates
45  // on which is mounted a DBM module
46  double layerUnitY = m_gmt_mgr->DBMModuleCageY();
47  double layerUnitZ = m_gmt_mgr->DBMModuleCageZ();
48 
49  // bracket unit dimension
50  double bracketX = m_gmt_mgr->DBMBracketX(); // width of the bracket unit
51  double bracketY = m_gmt_mgr->DBMBracketY(); // total height of the bracket unit
52  double bracketZ = m_gmt_mgr->DBMBracketZ(); // total thickness of the bracket unit,
53  // back trapezoid block with window
54  double trapBack_theta = m_gmt_mgr->DBMTrapezBackTheta();
55  double trapBackX = m_gmt_mgr->DBMTrapezBackX();
56  double trapBackY = m_gmt_mgr->DBMTrapezBackY();
57  double trapBackShortZ = m_gmt_mgr->DBMTrapezBackShortZ();
58  // bracket window
59  double brcktWindowX = m_gmt_mgr->DBMBrcktWindowX();
60  double brcktWindowY = m_gmt_mgr->DBMBrcktWindowY();
61  double brcktWindow_offset = m_gmt_mgr->DBMBrcktWindowOffset();
62  double brcktWindow_centerZ = m_gmt_mgr->DBMBrcktWindowCenterZ();
63  // bracket front block
64  double brcktTopBlockZ = m_gmt_mgr->DBMBrcktTopBlockZ();
65  double brcktSideBlockX = m_gmt_mgr->DBMBrcktSideBlockX();
66  double brcktSideBlockY = m_gmt_mgr->DBMBrcktSideBlockY();
68  double brcktLockZ = m_gmt_mgr->DBMBrcktLockZ();
69  double brcktLockY = m_gmt_mgr->DBMBrcktLockY();
70 
71  // cooling side plate
72  double coolingSidePlateX = m_gmt_mgr->DBMCoolingSidePlateX();
73  double coolingSidePlateY = m_gmt_mgr->DBMCoolingSidePlateY();
74  double coolingSidePlateZ = m_gmt_mgr->DBMCoolingSidePlateZ();
75  // position of side plate, parallel to side plate axis,
76  // measured from the back of the V-slide to the front of the side plate
77  double coolingSidePlatePos = m_gmt_mgr->DBMCoolingSidePlatePos();
78  // cooling plates next to bracket
79  double coolingFinLongZ = m_gmt_mgr->DBMBrcktFinLongZ();
80  double coolingFinHeight = m_gmt_mgr->DBMBrcktFinHeight();
81  double coolingFinThick = m_gmt_mgr->DBMBrcktFinThick();
82  double coolingFinPos = m_gmt_mgr->DBMBrcktFinPos();
83 
84  double mainPlateX = m_gmt_mgr->DBMMainPlateX(); //dimension in x-direction or width
85 
86  // materials
87  const GeoMaterial* air = m_mat_mgr->getMaterial("std::Air");
88 
89  // DBM telescope volume
90  const GeoBox* telescopeBox = new GeoBox(telescopeX/2. + 3*safety, telescopeY/2.+ safety, telescopeZ/2.);
91  const GeoLogVol* telescopeLog = new GeoLogVol("dbmTelescopeLog", telescopeBox, air);
92  GeoPhysVol* telescopePhys = new GeoPhysVol(telescopeLog);
93 
94  GeoTrf::RotateX3D rmX10(-10.*Gaudi::Units::deg);
95 
96  GeoVPhysVol* moduleCagePhys = moduleCage.Build();
97 
98  // parameters for rotating the 3-layer unit
99  double lyRadius = sqrt(layerUnitY*layerUnitY/4 + layerUnitZ*layerUnitZ/4);
100  double lyAngle = atan(layerUnitY/layerUnitZ);//21.6444*Gaudi::Units::deg; // arctan(DBM3LayersY / DBM3LayersZ)
101  // position of bottom tip of the 3-layers unit, which is the rotation point
102  double layerUnitPos_Y = (trapBackY/cos(angle) - coolingSidePlateY)*cos(angle);
103  double layerUnitPos_Z = coolingSidePlateY*sin(angle) + trapBackShortZ + bracketZ - brcktLockZ;
104 
105  GeoTrf::Translation3D layerUnitPos( 0.0, -telescopeY/2. + layerUnitPos_Y + lyRadius * sin(lyAngle+angle), -telescopeZ/2. + layerUnitPos_Z + lyRadius * cos(lyAngle+angle) + 3*safety);
106  GeoTransform* xform = new GeoTransform(GeoTrf::Transform3D(layerUnitPos*rmX10));
107  GeoNameTag* tag = new GeoNameTag("dbm3layers");
108  telescopePhys->add(tag);
109  telescopePhys->add(xform);
110  telescopePhys->add(moduleCagePhys);
111 
112 
113  //**** build bracket unit
114 
115  // back trapezoid block with window, will be rotated by 90 degree along the x-axis
116 
117  const GeoTrap* trapBack = new GeoTrap(trapBackY/2., trapBack_theta, 90.0*Gaudi::Units::deg, trapBackShortZ/2., trapBackX/2., trapBackX/2, 0.0, (trapBackShortZ+trapBackY*tan(angle))/2., trapBackX/2., trapBackX/2., 0.0);
118 
119  double brWindowPosY = brcktWindow_offset + brcktWindow_centerZ * tan(angle) + brcktWindowY/(2 * cos(angle));
120  const GeoBox* brWindow = new GeoBox(brcktWindowX/2., trapBackShortZ, brcktWindowY/2.);
121  GeoTrf::Translation3D brWindowPos(0., 0., trapBackY/2. - brWindowPosY);
122  GeoTrf::Transform3D brWindowShift(brWindowPos*rmX10);
123 
124  const GeoShapeSubtraction& trapBack1 = trapBack->subtract(((*brWindow) << brWindowShift));
125 
126  // Cache the volume calculation here.
127  // It's always the same, and finding the volume of a subtracted shape
128  // is very expensive --- GeoModel does it by doing a MC integration within
129  // the bounding box with a hardcoded number of sample points of 1e6.
130  // This is particularly slow in a debug build, as we have to do a bunch
131  // of eigen calculations for each MC point.
132  const static double vol = trapBack1.volume();
133  const GeoMaterial* dbmPeek4 = m_mat_mgr->getMaterialForVolume("pix::DBMPeek4",vol);
134  const GeoLogVol* trapBackLog = new GeoLogVol("bracketLog", &trapBack1, dbmPeek4);
135  GeoPhysVol* trapBackPhys = new GeoPhysVol(trapBackLog);
136 
137  GeoTrf::RotateX3D rmX90(90.*Gaudi::Units::deg);
138  double trapBackPos_Z = -telescopeZ/2. + bracketZ - brcktLockZ + ( (trapBackShortZ+trapBackY*tan(angle))/2. + trapBackY/2.*sin(trapBack_theta) - trapBackY*tan(trapBack_theta) );
139  GeoTrf::Translation3D trapBackPos(0.0, -telescopeY/2. + trapBackY/2. + safety, trapBackPos_Z + 3*safety);
140  xform = new GeoTransform(GeoTrf::Transform3D(trapBackPos*rmX90));
141  tag = new GeoNameTag("trapBack");
142  telescopePhys->add(tag);
143  telescopePhys->add(xform);
144  telescopePhys->add(trapBackPhys);
145 
146  // bracket front top plate
147  const GeoBox* brcktTopBlock = new GeoBox(bracketX/2., (bracketY - brcktSideBlockY)/2., brcktTopBlockZ/2.);
148  const GeoMaterial* dbmPeekAluminium = m_mat_mgr->getMaterialForVolume("pix::DBMPeekAl",brcktTopBlock->volume());
149  const GeoLogVol* brcktTopBlockLog = new GeoLogVol("bracketLog", brcktTopBlock, dbmPeekAluminium);
150  GeoPhysVol* brcktTopBlockPhys = new GeoPhysVol(brcktTopBlockLog);
151 
152  GeoTrf::Translate3D brcktTopBlockPos( 0., -telescopeY/2. + brcktSideBlockY + (bracketY - brcktSideBlockY)/2.+2*safety, -telescopeZ/2. + brcktTopBlockZ/2.);
153  xform = new GeoTransform(brcktTopBlockPos);
154  tag = new GeoNameTag("brcktTopBlock");
155  telescopePhys->add(tag);
156  telescopePhys->add(xform);
157  telescopePhys->add(brcktTopBlockPhys);
158 
159  // bracket front side blocks
160  const GeoBox* brcktSideBlock = new GeoBox(brcktSideBlockX/2., brcktSideBlockY/2., brcktTopBlockZ/2.);
161  const GeoMaterial* dbmPeek2 = m_mat_mgr->getMaterialForVolume("pix::DBMPeek2",brcktSideBlock->volume());
162  const GeoLogVol* brcktSideLog = new GeoLogVol("brcktSideLog", brcktSideBlock, dbmPeek2);
163  GeoPhysVol* brcktSidePhys = new GeoPhysVol(brcktSideLog);
164 
165  GeoTrf::Translate3D brcktSidePos1( bracketX/2. - brcktSideBlockX/2., -telescopeY/2. + brcktSideBlockY/2.+safety, -telescopeZ/2. + brcktTopBlockZ/2.);
166  xform = new GeoTransform(brcktSidePos1);
167  tag = new GeoNameTag("brcktSideBlock");
168  telescopePhys->add(tag);
169  telescopePhys->add(xform);
170  telescopePhys->add(brcktSidePhys);
171 
172  GeoTrf::Translate3D brcktSidePos2( -bracketX/2. + brcktSideBlockX/2., -telescopeY/2. + brcktSideBlockY/2. + safety, -telescopeZ/2. + brcktTopBlockZ/2.);
173  xform = new GeoTransform(brcktSidePos2);
174  tag = new GeoNameTag("brcktSideBlock");
175  telescopePhys->add(tag);
176  telescopePhys->add(xform);
177  telescopePhys->add(brcktSidePhys);
178 
179  // bracket Locking block
180  const GeoBox* brcktLock = new GeoBox(bracketX/2., brcktLockY/2.-safety, brcktLockZ/2.-safety);
181  const GeoMaterial* dbmPeek3 = m_mat_mgr->getMaterialForVolume("pix::DBMPeek3",brcktLock->volume());
182  const GeoLogVol* brcktLockLog = new GeoLogVol("bracketLog", brcktLock, dbmPeek3);
183  GeoPhysVol* brcktLockPhys = new GeoPhysVol(brcktLockLog);
184 
185  GeoTrf::Translate3D brcktLockPos( 0., -telescopeY/2. + trapBackY + brcktLockY/2. + 2*safety, -telescopeZ/2. + bracketZ - brcktLockZ/2. + safety);
186  xform = new GeoTransform(brcktLockPos);
187  tag = new GeoNameTag("brcktLock");
188  telescopePhys->add(tag);
189  telescopePhys->add(xform);
190  telescopePhys->add(brcktLockPhys);
191 
192  // rectangular aluminium side plates
193 
194  const GeoBox* sidePlate = new GeoBox(coolingSidePlateX/2., coolingSidePlateY/2., coolingSidePlateZ/2.);
195  const GeoMaterial* dbmAluminium2 = m_mat_mgr->getMaterialForVolume("pix::DBMAluminium2", sidePlate->volume());
196  const GeoLogVol* sidePlateLog = new GeoLogVol("sidePlateLog", sidePlate, dbmAluminium2);
197  GeoPhysVol* sidePlatePhys = new GeoPhysVol(sidePlateLog);
198 
199  double spAngle = angle + 17.57126*Gaudi::Units::deg;
200  double spRadius = 1/2. * sqrt(coolingSidePlateZ*coolingSidePlateZ + coolingSidePlateY*coolingSidePlateY);
201 
202  GeoTrf::Translation3D sidePlatePos1( mainPlateX/2. + coolingSidePlateX/2. + 2*safety, - telescopeY/2. + spRadius * sin(spAngle), -telescopeZ/2. + layerUnitPos_Z - coolingSidePlatePos*cos(angle) + spRadius * cos(spAngle));
203  xform = new GeoTransform(GeoTrf::Transform3D(sidePlatePos1*rmX10));
204  tag = new GeoNameTag("sidePlate");
205  telescopePhys->add(tag);
206  telescopePhys->add(xform);
207  telescopePhys->add(sidePlatePhys);
208 
209  GeoTrf::Translation3D sidePlatePos2( -mainPlateX/2. - coolingSidePlateX/2. - 2*safety, - telescopeY/2. + spRadius * sin(spAngle), -telescopeZ/2. + layerUnitPos_Z - coolingSidePlatePos*cos(angle) + spRadius * cos(spAngle));
210  xform = new GeoTransform(GeoTrf::Transform3D(sidePlatePos2*rmX10));
211  tag = new GeoNameTag("sidePlate");
212  telescopePhys->add(tag);
213  telescopePhys->add(xform);
214  telescopePhys->add(sidePlatePhys);
215 
216  //cooling plates next to the bracket unit
217  const GeoTrap* coolingFin = new GeoTrap(coolingFinHeight/2., trapBack_theta, 90.0*Gaudi::Units::deg, (coolingFinLongZ - coolingFinHeight*tan(angle))/2., coolingFinThick/2., coolingFinThick/2, 0.0, coolingFinLongZ/2., coolingFinThick/2., coolingFinThick/2., 0.0);
218  const GeoMaterial* dbmAluminium3 = m_mat_mgr->getMaterialForVolume("pix::DBMAluminium3", coolingFin->volume());
219  const GeoLogVol* finLog = new GeoLogVol("finLog", coolingFin, dbmAluminium3);
220  GeoPhysVol* coolingFinPhys = new GeoPhysVol(finLog);
221 
222  GeoTrf::Translation3D finPos1( mainPlateX/2. - coolingFinThick/2. + safety, -telescopeY/2. + coolingFinHeight/2. + 4*safety, -telescopeZ/2. + coolingFinPos + 0.05*Gaudi::Units::mm);
223  xform = new GeoTransform(GeoTrf::Transform3D(finPos1*rmX90));
224  tag = new GeoNameTag("finPlate");
225  telescopePhys->add(tag);
226  telescopePhys->add(xform);
227  telescopePhys->add(coolingFinPhys);
228 
229  GeoTrf::Translation3D finPos2( -mainPlateX/2. + coolingFinThick/2. - safety, -telescopeY/2. + coolingFinHeight/2. + 4*safety, -telescopeZ/2. + coolingFinPos + 0.05*Gaudi::Units::mm);
230  xform = new GeoTransform(GeoTrf::Transform3D(finPos2*rmX90));
231  tag = new GeoNameTag("finPlate");
232  telescopePhys->add(tag);
233  telescopePhys->add(xform);
234  telescopePhys->add(coolingFinPhys);
235 
236 
237  return telescopePhys;
238 
239 }
240 
PixelGeometryManager::DBMBrcktLockZ
virtual double DBMBrcktLockZ()=0
PixelGeometryManager::DBMBrcktWindowY
virtual double DBMBrcktWindowY()=0
DBM_ModuleCage.h
DBM_ModuleCage
The module cage is the structure forming of the three aluminium plates and rods, which support the DB...
Definition: DBM_ModuleCage.h:17
PixelGeometryManager::DBMTelescopeZ
virtual double DBMTelescopeZ()=0
PixelGeometryManager::DBMBracketZ
virtual double DBMBracketZ()=0
PixelGeometryManager::DBMTelescopeX
virtual double DBMTelescopeX()=0
PixelGeometryManager::DBMMainPlateX
virtual double DBMMainPlateX()=0
PixelGeometryManager::DBMTrapezBackX
virtual double DBMTrapezBackX()=0
PixelGeometryManager::DBMCoolingSidePlatePos
virtual double DBMCoolingSidePlatePos()=0
PixelGeometryManager::DBMCoolingSidePlateX
virtual double DBMCoolingSidePlateX()=0
PixelGeometryManager::DBMTrapezBackShortZ
virtual double DBMTrapezBackShortZ()=0
deg
#define deg
Definition: SbPolyhedron.cxx:17
PixelGeometryManager::DBMBracketY
virtual double DBMBracketY()=0
PixelGeometryManager::DBMBrcktWindowX
virtual double DBMBrcktWindowX()=0
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
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
PixelGeometryManager::DBMTelescopeY
virtual double DBMTelescopeY()=0
GeoVPixelFactory::m_DDmgr
InDetDD::PixelDetectorManager * m_DDmgr
Definition: GeoVPixelFactory.h:45
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
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
PixelGeometryManager::DBMCoolingSidePlateZ
virtual double DBMCoolingSidePlateZ()=0
PixelGeometryManager::DBMBrcktFinPos
virtual double DBMBrcktFinPos()=0
DBM_Telescope.h
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
PixelGeometryManager::DBMBrcktLockY
virtual double DBMBrcktLockY()=0
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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
DBM_Telescope::Build
virtual GeoVPhysVol * Build() override
Definition: DBM_Telescope.cxx:25
PixelGeometryManager::DBMAngle
virtual double DBMAngle()=0
PixelGeometryManager::DBMBrcktFinHeight
virtual double DBMBrcktFinHeight()=0
PixelGeometryManager::DBMCoolingSidePlateY
virtual double DBMCoolingSidePlateY()=0
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
PixelGeometryManager::DBMTrapezBackY
virtual double DBMTrapezBackY()=0
PixelGeometryManager::DBMBrcktWindowCenterZ
virtual double DBMBrcktWindowCenterZ()=0
InDetMaterialManager.h
PixelGeometryManager::DBMModuleCageY
virtual double DBMModuleCageY()=0
PixelGeometryManager::DBMModuleCageZ
virtual double DBMModuleCageZ()=0
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
PixelGeometryManager::DBMBrcktFinThick
virtual double DBMBrcktFinThick()=0
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
PixelGeometryManager::DBMBracketX
virtual double DBMBracketX()=0
PixelGeometryManager::DBMBrcktSideBlockY
virtual double DBMBrcktSideBlockY()=0
PixelGeometryManager::DBMBrcktTopBlockZ
virtual double DBMBrcktTopBlockZ()=0
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
PixelGeometryManager::DBMBrcktWindowOffset
virtual double DBMBrcktWindowOffset()=0
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::DBMBrcktSideBlockX
virtual double DBMBrcktSideBlockX()=0
PixelGeometryManager::DBMTrapezBackTheta
virtual double DBMTrapezBackTheta()=0
PixelGeometryManager::DBMBrcktFinLongZ
virtual double DBMBrcktFinLongZ()=0