ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_FwdSubSpine.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
14#include "SCT_FwdSubSpine.h"
15
16#include "SCT_MaterialManager.h"
17
18#include "SCT_GeometryManager.h"
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
28#include "GeoModelKernel/Units.h"
29
30#include "GeoModelKernel/GeoDefinitions.h"
31
32
33
34#include <cmath>
35
36
37SCT_FwdSubSpine::SCT_FwdSubSpine(const std::string & name,
38 int ringType, int spineSide,
39 InDetDD::SCT_DetectorManager* detectorManager,
40 SCT_GeometryManager* geometryManager,
41 SCT_MaterialManager* materials)
42 : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
43 m_ringType(ringType), m_spineSide(spineSide)
44{
47}
48
49
50
51void
53{
54 const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
55
56 m_material = m_materials->getMaterial(parameters->fwdSubSpineMaterial(m_ringType));
57
58 // Width is in direction of module width (ie long axis of arm)
59 // Length is in direction of module length (ie short axis of arm)
60
61 //Inner subspine
62 m_thickness1 = parameters->fwdSpineThickness(m_ringType);
63 m_width1 = parameters->fwdSubSpineInnerWidth(m_ringType);
64 m_length1 = parameters->fwdSubSpineInnerLength(m_ringType);
65 //Middle subspine
66 m_thickness2 = parameters->fwdSpineThickness(m_ringType);
67 m_width2 = parameters->fwdSubSpineMiddleWidth(m_ringType);
68 m_length2 = parameters->fwdSubSpineMiddleLength(m_ringType);
69 //Outer subspine
70 m_thickness3 = parameters->fwdSpineThickness(m_ringType);
71 m_width3 = parameters->fwdSubSpineOuterWidth(m_ringType);
72 m_length3 = parameters->fwdSubSpineOuterLength(m_ringType);
73}
74
76{
77 // x,y,z are in the geomodel module coordinates
78
79 const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
80
81 const GeoBox * spineShape1 = new GeoBox( m_thickness1/2., m_width1/2., m_length1/2.);
82 const GeoBox * spineShape2 = nullptr;
83 if (m_ringType != 3) spineShape2 = new GeoBox( m_thickness2/2., m_width2/2., m_length2/2.);
84 const GeoBox * spineShape3 = new GeoBox( m_thickness3/2., m_width3/2., m_length3/2.);
85
86
87 double position, position2;
88
89 int HybPos;
90
91 if (m_ringType == 0) { HybPos = -1; } // outer module, hybrid in inner side
92 else { HybPos = 1; } //hybrid in outer side
93
94
95 double widthMain = parameters->fwdSpineWidth(m_ringType); // width of main spine
96
97
98 const GeoShape * subSpineMiddle = nullptr;
99
100 // Inner sub spine
101 double mountPosition = parameters->fwdModuleMountPoint(m_ringType); // mount point to physics center
102 position = mountPosition - parameters->fwdSubSpineInnerRefDist(m_ringType) - 0.5*m_length1;
103 position = position * HybPos;
104 position2 = (widthMain + m_width1) / 2.;
105 const GeoShape & spinePos1 = (*spineShape1 << GeoTrf::TranslateY3D(m_spineSide * position2) << GeoTrf::TranslateZ3D(position) );
106
107
108 // Middle sub spine
109 // Not defined for inner module.
110 if (m_ringType != 3) {
111 position = mountPosition - parameters->fwdSubSpineMiddleRefDist(m_ringType) - 0.5*m_length2;
112 position = position * HybPos;
113 position2 = (widthMain + m_width2) / 2.;
114 const GeoShape & spinePos2 = (*spineShape2 << GeoTrf::TranslateY3D(m_spineSide * position2) << GeoTrf::TranslateZ3D(position) );
115 subSpineMiddle = &spinePos2;
116 }
117
118 // Outer sub spine
119 position = mountPosition - parameters->fwdSubSpineOuterRefDist(m_ringType) - 0.5*m_length3;
120 position = position * HybPos;
121 position2 = (widthMain + m_width3) / 2.;
122 const GeoShape & spinePos3 = (*spineShape3 << GeoTrf::TranslateY3D(m_spineSide * position2) << GeoTrf::TranslateZ3D(position) );
123
124 const GeoShapeUnion & spineTmp = (spinePos1).add(spinePos3);
125 GeoLogVol * spineLog = nullptr;
126 if (m_ringType != 3) {
127 const GeoShapeUnion & spineTmp2 = spineTmp.add(*subSpineMiddle);
128 spineLog = new GeoLogVol(getName(), &spineTmp2, m_material);
129 } else {
130 spineLog = new GeoLogVol(getName(), &spineTmp, m_material);
131 }
132
133 GeoPhysVol * spine = new GeoPhysVol(spineLog);
134
135 return spine;
136}
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
const std::string & getName() const
SCT_GeometryManager * m_geometryManager
SCT_MaterialManager * m_materials
SCT_FwdSubSpine(const std::string &name, int ringType, int spineSide, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
const GeoMaterial * m_material
virtual GeoVPhysVol * build()
SCT_SharedComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials=nullptr)
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55