ATLAS Offline Software
SCT_ReadoutScheme.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SCT_ReadoutScheme.cxx
7 // Implementation file for class SCT_ReadoutScheme
9 // (c) ATLAS Detector software
11 // Version 1.0 23/5/2001 Alessandro Fornaini
12 // Modified: Grant Gorfine
14 
16 
17 namespace InDetDD {
18 
19 // Copy constructor:
20 SCT_ReadoutScheme::SCT_ReadoutScheme(const SCT_ReadoutScheme &scheme)
21 
22 = default;
23 
24 // Constructor with parameters:
25 SCT_ReadoutScheme::SCT_ReadoutScheme(const int crystals,const int diodes,
26  const int cells,const int shift) :
27  m_crystals(crystals),
28  m_diodes(diodes),
29  m_cells(cells),
30  m_shift(shift)
31 {
32  //check if parameters are consistent
33  if (m_crystals<1) m_crystals=1;
34  if (m_diodes<0) m_diodes=0;
35  if (m_cells<0) m_cells=0;
36 }
37 
38 // Assignment operator:
40 {
41  if (this!=&scheme) {
42  m_crystals=scheme.m_crystals;
43  m_diodes=scheme.m_diodes;
44  m_cells=scheme.m_cells;
45  m_shift=scheme.m_shift;
46  } else {}
47  return *this;
48 }
49 
50 
51 // diode id -> readout id
54 {
55  // readout cell and diode numbering are the same.
56  // The range can be different due to the unconnected edge strips (if m_shift != 0).
57  if (!cellId.isValid()) return {}; // return an invalid id.
58  int strip = cellId.strip();
59  // I think this should be >= m_cells. But need to check if this has any implications.
60  if (strip < 0 || strip > m_cells) return {}; // return an invalid id.
61  return {strip};
62 }
63 
64 } // namespace InDetDD
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
InDetDD::SCT_ReadoutScheme::m_crystals
int m_crystals
Definition: SCT_ReadoutScheme.h:96
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
SCT_ReadoutScheme.h
InDetDD::SiCellId::strip
int strip() const
Get strip number. Equivalent to phiIndex().
Definition: SiCellId.h:131
InDetDD::SCT_ReadoutScheme::m_cells
int m_cells
Definition: SCT_ReadoutScheme.h:98
JetTagCalibConfig.scheme
scheme
Definition: JetTagCalibConfig.py:16
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::SiReadoutCellId
Definition: SiReadoutCellId.h:42
InDetDD::SCT_ReadoutScheme::m_diodes
int m_diodes
Definition: SCT_ReadoutScheme.h:97
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