ATLAS Offline Software
Loading...
Searching...
No Matches
InDetDD::StripStereoAnnulusDesign Class Reference

#include <StripStereoAnnulusDesign.h>

Inheritance diagram for InDetDD::StripStereoAnnulusDesign:
Collaboration diagram for InDetDD::StripStereoAnnulusDesign:

Public Types

enum  Axis { xAxis =0 , yAxis , zAxis }

Public Member Functions

 StripStereoAnnulusDesign (const SiDetectorDesign::Axis &stripDirection, const SiDetectorDesign::Axis &thicknessDirection, const double &thickness, const int &readoutSide, const InDetDD::CarrierType &carrier, const int &nRows, const std::vector< int > &nStrips, const std::vector< double > &pitch, const std::vector< double > &stripStart, const std::vector< double > &stripEnd, const double &stereoAngle, const double &centreR, const bool &usePC, InDetDD::DetectorType detectorType=InDetDD::Undefined)
 StripStereoAnnulusDesign (const SiDetectorDesign::Axis &stripDirection, const SiDetectorDesign::Axis &thicknessDirection, const double &thickness, const int &readoutSide, const InDetDD::CarrierType &carrier, const int &nRows, const std::vector< int > &nStrips, const std::vector< double > &pitch, const std::vector< double > &stripStart, const std::vector< double > &stripEnd, const double &stereoAngle, const double &centreR, const double &waferCentreR, const bool &usePC, InDetDD::DetectorType detectorType=InDetDD::Undefined)
 ~StripStereoAnnulusDesign ()=default
SiLocalPosition beamToStrip (const SiLocalPosition &pos) const
SiLocalPosition beamToStripPC (const SiLocalPosition &pos) const
SiLocalPosition beamToStripPCpolar (const SiLocalPosition &pos) const
 Version of StripStereoAnnulusDesign::beamToStripPC transform based exclusively in a polar system.
SiLocalPosition stripToBeam (const SiLocalPosition &pos) const
SiLocalPosition stripToBeamPC (const SiLocalPosition &pos) const
SiLocalPosition stripToBeamPCpolar (const SiLocalPosition &pos) const
 Version of StripStereoAnnulusDesign::stripToBeamPC transform based exclusively in a polar system.
virtual Amg::Vector3D sensorCenter () const override
 Return the centre of a sensor in the local reference frame.
 StripStereoAnnulusDesign (const StripStereoAnnulusDesign &design)
StripStereoAnnulusDesignoperator= (const StripStereoAnnulusDesign &design)
std::pair< int, int > getStripRow (SiCellId cellId) const final
 Get the strip and row number of the cell.
virtual int strip1Dim (int strip, int row) const override
 only relevant for SCT.
SiLocalPosition stripPosAtR (int strip, int row, double r) const
virtual int diodesInRow (const int row) const override
virtual void distanceToDetectorEdge (const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const override
 Returns distance to nearest detector active edge +ve = inside -ve = outside.
virtual bool inActiveArea (const SiLocalPosition &chargePos, bool checkBondGap=true) const override
 check if the position is in active area
virtual const Trk::SurfaceBoundsbounds () const override
 Get a reference to the module bounds object.
virtual std::pair< SiLocalPosition, SiLocalPositionendsOfStrip (const SiLocalPosition &position) const override
 Give end points of the strip that covers the given position.
virtual double stripPitch (const SiLocalPosition &localPosition) const override
 give the strip pitch (dependence on position needed for forward)
double stripPitch (const SiCellId &cellId) const
virtual double stripPitch () const override
 give the strip pitch (For Forward returns pitch at center)
virtual double phiPitch (const SiLocalPosition &localPosition) const override
 Pitch in phi direction.
double phiPitch (const SiCellId &cellId) const
virtual double phiPitch () const override
 Pitch in phi direction.
double phiPitchPhi (const SiLocalPosition &localPosition) const
double phiPitchPhi (const SiCellId &cellId) const
double phiPitchPhi () const
virtual double scaledDistanceToNearestDiode (const SiLocalPosition &chargePos) const override
 give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as it is called for every surface charge in the SCT_SurfaceChargesGenerator
virtual SiDiodesParameters parameters (const SiCellId &cellId) const override
 Return strip width, centre, length etc. Hard to find if this is used or not.
virtual SiLocalPosition localPositionOfCell (const SiCellId &cellId) const override
 id -> position
virtual SiLocalPosition localPositionOfCluster (const SiCellId &cellId, int clusterSize) const override
SiLocalPosition localPositionOfCellPC (const SiCellId &cellId) const
 This is for debugging only.
SiLocalPosition localPositionOfClusterPC (const SiCellId &cellId, int clusterSize) const
 This is for debugging only.
virtual SiCellId cellIdOfPosition (const SiLocalPosition &localPos) const override
 position -> id
SiLocalPosition positionFromStrip (const SiCellId &cellId) const
virtual SiLocalPosition positionFromStrip (const int stripNumber) const override
 gives position of strip center ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId & cellId) or rawLocalPositionOfCell method in SiDetectorElement.
virtual int row (int stripId1Dim) const override
virtual int strip (int stripId1Dim) const override
virtual void neighboursOfCell (const SiCellId &cellId, std::vector< SiCellId > &neighbours) const override
 Get the neighbouring diodes of a given diode: Cell for which the neighbours must be found List of cells which are neighbours of the given one.
virtual SiCellId cellIdInRange (const SiCellId &) const override
 DEPRECATED: only used in a stupid example (2014) Check if cell is in range.
virtual SiReadoutCellId readoutIdOfCell (const SiCellId &cellId) const override
 diode id -> readout id
double waferCentreR () const
double centreR () const
InDetDD::DetectorType type () const override final
 Type of element.
virtual HepGeom::Vector3D< double > phiMeasureSegment (const SiLocalPosition &position) const override
 Helper method for stereo angle computation, DEPRECATED.
virtual double length () const override
 Method to calculate length of a module.
virtual double width () const override
 Method to calculate average width of a module.
virtual double minWidth () const override
 Method to calculate minimum width of a module.
virtual double maxWidth () const override
 Method to calculate maximum width of a module.
virtual double etaPitch () const override
virtual bool swapHitPhiReadoutDirection () const override
 Return true if hit local direction is the same as readout direction.
virtual bool swapHitEtaReadoutDirection () const override
virtual bool nearBondGap (const SiLocalPosition &, double) const override
 Test if near bond gap within tolerances, only relevant for SCT.
virtual DetectorShape shape () const override
 Shape of element.
virtual double sinStripAngleReco (double phiCoord, double etaCoord) const override
 Give strip angle in the reco frame.
double pitch (const SiCellId &cellId) const
double stripLength (const SiCellId &cellId) const
double minR () const
double maxR () const
double phiWidth () const
double stereo () const
virtual double deadAreaUpperBoundary () const override
 DEPRECATED for StripStereoAnnulusDesign; no dead area.
virtual double deadAreaLowerBoundary () const override
 give lower boundary of dead area
virtual double deadAreaLength () const override
 give length of dead area
virtual int numberOfConnectedCells (const SiReadoutCellId &readoutId) const override
 readout id -> id of connected diodes Not particularly useful for the SCT but implemented to keep a uniform interface.
virtual SiCellId connectedCell (const SiReadoutCellId &readoutId, int number) const override
 readout id -> id of connected diodes.
virtual SiCellId gangedCell (const SiCellId &cellId) const override
 If cell is ganged return the other cell, otherwise return an invalid id.
virtual SiReadoutCellId readoutIdOfPosition (const SiLocalPosition &localPos) const override
 position -> id
int crystals () const
 number of crystals within module side:
int diodes () const
 number of strips within crystal:
int cells () const
 number of readout stips within module side:
int shift () const
 number of edge strips before first readout strip.
void setMother (SCT_ModuleSideDesign *mother)
const SCT_ModuleSideDesigngetMother () const
const std::map< int, const SCT_ModuleSideDesign * > & getChildren () const
void addChildDesign (int index, const SCT_ModuleSideDesign *element)
virtual SiIntersect inDetector (const SiLocalPosition &localPosition, double phiTol, double etaTol) const override
 Test if point is in the active part of the detector with specified tolerances.
void setSymmetry (bool phiSymmetric, bool etaSymmetric, bool depthSymmetric)
 Override default symmetries to prevent swapping of axes.
Axis etaAxis () const
 local axis corresponding to eta direction:
Axis phiAxis () const
 local axis corresponding to phi direction:
Axis depthAxis () const
 local axis corresponding to depth direction:
double thickness () const
 Method which returns thickness of the silicon wafer.
InDetDD::CarrierType carrierType () const
 Return carrier type (ie electrons or holes)
bool phiSymmetric () const
bool etaSymmetric () const
bool depthSymmetric () const
int readoutSide () const
 ReadoutSide.
virtual const Amg::Transform3D moduleShift () const

Protected Attributes

SCT_ReadoutScheme m_scheme
InDetDD::DetectorType m_detectorType {Undefined}

Private Attributes

const int m_nRows
const std::vector< int > m_nStrips
std::vector< int > m_firstStrip
const std::vector< double > m_pitch
const std::vector< double > m_stripStartRadius
const std::vector< double > m_stripEndRadius
const double m_stereo
const double m_R
const double m_waferCentreR
const double m_lengthBF
std::unique_ptr< Trk::SurfaceBoundsm_bounds
const double m_sinStereo
const double m_cosStereo
const double m_sinNegStereo
const double m_cosNegStereo
const bool m_usePC
bool m_swapStripReadout
const SCT_ModuleSideDesignm_motherDesign {nullptr}
std::map< int, const SCT_ModuleSideDesign * > m_childDesigns
Axis m_etaAxis
Axis m_phiAxis
Axis m_depthAxis
double m_thickness
InDetDD::CarrierType m_carrierType
bool m_phiSymmetric
bool m_etaSymmetric
bool m_depthSymmetric
bool m_readoutSidePosDepth

Detailed Description

Definition at line 50 of file StripStereoAnnulusDesign.h.

Member Enumeration Documentation

◆ Axis

Enumerator
xAxis 
yAxis 
zAxis 

Definition at line 59 of file DetectorDesign.h.

Constructor & Destructor Documentation

◆ StripStereoAnnulusDesign() [1/3]

InDetDD::StripStereoAnnulusDesign::StripStereoAnnulusDesign ( const SiDetectorDesign::Axis & stripDirection,
const SiDetectorDesign::Axis & thicknessDirection,
const double & thickness,
const int & readoutSide,
const InDetDD::CarrierType & carrier,
const int & nRows,
const std::vector< int > & nStrips,
const std::vector< double > & pitch,
const std::vector< double > & stripStart,
const std::vector< double > & stripEnd,
const double & stereoAngle,
const double & centreR,
const bool & usePC,
InDetDD::DetectorType detectorType = InDetDD::Undefined )

Definition at line 109 of file StripStereoAnnulusDesign.cxx.

122 :
123 StripStereoAnnulusDesign(stripDirection,thicknessDirection,thickness,readoutSide,carrier,nRows,nStrips,
124 pitch,stripStartRadius,stripEndRadius,stereoAngle,centreR,centreR,usePC,detectorType){
125//assuming here that centreR==waferCentreR
126}
double thickness() const
Method which returns thickness of the silicon wafer.
int readoutSide() const
ReadoutSide.
StripStereoAnnulusDesign(const SiDetectorDesign::Axis &stripDirection, const SiDetectorDesign::Axis &thicknessDirection, const double &thickness, const int &readoutSide, const InDetDD::CarrierType &carrier, const int &nRows, const std::vector< int > &nStrips, const std::vector< double > &pitch, const std::vector< double > &stripStart, const std::vector< double > &stripEnd, const double &stereoAngle, const double &centreR, const bool &usePC, InDetDD::DetectorType detectorType=InDetDD::Undefined)
double pitch(const SiCellId &cellId) const

◆ StripStereoAnnulusDesign() [2/3]

InDetDD::StripStereoAnnulusDesign::StripStereoAnnulusDesign ( const SiDetectorDesign::Axis & stripDirection,
const SiDetectorDesign::Axis & thicknessDirection,
const double & thickness,
const int & readoutSide,
const InDetDD::CarrierType & carrier,
const int & nRows,
const std::vector< int > & nStrips,
const std::vector< double > & pitch,
const std::vector< double > & stripStart,
const std::vector< double > & stripEnd,
const double & stereoAngle,
const double & centreR,
const double & waferCentreR,
const bool & usePC,
InDetDD::DetectorType detectorType = InDetDD::Undefined )

Definition at line 15 of file StripStereoAnnulusDesign.cxx.

29 :
30 SCT_ModuleSideDesign(thickness, false, false, true, 1, 0, 0, 0, false, carrier,
31 readoutSide, stripDirection, thicknessDirection),
32 m_nRows(nRows),
33 m_nStrips(nStrips),
35 m_stripStartRadius(stripStartRadius),
36 m_stripEndRadius(stripEndRadius),
37 m_stereo(stereoAngle),
38 m_R(centreR),
39 m_waferCentreR(waferCentreR),//if not specified in constructor, wafer centre assumed to simply be element centre
40 m_lengthBF(2. * waferCentreR * std::sin(stereoAngle*0.5)),// Eq. 5 p. 7
41 m_sinStereo(std::sin(m_stereo)),
42 m_cosStereo(std::cos(m_stereo)),
45 m_usePC(usePC)
46{
47
48 m_detectorType = detectorType;
49
50 if (nRows < 0) {
51 throw std::runtime_error(
52 "ERROR: StripStereoAnnulusDesign called with negative number of rows");
53 }
54
55 if (pitch.size() != (unsigned) nRows) {
56 throw std::runtime_error(
57 "ERROR: StripStereoAnnulusDesign called with insufficiant pitch values for no. of rows");
58 }
59
60 if (stripStartRadius.size() != (unsigned) nRows) {
61 throw std::runtime_error(
62 "ERROR: StripStereoAnnulusDesign called with insufficiant strip start-positions for no. of rows");
63 }
64
65 if (stripEndRadius.size() != (unsigned) nRows) {
66 throw std::runtime_error(
67 "ERROR: StripStereoAnnulusDesign called with insufficiant strip end-positions for no. of rows");
68 }
69
70 int startStrip = 0;
71 for (int r = 0; r < nRows; ++r) {
72 m_firstStrip.push_back(startStrip);
73 startStrip += m_nStrips[r];
74 }
75 int totalStrips = startStrip;
76 m_firstStrip.push_back(totalStrips); // Add one more as total number of strips, so you can safely use row + 1 in a loop
77
78 m_scheme.setCells(totalStrips);
79 m_scheme.setDiodes(totalStrips);
80
81
82 double phi = m_nStrips[0] * m_pitch[0];
83
84 if (m_usePC) {
85 // Maths for calculating PC bounds is based off
86 // Trk::AnnulusBoundsPC::fromCartesian() and detailed at
87 // https://hep.ph.liv.ac.uk/~jsmith/dropbox/AnnulusBoundsPC_Constructor_Maths.pdf.
88 // This will later form some kind of INT Note or report or similar
89 // internal documentation,
90 Amg::Vector2D origin(m_R * (1.0 - std::cos(m_stereo)),
91 m_R * std::sin(-m_stereo));
92 m_bounds = std::make_unique<Trk::AnnulusBoundsPC>(
93 Trk::AnnulusBoundsPC(m_stripStartRadius[0],
94 m_stripEndRadius.back(),
95 phi * -0.5,
96 phi * 0.5,
97 origin,
98 0));
99 } else {
100 m_bounds = std::make_unique<Trk::AnnulusBounds>(
101 Trk::AnnulusBounds(m_stripStartRadius[0],
102 m_stripEndRadius.back(),
104 phi,
105 m_stereo));
106 }
107}
Scalar phi() const
phi method
std::unique_ptr< Trk::SurfaceBounds > m_bounds
const std::vector< double > m_stripStartRadius
const std::vector< double > m_stripEndRadius
int r
Definition globals.cxx:22
Eigen::Matrix< double, 2, 1 > Vector2D
unsigned int constexpr nRows
Definition RPDUtils.h:24

◆ ~StripStereoAnnulusDesign()

InDetDD::StripStereoAnnulusDesign::~StripStereoAnnulusDesign ( )
default

◆ StripStereoAnnulusDesign() [3/3]

InDetDD::StripStereoAnnulusDesign::StripStereoAnnulusDesign ( const StripStereoAnnulusDesign & design)

Member Function Documentation

◆ addChildDesign()

void InDetDD::SCT_ModuleSideDesign::addChildDesign ( int index,
const SCT_ModuleSideDesign * element )
inlineinherited

Definition at line 292 of file SCT_ModuleSideDesign.h.

292 {
293 m_childDesigns.emplace(index,child);
294 }
std::map< int, const SCT_ModuleSideDesign * > m_childDesigns

◆ beamToStrip()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::beamToStrip ( const SiLocalPosition & pos) const

Definition at line 128 of file StripStereoAnnulusDesign.cxx.

128 {
129 if (m_usePC) return beamToStripPC(pos);
130
131 const double x_beam = pos.xEta();
132 const double y_beam = pos.xPhi();
133
134 // Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame)
135 //
136 // x_strip cos(-m_stereo) -sin(-m_stereo) x-R R
137 // ( ) = [ ]( ) + ( )
138 // y_strip sin(-m_stereo) cos(-m_stereo) y 0
139 const double x_strip = m_cosNegStereo * (x_beam - m_waferCentreR) - m_sinNegStereo * y_beam + m_waferCentreR;
140 const double y_strip = m_sinNegStereo * (x_beam - m_waferCentreR) + m_cosNegStereo * y_beam;
141
142 return {x_strip, y_strip};
143}
SiLocalPosition beamToStripPC(const SiLocalPosition &pos) const

◆ beamToStripPC()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::beamToStripPC ( const SiLocalPosition & pos) const

Definition at line 145 of file StripStereoAnnulusDesign.cxx.

145 {
146 const double phi_beam = pos.xPhi();
147 const double rad_beam = pos.xEta();
148
149 // Convert to cart and use cartesian transform
150 const double x_beam = rad_beam * std::cos(phi_beam);
151 const double y_beam = rad_beam * std::sin(phi_beam);
152
153 // Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame)
154 //
155 // x_strip cos(-m_stereo) -sin(-m_stereo) x-R R
156 // ( ) = [ ]( ) + ( )
157 // y_strip sin(-m_stereo) cos(-m_stereo) y 0
158 const double x_strip = m_cosNegStereo * (x_beam - m_waferCentreR) - m_sinNegStereo * y_beam + m_waferCentreR;
159 const double y_strip = m_sinNegStereo * (x_beam - m_waferCentreR) + m_cosNegStereo * y_beam;
160
161 const double phi_strip = std::atan2(y_strip, x_strip);
162 const double rad_strip = std::hypot(x_strip, y_strip);
163
164 return {rad_strip, phi_strip};
165}

◆ beamToStripPCpolar()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::beamToStripPCpolar ( const SiLocalPosition & pos) const

Version of StripStereoAnnulusDesign::beamToStripPC transform based exclusively in a polar system.

Not currently used. Requires debugging and profiling

Parameters
pos
Returns
SiLocalPosition

Definition at line 175 of file StripStereoAnnulusDesign.cxx.

175 {
176 const double phi_beam = pos.xPhi();
177 const double rad_beam = pos.xEta();
178
179 // Exclusively-polar transform:
180 // Trig which can be precalculated in the future
181 const double stereo_2 = m_stereo*0.5;
182 const double cosStereo_2 = std::cos(stereo_2);
183 const double sin_plus_stereo_2 = std::sin(stereo_2);
184
185 // calculation for strip-frame radius uses cosine law - see ATL-COM-ITK-2021-048
186 const double rad_conv = 2.0*m_waferCentreR*std::abs(sin_plus_stereo_2);
187 const double rad_strip = std::sqrt( std::pow(rad_beam,2.0) + std::pow(rad_conv,2.0) + 2.0*rad_beam*rad_conv*cosStereo_2);
188
189 // calculation for strip-frame angle uses sine law - see ATL-COM-ITK-2021-048
190 const double phi_strip = M_PI_2 - stereo_2 - std::asin((rad_beam*std::sin(M_PI + phi_beam - stereo_2))/rad_strip);
191
192 return {rad_strip, phi_strip};
193}
#define M_PI

◆ bounds()

const Trk::SurfaceBounds & InDetDD::StripStereoAnnulusDesign::bounds ( ) const
overridevirtual

Get a reference to the module bounds object.

Returns
const Trk::SurfaceBounds& The module bounds.

Implements InDetDD::DetectorDesign.

Definition at line 326 of file StripStereoAnnulusDesign.cxx.

326 {
327 return *(m_bounds); // Equivalent but more explicit than *m_bounds -
328 // gets the normal pointer from the unique then dereferences it.
329}

◆ carrierType()

InDetDD::CarrierType InDetDD::DetectorDesign::carrierType ( ) const
inlineinherited

Return carrier type (ie electrons or holes)

Definition at line 275 of file DetectorDesign.h.

275 {
276 return m_carrierType;
277}
InDetDD::CarrierType m_carrierType

◆ cellIdInRange()

SiCellId InDetDD::StripStereoAnnulusDesign::cellIdInRange ( const SiCellId & cellId) const
overridevirtual

DEPRECATED: only used in a stupid example (2014) Check if cell is in range.

Returns the original cellId if it is in range, otherwise it

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 532 of file StripStereoAnnulusDesign.cxx.

532 {
533
534 if (!cellId.isValid()) {
535 return {}; // Invalid
536 }
537 int row = cellId.etaIndex();
538 int strip = cellId.phiIndex();
539 if (strip < 0 || row < 0 || row >= m_nRows || strip >= m_nStrips[row]) {
540 return {}; // Invalid
541 }
542 return cellId;
543}
virtual int row(int stripId1Dim) const override
virtual int strip(int stripId1Dim) const override
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
bool isValid() const
Test if its in a valid state.
Definition SiCellId.h:136
int etaIndex() const
Get eta index.
Definition SiCellId.h:114

◆ cellIdOfPosition()

SiCellId InDetDD::StripStereoAnnulusDesign::cellIdOfPosition ( const SiLocalPosition & localPos) const
overridevirtual

position -> id

Implements InDetDD::DetectorDesign.

Definition at line 331 of file StripStereoAnnulusDesign.cxx.

331 {
332//
333// Find the row
334//
335 double rad_beam = (m_usePC) ? pos.xEta() : pos.r();
336 if (rad_beam < m_stripStartRadius[0] || rad_beam >= m_stripEndRadius.back()) {
337 return {}; // return an invalid id
338 }
339
340 std::vector<double>::const_iterator endPtr = upper_bound(m_stripStartRadius.begin(), m_stripStartRadius.end(), rad_beam);
341 int row = distance(m_stripStartRadius.begin(), endPtr) - 1;
342 // Following should never happen, check is done on r above
344 return {}; // return an invalid id
345 }
346
347 // Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame)
348 SiLocalPosition pos_strip = beamToStrip(pos);
349 double phi_strip = (m_usePC) ? pos_strip.xPhi() : std::atan2(pos_strip.xPhi(), pos_strip.xEta());
350 int strip = std::floor(phi_strip / m_pitch[row]) + m_nStrips[row] *0.5;
351 if (strip < 0) { // Outside
352 return {}; // return an invalid id
353 }
354 if (strip >= m_nStrips[row]) { // Outside
355 return {}; // return an invalid id
356 }
357
358 int strip1D = strip1Dim(strip, row);
359 return {strip1D, 0};
360}
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
SiLocalPosition beamToStrip(const SiLocalPosition &pos) const
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space

◆ cells()

int InDetDD::SCT_ModuleSideDesign::cells ( ) const
inlineinherited

number of readout stips within module side:

Definition at line 228 of file SCT_ModuleSideDesign.h.

228 {
229 return m_scheme.cells();
230}

◆ centreR()

double InDetDD::StripStereoAnnulusDesign::centreR ( ) const
inline

Definition at line 366 of file StripStereoAnnulusDesign.h.

366 {
367 return m_R;
368}

◆ connectedCell()

SiCellId InDetDD::SCT_ModuleSideDesign::connectedCell ( const SiReadoutCellId & readoutId,
int number ) const
inlineoverridevirtualinherited

readout id -> id of connected diodes.

parameter number = 0 will refer to the primary diode and in general the cell number will be the same. NB. SiCellId cellId = connectedCell(readoutId, 0) will in general be equivalent to SiCellId cellId = readoutId

Implements InDetDD::DetectorDesign.

Definition at line 241 of file SCT_ModuleSideDesign.h.

242 {
243 return m_scheme.connectedCell(readoutId, number);
244}
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186

◆ crystals()

int InDetDD::SCT_ModuleSideDesign::crystals ( ) const
inlineinherited

number of crystals within module side:

Definition at line 216 of file SCT_ModuleSideDesign.h.

216 {
217 return m_scheme.crystals();
218}

◆ deadAreaLength()

double InDetDD::StripStereoAnnulusDesign::deadAreaLength ( ) const
inlineoverridevirtual

give length of dead area

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 383 of file StripStereoAnnulusDesign.h.

383 {
384 return 0.;
385}

◆ deadAreaLowerBoundary()

double InDetDD::StripStereoAnnulusDesign::deadAreaLowerBoundary ( ) const
inlineoverridevirtual

give lower boundary of dead area

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 379 of file StripStereoAnnulusDesign.h.

379 {
380 return 0.;
381}

◆ deadAreaUpperBoundary()

double InDetDD::StripStereoAnnulusDesign::deadAreaUpperBoundary ( ) const
inlineoverridevirtual

DEPRECATED for StripStereoAnnulusDesign; no dead area.

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 375 of file StripStereoAnnulusDesign.h.

375 {
376 return 0.;
377}

◆ depthAxis()

DetectorDesign::Axis InDetDD::DetectorDesign::depthAxis ( ) const
inlineinherited

local axis corresponding to depth direction:

Definition at line 267 of file DetectorDesign.h.

267 {
268 return m_depthAxis;
269}

◆ depthSymmetric()

bool InDetDD::DetectorDesign::depthSymmetric ( ) const
inlineinherited

Definition at line 287 of file DetectorDesign.h.

287 {
288 return m_depthSymmetric;
289}

◆ diodes()

int InDetDD::SCT_ModuleSideDesign::diodes ( ) const
inlineinherited

number of strips within crystal:

Definition at line 220 of file SCT_ModuleSideDesign.h.

220 {
221 return m_scheme.diodes();
222}

◆ diodesInRow()

int InDetDD::StripStereoAnnulusDesign::diodesInRow ( const int row) const
inlineoverridevirtual

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 251 of file StripStereoAnnulusDesign.h.

251 {
252 return m_nStrips[row];
253}

◆ distanceToDetectorEdge()

void InDetDD::StripStereoAnnulusDesign::distanceToDetectorEdge ( const SiLocalPosition & localPosition,
double & etaDist,
double & phiDist ) const
overridevirtual

Returns distance to nearest detector active edge +ve = inside -ve = outside.

Implements InDetDD::DetectorDesign.

Definition at line 579 of file StripStereoAnnulusDesign.cxx.

579 {
580 // For eta, we use the Strip frame. This is centred at the beamline, x along eta, y along phi, z along depth
581 // Happens to coincide with SiLocalPosition; no transform needed.
582 double rInner = m_stripStartRadius[0];
583 double rOuter = m_stripEndRadius[m_nRows - 1];
584
585 double rad_beam = (m_usePC) ? pos.xEta() : std::hypot(pos.xEta(), pos.xPhi());
586
587 if (rad_beam < rInner)
588 etaDist = rad_beam - rInner;
589 else if (rad_beam > rOuter)
590 etaDist = rOuter - rad_beam;
591 else
592 etaDist = std::min(rOuter - rad_beam, rad_beam - rInner);
593
594 // For phi, we use the Strip frame. Transform to Strip-frame:
595 SiLocalPosition pos_strip = beamToStrip(pos);
596
597 // Put these into polar coordinates
598 double rad_strip = (m_usePC) ? pos_strip.xEta() : std::hypot(pos_strip.xEta(), pos_strip.xPhi());
599 double phi_strip = (m_usePC) ? pos_strip.xPhi() : std::atan2(pos_strip.xPhi(), pos_strip.xEta());
600
601 double phiAngleMax = m_pitch[0] * m_nStrips[0]*0.5;
602 double phiAngleMin = -phiAngleMax;
603
604 if (phi_strip < phiAngleMin)
605 phiDist = rad_strip * (phi_strip - phiAngleMin);
606 else if (phi_strip > phiAngleMax)
607 phiDist = rad_strip * (phiAngleMax - phi_strip);
608 else
609 phiDist = rad_strip * std::min(phiAngleMax - phi_strip, phi_strip - phiAngleMin);
610}

◆ endsOfStrip()

std::pair< SiLocalPosition, SiLocalPosition > InDetDD::StripStereoAnnulusDesign::endsOfStrip ( const SiLocalPosition & position) const
overridevirtual

Give end points of the strip that covers the given position.

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 474 of file StripStereoAnnulusDesign.cxx.

474 {
475
476 SiCellId cellId = cellIdOfPosition(pos);
477
478 auto [strip, row] = getStripRow(cellId);
479
480 SiLocalPosition innerEnd = stripPosAtR(strip, row, m_stripStartRadius[row]);
481
482 SiLocalPosition outerEnd = stripPosAtR(strip, row, m_stripEndRadius[row]);
483
484 return std::pair<SiLocalPosition, SiLocalPosition>(innerEnd, outerEnd);
485}
SiLocalPosition stripPosAtR(int strip, int row, double r) const
std::pair< int, int > getStripRow(SiCellId cellId) const final
Get the strip and row number of the cell.
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const override
position -> id

◆ etaAxis()

DetectorDesign::Axis InDetDD::DetectorDesign::etaAxis ( ) const
inlineinherited

local axis corresponding to eta direction:

Definition at line 259 of file DetectorDesign.h.

259 {
260 return m_etaAxis;
261}

◆ etaPitch()

double InDetDD::StripStereoAnnulusDesign::etaPitch ( ) const
overridevirtual

Implements InDetDD::DetectorDesign.

Definition at line 569 of file StripStereoAnnulusDesign.cxx.

569 {
570// Return average strip length
571 return length() / m_stripStartRadius.size();
572}
virtual double length() const override
Method to calculate length of a module.

◆ etaSymmetric()

bool InDetDD::DetectorDesign::etaSymmetric ( ) const
inlineinherited

Definition at line 283 of file DetectorDesign.h.

283 {
284 return m_etaSymmetric;
285}

◆ gangedCell()

SiCellId InDetDD::SCT_ModuleSideDesign::gangedCell ( const SiCellId & cellId) const
inlineoverridevirtualinherited

If cell is ganged return the other cell, otherwise return an invalid id.

Not particularly useful for the SCT but implemented to keep a uniform interface. For SCT always returns an invalid id.

Implements InDetDD::SiDetectorDesign.

Definition at line 246 of file SCT_ModuleSideDesign.h.

246 {
247 // No ganged cells in SCT so always return invalid id.
248 return SiCellId();
249}

◆ getChildren()

const std::map< int, const SCT_ModuleSideDesign * > & InDetDD::SCT_ModuleSideDesign::getChildren ( ) const
inlineinherited

Definition at line 287 of file SCT_ModuleSideDesign.h.

287 {
288 return m_childDesigns;
289 }

◆ getMother()

const SCT_ModuleSideDesign * InDetDD::SCT_ModuleSideDesign::getMother ( ) const
inlineinherited

Definition at line 283 of file SCT_ModuleSideDesign.h.

283 {
284 return m_motherDesign;
285 }
const SCT_ModuleSideDesign * m_motherDesign

◆ getStripRow()

std::pair< int, int > InDetDD::StripStereoAnnulusDesign::getStripRow ( SiCellId cellId) const
finalvirtual

Get the strip and row number of the cell.

Can be used as auto [strip, row] = getStripRow(cellId);

Parameters
cellIdThe SiCellId
Returns
std::pai<int,int> A pair of ints representing the strip ID and row ID

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 287 of file StripStereoAnnulusDesign.cxx.

287 {
288 int strip1D = cellId.phiIndex();
289 int rowNum = row(strip1D);
290 int strip2D = strip1D - m_firstStrip[rowNum];
291 return {strip2D,rowNum};
292}

◆ inActiveArea()

bool InDetDD::StripStereoAnnulusDesign::inActiveArea ( const SiLocalPosition & chargePos,
bool checkBondGap = true ) const
overridevirtual

check if the position is in active area

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 487 of file StripStereoAnnulusDesign.cxx.

487 {
488
489 SiCellId id = cellIdOfPosition(pos);
490 bool inside = id.isValid();
491
492 return inside;
493}

◆ inDetector()

SiIntersect InDetDD::SCT_ModuleSideDesign::inDetector ( const SiLocalPosition & localPosition,
double phiTol,
double etaTol ) const
overridevirtualinherited

Test if point is in the active part of the detector with specified tolerances.

Reimplemented from InDetDD::DetectorDesign.

Definition at line 131 of file SCT_ModuleSideDesign.cxx.

131 {
132
133 double etaDist = 0;
134 double phiDist = 0;
135
136 distanceToDetectorEdge(localPosition, etaDist, phiDist);
137
138 SiIntersect state;
139
140 if (phiDist < -phiTol || etaDist < -etaTol) {
141 state.setOut();
142 return state;
143 }
144
145 if (phiDist > phiTol && etaDist > etaTol) {
146 state.setIn();
147 return state;
148 }
149
150 // Near boundary.
151 state.setNearBoundary();
152 return state;
153}
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const =0
Returns distance to nearest detector active edge +ve = inside -ve = outside.

◆ length()

double InDetDD::StripStereoAnnulusDesign::length ( ) const
overridevirtual

Method to calculate length of a module.

Implements InDetDD::DetectorDesign.

Definition at line 545 of file StripStereoAnnulusDesign.cxx.

545 {
546// Return the total length of all strips, i.e. the active area length.
547 return m_stripEndRadius.back() - m_stripStartRadius[0];
548}

◆ localPositionOfCell()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::localPositionOfCell ( const SiCellId & cellId) const
overridevirtual

id -> position

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 362 of file StripStereoAnnulusDesign.cxx.

362 {
363 auto [strip, row] = getStripRow(cellId);
364 double r = (m_stripEndRadius[row] + m_stripStartRadius[row])*0.5;
365
366 // Modified StripPosAtR?
367 // get phi of strip in the strip system
368 double phi_strip = (strip - m_nStrips[row] / 2. + 0.5) * m_pitch[row];
369
370 double b = -2. * m_lengthBF * std::sin(m_stereo/2. + phi_strip);
371 double c = m_lengthBF * m_lengthBF - r * r;
372 // this is the radius in the strip system
373 double rad_strip = (-b + std::sqrt(b * b - 4. * c))/2.;
374
375 if (m_usePC) return stripToBeam({rad_strip,phi_strip});
376 else {
377 //else use cart
378 double x_strip = rad_strip * std::cos(phi_strip);
379 double y_strip = rad_strip * std::sin(phi_strip);
380 //Return strip pos not beam pos?
381 return stripToBeam({x_strip, y_strip});
382 }
383}
SiLocalPosition stripToBeam(const SiLocalPosition &pos) const

◆ localPositionOfCellPC()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::localPositionOfCellPC ( const SiCellId & cellId) const

This is for debugging only.

Call to explicitly use PC cells.

Deprecated
No longer required as localPositionOfCell() will automatically use the appropriate transform.
Parameters
cellId
Returns
SiLocalPosition

Definition at line 428 of file StripStereoAnnulusDesign.cxx.

428 {
429
430 auto [strip, row] = getStripRow(cellId);
431 // this is the radius in the module / radial system
432 double r = (m_stripEndRadius[row] + m_stripStartRadius[row])*0.5;
433
434 // get phi of strip in the strip system
435 double phiPrime = (strip - m_nStrips[row]*0.5 + 0.5) * m_pitch[row];
436
437 double b = -2. * m_lengthBF * std::sin(m_stereo*0.5 + phiPrime);
438 double c = m_lengthBF * m_lengthBF - r * r;
439 // this is the radius in the strip systems
440 double rPrime = (-b + std::sqrt(b * b - 4. * c))*0.5;
441
442 // flip this, since coordinate system is defined the other way round
443 double phi = -1*phiPrime;
444
445 // xEta => r, xPhi = phi
446 return SiLocalPosition(rPrime, phi);
447}

◆ localPositionOfCluster()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::localPositionOfCluster ( const SiCellId & cellId,
int clusterSize ) const
overridevirtual

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 401 of file StripStereoAnnulusDesign.cxx.

401 {
402//
403// Return the average centre-position of the first and last strips.
404//
405
406 SiLocalPosition startPos = localPositionOfCell(cellId); // Should automatically detect PC Usage
407
408 if (clusterSize <= 1) {
409 return startPos;
410 }
411
412 auto [strip, row] = getStripRow(cellId);
413 int stripEnd = strip + clusterSize - 1;
414 SiCellId endId = strip1Dim(stripEnd, row);
415 SiLocalPosition endPos = localPositionOfCell(endId); // Should automatically detect PC Usage
416
417 return (startPos + endPos)*0.5;
418}
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override
id -> position

◆ localPositionOfClusterPC()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::localPositionOfClusterPC ( const SiCellId & cellId,
int clusterSize ) const

This is for debugging only.

Call to explicitly use PC clusters.

Deprecated
No longer required as localPositionOfCluster() will automatically use the appropriate transform.
Parameters
cellId
clusterSize
Returns
SiLocalPosition

Definition at line 458 of file StripStereoAnnulusDesign.cxx.

458 {
459 SiLocalPosition startPos = localPositionOfCellPC(cellId);
460
461 if (clusterSize <= 1) {
462 return startPos;
463 }
464
465 auto [strip, row] = getStripRow(cellId);
466 int stripEnd = strip + clusterSize - 1;
467 SiCellId endId = strip1Dim(stripEnd, row);
468 SiLocalPosition endPos = localPositionOfCellPC(endId);
469
470 return (startPos + endPos)*0.5;
471}
SiLocalPosition localPositionOfCellPC(const SiCellId &cellId) const
This is for debugging only.

◆ maxR()

double InDetDD::StripStereoAnnulusDesign::maxR ( ) const
inline

Definition at line 326 of file StripStereoAnnulusDesign.h.

326 {
327 return m_stripEndRadius.back();
328}

◆ maxWidth()

double InDetDD::StripStereoAnnulusDesign::maxWidth ( ) const
overridevirtual

Method to calculate maximum width of a module.

Implements InDetDD::DetectorDesign.

Definition at line 565 of file StripStereoAnnulusDesign.cxx.

565 {
566 return 2. * tan((m_pitch.back() * m_nStrips.back()) * 0.5) * m_stripEndRadius.back();
567}

◆ minR()

double InDetDD::StripStereoAnnulusDesign::minR ( ) const
inline

Definition at line 322 of file StripStereoAnnulusDesign.h.

322 {
323 return m_stripStartRadius[0];
324}

◆ minWidth()

double InDetDD::StripStereoAnnulusDesign::minWidth ( ) const
overridevirtual

Method to calculate minimum width of a module.

Implements InDetDD::DetectorDesign.

Definition at line 561 of file StripStereoAnnulusDesign.cxx.

561 {
562 return 2. * tan((m_pitch[0] * m_nStrips[0]) * 0.5 ) * m_stripStartRadius[0];
563}

◆ moduleShift()

const Amg::Transform3D InDetDD::DetectorDesign::moduleShift ( ) const
virtualinherited

Reimplemented in InDetDD::StripBoxDesign.

Definition at line 130 of file DetectorDesign.cxx.

130 {
131 return Amg::Transform3D::Identity();
132 }

◆ nearBondGap()

bool InDetDD::StripStereoAnnulusDesign::nearBondGap ( const SiLocalPosition & localPosition,
double etaTol ) const
inlineoverridevirtual

Test if near bond gap within tolerances, only relevant for SCT.

Implements InDetDD::SiDetectorDesign.

Definition at line 309 of file StripStereoAnnulusDesign.h.

309 {
310// No bond gap in strip modules
311 return false;
312}

◆ neighboursOfCell()

void InDetDD::StripStereoAnnulusDesign::neighboursOfCell ( const SiCellId & cellId,
std::vector< SiCellId > & neighbours ) const
overridevirtual

Get the neighbouring diodes of a given diode: Cell for which the neighbours must be found List of cells which are neighbours of the given one.

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 299 of file StripStereoAnnulusDesign.cxx.

299 {
300
301
302 neighbours.clear();
303
304 if (!cellId.isValid()) {
305 return;
306 }
307
308 auto [strip, row] = getStripRow(cellId);
309 int stripM = strip - 1;
310 int stripP = strip + 1;
311
312 if (stripM >= m_firstStrip[row]) {
313 neighbours.emplace_back(stripM);
314 }
315 if (stripP < m_firstStrip[row] + m_nStrips[row]) {
316 neighbours.emplace_back(stripP);
317 }
318
319}

◆ numberOfConnectedCells()

int InDetDD::SCT_ModuleSideDesign::numberOfConnectedCells ( const SiReadoutCellId & readoutId) const
inlineoverridevirtualinherited

readout id -> id of connected diodes Not particularly useful for the SCT but implemented to keep a uniform interface.

Implements InDetDD::DetectorDesign.

Definition at line 236 of file SCT_ModuleSideDesign.h.

237 {
238 return m_scheme.numberOfConnectedCells(readoutId);
239}

◆ operator=()

StripStereoAnnulusDesign & InDetDD::StripStereoAnnulusDesign::operator= ( const StripStereoAnnulusDesign & design)

◆ parameters()

SiDiodesParameters InDetDD::StripStereoAnnulusDesign::parameters ( const SiCellId & cellId) const
overridevirtual

Return strip width, centre, length etc. Hard to find if this is used or not.

Implements InDetDD::DetectorDesign.

Definition at line 514 of file StripStereoAnnulusDesign.cxx.

514 {
515 throw std::runtime_error("Call to StripStereoAnnulusDesign::parameters; not yet implemented");
516}

◆ phiAxis()

DetectorDesign::Axis InDetDD::DetectorDesign::phiAxis ( ) const
inlineinherited

local axis corresponding to phi direction:

Definition at line 263 of file DetectorDesign.h.

263 {
264 return m_phiAxis;
265}

◆ phiMeasureSegment()

HepGeom::Vector3D< double > InDetDD::StripStereoAnnulusDesign::phiMeasureSegment ( const SiLocalPosition & position) const
overridevirtual

Helper method for stereo angle computation, DEPRECATED.

Implements InDetDD::SiDetectorDesign.

Definition at line 574 of file StripStereoAnnulusDesign.cxx.

575 {
576 throw std::runtime_error("Call to phiMeasureSegment, DEPRECATED, not implemented.");
577}

◆ phiPitch() [1/3]

double InDetDD::StripStereoAnnulusDesign::phiPitch ( ) const
inlineoverridevirtual

Pitch in phi direction.

Implements InDetDD::DetectorDesign.

Definition at line 284 of file StripStereoAnnulusDesign.h.

284 {
285// Return pitch in mm for the row just below or including the centre
286 const int middleRow = m_nRows*0.5;
287 const int middleStrip = m_nStrips[middleRow]*0.5;
288 return phiPitch(SiCellId(middleStrip, middleRow));
289}
virtual double phiPitch() const override
Pitch in phi direction.

◆ phiPitch() [2/3]

double InDetDD::StripStereoAnnulusDesign::phiPitch ( const SiCellId & cellId) const
inline

Definition at line 278 of file StripStereoAnnulusDesign.h.

278 {
279// Return pitch in mm for centre of this strip.
280 const int row = cellId.etaIndex();
282}

◆ phiPitch() [3/3]

double InDetDD::StripStereoAnnulusDesign::phiPitch ( const SiLocalPosition & localPosition) const
inlineoverridevirtual

Pitch in phi direction.

Implements InDetDD::DetectorDesign.

Definition at line 270 of file StripStereoAnnulusDesign.h.

270 {
271// Return pitch in mm for the strip at this position, at this point's distance along the strip.
272 const SiCellId cellId = cellIdOfPosition(pos);
273 const int row = cellId.etaIndex();
274 const double radius = (m_usePC) ? pos.xEta() : std::hypot(pos.xEta(), pos.xPhi());
275 return m_pitch[row] * radius;
276}

◆ phiPitchPhi() [1/3]

double InDetDD::StripStereoAnnulusDesign::phiPitchPhi ( ) const
inline

Definition at line 303 of file StripStereoAnnulusDesign.h.

303 {
304 const int middleRow = m_nRows *0.5;
305 const int middleStrip = m_nStrips[middleRow] *0.5;
306 return phiPitchPhi(SiCellId(middleStrip, middleRow));
307}

◆ phiPitchPhi() [2/3]

double InDetDD::StripStereoAnnulusDesign::phiPitchPhi ( const SiCellId & cellId) const
inline

Definition at line 298 of file StripStereoAnnulusDesign.h.

298 {
299 const int row = cellId.etaIndex();
300 return m_pitch[row];
301}

◆ phiPitchPhi() [3/3]

double InDetDD::StripStereoAnnulusDesign::phiPitchPhi ( const SiLocalPosition & localPosition) const
inline

Definition at line 291 of file StripStereoAnnulusDesign.h.

291 {
292 // even though SiLocalPosition might not be in PC, the etaIndex should be correct
293 const SiCellId cellId = cellIdOfPosition(pos);
294 const int row = cellId.etaIndex();
295 return m_pitch[row];
296}

◆ phiSymmetric()

bool InDetDD::DetectorDesign::phiSymmetric ( ) const
inlineinherited

Definition at line 279 of file DetectorDesign.h.

279 {
280 return m_phiSymmetric;
281}

◆ phiWidth()

double InDetDD::StripStereoAnnulusDesign::phiWidth ( ) const
inline

Definition at line 331 of file StripStereoAnnulusDesign.h.

331 {
332 return m_nStrips[0] * m_pitch[0];
333}

◆ pitch()

double InDetDD::StripStereoAnnulusDesign::pitch ( const SiCellId & cellId) const

◆ positionFromStrip() [1/2]

SiLocalPosition InDetDD::StripStereoAnnulusDesign::positionFromStrip ( const int stripNumber) const
overridevirtual

gives position of strip center ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId & cellId) or rawLocalPositionOfCell method in SiDetectorElement.

DEPRECATED

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 525 of file StripStereoAnnulusDesign.cxx.

525 {
526 return localPositionOfCell(SiCellId(stripNumber, 0));
527}

◆ positionFromStrip() [2/2]

SiLocalPosition InDetDD::StripStereoAnnulusDesign::positionFromStrip ( const SiCellId & cellId) const

Definition at line 519 of file StripStereoAnnulusDesign.cxx.

519 {
520// throw std::runtime_error("Deprecated positionFromStrip called.");
521 return localPositionOfCell(cellId);
522}

◆ readoutIdOfCell()

SiReadoutCellId InDetDD::StripStereoAnnulusDesign::readoutIdOfCell ( const SiCellId & cellId) const
inlineoverridevirtual

diode id -> readout id

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 314 of file StripStereoAnnulusDesign.h.

314 {
315 int strip = cellId.phiIndex();
316 int row = cellId.etaIndex();
317
318 return SiReadoutCellId(strip, row);
319}

◆ readoutIdOfPosition()

SiReadoutCellId InDetDD::SCT_ModuleSideDesign::readoutIdOfPosition ( const SiLocalPosition & localPos) const
inlineoverridevirtualinherited

position -> id

Implements InDetDD::DetectorDesign.

Definition at line 256 of file SCT_ModuleSideDesign.h.

257 {
258 // Get the cellId then convert it to a readoutId.
259 // NEED to think about active area and bond gap check
260 return readoutIdOfCell(cellIdOfPosition(localPos));
261}
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const =0
position -> id
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const override
diode id -> readout id

◆ readoutSide()

int InDetDD::DetectorDesign::readoutSide ( ) const
inlineinherited

ReadoutSide.

+1 = postive depth side, -1 = negative depth side.

Definition at line 291 of file DetectorDesign.h.

291 {
292 return (m_readoutSidePosDepth) ? +1 : -1;
293}

◆ row()

int InDetDD::StripStereoAnnulusDesign::row ( int stripId1Dim) const
inlineoverridevirtual

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 339 of file StripStereoAnnulusDesign.h.

339 {
340
341 //This method is scheduled for deletion
342 std::vector<int>::const_iterator endPtr = std::upper_bound(m_firstStrip.begin(), m_firstStrip.end(), stripId1Dim);
343 int rowNum = std::distance(m_firstStrip.begin(), endPtr) - 1;
344 if (rowNum < 0 || rowNum >= m_nRows) {
345 const std::string errMsg=std::string("StripId1Dim index out of acceptable range ") + __FILE__+std::string(": ")+std::to_string(__LINE__);
346 throw std::runtime_error(errMsg);
347 }
348 return rowNum;
349}

◆ scaledDistanceToNearestDiode()

double InDetDD::StripStereoAnnulusDesign::scaledDistanceToNearestDiode ( const SiLocalPosition & chargePos) const
overridevirtual

give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as it is called for every surface charge in the SCT_SurfaceChargesGenerator

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 496 of file StripStereoAnnulusDesign.cxx.

496 {
497
498
499 // Get stripframe phi of pos
500 SiLocalPosition pos_stripframe = beamToStrip(pos);
501 double pos_phi_stripframe = (m_usePC) ? pos_stripframe.xPhi() : std::atan2(pos_stripframe.xPhi(),pos_stripframe.xEta());
502
503 // Get stripframe phi of strip
504 SiCellId cellId = cellIdOfPosition(pos);
505 SiLocalPosition stripPos_beamframe = localPositionOfCell(cellId);
506 SiLocalPosition stripPos_stripframe = beamToStrip(stripPos_beamframe);
507 double strip_phi_stripframe = (m_usePC) ? stripPos_stripframe.xPhi() : std::atan2(stripPos_stripframe.xPhi(),stripPos_stripframe.xEta());
508
509 auto [strip, row] = getStripRow(cellId);
510 return std::abs(pos_phi_stripframe - strip_phi_stripframe) / m_pitch[row];
511}

◆ sensorCenter()

Amg::Vector3D InDetDD::StripStereoAnnulusDesign::sensorCenter ( ) const
overridevirtual

Return the centre of a sensor in the local reference frame.

For most designs, this is the origin of the local reference frame. For StripStereoAnnulusDesign, this is not the case (coordinate origin is "on the beamline")

Reimplemented from InDetDD::DetectorDesign.

Definition at line 262 of file StripStereoAnnulusDesign.cxx.

262 {
263 return Amg::Vector3D(m_R, 0., 0.);
264}
Eigen::Matrix< double, 3, 1 > Vector3D

◆ setMother()

void InDetDD::SCT_ModuleSideDesign::setMother ( SCT_ModuleSideDesign * mother)
inherited

Definition at line 109 of file SCT_ModuleSideDesign.cxx.

109 {
110 if(m_motherDesign){
111 const std::string errMsg=std::string("SCT_ModuleSideDesign already has a mother set!");
112 throw std::runtime_error(errMsg);
113 }
114 m_motherDesign = mother;
115
116 }

◆ setSymmetry()

void InDetDD::DetectorDesign::setSymmetry ( bool phiSymmetric,
bool etaSymmetric,
bool depthSymmetric )
inherited

Override default symmetries to prevent swapping of axes.

NB. Flags can be changed from true to false but not false to true.

Definition at line 65 of file DetectorDesign.cxx.

66 {
67 // Flags can be changed from true to false but not false to true.
68 if (m_phiSymmetric) {
70 }
71 else if (phiSymmetric) {
72 std::cout <<
73 "SiDetectorDesign: WARNING! Attempt to allow swapping of xPhi axis direction ignored."
74 << std::endl;
75 }
76
77 if (m_etaSymmetric) {
79 }
80 else if (etaSymmetric) {
81 std::cout <<
82 "SiDetectorDesign: WARNING! Attempt to allow swapping of xEta axis direction ignored."
83 << std::endl;
84 }
85
86 if (m_depthSymmetric) {
88 }
89 else if (depthSymmetric) {
90 std::cout <<
91 "SiDetectorDesign: WARNING! Attempt to allow swapping of xDepth axis direction ignored."
92 << std::endl;
93 }
94}

◆ shape()

DetectorShape InDetDD::StripStereoAnnulusDesign::shape ( ) const
overridevirtual

Shape of element.

Reimplemented from InDetDD::DetectorDesign.

Definition at line 612 of file StripStereoAnnulusDesign.cxx.

613 {
614 if (m_usePC) return InDetDD::PolarAnnulus;
615 else return InDetDD::Annulus;
616 }

◆ shift()

int InDetDD::SCT_ModuleSideDesign::shift ( ) const
inlineinherited

number of edge strips before first readout strip.

Definition at line 232 of file SCT_ModuleSideDesign.h.

232 {
233 return m_scheme.shift();
234}

◆ sinStripAngleReco()

double InDetDD::StripStereoAnnulusDesign::sinStripAngleReco ( double phiCoord,
double etaCoord ) const
overridevirtual

Give strip angle in the reco frame.

Reimplemented from InDetDD::SiDetectorDesign.

Definition at line 266 of file StripStereoAnnulusDesign.cxx.

266 {
267//
268// Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame)
269//
270 SiLocalPosition pos_strip = beamToStrip({etaCoord, phiCoord});
271
272 double phi_strip = (m_usePC) ? pos_strip.xPhi() : std::atan2(pos_strip.xPhi(), pos_strip.xEta());
273
274 // The minus sign below is because this routine is called by tracking software, which swaps x and y, then measures angles from y
275 // to x
276 return -std::sin(phi_strip + m_stereo);
277}

◆ stereo()

double InDetDD::StripStereoAnnulusDesign::stereo ( ) const
inline

Definition at line 335 of file StripStereoAnnulusDesign.h.

335 {
336 return m_stereo;
337}

◆ strip()

int InDetDD::StripStereoAnnulusDesign::strip ( int stripId1Dim) const
inlineoverridevirtual

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 351 of file StripStereoAnnulusDesign.h.

351 {
352 int rowNum = row(stripId1Dim);
353
354 int strip2D = stripId1Dim - m_firstStrip[rowNum];
355 if (strip2D < 0 || strip2D >= m_firstStrip[rowNum + 1]) {
356 std::cout << "str1D " << stripId1Dim << " gives strip " << strip2D << " which is outside range 0 - " <<
357 m_firstStrip[rowNum + 1] << "\n";
358 }
359 return strip2D;
360}

◆ strip1Dim()

int InDetDD::StripStereoAnnulusDesign::strip1Dim ( int strip,
int row ) const
overridevirtual

only relevant for SCT.

Return strip1Dim(int strip, int row) if SCT; otherwise -1

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 294 of file StripStereoAnnulusDesign.cxx.

294 {
295
296 return m_firstStrip[row] + strip;
297}

◆ stripLength()

double InDetDD::StripStereoAnnulusDesign::stripLength ( const SiCellId & cellId) const

Definition at line 618 of file StripStereoAnnulusDesign.cxx.

619{
620 SiLocalPosition lpoc = localPositionOfCell(cellId);
621 std::pair<SiLocalPosition, SiLocalPosition> end = endsOfStrip(lpoc);
622 double dx = end.second.xEta() - end.first.xEta();
623 double dy = end.second.xPhi() - end.first.xPhi();
624 return std::sqrt(dx * dx + dy * dy);
625}
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override
Give end points of the strip that covers the given position.

◆ stripPitch() [1/3]

double InDetDD::StripStereoAnnulusDesign::stripPitch ( ) const
inlineoverridevirtual

give the strip pitch (For Forward returns pitch at center)

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 266 of file StripStereoAnnulusDesign.h.

266 { // Don't use; which strip?
267 return phiPitch();
268}

◆ stripPitch() [2/3]

double InDetDD::StripStereoAnnulusDesign::stripPitch ( const SiCellId & cellId) const
inline

Definition at line 262 of file StripStereoAnnulusDesign.h.

262 {
263 return phiPitch(cellId);
264}

◆ stripPitch() [3/3]

double InDetDD::StripStereoAnnulusDesign::stripPitch ( const SiLocalPosition & chargePos) const
inlineoverridevirtual

give the strip pitch (dependence on position needed for forward)

Implements InDetDD::SCT_ModuleSideDesign.

Definition at line 258 of file StripStereoAnnulusDesign.h.

258 {
259 return phiPitch(pos);
260}

◆ stripPosAtR()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::stripPosAtR ( int strip,
int row,
double r ) const

Definition at line 385 of file StripStereoAnnulusDesign.cxx.

385 {
386
387 double phi_strip = (strip - m_nStrips[row]*0.5 + 0.5) * m_pitch[row];
388
389 double b = -2. * m_lengthBF * std::sin(m_stereo*0.5 + phi_strip);
390 double c = m_lengthBF * m_lengthBF - r * r;
391 double rad_strip = (-b + std::sqrt(b * b - 4. * c))*0.5;
392
393 if (m_usePC) return stripToBeam({rad_strip,phi_strip});
394
395 double x_strip = rad_strip * std::cos(phi_strip);
396 double y_strip = rad_strip * std::sin(phi_strip);
397
398 return stripToBeam({x_strip, y_strip});
399}

◆ stripToBeam()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::stripToBeam ( const SiLocalPosition & pos) const

Definition at line 195 of file StripStereoAnnulusDesign.cxx.

195 {
196 if (m_usePC) return stripToBeamPC(pos);
197
198 const double x_strip = pos.xEta();
199 const double y_strip = pos.xPhi();
200
201 // Transform to beam frame (eq. 36 in ver G, combined with eq. 2 since we are in strip frame)
202 //
203 // x_beam cos(m_stereo) -sin(m_stereo) x-R R
204 // ( ) = [ ]( ) + ( )
205 // y_beam sin(m_stereo) cos(m_stereo) y 0
206 const double x_beam = m_cosStereo * (x_strip - m_waferCentreR) - m_sinStereo * y_strip + m_waferCentreR;
207 const double y_beam = m_sinStereo * (x_strip - m_waferCentreR) + m_cosStereo * y_strip;
208
209 return {x_beam, y_beam};
210}
SiLocalPosition stripToBeamPC(const SiLocalPosition &pos) const

◆ stripToBeamPC()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::stripToBeamPC ( const SiLocalPosition & pos) const

Definition at line 212 of file StripStereoAnnulusDesign.cxx.

212 {
213 const double phi_strip = pos.xPhi();
214 const double rad_strip = pos.xEta();
215
216 // Convert to cart and use previous transform
217 const double x_strip = rad_strip * std::cos(phi_strip);
218 const double y_strip = rad_strip * std::sin(phi_strip);
219
220 // Transform to beam frame (eq. 36 in ver G, combined with eq. 2 since we are in strip frame)
221 //
222 // x_beam cos(m_stereo) -sin(m_stereo) x-R R
223 // ( ) = [ ]( ) + ( )
224 // y_beam sin(m_stereo) cos(m_stereo) y 0
225 const double x_beam = m_cosStereo * (x_strip - m_waferCentreR) - m_sinStereo * y_strip + m_waferCentreR;
226 const double y_beam = m_sinStereo * (x_strip - m_waferCentreR) + m_cosStereo * y_strip;
227
228 const double phi_beam = std::atan2(y_beam, x_beam);
229 const double rad_beam = std::hypot(x_beam, y_beam);
230
231 return {rad_beam, phi_beam};
232}

◆ stripToBeamPCpolar()

SiLocalPosition InDetDD::StripStereoAnnulusDesign::stripToBeamPCpolar ( const SiLocalPosition & pos) const

Version of StripStereoAnnulusDesign::stripToBeamPC transform based exclusively in a polar system.

Not currently used. Requires debugging and profiling

Parameters
pos
Returns
SiLocalPosition

Definition at line 242 of file StripStereoAnnulusDesign.cxx.

242 {
243 const double phi_strip = pos.xPhi();
244 const double rad_strip = pos.xEta();
245
246 // Exclusively-polar transform:
247 // Trig which can be precalculated in the future
248 const double stereo_2 = m_stereo*0.5;
249 const double sin_plus_stereo_2 = std::sin(stereo_2);
250
251 // calculation for beam-frame radius uses cosine law - see ATL-COM-ITK-2021-048
252 const double rad_conv = 2.0*m_waferCentreR*std::abs(sin_plus_stereo_2);
253 const double rad_beam = std::sqrt( std::pow(rad_strip,2.0) + std::pow(rad_conv,2.0) + 2.0*rad_strip*rad_conv*std::cos(M_PI_2 - stereo_2 - phi_strip));
254
255 // calculation for beam-frame angle uses sine law - see ATL-COM-ITK-2021-048
256 const double phi_beam = stereo_2 - M_PI_2 + std::asin((rad_strip*std::sin(M_PI_2 - stereo_2 - phi_strip))/rad_beam);
257
258 return {rad_beam, phi_beam};
259}

◆ swapHitEtaReadoutDirection()

bool InDetDD::StripStereoAnnulusDesign::swapHitEtaReadoutDirection ( ) const
inlineoverridevirtual

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 391 of file StripStereoAnnulusDesign.h.

391 {
392 return false;
393 }

◆ swapHitPhiReadoutDirection()

bool InDetDD::StripStereoAnnulusDesign::swapHitPhiReadoutDirection ( ) const
inlineoverridevirtual

Return true if hit local direction is the same as readout direction.

Reimplemented from InDetDD::SCT_ModuleSideDesign.

Definition at line 387 of file StripStereoAnnulusDesign.h.

387 {
388 return false;
389}

◆ thickness()

double InDetDD::DetectorDesign::thickness ( ) const
inlineinherited

Method which returns thickness of the silicon wafer.

Definition at line 271 of file DetectorDesign.h.

271 {
272 return m_thickness;
273}

◆ type()

InDetDD::DetectorType InDetDD::StripStereoAnnulusDesign::type ( ) const
inlinefinaloverridevirtual

Type of element.

Reimplemented from InDetDD::DetectorDesign.

Definition at line 370 of file StripStereoAnnulusDesign.h.

370 {
371 return m_detectorType;
372}

◆ waferCentreR()

double InDetDD::StripStereoAnnulusDesign::waferCentreR ( ) const
inline

Definition at line 362 of file StripStereoAnnulusDesign.h.

362 {
363 return m_waferCentreR;
364}

◆ width()

double InDetDD::StripStereoAnnulusDesign::width ( ) const
overridevirtual

Method to calculate average width of a module.

Implements InDetDD::DetectorDesign.

Definition at line 550 of file StripStereoAnnulusDesign.cxx.

550 {
551// Return approximate width between the two central rows
552float middleRow = m_stripStartRadius.size() * 0.5 - 1;
553if (middleRow < 0) {
554 //single-row version
555 return 2. * tan((m_pitch[0] * m_nStrips[0])*0.5) * ((m_stripStartRadius[0] + m_stripEndRadius[0])*0.5);
556 }
557else return 2. * tan((m_pitch[middleRow] * m_nStrips[middleRow]) * 0.5) * m_stripEndRadius[middleRow];
558
559}

Member Data Documentation

◆ m_bounds

std::unique_ptr<Trk::SurfaceBounds> InDetDD::StripStereoAnnulusDesign::m_bounds
private

Definition at line 239 of file StripStereoAnnulusDesign.h.

◆ m_carrierType

InDetDD::CarrierType InDetDD::DetectorDesign::m_carrierType
privateinherited

Definition at line 240 of file DetectorDesign.h.

◆ m_childDesigns

std::map<int, const SCT_ModuleSideDesign *> InDetDD::SCT_ModuleSideDesign::m_childDesigns
privateinherited

Definition at line 210 of file SCT_ModuleSideDesign.h.

◆ m_cosNegStereo

const double InDetDD::StripStereoAnnulusDesign::m_cosNegStereo
private

Definition at line 244 of file StripStereoAnnulusDesign.h.

◆ m_cosStereo

const double InDetDD::StripStereoAnnulusDesign::m_cosStereo
private

Definition at line 242 of file StripStereoAnnulusDesign.h.

◆ m_depthAxis

Axis InDetDD::DetectorDesign::m_depthAxis
privateinherited

Definition at line 238 of file DetectorDesign.h.

◆ m_depthSymmetric

bool InDetDD::DetectorDesign::m_depthSymmetric
privateinherited

Definition at line 244 of file DetectorDesign.h.

◆ m_detectorType

InDetDD::DetectorType InDetDD::SCT_ModuleSideDesign::m_detectorType {Undefined}
protectedinherited

Definition at line 197 of file SCT_ModuleSideDesign.h.

197{Undefined};

◆ m_etaAxis

Axis InDetDD::DetectorDesign::m_etaAxis
privateinherited

Definition at line 236 of file DetectorDesign.h.

◆ m_etaSymmetric

bool InDetDD::DetectorDesign::m_etaSymmetric
privateinherited

Definition at line 243 of file DetectorDesign.h.

◆ m_firstStrip

std::vector<int> InDetDD::StripStereoAnnulusDesign::m_firstStrip
private

Definition at line 231 of file StripStereoAnnulusDesign.h.

◆ m_lengthBF

const double InDetDD::StripStereoAnnulusDesign::m_lengthBF
private

Definition at line 238 of file StripStereoAnnulusDesign.h.

◆ m_motherDesign

const SCT_ModuleSideDesign* InDetDD::SCT_ModuleSideDesign::m_motherDesign {nullptr}
privateinherited

Definition at line 208 of file SCT_ModuleSideDesign.h.

208{nullptr};

◆ m_nRows

const int InDetDD::StripStereoAnnulusDesign::m_nRows
private

Definition at line 229 of file StripStereoAnnulusDesign.h.

◆ m_nStrips

const std::vector<int> InDetDD::StripStereoAnnulusDesign::m_nStrips
private

Definition at line 230 of file StripStereoAnnulusDesign.h.

◆ m_phiAxis

Axis InDetDD::DetectorDesign::m_phiAxis
privateinherited

Definition at line 237 of file DetectorDesign.h.

◆ m_phiSymmetric

bool InDetDD::DetectorDesign::m_phiSymmetric
privateinherited

Definition at line 242 of file DetectorDesign.h.

◆ m_pitch

const std::vector<double> InDetDD::StripStereoAnnulusDesign::m_pitch
private

Definition at line 232 of file StripStereoAnnulusDesign.h.

◆ m_R

const double InDetDD::StripStereoAnnulusDesign::m_R
private

Definition at line 236 of file StripStereoAnnulusDesign.h.

◆ m_readoutSidePosDepth

bool InDetDD::DetectorDesign::m_readoutSidePosDepth
privateinherited

Definition at line 246 of file DetectorDesign.h.

◆ m_scheme

SCT_ReadoutScheme InDetDD::SCT_ModuleSideDesign::m_scheme
protectedinherited

Definition at line 196 of file SCT_ModuleSideDesign.h.

◆ m_sinNegStereo

const double InDetDD::StripStereoAnnulusDesign::m_sinNegStereo
private

Definition at line 243 of file StripStereoAnnulusDesign.h.

◆ m_sinStereo

const double InDetDD::StripStereoAnnulusDesign::m_sinStereo
private

Definition at line 241 of file StripStereoAnnulusDesign.h.

◆ m_stereo

const double InDetDD::StripStereoAnnulusDesign::m_stereo
private

Definition at line 235 of file StripStereoAnnulusDesign.h.

◆ m_stripEndRadius

const std::vector<double> InDetDD::StripStereoAnnulusDesign::m_stripEndRadius
private

Definition at line 234 of file StripStereoAnnulusDesign.h.

◆ m_stripStartRadius

const std::vector<double> InDetDD::StripStereoAnnulusDesign::m_stripStartRadius
private

Definition at line 233 of file StripStereoAnnulusDesign.h.

◆ m_swapStripReadout

bool InDetDD::SCT_ModuleSideDesign::m_swapStripReadout
privateinherited

Definition at line 204 of file SCT_ModuleSideDesign.h.

◆ m_thickness

double InDetDD::DetectorDesign::m_thickness
privateinherited

Definition at line 239 of file DetectorDesign.h.

◆ m_usePC

const bool InDetDD::StripStereoAnnulusDesign::m_usePC
private

Definition at line 245 of file StripStereoAnnulusDesign.h.

◆ m_waferCentreR

const double InDetDD::StripStereoAnnulusDesign::m_waferCentreR
private

Definition at line 237 of file StripStereoAnnulusDesign.h.


The documentation for this class was generated from the following files: