ATLAS Offline Software
Loading...
Searching...
No Matches
GeoPixelDisk Class Reference

#include <GeoPixelDisk.h>

Inheritance diagram for GeoPixelDisk:
Collaboration diagram for GeoPixelDisk:

Public Member Functions

 GeoPixelDisk (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
double Thickness ()
double RMax ()
double RMin ()

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

Detailed Description

Definition at line 11 of file GeoPixelDisk.h.

Constructor & Destructor Documentation

◆ GeoPixelDisk()

GeoPixelDisk::GeoPixelDisk ( 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 26 of file GeoPixelDisk.cxx.

31 : GeoVPixelFactory (ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX))
32{
33}
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)

Member Function Documentation

◆ Build()

GeoVPhysVol * GeoPixelDisk::Build ( )
overridevirtual

Implements GeoVPixelFactory.

Definition at line 35 of file GeoPixelDisk.cxx.

35 {
36
37 int brl_ec=0;
38
39 // Need to specify some eta. Assume all module the same
40 m_gmt_mgr->SetEta(0);
41 // angle between two adjacent modules on one side of the disk
42 // it is 360 deg / 24 modules = 15 deg
43 int nbECSector = m_gmt_mgr->PixelECNSectors1();
44 if(nbECSector==0){
45 return nullptr;
46 }
47
48 std::ostringstream ostr;
49 ostr << m_gmt_mgr->GetLD();
50 const GeoLogVol* theDisk{nullptr};
51 if(!m_sqliteReader) {
52 //
53 // Dimensions from class methods.
54 //
55 double rmin = RMin();
56 double rmax = RMax();
57 double halflength = Thickness()*0.5;
58 const GeoMaterial* air = m_mat_mgr->getMaterial("std::Air");
59 const GeoTube* diskTube = new GeoTube(rmin,rmax,halflength);
60 theDisk = new GeoLogVol("Disk"+ostr.str(),diskTube,air);
61 }
62 //
63 // Define the Sensor to be used here, so it will be the same for all the disk
64 GeoPixelSiCrystal theSensor(m_DDmgr, m_gmt_mgr, m_sqliteReader, m_mapFPV, m_mapAX, false, false, true /*different design for even and odd phi*/);
65 if(m_sqliteReader && m_gmt_mgr->isEndcap() ) brl_ec = 2*m_gmt_mgr->GetSide();
66 GeoFullPhysVol* diskPhys = m_sqliteReader==nullptr ? new GeoFullPhysVol(theDisk) : nullptr;
67 //
68 // Place the disk sectors (on both sides):
69 //
70 // Need to specify some eta. Assume all module the same
71 GeoPixelModule psd(m_DDmgr, m_gmt_mgr, m_sqliteReader, m_mapFPV, m_mapAX, theSensor);
72 double zpos = m_gmt_mgr->PixelECSiDz1()*0.5;
73 double deltaPhi = 360.*Gaudi::Units::deg/ (float) nbECSector;
74 // This is the start angle of the even modules (3.75 deg):
75 double startAngle = deltaPhi*0.25;
76 // Start angle could eventually come from the database...
77 // double startAngle = m_gmt_mgr->PixelECStartPhi();
78
79 // This is the radius of the center of the active sensor (also center of the module)
80 double moduleRadius = m_gmt_mgr->PixelDiskRMin() + 0.5*m_gmt_mgr->PixelBoardActiveLength();
81
82 // for compatibility with older geometries we have to incorrectly rotate modules in endcap C
83 bool oldGeometry = (m_gmt_mgr->dbVersion() < 1);
84
85 // In Global coordinate system (X,Y,Z):
86 //--------------------------------------
87 // (for reference see GWG's June 20, 2005 Pixel Offline Mtg presentation, p.4)
88 // The module has X axis (depth axis) out of the plane pointing
89 // towards the chips. Z axis is the eta direction. To place it on
90 // the disk we rotate 90 deg around Y. This leaves the depth axis
91 // pointing in the -ve Z direction. For the back of the disk this is
92 // the correct orientation. For the front of the disk we rotate
93 // 180 deg around X.
94
95
96
97 // Looking from IP at module at ~12:00 (+ve global Y)
98 //
99 // For side A, Global axes:
100 //
101 // Y ^
102 // |
103 // |
104 // X<--x
105 //
106 // Z axis into page
107 //
108
109 // Module on front of disk (closest to IP)
110 // MCC side
111 //
112 // 0 F ^z
113 // . . |
114 // . . |
115 // . . <-- x Module ref system (Hit frame)
116 // 7 8 y
117
118 // Module on back of disk (furthest from IP)
119 // Still looking from IP.
120 //
121 // Chip side
122 // F 0 ^z
123 // . . |
124 // . . |
125 // . . .--> Module ref system (Hit frame)
126 // 8 z y
127 //
128 //
129
130 // Set numerology
131 m_gmt_mgr->SetEta(0);
132 m_DDmgr->numerology().setNumRingsForDisk(m_gmt_mgr->GetLD(),1);
133 m_DDmgr->numerology().setNumPhiModulesForDiskRing(m_gmt_mgr->GetLD(),0,m_gmt_mgr->PixelECNSectors1()*2);
134
135 // Even modules (front of disk, delta z < 0)
136 // and Odd modules (back of disk, delta z > 0)
137 int pixelECNSectors1 = m_gmt_mgr->PixelECNSectors1();
138 for (int ii = 0; ii < pixelECNSectors1*2; ii++) {
139
140 // Build both endcaps the same but re-number phiId in endcap C to get correct offline numbering.
141 // Endcap C is obtained by rotating endcap A by 180 around y axis. Numbering goes in opposite direction
142 // with module 0 becoming module 23. Mapping is 0<->23, 24<->47.
143
144 // Add a test to get rid off division by zero coverity error
145 int phiId = 0;
146 if(pixelECNSectors1>0) phiId = (m_gmt_mgr->GetSide()>0) ? ii : (3*pixelECNSectors1-ii-1)%(pixelECNSectors1*2);
147
148 m_gmt_mgr->SetPhi(phiId);
149
150 if(m_sqliteReader) {
151 psd.Build();
152 std::string key="ModuleEC_"+ std::to_string(phiId)+"_"+std::to_string(m_gmt_mgr->GetLD())+"_"+std::to_string(m_gmt_mgr->Phi())+"_"+std::to_string(m_gmt_mgr->Eta());
153 Identifier id = theSensor.getID();
154 m_DDmgr->addAlignableTransform(0,id,(*m_mapAX)[key],(*m_mapFPV)[key]);
155 continue;
156 }
157
158 double angle = ii*0.5*deltaPhi+startAngle;
159 //if ( m_gmt_mgr->GetSide()<0 ) angle = 360*Gaudi::Units::deg-(ii*deltaPhi+startAngle);
160 int diskSide = (ii%2) ? +1 : -1; // even: -1, odd +1
161
162
163 GeoTrf::Transform3D rmX(GeoTrf::Transform3D::Identity());
164 if (oldGeometry && m_gmt_mgr->GetSide()<0) {
165 if (diskSide > 0) rmX = GeoTrf::RotateX3D(180.*Gaudi::Units::deg); // This is for compatibilty with older geomtries.
166 } else {
167 if (diskSide < 0) rmX = GeoTrf::RotateX3D(180.*Gaudi::Units::deg); // depth axis points towards disk.
168 }
169 GeoTrf::Transform3D rm = GeoTrf::RotateZ3D(angle) * rmX * GeoTrf::RotateY3D(90*Gaudi::Units::deg);
170 GeoTrf::Vector3D pos(moduleRadius,0.,diskSide*zpos);
171 pos = GeoTrf::RotateZ3D(angle)*pos;
172 GeoAlignableTransform* xform = new GeoAlignableTransform(GeoTrf::Translate3D(pos.x(),pos.y(),pos.z())*rm);
173 GeoVPhysVol * modulePhys = psd.Build();
174 std::ostringstream nameTag;
175 nameTag << "ModuleEC" << phiId;
176 GeoNameTag * tag = new GeoNameTag(nameTag.str());
177 diskPhys->add(tag);
178 diskPhys->add(new GeoIdentifierTag(phiId));
179 diskPhys->add(xform);
180 diskPhys->add(modulePhys);
181
182 // Now store the xform by identifier:
183 Identifier id = theSensor.getID();
184 m_DDmgr->addAlignableTransform(0,id,xform,modulePhys);
185 }
186
187 if(m_sqliteReader) {
188 std::string key="PixelDisk_"+std::to_string(brl_ec)+"_"+std::to_string(m_gmt_mgr->GetLD())+"_"+std::to_string(m_gmt_mgr->Phi())+"_"+std::to_string(m_gmt_mgr->Eta());
189 diskPhys=(*m_mapFPV)[key];
190 }
191 else {
192 //
193 // Place the supports for the disks:
194 //
195 GeoPixelDiskSupports pds (m_DDmgr, m_gmt_mgr, m_sqliteReader, m_mapFPV, m_mapAX);
196 for(int ii =0; ii< pds.NCylinders(); ii++) {
197 pds.SetCylinder(ii);
198 GeoTransform* xform = new GeoTransform( GeoTrf::Translate3D(0, 0, pds.ZPos()) );
199 diskPhys->add(xform);
200 diskPhys->add(pds.Build() );
201 }
202 }
203
204 // Extra Material
205 InDetDD::ExtraMaterial xMat(m_gmt_mgr->distortedMatManager());
206 xMat.add(diskPhys,"PixelDisc");
207 //Defined above as:
208 // std::ostringstream ostr; ostr << m_gmt_mgr->GetLD();
209 xMat.add(diskPhys,"PixelDisc"+ostr.str());
210 if (m_gmt_mgr->GetSide()>0) { // EndcapA
211 xMat.add(diskPhys,"PixelDiscA");
212 xMat.add(diskPhys,"PixelDiscA"+ostr.str());
213 } else { // EndcapC
214 xMat.add(diskPhys,"PixelDiscC");
215 xMat.add(diskPhys,"PixelDiscC"+ostr.str());
216 }
217
218
219 return diskPhys;
220}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
double Thickness()
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
GeoModelIO::ReadGeoModel * m_sqliteReader
PixelGeometryManager * m_gmt_mgr
InDetDD::PixelDetectorManager * m_DDmgr
InDetMaterialManager * m_mat_mgr

◆ RMax()

double GeoPixelDisk::RMax ( )

Definition at line 226 of file GeoPixelDisk.cxx.

226 {
227 return m_gmt_mgr->PixelECCarbonRMax("Outer");
228}

◆ RMin()

double GeoPixelDisk::RMin ( )

Definition at line 222 of file GeoPixelDisk.cxx.

222 {
223 return m_gmt_mgr->PixelECCarbonRMin("Inner");
224}

◆ Thickness()

double GeoPixelDisk::Thickness ( )

Definition at line 230 of file GeoPixelDisk.cxx.

230 {
231 //
232 // This can be calculated as the minimum thickness possible
233 // as for the layers I use a number which is enough to contain
234 // the inner part of the detector.
235 //
236 // 7-1 I switch to the minimum thickness possible as the cables are right
237 // outside this volume.
238 //
239 // return 10*Gaudi::Units::mm;
240 // GWG. It would be nice to get these numbers from the module itself to
241 // ensure consistency.
242 double safety = 0.01* Gaudi::Units::mm; // This is the safety added to the module.
243 double zClearance = 0.5 * Gaudi::Units::mm; // Clearance for misalignments
244 double tck = 2*(safety + 0.5*m_gmt_mgr->PixelBoardThickness()
245 + std::max(m_gmt_mgr->PixelHybridThickness(),
246 m_gmt_mgr->PixelChipThickness()+m_gmt_mgr->PixelChipGap())
247 );
248 tck += std::max(m_gmt_mgr->PixelECSiDz1(),m_gmt_mgr->PixelECSiDz2());
249 tck += 2.*zClearance;
250 // TO DO: Add some safety (N.B. I think the module is slightly bigger because of some safety added there)
251 return tck;
252}

Member Data Documentation

◆ m_DDmgr

InDetDD::PixelDetectorManager* GeoVPixelFactory::m_DDmgr
protectedinherited

Definition at line 45 of file GeoVPixelFactory.h.

◆ m_epsilon

const double GeoVPixelFactory::m_epsilon
protectedinherited

Definition at line 49 of file GeoVPixelFactory.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_sqliteReader

GeoModelIO::ReadGeoModel* GeoVPixelFactory::m_sqliteReader
protectedinherited

Definition at line 46 of file GeoVPixelFactory.h.


The documentation for this class was generated from the following files: