ATLAS Offline Software
SCT_ReadoutScheme.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SCT_ReadoutScheme.h
8 // (c) ATLAS Detector software
10 
11 #ifndef INDETREADOUTGEOMETRY_SCT_READOUTSCHEME_H
12 #define INDETREADOUTGEOMETRY_SCT_READOUTSCHEME_H
13 
16 
17 #include <list>
18 
19 namespace InDetDD {
20 
30 
32  // Public methods:
34  public:
35 
36  // Copy constructor:
38 
39  // Constructor with parameters:
40  // number of crystals within module side
41  // number of diodes within crystal
42  // number of cells within module side
43  // index of diode connected to cell with index 0
44  SCT_ReadoutScheme(const int crystals,const int diodes,
45  const int cells,const int shift);
46 
47  // Destructor:
48  virtual ~SCT_ReadoutScheme() = default;
49 
50  // Assignment operator:
52 
53  void setDiodes(int numDiodes);
54  void setCells(int numReadoutCells);
55 
57  // Const methods:
59 
60  // number of crystals within module side:
61  int crystals() const;
62 
63  // number of diodes within crystal:
64  int diodes() const;
65 
66  // number of cells within module side:
67  int cells() const;
68 
69  // index of diode connected to cell with index 0:
70  int shift() const;
71 
72  // readout id -> id of connected diodes
73  int numberOfConnectedCells(const SiReadoutCellId & readoutId) const;
74  SiCellId connectedCell(const SiReadoutCellId & readoutId, int number) const;
75 
76  // diode id -> readout id
77  SiReadoutCellId readoutIdOfCell(const SiCellId & cellId) const;
78 
79 
80 
82  // Non-const methods:
84 
86  // Private methods:
88  private:
89 
91 
93  // Private data:
95  private:
96  int m_crystals; // number of crystals within module side
97  int m_diodes; // number of diodes within crystal
98  int m_cells; // number of cells within module side
99  int m_shift; // index of diode connected to cell with index 0
100 };
101 
103 // Inline methods:
105 inline void SCT_ReadoutScheme::setDiodes(int numDiodes) {
106  m_diodes = numDiodes;
107 }
108 
109 inline void SCT_ReadoutScheme::setCells(int numReadoutCells) {
110  m_cells = numReadoutCells;
111 }
112 
113 inline int SCT_ReadoutScheme::crystals() const
114 {
115  return m_crystals;
116 }
117 
118 inline int SCT_ReadoutScheme::diodes() const
119 {
120  return m_diodes;
121 }
122 
123 inline int SCT_ReadoutScheme::cells() const
124 {
125  return m_cells;
126 }
127 
128 inline int SCT_ReadoutScheme::shift() const
129 {
130  return m_shift;
131 }
132 
134 {
135  // Assume an in range readout id is used. No checks are made.
136  // Always 1 to 1 correspondence in SCT
137  return (readoutId.isValid()) ? 1 : 0;
138 }
139 
140 
141 inline SiCellId SCT_ReadoutScheme::connectedCell(const SiReadoutCellId & readoutId, int) const
142 {
143  // Assume a valid readout id is used.
144  // Always 1 to 1 correspondence in SCT
145  return readoutId; // Allowed to convert a SiReadoutCellId to a SiCellId.
146 }
147 
148 } // namespace InDetDD
149 
150 #endif // INDETREADOUTGEOMETRY_SCT_READOUTSCHEME_H
InDetDD::SCT_ReadoutScheme::cells
int cells() const
Definition: SCT_ReadoutScheme.h:123
InDetDD::SCT_ReadoutScheme::diodes
int diodes() const
Definition: SCT_ReadoutScheme.h:118
InDetDD::SCT_ReadoutScheme::m_crystals
int m_crystals
Definition: SCT_ReadoutScheme.h:96
InDetDD::SCT_ReadoutScheme::SCT_ReadoutScheme
SCT_ReadoutScheme(const SCT_ReadoutScheme &scheme)
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition: SiCellId.h:136
InDetDD::SCT_ReadoutScheme
Definition: SCT_ReadoutScheme.h:29
InDetDD::SCT_ReadoutScheme::shift
int shift() const
Definition: SCT_ReadoutScheme.h:128
SiReadoutCellId.h
InDetDD::SCT_ReadoutScheme::connectedCell
SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const
Definition: SCT_ReadoutScheme.h:141
InDetDD::SCT_ReadoutScheme::numberOfConnectedCells
int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
Definition: SCT_ReadoutScheme.h:133
InDetDD::SCT_ReadoutScheme::m_cells
int m_cells
Definition: SCT_ReadoutScheme.h:98
JetTagCalibConfig.scheme
scheme
Definition: JetTagCalibConfig.py:10
InDetDD::SCT_ReadoutScheme::crystals
int crystals() const
Definition: SCT_ReadoutScheme.h:113
python.selection.number
number
Definition: selection.py:20
InDetDD::SCT_ReadoutScheme::setCells
void setCells(int numReadoutCells)
Definition: SCT_ReadoutScheme.h:109
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::SCT_ReadoutScheme::readoutIdOfCell
SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
Definition: SCT_ReadoutScheme.cxx:53
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::SCT_ReadoutScheme::~SCT_ReadoutScheme
virtual ~SCT_ReadoutScheme()=default
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
InDetDD::SCT_ReadoutScheme::m_diodes
int m_diodes
Definition: SCT_ReadoutScheme.h:97
SiCellId.h
InDetDD::SCT_ReadoutScheme::setDiodes
void setDiodes(int numDiodes)
Definition: SCT_ReadoutScheme.h:105
InDetDD::SCT_ReadoutScheme::operator=
SCT_ReadoutScheme & operator=(const SCT_ReadoutScheme &scheme)
Definition: SCT_ReadoutScheme.cxx:39
InDetDD::SCT_ReadoutScheme::SCT_ReadoutScheme
SCT_ReadoutScheme()
InDetDD::SCT_ReadoutScheme::m_shift
int m_shift
Definition: SCT_ReadoutScheme.h:99