ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_ForwardModuleSideGeometry.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6// SCT_ForwardModuleSideGeometry.cxx
7// Implementation file for class SCT_ForwardModuleSideGeometry
9// (c) ATLAS Detector software
11// Version 1.6 09/7/2001 Alessandro Fornaini
13
15#include <cmath>
16
17namespace InDetDD {
18
19 using std::cos;
20 using std::sin;
21
22// Constructor with parameters:
77
78
79
80// Returns distance to nearest detector edge
81// +ve = inside
82// -ve = outside
83void
85 const SCT_ForwardPolarPosition & polar,
86 double & etaDist, double & phiDist) const
87{
88
89 // Distance to top/bottom.
90 // Calculation symmetric around zero so we can use abs.
91 etaDist = m_halfLength - std::abs(localPosition.xEta());
92
93 // For phi distance use r*phiDiff.
94 phiDist = polar.r() * (m_rightSide - std::abs(polar.theta()));
95
96}
97
98
99bool SCT_ForwardModuleSideGeometry::nearBondGap(const SiLocalPosition & localPosition, double etaTol) const
100{
101 if (m_nCrystals == 1) return false; // No bond gap (eg for truncated middle detectors)
102
103 return ((localPosition.xEta() < m_deadRegionUpper + etaTol ) &&
104 (localPosition.xEta() > m_deadRegionLower - etaTol));
105
106}
107
108
109// check if the position is in active area
111 bool checkBondGap) const
112{
113 double xEta = chargePos.xEta();
114 double xPhi = chargePos.xPhi();
115
116 if (std::abs(xEta) > m_halfLength) return false;
117
118 if (checkBondGap && m_nCrystals > 1) {
119 // Check if in bond gap
120 if (xEta > m_deadRegionLower && xEta < m_deadRegionUpper) return false;
121 }
122
123 // edge at xEta
124 double edge = (xEta + m_radius) * m_tangent;
125
126 return (std::abs(xPhi) < edge);
127}
128
129// DEPRECATED
130// check if the position is in active area
132 &polarPos ) const
133{
134 bool conditionTheta=false;
135 bool conditionEtaOne=false;
136 bool conditionEtaTwo=false;
137 double polarR = polarPos.r();
138 double polarTheta = polarPos.theta();
139 double cosPolarTheta = cos(polarTheta);
140
141
142 if (polarR*cosPolarTheta<m_upperSide1 &&
143 polarR*cosPolarTheta>m_lowerSide1)
144 conditionEtaOne=true;
145 if (polarR*cosPolarTheta<m_upperSide2 &&
146 polarR*cosPolarTheta>m_lowerSide2)
147 conditionEtaTwo=true;
148 if (polarTheta<m_rightSide &&
149 polarTheta>m_leftSide) conditionTheta=true;
150 return (conditionEtaOne || conditionEtaTwo) && conditionTheta;
151}
152
153// give the strip pitch (dependence on position needed for forward)
155 &polarPos) const
156{
157 return 2.0*polarPos.r()*std::abs(sin(m_step*0.5));
158}
159
160// give distance to the nearest diode in units of pitch, from 0.0 to 0.5,
161// this method should be fast as it is called for every surface charge
162// in the SCT_SurfaceChargesGenerator
164{
165 int stripIndex;
166 if (polarPos.theta()>0) stripIndex =
167 static_cast<int>(polarPos.theta()/m_step);
168 else stripIndex = static_cast<int>(polarPos.theta()/m_step-1);
169 const double thetaStrip = (stripIndex+0.5)*m_step;
170 const double pitch = 2.0*polarPos.r()*std::abs(sin(m_step*0.5));
171 return polarPos.r()*std::abs(sin(polarPos.theta()-thetaStrip))/pitch;
172}
173
174// Method to calculate length of a module
176{
177 return 2 * m_halfLength;
178}
179
180// Method to calculate average width of a module
182{
183 return 2 * m_radius * m_tangent;
184}
185
186// Method to calculate minimum width of a module
188{
189 return 2 * m_lowerSide1 * m_tangent;
190}
191
192// Method to calculate maximum width of a module
194{
195 if (m_nCrystals==1) {
196 return 2 * m_upperSide1 * m_tangent;
197 }
198 else {
199 return 2 * m_upperSide2 * m_tangent;
200 }
201}
202
203// give length of dead area
205{
206 if (m_nCrystals==1) {
207 return 0;
208 } else {
210 }
211
212}
213
214
215// give upper boundary of dead area
220
221// give lower boundary of dead area
226
227} // namespace InDetDD
double deadAreaLength() const
give length of dead area
double m_step
strip step in angle (same for both crystals)
double m_radius2
r from outer crystal (if present) center to beam
double maxWidth() const
Method to calculate maximum width of a module.
bool nearBondGap(const SiLocalPosition &localPosition, double etaTol) const
Test if near bond gap within tolerances.
double m_halfHeight2
outer crystal (if present) half height
double halfHeight1() const
inner crystal half height:
double minWidth() const
Method to calculate minimum width of a module.
double length() const
Method to calculate length of a module.
double step() const
strip step in angle (same for both crystals):
bool inActiveArea(const SiLocalPosition &chargePosition, bool checkBondGap=true) const
check if position is in active area
double scaledDistanceToNearestDiode(const SCT_ForwardPolarPosition &polarPos) const
give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as ...
double m_tangent
tan(theta) at edge = (halfWidth) / (radius)
double m_leftSide
left border of module in angle
double m_halfLength
top = +halfLength, bot = -halfLength
double radius2() const
r from outer crystal (if present) center to beam:
double m_deadRegionUpper
relative to center of detector.
double deadAreaUpperBoundary() const
give upper boundary of dead area
int strips() const
number of strips (same for both crystals):
double width() const
Method to calculate average width of a module.
double radius1() const
r from inner crystal center to beam:
int nCrystals() const
number of crystals per module side
double halfHeight2() const
outer crystal (if present) half height:
double m_radius1
r from inner crystal center to beam
double deadAreaLowerBoundary() const
give lower boundary of dead area
double m_deadRegionLower
relative to center of detector.
double m_rightSide
right border of module in angle
double m_radius
r from nominal element center to beam
double stripPitch(const SCT_ForwardPolarPosition &polarPos) const
give the strip pitch (dependence on position needed for forward)
void distanceToDetectorEdge(const SiLocalPosition &localPosition, const SCT_ForwardPolarPosition &polarPos, double &etaDist, double &phiDist) const
int m_strips
number of strips (same for both crystals)
int m_nCrystals
number of crystals per module side
2D position in polar coordinates for the polar frame in the SCT endcaps.
double theta() const
theta coordinate of point:
double r() const
r coordinate of point:
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:
Message Stream Member.