ATLAS Offline Software
SCT_InnerSide.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
6 // 13rd Mar 2005 D.Naito
7 // 28th Mar 2005 S.Mima
8 // Wed 15th Jun 2005 D.Naito modified.
9 //
11 
13 
18 
19 // module parts.
22 
24 
25 #include "GeoModelRead/ReadGeoModel.h"
26 #include "GeoModelKernel/GeoBox.h"
27 #include "GeoModelKernel/GeoLogVol.h"
28 #include "GeoModelKernel/GeoPhysVol.h"
29 #include "GeoModelKernel/GeoFullPhysVol.h"
30 #include "GeoModelKernel/GeoNameTag.h"
31 #include "GeoModelKernel/GeoIdentifierTag.h"
32 #include "GeoModelKernel/GeoTransform.h"
33 #include "GeoModelKernel/GeoShape.h"
34 #include "GeoModelKernel/GeoShapeUnion.h"
35 #include "GeoModelKernel/GeoShapeShift.h"
36 #include "GeoModelKernel/GeoDefinitions.h"
37 #include "GaudiKernel/SystemOfUnits.h"
38 
39 #include <cmath>
40 
41 SCT_InnerSide::SCT_InnerSide(const std::string & name,
42  InDetDD::SCT_DetectorManager* detectorManager,
43  SCT_GeometryManager* geometryManager,
44  SCT_MaterialManager* materials,
45  GeoModelIO::ReadGeoModel* sqliteReader,
46  std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
47  std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
48  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials, sqliteReader, mapFPV, mapAX)
49 {
50  getParameters();
52 }
53 
54 
56 
57 void
59 {
61  const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters();
62 
63  m_safety = generalParameters->safety();
64  m_hybridOffsetZ = parameters->hybridOffsetZ();
65  m_hybridOffsetX = parameters->hybridOffsetX();
66 }
67 
68 
69 const GeoLogVol *
71 {
72  // Create child components
73  m_sensor = std::make_unique<SCT_Sensor>("BRLSensor", m_detectorManager, m_geometryManager, m_materials, m_sqliteReader, m_mapFPV, m_mapAX);
74 
75  if(m_sqliteReader) return nullptr;
76 
77  m_hybrid = std::make_unique<SCT_Hybrid>("Hybrid", m_detectorManager, m_geometryManager, m_materials);
78 
79  //
80  // Define constants for convenience.
81  // t_XXX: thickness of XXX.
82  // w_XXX: width of XXX.
83  // l_XXX: length of XXX.
84  //
85  const double t_hybrid = m_hybrid->thickness();
86  const double w_hybrid = m_hybrid->width();
87  const double l_hybrid = m_hybrid->length();
88 
89  const double t_sensor = m_sensor->thickness();
90  const double w_sensor = m_sensor->width();
91  const double l_sensor = m_sensor->length();
92 
93  //
94  // Calculate a few things.
95  //
96  const double sensorPosX = 0.0;
97  const double sensorPosY = 0.0;
98  const double sensorPosZ = 0.0;
99 
100  const double hybridPosX = m_hybridOffsetX;
101  const double hybridPosY = 0.0;
102  const double hybridPosZ = m_hybridOffsetZ;
103 
104  //
105  // ise : InnerSideEnvelope
106  // Reference: sct_module_geometry.ps
107  //
108  const double w_ise1 = w_sensor + m_safety;
109  const double t_ise1 = t_sensor + m_safety;
110  const double l_ise1 = l_sensor + m_safety;
111 
112  const double t_ise2 = t_hybrid + m_safety;
113  const double w_ise2 = w_hybrid + m_safety;
114  const double l_ise2 = l_hybrid + m_safety;
115 
116  const double ise2PosX = hybridPosX;
117  const double ise2PosY = hybridPosY;
118  const double ise2PosZ = hybridPosZ;
119 
120  m_env1RefPointVector = std::make_unique<GeoTrf::Vector3D>(0.0, 0.0, 0.0);
121  m_env2RefPointVector = std::make_unique<GeoTrf::Vector3D>(-ise2PosX, -ise2PosY, -ise2PosZ);
122 
123  m_hybridPos = new GeoTransform(GeoTrf::Translate3D(hybridPosX, hybridPosY, hybridPosZ));
124 
125  // The depth axis goes from the backside to the implant side
126  // and so point away from the module center.
127  // The two sensor+hybrid combinations are built in a similar way.
128  //
129  // ^
130  // --- hybrid |
131  // ------- sensor | x-axis
132  //
133  // Shown is the outer side. The inner side is the same but with a rotation of 180 deg around the z-axis.
134  //
135  //Gaudi::Units::HepRotation rotSensor;
136  //rotSensor.rotateZ(180*Gaudi::Units::deg);
137  m_sensorPos = new GeoTransform(GeoTrf::Translate3D(sensorPosX, sensorPosY, sensorPosZ));
138 
139  //
140  // Make an envelope for the whole module.
141  //
142  const GeoBox * ise1Shape = new GeoBox(0.5 * t_ise1,
143  0.5 * w_ise1,
144  0.5 * l_ise1);
145  const GeoBox * ise2Shape = new GeoBox(0.5 * t_ise2,
146  0.5 * w_ise2,
147  0.5 * l_ise2);
148 
149  const GeoShape & InnerSideEnvelopeShape = (*ise1Shape).
150  add(*ise2Shape << GeoTrf::Translate3D(ise2PosX, ise2PosY, ise2PosZ));
151 
152  const GeoLogVol * InnerSideEnvelopeLog = new GeoLogVol("InnerSideEnvelope",
153  &InnerSideEnvelopeShape,
155  m_thickness = 0.5*t_ise1 + hybridPosX + 0.5*t_ise2;
156  m_width = w_ise1;
157  m_length = l_ise1;
158 
159  return InnerSideEnvelopeLog;
160 }
161 
162 
163 GeoVPhysVol *
165 {
166 
167  if(m_sqliteReader){
168 
169  m_sensor->build(id);
170  return nullptr;
171 
172  }
173  GeoFullPhysVol * innerSide = new GeoFullPhysVol(m_logVolume);
174 
175  //
176  // Build the innerSide
177  //
178  // Add Sensor
179  innerSide->add(new GeoIdentifierTag(1000));
180  innerSide->add(m_sensorPos);
181  innerSide->add(m_sensor->build(id));
182 
183  // Add Hybrid
184  innerSide->add(m_hybridPos);
185  innerSide->add(m_hybrid->getVolume());
186 
187  return innerSide;
188 }
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition: SCT_ComponentFactory.h:42
SCT_MaterialManager
Definition: SCT_MaterialManager.h:21
SCT_Identifier
Definition: SCT_Identifier.h:12
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
SCT_UniqueComponentFactory::m_mapFPV
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
Definition: SCT_ComponentFactory.h:95
SCT_GeneralParameters::safety
double safety() const
Definition: SCT_GeneralParameters.cxx:48
SCT_Identifier.h
SCT_UniqueComponentFactory::m_mapAX
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
Definition: SCT_ComponentFactory.h:96
SCT_InnerSide::build
virtual GeoVPhysVol * build(SCT_Identifier id)
Definition: SCT_InnerSide.cxx:164
SCT_MaterialManager.h
SCT_InnerSide::~SCT_InnerSide
~SCT_InnerSide()
SCT_Sensor.h
SCT_BarrelModuleParameters.h
SCT_ComponentFactory::m_detectorManager
InDetDD::SCT_DetectorManager * m_detectorManager
Definition: SCT_ComponentFactory.h:41
SCT_InnerSide::m_thickness
double m_thickness
Definition: SCT_InnerSide.h:72
SCT_InnerSide::m_env1RefPointVector
std::unique_ptr< GeoTrf::Vector3D > m_env1RefPointVector
Definition: SCT_InnerSide.h:86
SCT_InnerSide::m_hybridPos
GeoIntrusivePtr< GeoTransform > m_hybridPos
Definition: SCT_InnerSide.h:83
SCT_GeometryManager::generalParameters
const SCT_GeneralParameters * generalParameters() const
Definition: SCT_GeometryManager.cxx:105
SCT_GeneralParameters.h
SCT_InnerSide::m_safety
double m_safety
Definition: SCT_InnerSide.h:78
SCT_MaterialManager::gasMaterial
const GeoMaterial * gasMaterial() const
Definition: SCT_MaterialManager.cxx:80
SCT_InnerSide::m_hybridOffsetZ
double m_hybridOffsetZ
Definition: SCT_InnerSide.h:77
SCT_InnerSide::getParameters
void getParameters()
Definition: SCT_InnerSide.cxx:58
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
SCT_InnerSide::m_env2RefPointVector
std::unique_ptr< GeoTrf::Vector3D > m_env2RefPointVector
Definition: SCT_InnerSide.h:87
SCT_InnerSide::m_hybridOffsetX
double m_hybridOffsetX
Definition: SCT_InnerSide.h:76
SCT_Hybrid.h
SCT_GeneralParameters
Definition: SCT_GeneralParameters.h:16
SCT_GeometryManager::barrelModuleParameters
const SCT_BarrelModuleParameters * barrelModuleParameters() const
Definition: SCT_GeometryManager.cxx:84
SCT_InnerSide::m_sensorPos
GeoIntrusivePtr< GeoTransform > m_sensorPos
Definition: SCT_InnerSide.h:84
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition: SCT_ComponentFactory.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SCT_BarrelModuleParameters
Definition: SCT_BarrelModuleParameters.h:12
SCT_InnerSide::m_width
double m_width
Definition: SCT_InnerSide.h:73
SCT_UniqueComponentFactory::m_logVolume
const GeoLogVol * m_logVolume
Definition: SCT_ComponentFactory.h:90
SCT_UniqueComponentFactory
Definition: SCT_ComponentFactory.h:76
SCT_InnerSide::m_sensor
std::unique_ptr< SCT_Sensor > m_sensor
Definition: SCT_InnerSide.h:81
SCT_InnerSide::m_length
double m_length
Definition: SCT_InnerSide.h:74
SCT_InnerSide::SCT_InnerSide
SCT_InnerSide(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * >> mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * >> mapAX)
Definition: SCT_InnerSide.cxx:41
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
SCT_DetectorManager.h
SCT_UniqueComponentFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition: SCT_ComponentFactory.h:91
SCT_InnerSide::m_hybrid
std::unique_ptr< SCT_Hybrid > m_hybrid
Definition: SCT_InnerSide.h:80
SCT_InnerSide.h
SCT_GeometryManager.h
SCT_InnerSide::preBuild
virtual const GeoLogVol * preBuild()
Definition: SCT_InnerSide.cxx:70
SCT_GeometryManager
Definition: SCT_GeometryManager.h:25