ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
GeoPixelCable Class Reference

#include <GeoPixelCable.h>

Inheritance diagram for GeoPixelCable:
Collaboration diagram for GeoPixelCable:

Public Member Functions

 GeoPixelCable (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
 
int numElements () const
 
void setElement (int i)
 
double getStackOffset ()
 
double zpos ()
 

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

void fillElements (int layer, int phiSector)
 

Private Attributes

int m_currentElement
 
std::vector< int > m_elements
 

Detailed Description

Definition at line 11 of file GeoPixelCable.h.

Constructor & Destructor Documentation

◆ GeoPixelCable()

GeoPixelCable::GeoPixelCable ( 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 13 of file GeoPixelCable.cxx.

18  : GeoVPixelFactory(ddmgr, mgr, sqliteReader, mapFPV, mapAX),
20 {
22  if (m_elements.empty()) { // If no information for layer use layer 0 numbers.
23  fillElements(0, m_gmt_mgr->Phi());
24  }
25 }

Member Function Documentation

◆ Build()

GeoVPhysVol * GeoPixelCable::Build ( )
overridevirtual

Implements GeoVPixelFactory.

Definition at line 49 of file GeoPixelCable.cxx.

49  {
50 
51  if (m_currentElement < 0){
52  std::cout << "ERROR: GeoPixelCableCurrent, current element not set." << std::endl;
53  return nullptr;
54  }
55 
56 
57  int tableIndex = m_elements[m_currentElement];
58  //std::cout << "GeoPixelCable: " << m_currentElement << ", " << tableIndex << std::endl;
59 
60  double zstart = m_gmt_mgr->PixelCableZStart(tableIndex);
61  double zend = m_gmt_mgr->PixelCableZEnd(tableIndex);
62  double length = std::abs(zend - zstart);
63  double width = m_gmt_mgr->PixelCableWidth(tableIndex);
64  double thickness = m_gmt_mgr->PixelCableThickness(tableIndex);
65  double weight = m_gmt_mgr->PixelCableWeight(tableIndex);
66  std::string label = m_gmt_mgr->PixelCableLabel(tableIndex);
67 
68  std::string matName = m_gmt_mgr->getMaterialName("Cable", m_gmt_mgr->GetLD());
69  const GeoMaterial* cableMat = m_mat_mgr->getMaterial(matName);
70 
71  // If weight supplied use it to calculate the required thickness
72  // otherwise use the suppled thickness
73  if (weight != 0) {
74  thickness = weight / (cableMat->getDensity() * length * width);
75  }
76 
77  const GeoBox* cableBox = new GeoBox(0.5*thickness,0.5*width,0.5*length);
78  std::string logName = "Cable";
79  std::ostringstream o;
80  o << m_gmt_mgr->getLD_Label() << label;
81  logName = logName+o.str();
82  //std::cout << logName << ": " << weight/Gaudi::Units::g << " g, " << thickness << std::endl;
83 
84  GeoLogVol* theCable = new GeoLogVol(logName,cableBox,cableMat);
85  GeoPhysVol* cablePhys = new GeoPhysVol(theCable);
86  return cablePhys;
87 }

◆ fillElements()

void GeoPixelCable::fillElements ( int  layer,
int  phiSector 
)
private

Definition at line 28 of file GeoPixelCable.cxx.

29 {
31  int biStaveType = m_gmt_mgr->PixelBiStaveType(layer, phiSector);
32 
33  for (int i = 0; i < nentries; i++) {
34  // bistave number
35  // 0 means both staves in bistave the same
36  // 1 means odd bistave
37  // 2 means even bistave
38  // If 0 then keep for all staves otherwise keep if odd/even correspond
39  int cableBiStaveNum = m_gmt_mgr->PixelCableBiStaveNum(i);
41  if (!cableBiStaveNum || ((cableBiStaveNum%2) == biStaveType%2)) {
42  m_elements.push_back(i);
43  }
44  }
45  }
46 }

◆ getStackOffset()

double GeoPixelCable::getStackOffset ( )

Definition at line 98 of file GeoPixelCable.cxx.

98  {
99  int tableIndex = m_elements[m_currentElement];
100  return m_gmt_mgr->PixelCableStackOffset(tableIndex);
101 
102 }

◆ numElements()

int GeoPixelCable::numElements ( ) const
inline

Definition at line 19 of file GeoPixelCable.h.

19 {return m_elements.size();}

◆ setElement()

void GeoPixelCable::setElement ( int  i)
inline

Definition at line 20 of file GeoPixelCable.h.

◆ zpos()

double GeoPixelCable::zpos ( )

Definition at line 90 of file GeoPixelCable.cxx.

90  {
91 
92  int tableIndex = m_elements[m_currentElement];
93  double zstart = m_gmt_mgr->PixelCableZStart(tableIndex);
94  double zend = m_gmt_mgr->PixelCableZEnd(tableIndex);
95  return 0.5*(zend + zstart);
96 }

Member Data Documentation

◆ m_currentElement

int GeoPixelCable::m_currentElement
private

Definition at line 25 of file GeoPixelCable.h.

◆ m_DDmgr

InDetDD::PixelDetectorManager* GeoVPixelFactory::m_DDmgr
protectedinherited

Definition at line 45 of file GeoVPixelFactory.h.

◆ m_elements

std::vector<int> GeoPixelCable::m_elements
private

Definition at line 26 of file GeoPixelCable.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:
GeoPixelCable::m_elements
std::vector< int > m_elements
Definition: GeoPixelCable.h:26
PixelGeometryManager::PixelCableZEnd
virtual double PixelCableZEnd(int index)=0
PixelGeometryManager::PixelCableStackOffset
virtual double PixelCableStackOffset(int index)=0
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
GeoPixelCable::fillElements
void fillElements(int layer, int phiSector)
Definition: GeoPixelCable.cxx:28
PixelGeometryManager::PixelCableLabel
virtual std::string PixelCableLabel(int index)=0
GeoPixelCable::m_currentElement
int m_currentElement
Definition: GeoPixelCable.h:25
GeoVPixelFactory::m_gmt_mgr
PixelGeometryManager * m_gmt_mgr
Definition: GeoVPixelFactory.h:43
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
PixelGeometryManager::PixelBiStaveType
virtual int PixelBiStaveType(int layer, int phi)=0
PixelGeometryManager::PixelCableWidth
virtual double PixelCableWidth(int index)=0
PlotCalibFromCool.nentries
nentries
Definition: PlotCalibFromCool.py:798
lumiFormat.i
int i
Definition: lumiFormat.py:92
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
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)
Definition: GeoVPixelFactory.cxx:9
PixelGeometryManager::getLD_Label
virtual std::string getLD_Label()=0
PixelGeometryManager::PixelCableLayerNum
virtual int PixelCableLayerNum(int index)=0
PixelGeometryManager::PixelCableElements
virtual int PixelCableElements()=0
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
PixelGeometryManager::PixelCableZStart
virtual double PixelCableZStart(int index)=0
PixelGeometryManager::PixelCableWeight
virtual double PixelCableWeight(int index)=0
PixelGeometryManager::getMaterialName
virtual std::string getMaterialName(const std::string &volumeName, int layerdisk=0, int typenum=0)=0
PixelGeometryManager::PixelCableBiStaveNum
virtual int PixelCableBiStaveNum(int index)=0
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
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
PixelGeometryManager::PixelCableThickness
virtual double PixelCableThickness(int index)=0
PixelGeometryManager::GetLD
virtual int GetLD()=0
PixelGeometryManager::Phi
virtual int Phi()=0