ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_SkiPowerTape.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5//
6// 1st Feb 2005 D.Naito modified.
7// 28th Mar 2005 S.Mima modified.
8//
9#include "SCT_SkiPowerTape.h"
10
11#include "SCT_MaterialManager.h"
12
13#include "SCT_GeometryManager.h"
15
16#include "SCT_Ski.h"
17#include "SCT_PowerTape.h"
18#include "SCT_Module.h"
19
20#include "GeoModelKernel/GeoBox.h"
21#include "GeoModelKernel/GeoLogVol.h"
22#include "GeoModelKernel/GeoPhysVol.h"
23#include "GeoModelKernel/GeoNameTag.h"
24#include "GeoModelKernel/GeoTransform.h"
25#include "GeoModelKernel/GeoMaterial.h"
26#include "GeoModelKernel/Units.h"
27#include "GeoModelKernel/GeoDefinitions.h"
28#include "GaudiKernel/SystemOfUnits.h"
29#include <cmath>
30#include <format>
31
32SCT_SkiPowerTape::SCT_SkiPowerTape(const std::string & name,
33 const SCT_Ski * ski,
34 double length,
35 InDetDD::SCT_DetectorManager* detectorManager,
36 SCT_GeometryManager* geometryManager,
37 SCT_MaterialManager* materials) :
38 SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
39 m_length(length), m_ski(ski)
40{
43}
44
45void
47{
48 const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
49
50 // Width is the same as the width of a single powertape.
51 m_powerTapeThickness = parameters->powerTapeThickness();
52 m_width = parameters->powerTapeWidth();
53 m_powerTapeStartPointOffset = parameters->powerTapeStartPointOffset();
54}
55
56
57GeoVPhysVol *
59{
60 // The power tapes are stacked going from the nearest interlink to the
61 // nearset edge of the dogleg.
62 //
63 // --- ---
64 // ------ ------
65 // --------- ---------
66
67
68 int nHalfModules = m_ski->modulesPerSki()/2;
69
70 // Thickness of the stack.
71 m_thickness = nHalfModules * m_powerTapeThickness;
72
73
74 // This is a volume containing all the power tapes.
75 const GeoBox * skiPowerTapeShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length);
76 const GeoLogVol *skiPowerTapeLog =
77 new GeoLogVol(getName(), skiPowerTapeShape, m_materials->gasMaterial());
78 GeoPhysVol * skiPowerTape = new GeoPhysVol(skiPowerTapeLog);
79
80 // Loop over modules in ski as we need their z positions.
81 for (int iModule = 0; iModule < m_ski->modulesPerSki(); iModule++) {
82
83 // Position PowerTapes
84 // These run from the nearest interlink to the edge of the dogleg
85 double tapeLength, tapeMid, tapeStart, tapeEnd;
86
87 // nPos is used to stack the power tapes. Modules closest to interlink are
88 // furthest from support. The positive and negative z positions are
89 // syGaudi::Units::mmetric. nPos = 5,4,3,2,1,0,0,1,2,3,4,5 for the 12 modules.
90 int nPos;
91
92 // test sign of zpos to determine whether the tape runs to the
93 // high z end or low z end.
94
95 if (m_ski->zPos(iModule) > 0) {
96
97 // Tape runs from high z end to edge of dogleg. NB width of dogleg is in z-direction
98 tapeStart = m_ski->zPos(iModule) + m_ski->coolingBlockOffsetZ() + m_powerTapeStartPointOffset;
99 tapeEnd = 0.5 * m_length;
100
101 // For 12 module: iModule = 6, 7, 8, ..., 11 --> nPos = 0, 1, 2, ..., 5
102 nPos = iModule - nHalfModules;
103
104 } else {
105
106 // Tape runs from low z end to edge of dogleg. NB width of dogleg is in z-direction
107 tapeStart = m_ski->zPos(iModule) + m_ski->coolingBlockOffsetZ() - m_powerTapeStartPointOffset;
108 tapeEnd = -0.5 * m_length;
109
110 // For 12 module: iModule = 0, 1, 2, ..., 5 --> nPos = 5, 4, 3, ..., 0
111 nPos = nHalfModules - iModule - 1;
112
113 }
114
115 tapeLength = std::abs(tapeEnd - tapeStart);
116 tapeMid = 0.5 * (tapeEnd + tapeStart);
117
118
119 // Make sure that first half are negative and secand half are positive.
120 // Checking that nPos is >= 0 is equivalent to this.
121 if (nPos < 0) {
122 std::cout << "SCT_SkiPowerTape: Module position inconsistent with assumption that\n"
123 << " first half has z < 0 and second half has z > 0"
124 << std::endl;
125 }
126
127 // Create the tape
128
129 // Label tape with M# at end of string
130 SCT_PowerTape powerTape(std::format("{}PowerTapeM{}",getName(),iModule + 1), tapeLength,
132
133 // Calculate x position of tape. This will depend on the module number.
134 // The reference point is the middle of the stack.
135 double xTapePos = - 0.5 * m_thickness +
136 (nPos + 0.5) * powerTape.thickness();
137 double yTapePos = 0;
138
139
140 // Position the tape
141 skiPowerTape->add(new GeoTransform(GeoTrf::Translate3D(xTapePos, yTapePos, tapeMid)));
142 skiPowerTape->add(powerTape.getVolume());
143
144 }
145
146 return skiPowerTape;
147}
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
const std::string & getName() const
InDetDD::SCT_DetectorManager * m_detectorManager
SCT_GeometryManager * m_geometryManager
SCT_MaterialManager * m_materials
double thickness() const
SCT_SharedComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials=nullptr)
SCT_SkiPowerTape(const std::string &name, const SCT_Ski *ski, double length, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
virtual GeoVPhysVol * build()
const SCT_Ski * m_ski
double m_powerTapeStartPointOffset
double length() const