ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_ModuleSideDesign.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// SCT_ModuleSideDesign.cxx
7// Implementation file for class SCT_ModuleSideDesign
9// (c) ATLAS Detector software
11// Version 1.2 03/7/2001 Alessandro Fornaini
12// Modified: Grant Gorfine
14
16#include "Identifier/Identifier.h"
18#include <string>
19#include <stdexcept>
20
21namespace InDetDD {
22// Constructor with parameters:
23// local axis corresponding to eta direction
24// local axis corresponding to phi direction
25// local axis corresponding to depth direction
26// thickness of silicon sensor
27// number of crystals within module side
28// number of diodes within crystal
29// number of cells within module side
30// index of diode connected to cell with index 0
31
32
34 const bool phiSymmetric,
35 const bool etaSymmetric,
36 const bool depthSymmetric,
37 const int crystals,
38 const int diodes,
39 const int cells,
40 const int shift,
41 const bool swapStripReadout,
43 int readoutSide):
46 m_swapStripReadout(swapStripReadout) {
47}
48
50 const bool phiSymmetric,
51 const bool etaSymmetric,
52 const bool depthSymmetric,
53 const int crystals,
54 const int diodes,
55 const int cells,
56 const int shift,
57 const bool swapStripReadout,
59 int readoutSide,
60 const InDetDD::SiDetectorDesign::Axis stripDirection,
61 const InDetDD::SiDetectorDesign::Axis thicknessDirection)
62 :
64 stripDirection, thicknessDirection),
66 m_swapStripReadout(swapStripReadout) {
67}
68
69
71 std::vector<SiCellId> &neighbours) const {
72 neighbours.clear();
73 neighbours.reserve(2);
74
75 if (!cellId.isValid()) {
76 return;
77 }
78
79 int strip = cellId.strip();
80 int stripM = strip - 1;
81 int stripP = strip + 1;
82
83 if (stripM >= m_scheme.shift()) {
84 neighbours.emplace_back(stripM);
85 }
86 if (stripP < m_scheme.diodes() + m_scheme.shift()) {
87 neighbours.emplace_back(stripP);
88 }
89}
90
91// This method returns the position of the centre of a strip
92// ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId & cellId) or
93// rawLocalPositionOfCell method in SiDetectorElement.
94// DEPRECATED (but used in numerous places)
96 return localPositionOfCell(SiCellId(stripNumber));
97}
98
100// returns an invalid id.
102 if (!cellId.isValid() ||
103 cellId.strip() < 0 || cellId.strip() >= cells()) {
104 return {}; // Invalid
105 }
106 return cellId;
107}
108
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 }
117
127std::pair<int,int> SCT_ModuleSideDesign::getStripRow(SiCellId /*id*/) const {
128 return {0,0};
129 }
130
131 SiIntersect SCT_ModuleSideDesign::inDetector(const SiLocalPosition &localPosition, double phiTol, double etaTol) const {
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}
154
155} // namespace InDetDD
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const =0
Returns distance to nearest detector active edge +ve = inside -ve = outside.
double thickness() const
Method which returns thickness of the silicon wafer.
InDetDD::CarrierType carrierType() const
Return carrier type (ie electrons or holes)
int readoutSide() const
ReadoutSide.
virtual std::pair< int, int > getStripRow(SiCellId id) const
Get the strip and row number of the cell.
virtual SiCellId cellIdInRange(const SiCellId &cellId) const override
Check if cell is in range.
int diodes() const
number of strips within crystal:
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override=0
id -> position
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
const SCT_ModuleSideDesign * m_motherDesign
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...
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.
virtual SiLocalPosition positionFromStrip(const int stripNumber) const
gives position of strip center ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId ...
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...
void setMother(SCT_ModuleSideDesign *mother)
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
SiDetectorDesign(double thickness, bool phiSymmetric, bool etaSymmetric, bool depthSymmetric, InDetDD::CarrierType carrierType, int readoutSide)
Constructor.
class to run intersection tests
Definition SiIntersect.h:23
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
Message Stream Member.