ATLAS Offline Software
Loading...
Searching...
No Matches
StripAnnulusDesign.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#include <stdexcept>
6#include <algorithm> // For upper_bound
7#include <iterator> // for std::distance()
8#include <cmath>
10#include "Identifier/Identifier.h"
13
14namespace InDetDD {
16 const SiDetectorDesign::Axis &thicknessDirection,
17 const double &thickness,
18 const int &readoutSide,
19 const InDetDD::CarrierType &carrier,
20 const int &nStrips,
21 const double &pitch,
22 const double &stripStartRadius,
23 const double &stripEndRadius) :
24 SCT_ModuleSideDesign(thickness, true, true, true, 1, 0, 0, 0, false, carrier, readoutSide, stripDirection, thicknessDirection) {
25
26 m_nStrips = nStrips;
27 m_pitch = pitch;
28 m_stripStartRadius = stripStartRadius;
29 m_stripEndRadius = stripEndRadius;
30
31 m_scheme.setCells(m_nStrips);
32 m_scheme.setDiodes(m_nStrips);
33
34 double width = m_nStrips * m_pitch;
36 m_bounds = std::make_unique<Trk::RectangleBounds>(width / 2.0, length / 2.0); // Awaiting new boundclass for Annulus shape
37}
38
40 double centerR = (m_stripStartRadius + m_stripEndRadius) * 0.5;
41 return Amg::Vector3D(centerR, 0., 0.);
42}
43
44void StripAnnulusDesign::neighboursOfCell(const SiCellId &cellId, std::vector<SiCellId> &neighbours) const {
45
46 neighbours.clear();
47
48 if (!cellId.isValid()) {
49 return;
50 }
51
52 int strip = cellId.strip();
53 int stripM = strip - 1;
54 int stripP = strip + 1;
55
56 if (stripM > 0) {
57 neighbours.emplace_back(stripM);
58 }
59 if (stripP < m_nStrips) {
60 neighbours.emplace_back(stripP);
61 }
62
63}
64
66
67 return *m_bounds;
68}
69
71 double phi = pos.phi();
72//
73// Find the strip
74//
75 int strip = std::floor(phi / m_pitch) + m_nStrips * 0.5;
76 return {strip};
77}
78
80
81 int strip = cellId.strip();
82 double r = (m_stripEndRadius - m_stripStartRadius) *0.5;
83 double phi = (strip - m_nStrips*0.5 + 0.5) * m_pitch;
84 double xEta = r * std::cos(phi);
85 double xPhi = r * std::sin(phi);
86 return SiLocalPosition(xEta, xPhi, 0.0);
87}
88
90
92
93 if (clusterSize <= 1) {
94 return pos;
95 }
96
97 double clusterWidth = clusterSize * m_pitch;
98 double phi = pos.phi() + clusterWidth *0.5;
99 double r = pos.r();
100
101 pos.xPhi(r * std::sin(phi));
102 pos.xEta(r * std::cos(phi));
103
104 return pos;
105}
106
108std::pair<SiLocalPosition, SiLocalPosition> StripAnnulusDesign::endsOfStrip(SiLocalPosition const &pos) const {
109
110 SiCellId cellId = cellIdOfPosition(pos);
111
112 int strip = cellId.strip();
113
114 double rStart = m_stripStartRadius;
115 double rEnd = m_stripEndRadius;
116 double phi = (strip - m_nStrips*0.5 + 0.5) * m_pitch;
117
118 SiLocalPosition end1(rStart * std::cos(phi), rStart * std::sin(phi), 0.0);
119 SiLocalPosition end2(rEnd * std::cos(phi), rEnd * std::sin(phi), 0.0);
120
121 return std::pair<SiLocalPosition, SiLocalPosition>(end1, end2);
122}
123
124bool StripAnnulusDesign::inActiveArea(SiLocalPosition const &pos, bool /*checkBondGap*/) const {
125
126
127 SiCellId id = cellIdOfPosition(pos);
128
129 return id.isValid();
130}
131
132// Used in surfaceChargesGenerator
134
135 SiCellId cellId = cellIdOfPosition(pos);
136 SiLocalPosition posStrip = localPositionOfCell(cellId);
137
138 return std::abs(pos.xPhi() - posStrip.xPhi()) / m_pitch;
139}
140
143 throw std::runtime_error("Call to StripAnnulusDesign::parameters; not yet implemented");
144}
145
146// Used in VP1 graphics. DEPRECATED.
148// throw std::runtime_error("Deprecated positionFromStrip called.");
149 return localPositionOfCell(cellId);
150}
151
155//
156// DEPRECATED: only used in a stupid example (2014). Make cellId's by correct methods and
157// they are either invalid or in range.
158// Check if cell is in range. Returns the original cellId if it is in range, otherwise it
159// returns an invalid id.
160//
162
163 if (!cellId.isValid()) {
164 return {}; // Invalid
165 }
166 int strip = cellId.strip();
168 return {}; // Invalid
169 }
170 return cellId;
171}
172
173double StripAnnulusDesign::length() const { // DEPRECATED:
175}
176
177double StripAnnulusDesign::width() const { // DEPRECATED
178 return m_pitch * m_nStrips;
179}
180
181double StripAnnulusDesign::minWidth() const { // DEPRECATED
182 return width();
183}
184
185double StripAnnulusDesign::maxWidth() const { // DEPRECATED
186 return width();
187}
188
189double StripAnnulusDesign::etaPitch() const { // DEPRECATED
190 return length();
191}
192
196
197} // namespace InDetDD
Scalar phi() const
phi method
double thickness() const
Method which returns thickness of the silicon wafer.
int readoutSide() const
ReadoutSide.
virtual int strip(int stripId1Dim) const
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
bool isValid() const
Test if its in a valid state.
Definition SiCellId.h:136
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:
SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const
std::unique_ptr< Trk::RectangleBounds > m_bounds
double minWidth() const
Method to calculate minimum width of a module.
double pitch(const SiCellId &cellId) const
SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
id -> position
bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=false) const
check if the position is in active area
double maxWidth() const
Method to calculate maximum width of a module.
const Trk::SurfaceBounds & bounds() const
Element boundary.
SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const
position -> id
SiCellId cellIdInRange(const SiCellId &) const
Check if cell is in range.
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 ...
double width() const
Method to calculate average width of a module.
Amg::Vector3D sensorCenter() const
Return the centre of a sensor in the local reference frame.
StripAnnulusDesign(const SiDetectorDesign::Axis &stripDirection, const SiDetectorDesign::Axis &thicknessDirection, const double &thickness, const int &readoutSide, const InDetDD::CarrierType &carrier, const int &nStrips, const double &pitch, const double &stripStart, const double &stripEnd)
SiLocalPosition positionFromStrip(const SiCellId &cellId) const
std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const
Give end points of the strip that covers the given position.
double length() const
Method to calculate length of a module.
SiDiodesParameters parameters(const SiCellId &cellId) const
Return strip width, centre, length etc. Hard to find if this is used or not.
static const Amg::Transform3D SiHitToGeoModel()
void neighboursOfCell(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const
Get the neighbouring diodes of a given diode: Cell for which the neighbours must be found List of cel...
Abstract base class for surface bounds to be specified.
int r
Definition globals.cxx:22
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Message Stream Member.