ATLAS Offline Software
GeoPixelStaveRing.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 // Build detailed stave support : face plate + carbon foam + cable flex + cooling pipe + end blocks
6 // This is built one time per layer.
7 
8 #include "GeoPixelStaveRing.h"
9 
10 #include "GeoPixelSiCrystal.h"
11 #include "GeoPixelModule.h"
12 
13 #include "GeoModelKernel/GeoBox.h"
14 #include "GeoModelKernel/GeoTube.h"
15 #include "GeoModelKernel/GeoSimplePolygonBrep.h"
16 #include "GeoModelKernel/GeoLogVol.h"
17 #include "GeoModelKernel/GeoPhysVol.h"
18 #include "GeoModelKernel/GeoMaterial.h"
19 #include "GeoModelKernel/GeoNameTag.h"
20 #include "GaudiKernel/SystemOfUnits.h"
21 
22 #include <algorithm>
23 #include <utility>
24 using std::max;
25 using namespace std;
26 
29  GeoModelIO::ReadGeoModel* sqliteReader,
30  std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
31  std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
32  : GeoVPixelFactory (ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX)),
33  m_physVol (nullptr),
34  m_zPosition (0),
35  m_innerRadius (0),
36  m_outerRadius (0),
37  m_ringPosition ("AC"),
38  m_ringName ("staveRing")
39 {
40 }
41 
42 GeoVPhysVol* GeoPixelStaveRing::SetParametersAndBuild(const std::string& ringName,
43  const std::string& ringPos)
44 {
45  m_ringName=ringName;
46  m_ringPosition=ringPos;
47  m_physVol = Build();
48 
49  return m_physVol;
50 }
51 
52 GeoVPhysVol* GeoPixelStaveRing::Build(){
53 
54  m_gmt_mgr->msg(MSG::INFO) <<"Build detailed stave ring support : "<<m_ringName<<" "<<m_ringPosition<<endmsg;
55 
56  double safety = 0.001*Gaudi::Units::mm;
57  bool isBLayer = false;
58  if(m_gmt_mgr->GetLD() == 0) isBLayer = true;
61  if(m_sqliteReader) return nullptr;
62  // Ladder geometry
63 
64  double endBlockFixingPoint= m_gmt_mgr->IBLStaveMechanicalStaveEndBlockFixPoint();
65  double totalStaveLength = m_gmt_mgr->IBLStaveLength();
66 
67  if(m_ringPosition=="AC")
68  {
69  // Stave ring geometry
70  double ringWidth = m_gmt_mgr->IBLSupportRingWidth();
73  double fixingPoint = m_gmt_mgr->IBLSupportMechanicalStaveRingFixPoint();
74 
75  // SES (dec 2012 - IBL pcache ): values hard coded as the one defined in ATLAS-IBL-02-01-00
76  // to get rid off the overlap between staverings ans ladder with ATLAS-IBL-02-00-00 values
77  if(m_innerRadius<29.56) m_innerRadius=29.56; // instead of 29.2
78  if(m_outerRadius>31.85) m_outerRadius=31.85; // instead of 32.
79 
80  double endBlockPosition = totalStaveLength*0.5+endBlockFixingPoint;
81  double ringPosition = -ringWidth*0.5+fixingPoint;
82  m_zPosition = endBlockPosition-ringPosition;
83 
84  double IPTouterRadius = m_gmt_mgr->IBLServiceGetMaxRadialPosition("IPT","simple",m_zPosition,m_zPosition)+safety;
85  m_gmt_mgr->msg(MSG::DEBUG)<<"IBL stave ring "<<m_zPosition<<" "<<m_innerRadius<<" "<<IPTouterRadius<<endmsg;
86  if(IPTouterRadius>m_innerRadius) m_innerRadius=IPTouterRadius;
87 
88  // create log and phys volumes
89  m_gmt_mgr->msg(MSG::DEBUG)<<"-> IBL stave ring "<<m_zPosition<<" "<<m_innerRadius<<" "<<m_outerRadius<<endmsg;
90  const GeoTube* ring_tube = new GeoTube(m_innerRadius,m_outerRadius,ringWidth*0.5);
91  const GeoMaterial* ring_material_weight = m_mat_mgr->getMaterialForVolume("pix::StaveRing_IBLwght",ring_tube->volume());
92  m_gmt_mgr->msg(MSG::DEBUG)<<"IBL stave ring weighted material : "<<(ring_material_weight==nullptr)<<endmsg;
93 
94  GeoLogVol * logVol = nullptr;
95  if(ring_material_weight)
96  logVol = new GeoLogVol(m_ringName,ring_tube,ring_material_weight);
97  else {
98  const GeoMaterial* ring_material = m_mat_mgr->getMaterial("pix::StaveRing_IBL");
99  logVol = new GeoLogVol(m_ringName,ring_tube,ring_material);
100  }
101  GeoPhysVol * logVolPV = new GeoPhysVol(logVol);
102  m_gmt_mgr->msg(MSG::INFO) <<"Build detailed stave ring support - logVol : "<<logVol->getName()<<endmsg;
103 
104  return logVolPV;
105  }
106 
107  // Stave ring geometry
108  double ringWidth = m_gmt_mgr->IBLSupportMidRingWidth();
111 
112  m_zPosition = 0.0;
113 
114  // create log and phys volumes
115  const GeoTube* ring_tube = new GeoTube(m_innerRadius,m_outerRadius,ringWidth*0.5);
116  const GeoMaterial* ring_material_weight = m_mat_mgr->getMaterialForVolume("pix::StaveRingMid_IBLwght",ring_tube->volume());
117  GeoLogVol *logVol=nullptr;
118  if(ring_material_weight)
119  logVol = new GeoLogVol(m_ringName,ring_tube,ring_material_weight);
120  else {
121  const GeoMaterial* ring_material = m_mat_mgr->getMaterial("pix::MiddleRing_IBL");
122  logVol = new GeoLogVol(m_ringName,ring_tube,ring_material);
123  }
124 
125  GeoPhysVol * logVolPV = new GeoPhysVol(logVol);
126 
127  m_gmt_mgr->msg(MSG::INFO) <<"Build detailed stave ring support - logVol : "<<logVol->getName()<<endmsg;
128 
129  return logVolPV;
130 
131 }
132 
GeoPixelStaveRing::m_outerRadius
double m_outerRadius
Definition: GeoPixelStaveRing.h:29
GeoPixelStaveRing::m_ringPosition
std::string m_ringPosition
Definition: GeoPixelStaveRing.h:30
PixelGeometryManager::IBLSupportMidRingOuterRadius
virtual double IBLSupportMidRingOuterRadius()=0
PixelGeometryManager::IBLSupportRingInnerRadius
virtual double IBLSupportRingInnerRadius()=0
max
#define max(a, b)
Definition: cfImp.cxx:41
PixelGeometryManager
Definition: PixelGeometryManager.h:28
PixelGeometryManager::msg
MsgStream & msg(MSG::Level lvl) const
Definition: PixelGeometryManager.h:611
GeoPixelStaveRing::m_innerRadius
double m_innerRadius
Definition: GeoPixelStaveRing.h:29
GeoPixelStaveRing::GeoPixelStaveRing
GeoPixelStaveRing(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: GeoPixelStaveRing.cxx:27
GeoPixelStaveRing::m_ringName
std::string m_ringName
Definition: GeoPixelStaveRing.h:31
GeoPixelSiCrystal.h
PixelGeometryManager::IBLSupportMidRingWidth
virtual double IBLSupportMidRingWidth()=0
GeoPixelStaveRing::SetParametersAndBuild
GeoVPhysVol * SetParametersAndBuild(const std::string &, const std::string &)
Definition: GeoPixelStaveRing.cxx:42
GeoPixelStaveRing.h
GeoVPixelFactory::m_mapAX
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
Definition: GeoVPixelFactory.h:48
PixelGeometryManager::IBLSupportRingOuterRadius
virtual double IBLSupportRingOuterRadius()=0
GeoVPixelFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition: GeoVPixelFactory.h:46
PixelGeometryManager::IBLSupportMidRingInnerRadius
virtual double IBLSupportMidRingInnerRadius()=0
GeoVPixelFactory::m_DDmgr
InDetDD::PixelDetectorManager * m_DDmgr
Definition: GeoVPixelFactory.h:45
GeoVPixelFactory::m_gmt_mgr
PixelGeometryManager * m_gmt_mgr
Definition: GeoVPixelFactory.h:43
GeoVPixelFactory::m_mapFPV
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
Definition: GeoVPixelFactory.h:47
GeoPixelStaveRing::m_physVol
GeoVPhysVol * m_physVol
Definition: GeoPixelStaveRing.h:27
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
GeoPixelSiCrystal
Definition: GeoPixelSiCrystal.h:20
PixelGeometryManager::IBLServiceGetMaxRadialPosition
virtual double IBLServiceGetMaxRadialPosition(const std::string &srvName, const std::string &srvType, double srvZmin, double srvZmax)=0
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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::IBLSupportRingWidth
virtual double IBLSupportRingWidth()=0
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
PixelGeometryManager::IBLStaveLength
virtual double IBLStaveLength()=0
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
GeoPixelModule.h
PixelGeometryManager::IBLSupportMechanicalStaveRingFixPoint
virtual double IBLSupportMechanicalStaveRingFixPoint()=0
GeoPixelStaveRing::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelStaveRing.cxx:52
PixelGeometryManager::IBLStaveMechanicalStaveEndBlockFixPoint
virtual double IBLStaveMechanicalStaveEndBlockFixPoint()=0
DEBUG
#define DEBUG
Definition: page_access.h:11
GeoVPixelFactory
This is the base class for all the pieces of the Pixel detector.
Definition: GeoVPixelFactory.h:31
GeoPixelModule
Definition: GeoPixelModule.h:14
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
GeoPixelStaveRing::m_zPosition
double m_zPosition
Definition: GeoPixelStaveRing.h:28
PixelGeometryManager::GetLD
virtual int GetLD()=0