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