ATLAS Offline Software
SCT_FwdSpine.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 // Simulation for the COMBINED TESTBEAM 2004 //
7 // //
8 // Zdenka.Broklova@matfyz.cz //
9 // Carlos.Escobar@ific.uv.es //
10 // Peter.Kodys@ific.uv.es //
11 // January 23, 2004 //
13 
15 
17 
20 
21 #include "GeoModelKernel/GeoBox.h"
22 #include "GeoModelKernel/GeoLogVol.h"
23 #include "GeoModelKernel/GeoPhysVol.h"
24 #include "GeoModelKernel/GeoShape.h"
25 #include "GeoModelKernel/GeoShapeShift.h"
26 #include "GeoModelKernel/GeoShapeUnion.h"
27 #include "GeoModelKernel/GeoDefinitions.h"
28 #include "GaudiKernel/SystemOfUnits.h"
29 
30 #include <cmath>
31 
32 SCT_FwdSpine::SCT_FwdSpine(const std::string & name,
33  int ringType,
34  InDetDD::SCT_DetectorManager* detectorManager,
35  SCT_GeometryManager* geometryManager,
36  SCT_MaterialManager* materials)
37  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
38  m_ringType(ringType)
39 {
40  getParameters();
42 }
43 
44 void
46 {
48 
49  m_materialName = parameters->fwdSpineMaterial(m_ringType);
50 
51  //Main spine
52  m_thickness = parameters->fwdSpineThickness(m_ringType);
53  m_width = parameters->fwdSpineWidth(m_ringType);
54 
55 
56  m_moduleCenterToEndTmp = parameters->fwdSpineEndToModuleCenter(m_ringType);
57  // FIXME: More accurate definition is
58  m_moduleCenterToEnd = parameters->fwdModuleDistBtwMountPoints(m_ringType)
59  - parameters->fwdModuleMountPoint(m_ringType)
60  + parameters->fwdSpineEndLocatorToEndMount(m_ringType);
61  //m_length = parameters->fwdSpineEndToModuleCenter(m_ringType)
62  // + parameters->fwdModuleMountPoint(m_ringType)
63  // - parameters->fwdHybridMountPointToInnerEdge()
64  // - parameters->fwdModuleHybridEdgeToSpine();
65  // FIXME: Better definition would be
66  m_length = parameters->fwdModuleDistBtwMountPoints(m_ringType) + parameters->fwdSpineEndLocatorToEndMount(m_ringType)
67  - parameters->fwdHybridMountPointToInnerEdge()
68  - parameters->fwdModuleHybridEdgeToSpine(m_ringType);
69 
70  // (zssp[m_ringType].spndox + zsmi[m_ringType].mountd - zhyb->hybysh - zhyb->hybgap0) * Gaudi::Units::cm;
71 
72 }
73 
74 GeoVPhysVol *
76 {
77 
78 
79  // Build the spine. Just a simple box. Its orientated for building a module in a trapezoid so the spine
80  // has its length along the z axis, width along the y axis and thickness along the x axis.
81 
82  const GeoBox * spineShapeMain = new GeoBox( 0.5*m_thickness, 0.5*m_width, 0.5*m_length);
83 
84  double position;
85 
86  int HybPos;
87  if (m_ringType == 0) { HybPos = -1; } // outer module, hybrid in inner side
88  else { HybPos = 1; } //hybrid in outer side
89 
90  // shift between module center and spine center.
91  position = (0.5*m_length - m_moduleCenterToEndTmp) * HybPos;
92  //position = zsmi[m_ringType].mountd - zhyb->hybysh - zhyb->hybgap0 - zssp[m_ringType].spndox;
93 
94  //position = position / 2. * HybPos;
95 
96  const GeoShape & spinePosMain = (*spineShapeMain << GeoTrf::TranslateZ3D(position) );
97  m_material = m_materials->getMaterialForVolume(m_materialName, spineShapeMain->volume());
98  GeoLogVol * spineLog = new GeoLogVol(getName(), &spinePosMain, m_material);
99  GeoPhysVol * spine = new GeoPhysVol(spineLog);
100 
101  return spine;
102 }
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_FwdSpine::SCT_FwdSpine
SCT_FwdSpine(const std::string &name, int ringType, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
Definition: SCT_FwdSpine.cxx:32
SCT_FwdSpine::getParameters
void getParameters()
Definition: SCT_FwdSpine.cxx:45
SCT_FwdSpine::m_materialName
std::string m_materialName
Definition: SCT_FwdSpine.h:42
SCT_ForwardModuleParameters
Definition: SCT_ForwardModuleParameters.h:12
SCT_FwdSpine.h
SCT_FwdSpine::build
virtual GeoVPhysVol * build()
Definition: SCT_FwdSpine.cxx:75
SCT_FwdSpine::m_thickness
double m_thickness
Definition: SCT_FwdSpine.h:43
SCT_FwdSpine::m_material
const GeoMaterial * m_material
Definition: SCT_FwdSpine.h:41
SCT_ForwardModuleParameters.h
SCT_FwdSpine::m_ringType
int m_ringType
Definition: SCT_FwdSpine.h:39
SCT_MaterialManager::getMaterialForVolume
const GeoMaterial * getMaterialForVolume(const std::string &materialName, double volume)
Definition: SCT_MaterialManager.cxx:61
SCT_FwdSpine::m_moduleCenterToEndTmp
double m_moduleCenterToEndTmp
Definition: SCT_FwdSpine.h:47
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition: SCT_ComponentFactory.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SCT_SharedComponentFactory::m_physVolume
GeoVPhysVol * m_physVolume
Definition: SCT_ComponentFactory.h:70
SCT_FwdSpine::m_width
double m_width
Definition: SCT_FwdSpine.h:44
SCT_FwdSpine::m_moduleCenterToEnd
double m_moduleCenterToEnd
Definition: SCT_FwdSpine.h:46
SCT_SharedComponentFactory
Definition: SCT_ComponentFactory.h:56
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
SCT_FwdSpine::m_length
double m_length
Definition: SCT_FwdSpine.h:45
SCT_ComponentFactory::getName
const std::string & getName() const
Definition: SCT_ComponentFactory.h:35
SCT_GeometryManager.h
SCT_GeometryManager
Definition: SCT_GeometryManager.h:25