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

#include <GeoPixelTMT.h>

Inheritance diagram for GeoPixelTMT:
Collaboration diagram for GeoPixelTMT:

Public Member Functions

 GeoPixelTMT (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 ~GeoPixelTMT ()=default
virtual GeoVPhysVol * Build () override
virtual GeoVPhysVol * getPhysVol () override
virtual const GeoTrf::Transform3D & transform () const override
virtual double thicknessP () const override
virtual double thicknessN () const override
virtual GeoSimplePolygonBrep * computeStaveEnvelopShape (double) override
virtual GeoVPhysVol * getEndblockEnvelopShape (int) override
virtual GeoTransform * getEndblockEnvelopShapeTrf (int) override
virtual double getEndblockZpos () const override
virtual double getServiceZpos () const override
virtual double getEndblockLength () const override
virtual void computeStaveEnvelopTransformAndSize (double, double, double, double, double, double) override
virtual int PixelNModule () const override
virtual int PixelNPlanarModule () const override
virtual int PixelN3DModule () const override
 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)

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

Private Member Functions

const GeoShape * addShape (const GeoShape *lastShape, const GeoShape *nextShape, const GeoTrf::Transform3D &trans)

Private Attributes

PVLink m_physVol {nullptr}
GeoTrf::Transform3D m_transform

Detailed Description

Definition at line 14 of file GeoPixelTMT.h.

Constructor & Destructor Documentation

◆ GeoPixelTMT()

GeoPixelTMT::GeoPixelTMT ( 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 25 of file GeoPixelTMT.cxx.

29 :
30 GeoPixelStaveSupport(ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX)),
31 m_transform(GeoTrf::Transform3D::Identity())
32{
33 if(!m_sqliteReader) {
35
36 }
37}
GeoTrf::Transform3D m_transform
Definition GeoPixelTMT.h:44
PVLink m_physVol
Definition GeoPixelTMT.h:43
virtual GeoVPhysVol * Build() override
GeoModelIO::ReadGeoModel * m_sqliteReader

◆ ~GeoPixelTMT()

virtual GeoPixelTMT::~GeoPixelTMT ( )
virtualdefault

Member Function Documentation

◆ addShape()

const GeoShape * GeoPixelTMT::addShape ( const GeoShape * lastShape,
const GeoShape * nextShape,
const GeoTrf::Transform3D & trans )
private

Definition at line 151 of file GeoPixelTMT.cxx.

152{
153 const GeoShape * shiftedShape = &(*nextShape << trans);
154 if (lastShape) {
155 lastShape = &(lastShape->add(*shiftedShape));
156 } else {
157 lastShape = shiftedShape;
158 }
159 return lastShape;
160}

◆ Build()

GeoVPhysVol * GeoPixelTMT::Build ( )
overridevirtual

Implements GeoVPixelFactory.

Definition at line 40 of file GeoPixelTMT.cxx.

40 {
41
42 if(m_sqliteReader) return nullptr;
43
44 // we want to use an assembly; therefore, we need a dummy volume to trigger the mechanism
45 const GeoMaterial* ether = m_mat_mgr->getMaterial("special::Ether");
46 GeoBox* dummybox= new GeoBox(4711., 4711., 4711.);
47 GeoLogVol* dummyTMT = new GeoLogVol("TMT",dummybox,ether);
48 GeoPhysVol* theTMT = new GeoPhysVol(dummyTMT);
49
50 // get the material by dividing the total material by the volume per layer,
51 // the weight is only stored in DB for the whole TMT layer
52 // we will commonly use TMT as name for the stuff
53 std::string matName = m_gmt_mgr->getMaterialName("TMT", m_gmt_mgr->GetLD());
54
55 double volume = 12647.7; // this number seems to be wrong
56 const GeoMaterial* material = m_mat_mgr->getMaterialForVolume(matName,volume);
57 GeoNameTag* tag = new GeoNameTag("TMT");
58
59 // this part is unchanged: reading the DB, creating the shapes of the volumes and defining their position
60 GeoTrf::RotateX3D traprot(180.*Gaudi::Units::deg);
61
62 int halfNModule = m_gmt_mgr->PixelNModule()/2;
63
64 for (int ii = 0; ii < m_gmt_mgr->PixelTMTNumParts(); ii++) {
65 double z1 = m_gmt_mgr->PixelTMTPosZ1(ii);
66 double z2 = m_gmt_mgr->PixelTMTPosZ2(ii);
67 double xbase1 = m_gmt_mgr->PixelTMTBaseX1(ii);
68 double xbase2 = m_gmt_mgr->PixelTMTBaseX2(ii);
69 double w1 = m_gmt_mgr->PixelTMTWidthX1(ii);
70 double w2 = m_gmt_mgr->PixelTMTWidthX2(ii);
71 double widthy = m_gmt_mgr->PixelTMTWidthY(ii);
72 double ypos = m_gmt_mgr->PixelTMTPosY(ii);
73 bool perModule = m_gmt_mgr->PixelTMTPerModule(ii);
74
75
76 // Code below assume z2>z1. Swap if this is not the case
77 if (z1>z2) {
78 std::swap(z1,z2);
79 std::swap(xbase1,xbase2);
80 std::swap(w1,w2);
81 }
82
83 double length = z2-z1;
84 double zpos = 0.5*(z1+z2);
85 double xpos = 0.5*(xbase1 + xbase2 - 0.5*(w2+w1));
86
87 double theta = 0;
88 if (w1 != w2 || xbase1 != xbase2) {
89 theta = std::atan((xbase2 - xbase1 - 0.5*(w2-w1))/length);
90 }
91
92 double phi = 0;
93 double angleydzn = 0;
94 double angleydzp = 0;
95
96 GeoIntrusivePtr<const GeoShape> shape{};
97 if (w1 == w2 && theta == 0) {
98 // Its a box
99 shape = new GeoBox(0.5*w1, 0.5*widthy, 0.5*length);
100 } else {
101 shape = new GeoTrap(0.5*length, theta, phi, 0.5*widthy, 0.5*w1, 0.5*w1, angleydzn,
102 0.5*widthy, 0.5*w2, 0.5*w2, angleydzp);
103 // Test GeoModel volume calculation. OK.
104 }
105
106
107 // end of the old part
108 // now we put everything into the assembly
109 if (!perModule) { // For middle section and others
110
111 // create the colume, move it to the correct relative position and add it to the assembly
112
113 GeoLogVol* tmpLogVol= new GeoLogVol("TMT",shape,material);
114 GeoPhysVol* tmpPhysVol= new GeoPhysVol(tmpLogVol);
115 GeoTransform* trans = new GeoTransform(GeoTrf::Translate3D(xpos,ypos,zpos));
116
117 theTMT->add(tag);
118 theTMT->add(trans);
119 theTMT->add(tmpPhysVol);
120
121 } else { // Once per module, copied in +z and -z side.
122 // we will add the same volume many times, need to create it only once
123
124 GeoLogVol* tmpLogVol= new GeoLogVol("TMT",shape,material);
125 GeoPhysVol* tmpPhysVol= new GeoPhysVol(tmpLogVol);
126
127 for (int ii = 0; ii < halfNModule; ii++) {
128
129 // move the dublicates to the correct relative position and add it to the assembly
130 double zshift = m_gmt_mgr->PixelModuleZPosition(1) * ii;
131
132 GeoTransform* transPos = new GeoTransform(GeoTrf::Translate3D(xpos,ypos,zpos+zshift));
133 theTMT->add(tag);
134 theTMT->add(transPos);
135 theTMT->add(tmpPhysVol);
136
137 GeoTransform* transNeg = new GeoTransform(GeoTrf::Translate3D(xpos,ypos,-(zpos+zshift))*GeoTrf::RotateX3D(180*Gaudi::Units::deg));
138 theTMT->add(tag);
139 theTMT->add(transNeg);
140 theTMT->add(tmpPhysVol);
141
142 }
143 }
144 }
145 // Return the assembly
146 return theTMT;
147
148}
Scalar phi() const
phi method
Scalar theta() const
theta method
double length(const pvec &v)
PixelGeometryManager * m_gmt_mgr
InDetMaterialManager * m_mat_mgr
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)

◆ computeStaveEnvelopShape()

virtual GeoSimplePolygonBrep * GeoPixelTMT::computeStaveEnvelopShape ( double )
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 28 of file GeoPixelTMT.h.

28{ return 0;}

◆ computeStaveEnvelopTransformAndSize()

virtual void GeoPixelTMT::computeStaveEnvelopTransformAndSize ( double ,
double ,
double ,
double ,
double ,
double  )
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 34 of file GeoPixelTMT.h.

34{};

◆ GeoVPixelFactory()

GeoVPixelFactory::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 )
inherited

Definition at line 33 of file GeoVPixelFactory.cxx.

16 : m_gmt_mgr (mgr)
17 , m_mat_mgr (m_gmt_mgr->getMaterialManager())
18 , m_DDmgr (ddmgr)
19 , m_sqliteReader(sqliteReader)
20 , m_mapFPV(std::move(mapFPV))
21 , m_mapAX(std::move(mapAX))
22 , m_epsilon(0.0001)
23{
24}
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
const double m_epsilon
InDetDD::PixelDetectorManager * m_DDmgr

◆ getEndblockEnvelopShape()

virtual GeoVPhysVol * GeoPixelTMT::getEndblockEnvelopShape ( int )
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 29 of file GeoPixelTMT.h.

29{return 0;}

◆ getEndblockEnvelopShapeTrf()

virtual GeoTransform * GeoPixelTMT::getEndblockEnvelopShapeTrf ( int )
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 30 of file GeoPixelTMT.h.

30{return 0;}

◆ getEndblockLength()

virtual double GeoPixelTMT::getEndblockLength ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 33 of file GeoPixelTMT.h.

33{ return 0.; }

◆ getEndblockZpos()

virtual double GeoPixelTMT::getEndblockZpos ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 31 of file GeoPixelTMT.h.

31{ return 0.; }

◆ getPhysVol()

virtual GeoVPhysVol * GeoPixelTMT::getPhysVol ( )
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 24 of file GeoPixelTMT.h.

24{return m_physVol;}

◆ getServiceZpos()

virtual double GeoPixelTMT::getServiceZpos ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 32 of file GeoPixelTMT.h.

32{ return 0; }

◆ PixelN3DModule()

virtual int GeoPixelTMT::PixelN3DModule ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 38 of file GeoPixelTMT.h.

38{return 0;}

◆ PixelNModule()

virtual int GeoPixelTMT::PixelNModule ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 36 of file GeoPixelTMT.h.

36{return 0;}

◆ PixelNPlanarModule()

virtual int GeoPixelTMT::PixelNPlanarModule ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 37 of file GeoPixelTMT.h.

37{return 0;}

◆ thicknessN()

virtual double GeoPixelTMT::thicknessN ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 27 of file GeoPixelTMT.h.

27{return 0;} // Use ladder thickness from database

◆ thicknessP()

virtual double GeoPixelTMT::thicknessP ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 26 of file GeoPixelTMT.h.

26{return 0;} // Use ladder thickness from database

◆ transform()

virtual const GeoTrf::Transform3D & GeoPixelTMT::transform ( ) const
inlineoverridevirtual

Implements GeoPixelStaveSupport.

Definition at line 25 of file GeoPixelTMT.h.

25{return m_transform;}

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_physVol

PVLink GeoPixelTMT::m_physVol {nullptr}
private

Definition at line 43 of file GeoPixelTMT.h.

43{nullptr};

◆ m_sqliteReader

GeoModelIO::ReadGeoModel* GeoVPixelFactory::m_sqliteReader
protectedinherited

Definition at line 46 of file GeoVPixelFactory.h.

◆ m_transform

GeoTrf::Transform3D GeoPixelTMT::m_transform
private

Definition at line 44 of file GeoPixelTMT.h.


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