ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_ForwardModuleSideDesign.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6// SCT_ForwardModuleSideDesign.cxx
7// Implementation file for class SCT_ForwardModuleSideDesign
9// (c) ATLAS Detector software
11// Version 1.16 29/10/2001 Alessandro Fornaini
12// Modified: Grant Gorfine
14
16#include "CLHEP/Units/SystemOfUnits.h"
17#include "CLHEP/Geometry/Vector3D.h"
19
20namespace InDetDD {
21
22// Constructor with parameters:
24 const int crystals,
25 const int diodes,
26 const int cells,
27 const int shift,
28 const bool swapStripReadout,
30 const double radius1,
31 const double halfHeight1,
32 const double radius2,
33 const double halfHeight2,
34 const double step,
35 const double etaCenter,
36 const double phiCenter,
37 int readoutSide) :
39 true, // phi
40 false, // eta: For trapezoid we cant swap z (xEta) axis.
41 true, // depth
43 m_geometry(radius1,halfHeight1,radius2,halfHeight2,diodes,step,crystals),
44 m_frame(etaCenter,phiCenter,radius1)
45{
46 if (crystals > 1) {
47 double radius = 0.5 * (radius1 + radius2 + halfHeight2 - halfHeight1);
49 }
51}
52
54 // If theta is angle between the edges of a sensor, then tan(theta/2) = (maxW - minW) / 2 / length
55 // and tan(theta/2) = width/2 / radius
56 // So 1/r = (maxW - minW) / (width * length)
57 double oneOverRadius = (maxWidth() - minWidth()) / (width() * length());
58 // We measure the angle from the y (eta) axis towards the x (phi) axis, hence the -ve sign.
59 double sinAngle = -x * oneOverRadius / sqrt(
60 (1 + y * oneOverRadius) * (1 + y * oneOverRadius) + x * oneOverRadius * x * oneOverRadius);
61
62 return sinAngle;
63}
64
65void
67 double & etaDist, double & phiDist) const
68{
69 m_geometry.distanceToDetectorEdge(localPosition,
70 m_frame.polarFromCartesian(localPosition),
71 etaDist, phiDist);
72}
73
74bool
75SCT_ForwardModuleSideDesign::nearBondGap(const SiLocalPosition & localPosition, double etaTol) const
76{
77 return m_geometry.nearBondGap(localPosition, etaTol);
78}
79
80// check if the position is in active area
81bool SCT_ForwardModuleSideDesign::inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap) const
82{
83 //const SCT_ForwardPolarPosition polar=m_frame.polarFromCartesian(chargePos);
84 //return m_geometry.inActiveArea(m_frame.polarFromCartesian(chargePos));
85 return m_geometry.inActiveArea(chargePos, checkBondGap);
86}
87
88// give distance to the nearest diode in units of pitch, from 0.0 to 0.5,
89// this method should be fast as it is called for every surface charge
90// in the SCT_SurfaceChargesGenerator
92{
93 const SCT_ForwardPolarPosition polar=m_frame.polarFromCartesian(chargePos);
94 return m_geometry.scaledDistanceToNearestDiode(polar);
95}
96
97
98// give the strip pitch (dependence on position needed for forward)
100{
101 const SCT_ForwardPolarPosition polar=m_frame.polarFromCartesian(chargePos);
102 // No longer make inActive check
103 // if (!m_geometry.inActiveArea(polar)) return 0;
104 return m_geometry.stripPitch(polar);
105}
106
107// give the strip pitch (dependence on position needed for forward)
109{
110 // Use center.
111 const SCT_ForwardPolarPosition polarCenter(m_frame.radius(), 0);
112 // No longer make inActive check
113 // if (!m_geometry.inActiveArea(polar)) return 0;
114 return m_geometry.stripPitch(polarCenter);
115}
116
117
118
119// this method returns the extremities of a strip passing by the point
120std::pair<SiLocalPosition,SiLocalPosition> SCT_ForwardModuleSideDesign::endsOfStrip(const SiLocalPosition &position) const
121{
122 const SCT_ForwardPolarPosition polarPosition =
123 m_frame.polarFromCartesian(position);
124 const double theta = polarPosition.theta();
125 const double innerRadius = (m_geometry.radius1()-m_geometry.halfHeight1())/cos(theta);
126 double outerRadius;
127 if (crystals()==1) {
128 outerRadius = (m_geometry.radius1()+m_geometry.halfHeight1())/cos(theta);
129 } else {
130 outerRadius = (m_geometry.radius2()+m_geometry.halfHeight2())/cos(theta);
131 }
132 const SCT_ForwardPolarPosition innerPointPolar = SCT_ForwardPolarPosition(innerRadius,theta);
133 const SCT_ForwardPolarPosition outerPointPolar = SCT_ForwardPolarPosition(outerRadius,theta);
134 const SiLocalPosition innerPoint = m_frame.cartesianFromPolar(innerPointPolar);
135 const SiLocalPosition outerPoint = m_frame.cartesianFromPolar(outerPointPolar);
136
137 return std::pair<SiLocalPosition,SiLocalPosition>(innerPoint,outerPoint);
138}
139
140
141// method for stereo angle computation - returns a vector parallel to the
142// strip being hit
143HepGeom::Vector3D<double> SCT_ForwardModuleSideDesign::phiMeasureSegment(const SiLocalPosition &position) const
144{
145 const SCT_ForwardPolarPosition secondPolarPosition(0,0);
146 const SiLocalPosition secondPosition = m_frame.cartesianFromPolar(secondPolarPosition);
147
148 HepGeom::Vector3D<double> notUnitVector;
149 notUnitVector[phiAxis()]=position.xPhi()-secondPosition.xPhi();
150 notUnitVector[etaAxis()]=position.xEta()-secondPosition.xEta();
151
152 return notUnitVector.unit();
153}
154
156{
157 return m_geometry.length();
158}
159
161{
162 return m_geometry.width();
163}
164
166{
167 return m_geometry.minWidth();
168}
169
171{
172 return m_geometry.maxWidth();
173}
174
176{
177 return m_geometry.deadAreaLength();
178}
179
181{
182 return m_geometry.deadAreaUpperBoundary();
183}
184
186{
187 return m_geometry.deadAreaLowerBoundary();
188}
189
190//this method returns the position of the centre of a strips
193{
194 // This method returns the position of the centre of the cell
195
196 // NB. No check is made that cellId is valid or in the correct range.
197
198 int strip = cellId.strip();
199
200 double clusterCenter = strip - 0.5*cells() + 0.5;
201
202 const double theta = m_geometry.angularPitch()*clusterCenter;
203 const double r = radius() / cos(theta);
204
205 // positions in polar coordinates and then cartesian
206 const SCT_ForwardPolarPosition polarPosition(r, theta);
207 return m_frame.cartesianFromPolar(polarPosition);
208}
209
210//this method returns the position of the centre of the cluster of strips
213 int clusterSize) const
214{
215 // This method returns the position of the centre of the cluster starting at cellId.strip()
216
217 // NB. No check is made that cellId is valid or in the correct range.
218
219 if (clusterSize < 1) clusterSize = 1;
220
221 int strip = cellId.strip();
222
223 double clusterCenter = strip - 0.5*cells() + 0.5;
224 if (clusterSize>1) clusterCenter += 0.5 * (clusterSize-1);
225
226 const double theta = angularPitch()*clusterCenter;
227 const double r = radius() / cos(theta);
228
229 // positions in polar coordinates and then cartesian
230 const SCT_ForwardPolarPosition polarPosition(r,theta);
231 return m_frame.cartesianFromPolar(polarPosition);
232}
233
236{
237 int strip = cellId.strip();
238
239 double clusterCenter = strip - 0.5*cells() + 0.5;
240
241 const double theta = m_geometry.angularPitch()*clusterCenter;
242 const double r = radius() / cos(theta);
243
244 // positions in polar coordinates and then cartesian
245 const SCT_ForwardPolarPosition polarPosition(r, theta);
246 SiLocalPosition center = m_frame.cartesianFromPolar(polarPosition);
247
248 // The strip is not rectangular put we return pitch at radius.
249 double stripWidth = angularPitch()*r;
250 double stripLength = length() / cos(theta);
251
252 SiLocalPosition width(stripLength, stripWidth);
253 return SiDiodesParameters(center, width);
254}
255
256
259{
260 // NB We do not distinguish between the two crystals anymore.
261 // Check if we are in the active region. No bondgap check.
262 if (!inActiveArea(localPosition, false)) return {}; // return an invalid id
263
264 const SCT_ForwardPolarPosition polar = m_frame.polarFromCartesian(localPosition);
265 double theta = polar.theta();
266
267 double dstrip = theta/angularPitch() + 0.5*diodes();
268
269 if (dstrip < 0) return {}; // return an invalid id
270 int strip = static_cast<int>(dstrip);
271 if (strip > diodes()) return {};// return an invalid id if strip # greater
272 // than number of diodes.
273 return {strip-shift()}; // strip numbering starts from first readout strip.
274 // Those to the left will have negative numbers.
275}
276
277
283
284const Trk::SurfaceBounds &
286{
287 return m_bounds;
288}
289
290} // namespace InDetDD
Scalar theta() const
theta method
#define y
#define x
Axis etaAxis() const
local axis corresponding to eta direction:
double thickness() const
Method which returns thickness of the silicon wafer.
Axis phiAxis() const
local axis corresponding to phi direction:
InDetDD::CarrierType carrierType() const
Return carrier type (ie electrons or holes)
int readoutSide() const
ReadoutSide.
Class that connect cartesian and pokar coordinates.
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const
position -> id
virtual SiDiodesParameters parameters(const SiCellId &cellId) const
readout or diode id -> position, size
virtual double stripPitch() const
give the strip pitch (For Forward returns pitch at center)
virtual double length() const
Method to calculate length of a module.
virtual double deadAreaLength() const
give length of dead area
virtual const Trk::SurfaceBounds & bounds() const
Element boundary.
virtual double deadAreaLowerBoundary() const
give lower boundary of dead area
SCT_ForwardModuleSideGeometry m_geometry
geometry of module side
virtual HepGeom::Vector3D< double > phiMeasureSegment(const SiLocalPosition &position) const
method for stereo angle computation - returns a vector parallel to the strip being hit
virtual DetectorShape shape() const
Shape of element.
SCT_ForwardModuleSideDesign()
Forbidden default constructor.
virtual double deadAreaUpperBoundary() const
give upper boundary of dead area
virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const
SCT_ForwardFrameTransformation m_frame
polar / cartesian frame transformation
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const
Returns distance to nearest detector active edge +ve = inside -ve = outside.
virtual bool nearBondGap(const SiLocalPosition &localPosition, double etaTol) const
Test if near bond gap within tolerances.
double radius() const
Nominal center radius of double wafer.
virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=true) const
check if the position is in active area
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const
this method returns the ends of the strip
virtual double maxWidth() const
Method to calculate maximum width of a module.
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
id -> position
double sinStripAngleReco(double phiCoord, double etaCoord) const
Give strip angle in the reco frame.
virtual double minWidth() const
Method to calculate minimum width of a module.
virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const
give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as ...
virtual double width() const
Method to calculate average width of a module.
2D position in polar coordinates for the polar frame in the SCT endcaps.
double theta() const
theta coordinate of point:
int diodes() const
number of strips within crystal:
int cells() const
number of readout stips within module side:
int crystals() const
number of crystals within module side:
virtual int strip(int stripId1Dim) const
int shift() const
number of edge strips before first readout strip.
SCT_ModuleSideDesign(const double thickness, const bool phiSymmetric, const bool etaSymmetric, const bool depthSymmetric, const int crystals, const int diodes, const int cells, const int shift, const bool swapStripReadout, InDetDD::CarrierType carrierType, int readoutSide)
Constructor with parameters: local axis corresponding to eta direction local axis corresponding to ph...
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
int strip() const
Get strip number. Equivalent to phiIndex().
Definition SiCellId.h:131
Class to handle the position of the centre and the width of a diode or a cluster of diodes Version 1....
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
Abstract base class for surface bounds to be specified.
Bounds for a trapezoidal, planar Surface.
int r
Definition globals.cxx:22
Message Stream Member.