ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
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, mapFPV, mapAX),
31  m_transform(GeoTrf::Transform3D::Identity())
32 {
33  if(!m_sqliteReader) {
35 
36  }
37 }

◆ ~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 }

◆ 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
inherited

Definition at line 33 of file GeoVPixelFactory.cxx.

14  : m_gmt_mgr (mgr)
16  , m_DDmgr (ddmgr)
17  , m_sqliteReader(sqliteReader)
18  , m_mapFPV(mapFPV)
19  , m_mapAX(mapAX)
20  , m_epsilon(0.0001)
21 {
22 }

◆ 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.

◆ 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:
GeoPixelTMT::m_transform
GeoTrf::Transform3D m_transform
Definition: GeoPixelTMT.h:44
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
GeoPixelTMT::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelTMT.cxx:40
PixelGeometryManager::PixelTMTPosZ1
virtual double PixelTMTPosZ1(int iPart)=0
PixelGeometryManager::PixelTMTNumParts
virtual int PixelTMTNumParts()=0
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
deg
#define deg
Definition: SbPolyhedron.cxx:17
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
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
PixelGeometryManager::PixelTMTWidthX2
virtual double PixelTMTWidthX2(int iPart)=0
GeoVPixelFactory::m_mapFPV
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
Definition: GeoVPixelFactory.h:47
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
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
PixelGeometryManager::PixelTMTPosZ2
virtual double PixelTMTPosZ2(int iPart)=0
PixelGeometryManager::PixelNModule
virtual int PixelNModule()=0
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
PixelGeometryManager::PixelTMTWidthX1
virtual double PixelTMTWidthX1(int iPart)=0
GeoVPixelFactory::m_epsilon
const double m_epsilon
Definition: GeoVPixelFactory.h:49
PixelGeometryManager::PixelTMTBaseX1
virtual double PixelTMTBaseX1(int iPart)=0
PixelGeometryManager::PixelTMTWidthY
virtual double PixelTMTWidthY(int iPart)=0
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
GeoPixelTMT::m_physVol
PVLink m_physVol
Definition: GeoPixelTMT.h:43
GeoPixelStaveSupport
Definition: GeoPixelStaveSupport.h:14
PixelGeometryManager::PixelTMTBaseX2
virtual double PixelTMTBaseX2(int iPart)=0
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
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::PixelTMTPosY
virtual double PixelTMTPosY(int iPart)=0
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
PixelGeometryManager::PixelTMTPerModule
virtual bool PixelTMTPerModule(int iPart)=0
PixelGeometryManager::PixelModuleZPosition
virtual double PixelModuleZPosition(int)=0
PixelGeometryManager::GetLD
virtual int GetLD()=0
PixelGeometryManager::getMaterialManager
virtual InDetMaterialManager * getMaterialManager()=0