ATLAS Offline Software
Loading...
Searching...
No Matches
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{
32 m_legacyManager = m_gmt_mgr->legacyManager();
33}
34
36{
37 return nullptr;
38}
39
41 //
42 std::string logName = "BoxFrBarOutLog";
43 std::string volumeName = "Frame";
44 int typenum = 1;
45 if(m_legacyManager->isBarrelInSFrame() ) {
46 logName = "BoxFrBarInLog";
47 typenum = 0;
48 }
49 if(m_legacyManager->isEndcapInSFrame() ) {
50 logName = "BoxFrEndcapLog";
51 typenum = 2;
52 }
53 //
54 // Dimensions
55 //
56 double length = m_legacyManager->PixelBFrameHalfLength();
57 double thickness = m_legacyManager->PixelBFrameHalfThickness();
58 double width = m_legacyManager->PixelBFrameHalfWidth();
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;
79 if(m_legacyManager->isBarrelInSFrame()) {
80 logName = "TrapFrBarInLog";
81 typenum = 3;
82 }
83 if(m_legacyManager->isEndcapInSFrame()) {
84 logName = "TrapFrEndcapLog";
85 typenum = 5;
86 }
87 if(m_legacyManager->isEndConeSFrame()) {
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.;
98 double length = m_legacyManager->PixelTFrameHalfLength();
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
117void 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
123 m_legacyManager->setBarrelInSFrame();
124 double alpha = 45.*Gaudi::Units::deg;
125 double w1 = m_legacyManager->PixelBarrelBFrameWidth();
126 double w2 = m_legacyManager->PixelBarrelTFrameWidth();
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
151 m_legacyManager->setBarrelOutSFrame();
152 w1 = m_legacyManager->PixelBarrelBFrameWidth();
153 w2 = m_legacyManager->PixelBarrelTFrameWidth();
154 off = m_legacyManager->PixelBarrelFrameOffset()+m_legacyManager->PixelBarrelFrameLength();
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++) {
174 m_legacyManager->setBarrelOutSFrame();
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 //
189 m_legacyManager->setEndConeSFrame();
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
207void 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 //
216 m_legacyManager->setEndcapInSFrame();
217 double alpha = 45.*Gaudi::Units::deg;
218 double w1 = m_legacyManager->PixelEndcapBFrameWidth();
219 double w2 = m_legacyManager->PixelEndcapTFrameWidth();
220 double off = m_legacyManager->PixelEndcapFrameOffset()+m_legacyManager->PixelEndcapFrameLength();
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
Scalar phi() const
phi method
double length(const pvec &v)
const double width
GeoVPhysVol * BuildTrap()
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)
GeoVPhysVol * BuildBox()
void BuildOutBarrel(GeoFullPhysVol *parent)
virtual GeoVPhysVol * Build() override
PixelLegacyManager * m_legacyManager
void BuildInBarrel(GeoFullPhysVol *parent)
PixelGeometryManager * m_gmt_mgr
InDetMaterialManager * m_mat_mgr
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)
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
STL namespace.