ATLAS Offline Software
Loading...
Searching...
No Matches
StripBoxDesign.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INDETREADOUTGEOMETRY_STRIPBOXDESIGN_H
6#define INDETREADOUTGEOMETRY_STRIPBOXDESIGN_H
7
8//
9// Upgrade strip barrel sensor with several rows of strips
10//
11
12// Base class
14
15#include "GeoModelKernel/GeoDefinitions.h"
18
19#include "CLHEP/Geometry/Vector3D.h" // For unused phiMeasureSegment
20
21#include <stdexcept> // For throw stuff
22#include <vector>
23
24namespace Trk {
25 class SurfaceBounds;
26}
27
28namespace InDetDD {
30
32public:
33 StripBoxDesign(); // Just for access to Axis; or can it be private?
34
35 StripBoxDesign(const SiDetectorDesign::Axis stripDirection,
36 const SiDetectorDesign::Axis thicknessDirection,
37 const double thickness,
38 const int readoutSide,
39 const InDetDD::CarrierType carrier,
40 const int nRows,
41 const int nStrips,
42 const double pitch,
43 const double length,
45 const double zShift=0.0);
46
47 ~StripBoxDesign() = default;
48
49 // Copy constructor and assignment:
52//
53// I make a one-dimensional strip number to store in the SiCellId, so etaIndex is always 0,
54// even with multi-row detectors. This was an easier way to get digitization than doing
55// the more natural 2D (strip, row) identifier. The following methods convert 1D to 2D and v.v.
56//
57 std::pair<int,int> getStripRow(SiCellId id) const final;
58 virtual int strip1Dim(int strip, int row) const override;
59 int diodes() const;
60 virtual int diodesInRow(const int row) const override;
61//
62// Pure virtual methods in base class:
63//
64 // Distance to nearest detector active edge (+ve = inside, -ve = outside)
65 virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist,
66 double &phiDist) const override;
67
68 // check if the position is in active area
69 virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap = true) const override;
70
71 // Element boundary
72 virtual const Trk::SurfaceBounds &bounds() const override;
73
74 // Retrieve the two ends of a "strip"
75 virtual std::pair<SiLocalPosition, SiLocalPosition> endsOfStrip(
76 const SiLocalPosition &position) const override;
77
78 // Phi-pitch (strip-width). Two names for same thing
79 virtual double stripPitch(const SiLocalPosition &localPosition) const override;
80 double stripPitch(const SiCellId &cellId) const;
81 virtual double stripPitch() const override;
82 virtual double phiPitch(const SiLocalPosition &localPosition) const override;
83 double phiPitch(const SiCellId &cellId) const;
84 virtual double phiPitch() const override;
85
86 // distance to the nearest diode in units of pitch, from 0.0 to 0.5,
87 // this method should be fast as it is called for every surface charge
88 // in the SCT_SurfaceChargesGenerator
89 // an active area check, done in the Generator anyway, is removed here
90 virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const override;
91
92 // readout or diode id -> position, size
93 virtual SiDiodesParameters parameters(const SiCellId &cellId) const override;
94 virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override;
95 virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const override;
96
97 // position -> id
98 virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const override;
99 // id to position
100 SiLocalPosition positionFromStrip(const SiCellId &cellId) const;
101 virtual SiLocalPosition positionFromStrip(const int stripNumber) const override;
102
103 // row and strip from 1-dim strip number
104 virtual int row(int stripId1Dim) const override;
105 virtual int strip(int stripId1Dim) const override;
106
107 // Find and fill a vector with all neighbour strips of a given cell
108 virtual void neighboursOfCell(const SiCellId &cellId,
109 std::vector<SiCellId> &neighbours) const override;
110 virtual SiCellId cellIdInRange(const SiCellId &) const override;
111
112 // For Strip sensors, readout cell == diode cell. Overload the SCT_ModuleSideDesign
113 // member
114 virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const override;
115
116 virtual const Amg::Transform3D moduleShift() const override final;
117
118 virtual InDetDD::DetectorType type() const override final;
119
120 // ---------------------------------------------------------------------------------------
121 // DEPRECATED at least for Strips
122 virtual HepGeom::Vector3D<double> phiMeasureSegment(const SiLocalPosition &position) const override;
123
124 // Method to calculate length of a strip. Which strip??
125 virtual double length() const override;
126
127 // Method to calculate average width of a module. What is it used for??
128 virtual double width() const override;
129
130 // Method to calculate minimum width of a module
131 virtual double minWidth() const override;
132
133 // Method to calculate maximum width of a module
134 virtual double maxWidth() const override;
135
136 // Pitch in eta direction Deprecated for strips: it varies in endcap
137 virtual double etaPitch() const override;
138
139 // Return true if hit local direction is the same as readout direction.
140 virtual bool swapHitPhiReadoutDirection() const override;
141 virtual bool swapHitEtaReadoutDirection() const override;
142
143 virtual bool nearBondGap(const SiLocalPosition &, double) const override;
144
145 // ------------------------------------------------------------------------------------------
146
147//
148// Accessors
149//
150 double pitch(const SiCellId &cellId) const;
152
153 // Give upper and lower boundaries, and length, of dead area
154 virtual double deadAreaUpperBoundary() const override;
155 virtual double deadAreaLowerBoundary() const override;
156 virtual double deadAreaLength() const override;
157private:
160 double m_pitch;
161 double m_length;
162 double m_zShift;
163 Trk::RectangleBounds m_bounds;
164};
165
167// Inline methods:
169inline int StripBoxDesign::diodes() const { // Total diodes
170 return m_nRows * m_nStrips;
171}
172
173inline int StripBoxDesign::diodesInRow(const int /* row */) const {
174 return m_nStrips;
175}
176
177// Unfortunately SCT introduced the name stripPitch as an alternative to phiPitch so
178// everything gets doubled
179
180inline double StripBoxDesign::stripPitch(const SiLocalPosition & /*pos not used */) const {
181 return m_pitch;
182}
183
184inline double StripBoxDesign::stripPitch(const SiCellId & /*cellId not used */) const {
185 return m_pitch;
186}
187
188inline double StripBoxDesign::stripPitch() const {
189 return m_pitch;
190}
191
192inline double StripBoxDesign::phiPitch(const SiLocalPosition & /*pos not used */) const {
193 return m_pitch;
194}
195
196inline double StripBoxDesign::phiPitch(const SiCellId & /*cellId not used */) const {
197 return m_pitch;
198}
199
200inline double StripBoxDesign::phiPitch() const {
201 return m_pitch;
202}
203
204inline bool StripBoxDesign::nearBondGap(const SiLocalPosition &, double) const {
205// No bond gap in strip modules
206 return false;
207}
208
210 int strip = cellId.phiIndex(); /* Gets a 1D strip id */
211 int row = cellId.etaIndex(); /* is junk or 0 in 1D scheme */
212
213 return SiReadoutCellId(strip, row);
214}
215
216inline int StripBoxDesign::row(int stripId1Dim) const {
217 return stripId1Dim / m_nStrips;
218}
219
220inline int StripBoxDesign::strip(int stripId1Dim) const {
221 return stripId1Dim % m_nStrips;
222}
223
227
230 return 0.;
231}
232
234 return 0.;
235}
236
238 return 0.;
239}
240
242 return false;
243}
244
246 return false;
247}
248
249} // namespace InDetDD
250#endif // INDETREADOUTGEOMETRY_STRIPBOXDESIGN_H
Eigen::Matrix< double, 3, 1 > Vector3D
double thickness() const
Method which returns thickness of the silicon wafer.
int readoutSide() const
ReadoutSide.
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 phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
int etaIndex() const
Get eta index.
Definition SiCellId.h:114
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: ...
Identifier for the strip or pixel readout cell.
virtual bool swapHitEtaReadoutDirection() const override
Trk::RectangleBounds m_bounds
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 void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const override
DEPRECATED: Unused (2014)
double stripLength(const SiCellId &cellId) const
virtual const Amg::Transform3D moduleShift() const override final
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const override
position -> id
StripBoxDesign(const StripBoxDesign &design)
virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=true) const override
check if the position is in active area
std::pair< int, int > getStripRow(SiCellId id) const final
Get the strip and row number of the cell.
virtual int strip(int stripId1Dim) const override
virtual int row(int stripId1Dim) const override
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override
Give end points of the strip that covers the given position.
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 ...
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 cel...
virtual double deadAreaLowerBoundary() const override
give lower boundary of dead area
virtual SiCellId cellIdInRange(const SiCellId &) const override
DEPRECATED: only used in a stupid example (2014) Check if cell is in range.
StripBoxDesign & operator=(const StripBoxDesign &design)
virtual InDetDD::DetectorType type() const override final
Type of element.
SiLocalPosition positionFromStrip(const SiCellId &cellId) const
virtual bool nearBondGap(const SiLocalPosition &, double) const override
Test if near bond gap within tolerances, only relevant for SCT.
virtual double stripPitch() const override
give the strip pitch (For Forward returns pitch at center)
virtual double deadAreaLength() const override
give length of dead area
virtual double length() const override
Method to calculate length of a module.
virtual double etaPitch() const override
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const override
diode id -> readout id
virtual int diodesInRow(const int row) const override
double pitch(const SiCellId &cellId) const
virtual bool swapHitPhiReadoutDirection() const override
Return true if hit local direction is the same as readout direction.
virtual double phiPitch() const override
Pitch in phi direction.
virtual HepGeom::Vector3D< double > phiMeasureSegment(const SiLocalPosition &position) const override
Helper method for stereo angle computation, DEPRECATED.
virtual double deadAreaUpperBoundary() const override
DEPRECATED for StripBoxDesign; no dead area.
virtual const Trk::SurfaceBounds & bounds() const override
Element boundary.
virtual double width() const override
Method to calculate average width of a module.
virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const override
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override
id -> position
virtual SiDiodesParameters parameters(const SiCellId &cellId) const override
Return strip width, centre, length etc. Hard to find if this is used or not.
Abstract base class for surface bounds to be specified.
Eigen::Affine3d Transform3D
Message Stream Member.
Ensure that the ATLAS eigen extensions are properly loaded.
#define private