ATLAS Offline Software
SCT_FwdModuleConnector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 
11 
12 #include "GeoModelKernel/GeoBox.h"
13 #include "GeoModelKernel/GeoLogVol.h"
14 #include "GeoModelKernel/GeoPhysVol.h"
15 #include "GeoModelKernel/GeoShape.h"
16 #include "GeoModelKernel/GeoShapeShift.h"
17 #include "GaudiKernel/SystemOfUnits.h"
18 
19 #include <cmath>
20 
21 SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int ringType,
22  InDetDD::SCT_DetectorManager* detectorManager,
23  SCT_GeometryManager* geometryManager,
24  SCT_MaterialManager* materials)
25  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
26  m_ringType(ringType)
27 {
28  getParameters();
30 }
31 
32 
33 void
35 {
37 
38  m_materialName= parameters->fwdModuleConnectorMaterial();
39  m_deltaR = parameters->fwdModuleConnectorDeltaR();
40  m_rphi = parameters->fwdModuleConnectorRPhi();
41  m_thickness = parameters->fwdModuleConnectorThickness();
42 }
43 
44 GeoVPhysVol *
46 {
48 
49  // Construct box
50  const GeoBox * moduleConnShape = new GeoBox(0.5 * m_thickness, 0.5 * m_rphi, 0.5 * m_deltaR);
51  m_material = m_materials->getMaterialForVolume(m_materialName, moduleConnShape->volume());
52 
53  // Shift to correct position within module
54  double xposition = 0.5 * (parameters->fwdHybridThickness() + m_thickness);
55  double zposition = parameters->fwdModuleMountPoint(m_ringType) - parameters->fwdHybridMountPointToInnerEdge() + parameters->fwdHybridLength() - 0.5*(m_deltaR);
56  if (m_ringType == 0) { zposition = -1 * zposition; }; // outer module, hybrid in inner side
57  const GeoShape & connectorPos = (*moduleConnShape << GeoTrf::Translate3D(xposition,0.,zposition));
58 
59 
60  const GeoLogVol * moduleConnLog = new GeoLogVol(getName(), &connectorPos, m_material);
61 
62  GeoPhysVol * moduleConnector = new GeoPhysVol(moduleConnLog);
63 
64  return moduleConnector;
65 }
SCT_FwdModuleConnector::getParameters
void getParameters()
Definition: SCT_FwdModuleConnector.cxx:34
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition: SCT_ComponentFactory.h:42
SCT_MaterialManager
Definition: SCT_MaterialManager.h:21
SCT_GeometryManager::forwardModuleParameters
const SCT_ForwardModuleParameters * forwardModuleParameters() const
Definition: SCT_GeometryManager.cxx:91
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
SCT_MaterialManager.h
SCT_FwdModuleConnector::m_rphi
double m_rphi
Definition: SCT_FwdModuleConnector.h:37
SCT_FwdModuleConnector::m_materialName
std::string m_materialName
Definition: SCT_FwdModuleConnector.h:40
SCT_FwdModuleConnector::m_thickness
double m_thickness
Definition: SCT_FwdModuleConnector.h:38
SCT_ForwardModuleParameters
Definition: SCT_ForwardModuleParameters.h:12
SCT_FwdModuleConnector::build
virtual GeoVPhysVol * build()
Definition: SCT_FwdModuleConnector.cxx:45
SCT_FwdModuleConnector.h
SCT_FwdModuleConnector::m_ringType
int m_ringType
Definition: SCT_FwdModuleConnector.h:34
SCT_ForwardModuleParameters.h
SCT_FwdModuleConnector::SCT_FwdModuleConnector
SCT_FwdModuleConnector(const std::string &name, int ringType, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
Definition: SCT_FwdModuleConnector.cxx:21
SCT_MaterialManager::getMaterialForVolume
const GeoMaterial * getMaterialForVolume(const std::string &materialName, double volume)
Definition: SCT_MaterialManager.cxx:61
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition: SCT_ComponentFactory.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SCT_SharedComponentFactory::m_physVolume
GeoVPhysVol * m_physVolume
Definition: SCT_ComponentFactory.h:70
SCT_FwdModuleConnector::m_material
const GeoMaterial * m_material
Definition: SCT_FwdModuleConnector.h:39
SCT_SharedComponentFactory
Definition: SCT_ComponentFactory.h:56
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
SCT_ComponentFactory::getName
const std::string & getName() const
Definition: SCT_ComponentFactory.h:35
SCT_FwdModuleConnector::m_deltaR
double m_deltaR
Definition: SCT_FwdModuleConnector.h:36
SCT_GeometryManager.h
SCT_GeometryManager
Definition: SCT_GeometryManager.h:25