ATLAS Offline Software
GeoPixelOldFrame.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 //
6 // New description of the pixel support frame (M.Zdrazil + AR)
7 // The box part (of barrel)
8 //
9 #include <utility>
10 
11 #include "GeoPixelOldFrame.h"
12 #include "PixelLegacyManager.h"
13 #include "GeoModelKernel/GeoBox.h"
14 #include "GeoModelKernel/GeoTrap.h"
15 #include "GeoModelKernel/GeoLogVol.h"
16 #include "GeoModelKernel/GeoNameTag.h"
17 #include "GeoModelKernel/GeoPhysVol.h"
18 #include "GeoModelKernel/GeoFullPhysVol.h"
19 #include "GeoModelKernel/GeoMaterial.h"
20 #include "GeoModelKernel/GeoTransform.h"
21 #include "GaudiKernel/SystemOfUnits.h"
22 
23 // Satisfy interface
24 
27  GeoModelIO::ReadGeoModel* sqliteReader,
28  std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
29  std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
30  : GeoVPixelFactory (ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX))
31 {
33 }
34 
35 GeoVPhysVol* GeoPixelOldFrame::Build()
36 {
37  return nullptr;
38 }
39 
41  //
42  std::string logName = "BoxFrBarOutLog";
43  std::string volumeName = "Frame";
44  int typenum = 1;
46  logName = "BoxFrBarInLog";
47  typenum = 0;
48  }
50  logName = "BoxFrEndcapLog";
51  typenum = 2;
52  }
53  //
54  // Dimensions
55  //
57  double thickness = m_legacyManager->PixelBFrameHalfThickness();
59  //
60  const GeoBox* frameBox = new GeoBox(thickness,width,length);
61  std::string matName = m_gmt_mgr->getMaterialName(volumeName, 0, typenum);
62  const GeoMaterial* frameMat = m_mat_mgr->getMaterialForVolume(matName, frameBox->volume());
63  GeoLogVol* theFrame = new GeoLogVol(logName,frameBox,frameMat);
64  GeoPhysVol* framePhys = new GeoPhysVol(theFrame);
65 
66  return framePhys;
67 }
68 
69 //
70 // New description of the pixel support frame (M.Zdrazil + AR)
71 // The trapezoid part (of barrel)
72 //
73 
75  //
76  std::string logName = "TrapFrBarOutLog";
77  std::string volumeName = "Frame";
78  int typenum = 4;
80  logName = "TrapFrBarInLog";
81  typenum = 3;
82  }
84  logName = "TrapFrEndcapLog";
85  typenum = 5;
86  }
88  logName = "TrapFrEndCone";
89  volumeName = "EndCone";
90  typenum = 0;
91  }
92  //
93  // Dimensions
94  //
95  double al1 = 0.;
96  double al2 = 0.;
97  double phi = 0.;
99  double widthy = m_legacyManager->PixelTFrameHalfWidthY();
100  double widthxzn = m_legacyManager->PixelTFrameHalfWidthXzn();
101  double widthxzp = m_legacyManager->PixelTFrameHalfWidthXzp();
102  double tet = m_legacyManager->PixelTFrameDzDr();
103  //
104 
105  const GeoTrap* frameTrap = new GeoTrap(length,tet,phi,widthy,widthxzn,widthxzp,al1,widthy,widthxzn,widthxzp,al2);
106  std::string matName = m_gmt_mgr->getMaterialName(volumeName, 0, typenum);
107  const GeoMaterial* frameMat = m_mat_mgr->getMaterialForVolume(matName, frameTrap->volume());
108  GeoLogVol* theFrame = new GeoLogVol(logName,frameTrap,frameMat);
109  GeoPhysVol* framePhys = new GeoPhysVol(theFrame);
110 
111  return framePhys;
112 }
113 
114 
115 
117 void GeoPixelOldFrame::BuildInBarrel(GeoFullPhysVol * parent) {
118  // It is split into two parts : one is the barrel part and one
119  // is part of the endcap frame.
120  //
121 
122  // First part
124  double alpha = 45.*Gaudi::Units::deg;
127  double off = m_legacyManager->PixelBarrelFrameOffset();
128  for (int ii = 0; ii < m_legacyManager->PixelBarrelNBFrame(); ii++) {
129  GeoNameTag* tag = new GeoNameTag("Inside Box Frame");
130  double thet = ((float)ii+0.5)*alpha;
131  GeoTrf::Translation3D pos(w1*cos(thet),w1*sin(thet),off);
132  GeoTrf::RotateZ3D rm(((float)ii+2.5)*alpha);
133  GeoTransform* xform = new GeoTransform(GeoTrf::Transform3D(pos*rm));
134  parent->add(tag);
135  parent->add(xform);
136  parent->add(BuildBox());
137  }
138 
139  for (int ii = 0; ii < m_legacyManager->PixelBarrelNTFrame(); ii++) {
140  GeoNameTag* tag = new GeoNameTag("Inside Trap Frame");
141  double thet = ((float)ii+1.)*alpha;
142  GeoTrf::Translation3D pos(w2*cos(thet),w2*sin(thet),off);
143  GeoTrf::RotateZ3D rm(((float)ii+3.0)*alpha);
144  GeoTransform* xform = new GeoTransform(GeoTrf::Transform3D(pos*rm));
145  parent->add(tag);
146  parent->add(xform);
147  parent->add(BuildTrap());
148  }
149  //
150  // Second part
155  double radi = m_legacyManager->PixelBarrelFrameECRadius();
156  double zpec = m_legacyManager->PixelBarrelFrameECZPos();
157  double alxec = m_legacyManager->PixelBarrelFrameECAlphaX();
158  for (int ii = 0; ii < m_legacyManager->PixelBarrelNBFrame(); ii++) {
159  GeoNameTag* tag = new GeoNameTag("Outside Box Frame");
160  double thet = ((float)ii+0.5)*alpha;
161  GeoTrf::Translation3D pos(w1*cos(thet),w1*sin(thet),off);
162  GeoTrf::RotateZ3D rm(((float)ii+2.5)*alpha);
163  GeoTransform* xform = new GeoTransform(GeoTrf::Transform3D(pos*rm));
164  parent->add(tag);
165  parent->add(xform);
166  parent->add(BuildBox());
167  pos.z()= -off;
168  GeoTransform* xform2 = new GeoTransform(GeoTrf::Transform3D(pos*rm));
169  parent->add(tag);
170  parent->add(xform2);
171  parent->add(BuildBox());
172  }
173  for (int ii = 0; ii < m_legacyManager->PixelBarrelNTFrame(); ii++) {
175  GeoNameTag* tag = new GeoNameTag("Outside Trap Frame");
176  double thet = ((float)ii+1.)*alpha;
177  GeoTrf::Translation3D pos(w2*cos(thet),w2*sin(thet),off);
178  GeoTrf::RotateZ3D rm(((float)ii+3.0)*alpha);
179  GeoTransform* xform = new GeoTransform(GeoTrf::Transform3D(pos*rm));
180  parent->add(tag);
181  parent->add(xform);
182  parent->add(BuildTrap());
183  pos.z() = -off;
184  GeoTransform* xform2 = new GeoTransform(GeoTrf::Transform3D(pos*rm));
185  parent->add(tag);
186  parent->add(xform2);
187  parent->add(BuildTrap());
188  //
190  GeoNameTag* tag2 = new GeoNameTag("Outside End Cone Trap Frame");
191  thet = ((float)ii+0.5)*alpha;
192  GeoTrf::Translation3D posec(radi*cos(thet),radi*sin(thet),zpec);
193  GeoTrf::Transform3D rm2 = GeoTrf::RotateZ3D(((float)ii+2.5)*alpha)*GeoTrf::RotateX3D(alxec);
194  GeoTransform* xform3 = new GeoTransform(GeoTrf::Transform3D(posec*rm2));
195  parent->add(tag2);
196  parent->add(xform3);
197  parent->add(BuildTrap());
198  posec.z() = -zpec;
199  GeoTrf::Transform3D rm3 = GeoTrf::RotateZ3D(((float)ii+2.5)*alpha)*GeoTrf::RotateX3D(-alxec);
200  GeoTransform* xform4 = new GeoTransform(GeoTrf::Transform3D(posec*rm3));
201  parent->add(tag2);
202  parent->add(xform4);
203  parent->add(BuildTrap());
204  }
205 }
206 
207 void GeoPixelOldFrame::BuildOutBarrel(GeoFullPhysVol * parent) {
208 
209 
210  bool endcapAPresent = m_gmt_mgr->partPresent("EndcapA");
211  bool endcapCPresent = m_gmt_mgr->partPresent("EndcapC");
212 
213  //
214  // Add the pixel frame inside the endcap volume
215  //
217  double alpha = 45.*Gaudi::Units::deg;
221 
222  for (int ii = 0; ii < m_legacyManager->PixelEndcapNBFrame(); ii++) {
223  GeoNameTag* tag = new GeoNameTag("Outside Outer Endcap Box Frame");
224  double thet = ((float)ii+0.5)*alpha;
225  GeoTrf::Translation3D pos(w1*cos(thet),w1*sin(thet),off);
226  GeoTrf::RotateZ3D rm(((float)ii+2.5)*alpha);
227 
228  if (endcapAPresent) {
229  GeoTransform* xform1 = new GeoTransform(GeoTrf::Transform3D(pos*rm));
230  parent->add(tag);
231  parent->add(xform1);
232  parent->add(BuildBox());
233  }
234  if (endcapCPresent) {
235  pos.z() = -off;
236  GeoTransform* xform2 = new GeoTransform(GeoTrf::Transform3D(pos*rm));
237  parent->add(tag);
238  parent->add(xform2);
239  parent->add(BuildBox());
240  }
241  }
242 
243  for (int ii = 0; ii < m_legacyManager->PixelEndcapNTFrame(); ii++) {
244  GeoNameTag* tag = new GeoNameTag("Outside Outer Endcap Trap Frame");
245  double thet = ((float)ii+1.)*alpha;
246  GeoTrf::Translation3D pos(w2*cos(thet),w2*sin(thet),off);
247  GeoTrf::RotateZ3D rm(((float)ii+3.0)*alpha);
248  if (endcapAPresent) {
249  GeoTransform* xform1 = new GeoTransform(GeoTrf::Transform3D(pos*rm));
250  parent->add(tag);
251  parent->add(xform1);
252  parent->add(BuildTrap());
253  }
254  if (endcapCPresent) {
255  pos.z() = -off;
256  GeoTransform* xform2 = new GeoTransform(GeoTrf::Transform3D(pos*rm));
257  parent->add(tag);
258  parent->add(xform2);
259  parent->add(BuildTrap());
260  }
261  }
262 }
263 
PixelLegacyManager::isEndConeSFrame
bool isEndConeSFrame()
Definition: PixelLegacyManager.h:77
GeoPixelOldFrame.h
PixelLegacyManager::PixelBarrelFrameLength
double PixelBarrelFrameLength()
Definition: PixelLegacyManager.cxx:105
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
PixelGeometryManager
Definition: PixelGeometryManager.h:28
PixelLegacyManager::PixelBarrelFrameECZPos
double PixelBarrelFrameECZPos()
Definition: PixelLegacyManager.cxx:283
PixelLegacyManager::PixelEndcapNBFrame
int PixelEndcapNBFrame()
Definition: PixelLegacyManager.cxx:124
deg
#define deg
Definition: SbPolyhedron.cxx:17
GeoPixelOldFrame::BuildTrap
GeoVPhysVol * BuildTrap()
Definition: GeoPixelOldFrame.cxx:74
PixelLegacyManager.h
PixelLegacyManager::PixelBarrelNTFrame
int PixelBarrelNTFrame()
Definition: PixelLegacyManager.cxx:78
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
PixelLegacyManager::isEndcapInSFrame
bool isEndcapInSFrame()
Definition: PixelLegacyManager.h:75
PixelLegacyManager::setEndcapInSFrame
void setEndcapInSFrame()
Definition: PixelLegacyManager.h:76
GeoVPixelFactory::m_gmt_mgr
PixelGeometryManager * m_gmt_mgr
Definition: GeoVPixelFactory.h:43
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
PixelLegacyManager::PixelEndcapNTFrame
int PixelEndcapNTFrame()
Definition: PixelLegacyManager.cxx:129
GeoPixelOldFrame::BuildOutBarrel
void BuildOutBarrel(GeoFullPhysVol *parent)
Definition: GeoPixelOldFrame.cxx:207
PixelLegacyManager::PixelBarrelFrameOffset
double PixelBarrelFrameOffset()
Definition: PixelLegacyManager.cxx:114
PixelLegacyManager::PixelEndcapTFrameWidth
double PixelEndcapTFrameWidth()
Definition: PixelLegacyManager.cxx:139
PixelLegacyManager::PixelTFrameDzDr
double PixelTFrameDzDr()
Definition: PixelLegacyManager.cxx:261
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
plotBeamSpotCompare.tag2
string tag2
Definition: plotBeamSpotCompare.py:76
GeoPixelOldFrame::GeoPixelOldFrame
GeoPixelOldFrame(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: GeoPixelOldFrame.cxx:25
PixelLegacyManager::PixelEndcapFrameOffset
double PixelEndcapFrameOffset()
Definition: PixelLegacyManager.cxx:149
GeoPixelOldFrame::BuildInBarrel
void BuildInBarrel(GeoFullPhysVol *parent)
Definition: GeoPixelOldFrame.cxx:117
PixelLegacyManager::PixelBFrameHalfLength
double PixelBFrameHalfLength()
Definition: PixelLegacyManager.cxx:154
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
PixelLegacyManager::PixelBarrelNBFrame
int PixelBarrelNBFrame()
Definition: PixelLegacyManager.cxx:69
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
PixelLegacyManager::PixelBarrelFrameECRadius
double PixelBarrelFrameECRadius()
Definition: PixelLegacyManager.cxx:278
PixelLegacyManager::PixelBarrelBFrameWidth
double PixelBarrelBFrameWidth()
Definition: PixelLegacyManager.cxx:87
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
GeoPixelOldFrame::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelOldFrame.cxx:35
PixelLegacyManager::setBarrelOutSFrame
void setBarrelOutSFrame()
Definition: PixelLegacyManager.h:79
PixelLegacyManager::PixelTFrameHalfWidthXzn
double PixelTFrameHalfWidthXzn()
Definition: PixelLegacyManager.cxx:227
GeoPixelOldFrame::BuildBox
GeoVPhysVol * BuildBox()
Definition: GeoPixelOldFrame.cxx:40
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
PixelLegacyManager::setEndConeSFrame
void setEndConeSFrame()
Definition: PixelLegacyManager.h:78
PixelLegacyManager::isBarrelInSFrame
bool isBarrelInSFrame()
Definition: PixelLegacyManager.h:73
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
PixelLegacyManager::PixelBarrelFrameECAlphaX
double PixelBarrelFrameECAlphaX()
Definition: PixelLegacyManager.cxx:288
PixelGeometryManager::legacyManager
virtual PixelLegacyManager * legacyManager()
Definition: PixelGeometryManager.cxx:17
GeoVPixelFactory
This is the base class for all the pieces of the Pixel detector.
Definition: GeoVPixelFactory.h:31
PixelLegacyManager::PixelTFrameHalfWidthY
double PixelTFrameHalfWidthY()
Definition: PixelLegacyManager.cxx:210
PixelLegacyManager::PixelEndcapFrameLength
double PixelEndcapFrameLength()
Definition: PixelLegacyManager.cxx:144
PixelLegacyManager::PixelEndcapBFrameWidth
double PixelEndcapBFrameWidth()
Definition: PixelLegacyManager.cxx:134
PixelGeometryManager::getMaterialName
virtual std::string getMaterialName(const std::string &volumeName, int layerdisk=0, int typenum=0)=0
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
GeoPixelOldFrame::m_legacyManager
PixelLegacyManager * m_legacyManager
Definition: GeoPixelOldFrame.h:30
PixelLegacyManager::setBarrelInSFrame
void setBarrelInSFrame()
Definition: PixelLegacyManager.h:74
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
PixelLegacyManager::PixelBFrameHalfThickness
double PixelBFrameHalfThickness()
Definition: PixelLegacyManager.cxx:180
readCCLHist.float
float
Definition: readCCLHist.py:83
PixelLegacyManager::PixelTFrameHalfWidthXzp
double PixelTFrameHalfWidthXzp()
Definition: PixelLegacyManager.cxx:244
PixelGeometryManager::partPresent
virtual bool partPresent(const std::string &partName) const =0
PixelLegacyManager::PixelTFrameHalfLength
double PixelTFrameHalfLength()
Definition: PixelLegacyManager.cxx:193
PixelLegacyManager::PixelBFrameHalfWidth
double PixelBFrameHalfWidth()
Definition: PixelLegacyManager.cxx:167
PixelLegacyManager::PixelBarrelTFrameWidth
double PixelBarrelTFrameWidth()
Definition: PixelLegacyManager.cxx:96