ATLAS Offline Software
Functions | Variables
SCT Namespace Reference

Functions

constexpr unsigned int getChip (unsigned int side, bool swap, unsigned int strip)
 Get the physical chip ID for the given strip. More...
 
unsigned int getChip (const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, const Identifier &stripId)
 Get the physical chip ID for the given strip. More...
 
constexpr unsigned int getGeometricalChipID (unsigned int strip)
 Get the geometrical chip ID for the given strip. More...
 
unsigned int getGeometricalChipID (const SCT_ID &sct_id, const Identifier &stripId)
 Get the physical chip ID for the given strip. More...
 
constexpr unsigned int getGeometricalFromPhysicalChipID (unsigned int side, bool swap, unsigned int physical_chip_id)
 Get the geometrical chip ID from a physica chip ID. More...
 
unsigned int getGeometricalFromPhysicalChipID (const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, unsigned int physical_chip_id)
 Get the geometrical chip ID from a physical chip ID. More...
 
constexpr unsigned int getPhysicalFromGeometricalChipID (unsigned int side, bool swap, unsigned int geometrical_chip_id)
 Get the physical chip ID from a geometrical chip ID. More...
 
unsigned int getPhysicalFromGeometricalChipID (const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, unsigned int geometrical_chip_id)
 Get the physical chip ID from a geometrical chip ID. More...
 
constexpr unsigned int getGeometricalFromPhysicalChipFlags (unsigned int side, bool swap, unsigned int physical_chip_flags)
 Convert a word in which each bit represents the status of a certain physical chip to a word in which each bit represents a geometrical chip. More...
 
unsigned int getGeometricalFromPhysicalChipFlags (const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, unsigned int physical_chip_flags)
 Convert a word in which each bit represents the status of a certain physical chip to a word in which each bit represents a geometrical chip. More...
 

Variables

constexpr unsigned int N_CHIPS_PER_SIDE = 6
 
constexpr unsigned int N_SIDES = 2
 
constexpr unsigned int N_STRIPS_PER_CHIP = 128
 
constexpr unsigned int N_STRIPS_PER_SIDE = N_STRIPS_PER_CHIP*N_CHIPS_PER_SIDE
 

Function Documentation

◆ getChip() [1/2]

unsigned int SCT::getChip ( const SCT_ID sct_id,
const InDetDD::SiDetectorElement siElement,
const Identifier stripId 
)
inline

Get the physical chip ID for the given strip.

Parameters
sct_idthe SCT ID helper
siElementthe SiDetectorElement of the module which contains the given strip
thestrip_id (must be on the given SiDetectorElement)
Returns
the physical chip ID which is in the range 0..11

Definition at line 55 of file SCT_ChipUtils.h.

55  {
56  // Get strip number
57  const int strip{sct_id.strip(stripId)};
58  if (strip<0 or static_cast<unsigned int>(strip)>=N_STRIPS_PER_SIDE) {
59  throw std::range_error("Invalid SCT strip");
60  }
61 
62  return getChip(static_cast<unsigned int>(sct_id.side(stripId)),
63  siElement.swapPhiReadoutDirection(),
64  strip);
65  }

◆ getChip() [2/2]

constexpr unsigned int SCT::getChip ( unsigned int  side,
bool  swap,
unsigned int  strip 
)
inlineconstexpr

Get the physical chip ID for the given strip.

Parameters
sidethe module side as returned by SCT_ID::side
swaptrue if the phi readout direction is swapped (returned by InDetDD::SiDetectorElement::swapPhiReadoutDirection )
stripthe strip id as returned by SCT_ID::strip
Returns
the physical chip ID which is in the range 0..11

Definition at line 26 of file SCT_ChipUtils.h.

26  {
27  // Get strip number
28  assert( strip <=N_STRIPS_PER_SIDE);
29 
30  // Conversion from strip to chip (specific for present SCT)
31  unsigned int chip{static_cast<unsigned int>(strip)/N_STRIPS_PER_CHIP}; // One ABCD chip reads 128 strips
32  // Relation between chip and offline strip is determined by the swapPhiReadoutDirection method.
33  // If swap is false
34  // offline strip: 0 767
35  // chip on side 0: 0 1 2 3 4 5
36  // chip on side 1: 11 10 9 8 7 6
37  // If swap is true
38  // offline strip: 0 767
39  // chip on side 0: 5 4 3 2 1 0
40  // chip on side 1: 6 7 8 9 10 11
41  if (side==0) {
42  chip = swap ? (N_CHIPS_PER_SIDE -1) - chip : chip;
43  } else {
44  chip = swap ? (N_CHIPS_PER_SIDE*N_SIDES-1) - chip : N_CHIPS_PER_SIDE + chip;
45  }
46  return chip;
47  }

◆ getGeometricalChipID() [1/2]

unsigned int SCT::getGeometricalChipID ( const SCT_ID sct_id,
const Identifier stripId 
)
inline

Get the physical chip ID for the given strip.

Parameters
sct_idthe SCT ID helper
thestrip_id.
Returns
the geometrical chip ID which is in the range 0..5 (for both sides and numbering is not swapped if the phi readout detection is swapped)

Definition at line 81 of file SCT_ChipUtils.h.

81  {
82  return getGeometricalChipID(static_cast<unsigned int>(sct_id.strip(stripId)));
83  }

◆ getGeometricalChipID() [2/2]

constexpr unsigned int SCT::getGeometricalChipID ( unsigned int  strip)
inlineconstexpr

Get the geometrical chip ID for the given strip.

Parameters
thestrip_id.
Returns
the geometrical chip ID which is in the range 0..5 (for both sides and numbering is not swapped if the phi readout detection is swapped)

Definition at line 71 of file SCT_ChipUtils.h.

71  {
73  return strip/N_STRIPS_PER_CHIP;
74  }

◆ getGeometricalFromPhysicalChipFlags() [1/2]

unsigned int SCT::getGeometricalFromPhysicalChipFlags ( const SCT_ID sct_id,
const InDetDD::SiDetectorElement siElement,
unsigned int  physical_chip_flags 
)
inline

Convert a word in which each bit represents the status of a certain physical chip to a word in which each bit represents a geometrical chip.

Parameters
sct_idthe SCT ID helper
siElementthe SiDetectorElement of the module of the chips represented by the given word
physical_chip_flagsa word in which bits 0..5 or 6..11 represent the status of a certain chip on the given module where each bit corresponds to the physical chip ID
Returns
a word in which bits 0..5 represent the status of a certain chip on the given module where each bit corresponds to the geometrical chip ID

Definition at line 174 of file SCT_ChipUtils.h.

174  {
175  return getGeometricalFromPhysicalChipFlags(static_cast<unsigned int>(sct_id.side(siElement.identify())),
176  siElement.swapPhiReadoutDirection(),
177  physical_chip_flags);
178  }

◆ getGeometricalFromPhysicalChipFlags() [2/2]

constexpr unsigned int SCT::getGeometricalFromPhysicalChipFlags ( unsigned int  side,
bool  swap,
unsigned int  physical_chip_flags 
)
inlineconstexpr

Convert a word in which each bit represents the status of a certain physical chip to a word in which each bit represents a geometrical chip.

Parameters
sidethe module side as returned by SCT_ID::side
swaptrue if the phi readout direction is swapped (returned by InDetDD::SiDetectorElement::swapPhiReadoutDirection )
physical_chip_flagsa word in which bits 0..5 or 6..11 represent the status of a certain chip on the given module where each bit corresponds to the physical chip ID
Returns
a word in which bits 0..5 represent the status of a certain chip on the given module where each bit corresponds to the geometrical chip ID

Definition at line 149 of file SCT_ChipUtils.h.

149  {
150  assert( side<2 );
151  // side 0 0..5 -> 0..5 or 5..0
152  // side 1 6..11 -> 0..5 or 5..0
153  unsigned int chip_flags = ( side==0 ? physical_chip_flags : physical_chip_flags>>N_CHIPS_PER_SIDE);
154  if (swap) {
155  unsigned int chip_flags_out=0;
156  // bit 0 -> 5
157  // bit 5 -> 0
158  for (unsigned int chip_i=SCT::N_CHIPS_PER_SIDE; chip_i-->0;) {
159  chip_flags_out <<=1;
160  chip_flags_out |= (chip_flags & 1);
161  chip_flags >>=1;
162  }
163  chip_flags = chip_flags_out;
164  }
165  return chip_flags;
166  }

◆ getGeometricalFromPhysicalChipID() [1/2]

unsigned int SCT::getGeometricalFromPhysicalChipID ( const SCT_ID sct_id,
const InDetDD::SiDetectorElement siElement,
unsigned int  physical_chip_id 
)
inline

Get the geometrical chip ID from a physical chip ID.

Parameters
sct_idthe SCT ID helper
siElementthe SiDetectorElement of the module which contains the given chip
physical_chip_idwhich must be in the range 0..5 for side 0 or 6..11 for side 1
Returns
the geometrical chip ID which is in the range 0..5 (for both sides and numbering is not swapped if the phi readout detection is swapped)

Definition at line 108 of file SCT_ChipUtils.h.

108  {
109  return getGeometricalFromPhysicalChipID(static_cast<unsigned int>(sct_id.side(siElement.identify())),
110  siElement.swapPhiReadoutDirection(),
111  physical_chip_id);
112  }

◆ getGeometricalFromPhysicalChipID() [2/2]

constexpr unsigned int SCT::getGeometricalFromPhysicalChipID ( unsigned int  side,
bool  swap,
unsigned int  physical_chip_id 
)
inlineconstexpr

Get the geometrical chip ID from a physica chip ID.

Parameters
sidethe module side as returned by SCT_ID::side
swaptrue if the phi readout direction is swapped (returned by InDetDD::SiDetectorElement::swapPhiReadoutDirection )
physical_chip_idwhich must be in the range 0..5 for side 0 or 6..11 for side 1
Returns
the geometrical chip ID which is in the range 0..5 (for both sides and numbering is not swapped if the phi readout detection is swapped)

Definition at line 91 of file SCT_ChipUtils.h.

91  {
92  // side 0 : 0 -> 0 5 -> 5
93  // side 0 swap : 0 -> 5 5 -> 0
94  // side 1 : 6 -> 0 11 -> 5
95  // side 1 swap : 6 -> 5 11 -> 0
96  assert( (side==0 && physical_chip_id<6) || (side ==1 && physical_chip_id<12));
97  return side==0
98  ? ( swap ? N_CHIPS_PER_SIDE - 1 - physical_chip_id : physical_chip_id)
99  : ( swap ? 2*N_CHIPS_PER_SIDE - 1 - physical_chip_id : physical_chip_id - N_CHIPS_PER_SIDE);
100  }

◆ getPhysicalFromGeometricalChipID() [1/2]

unsigned int SCT::getPhysicalFromGeometricalChipID ( const SCT_ID sct_id,
const InDetDD::SiDetectorElement siElement,
unsigned int  geometrical_chip_id 
)
inline

Get the physical chip ID from a geometrical chip ID.

Parameters
sct_idthe SCT ID helper
siElementthe SiDetectorElement of the module which contains the given chip
geometrical_chip_idthe geometrical chip id which must be in the range 0..5
Returns
physical chip ID which is in the range 0..5 for side0 and 6..11 for side 1 and the numbering scheme is swapped if the phi readout direction is swapped.

Definition at line 137 of file SCT_ChipUtils.h.

137  {
138  return getPhysicalFromGeometricalChipID(static_cast<unsigned int>(sct_id.side(siElement.identify())),
139  siElement.swapPhiReadoutDirection(),
140  geometrical_chip_id);
141  }

◆ getPhysicalFromGeometricalChipID() [2/2]

constexpr unsigned int SCT::getPhysicalFromGeometricalChipID ( unsigned int  side,
bool  swap,
unsigned int  geometrical_chip_id 
)
inlineconstexpr

Get the physical chip ID from a geometrical chip ID.

Parameters
sidethe module side as returned by SCT_ID::side
swaptrue if the phi readout direction is swapped (returned by InDetDD::SiDetectorElement::swapPhiReadoutDirection )
geometrical_chip_idthe geometrical chip id which must be in the range 0..5
Returns
physical chip ID which is in the range 0..5 for side0 and 6..11 for side 1 and the numbering scheme is swapped if the phi readout direction is swapped.

Definition at line 120 of file SCT_ChipUtils.h.

120  {
121  // side 0 : 0 -> 0 5 -> 5
122  // side 0 swap : 0 -> 5 5 -> 0
123  // side 1 : 0 -> 6 5 -> 11
124  // side 1 swap : 0 -> 11 5 -> 6
125  assert( geometrical_chip_id<6 && side<2);
126  return side==0
127  ? ( swap ? N_CHIPS_PER_SIDE - 1 - geometrical_chip_id : geometrical_chip_id)
128  : ( swap ? 2*N_CHIPS_PER_SIDE - 1 - geometrical_chip_id : geometrical_chip_id + N_CHIPS_PER_SIDE);
129  }

Variable Documentation

◆ N_CHIPS_PER_SIDE

constexpr unsigned int SCT::N_CHIPS_PER_SIDE = 6
constexpr

Definition at line 15 of file SCT_ChipUtils.h.

◆ N_SIDES

constexpr unsigned int SCT::N_SIDES = 2
constexpr

Definition at line 16 of file SCT_ChipUtils.h.

◆ N_STRIPS_PER_CHIP

constexpr unsigned int SCT::N_STRIPS_PER_CHIP = 128
constexpr

Definition at line 17 of file SCT_ChipUtils.h.

◆ N_STRIPS_PER_SIDE

constexpr unsigned int SCT::N_STRIPS_PER_SIDE = N_STRIPS_PER_CHIP*N_CHIPS_PER_SIDE
constexpr

Definition at line 18 of file SCT_ChipUtils.h.

SCT::getPhysicalFromGeometricalChipID
unsigned int getPhysicalFromGeometricalChipID(const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, unsigned int geometrical_chip_id)
Get the physical chip ID from a geometrical chip ID.
Definition: SCT_ChipUtils.h:137
SCT::N_STRIPS_PER_CHIP
constexpr unsigned int N_STRIPS_PER_CHIP
Definition: SCT_ChipUtils.h:17
SiliconTech::strip
@ strip
SCT::getGeometricalFromPhysicalChipFlags
unsigned int getGeometricalFromPhysicalChipFlags(const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, unsigned int physical_chip_flags)
Convert a word in which each bit represents the status of a certain physical chip to a word in which ...
Definition: SCT_ChipUtils.h:174
SCT::getGeometricalFromPhysicalChipID
unsigned int getGeometricalFromPhysicalChipID(const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, unsigned int physical_chip_id)
Get the geometrical chip ID from a physical chip ID.
Definition: SCT_ChipUtils.h:108
SCT::N_SIDES
constexpr unsigned int N_SIDES
Definition: SCT_ChipUtils.h:16
TRT::Hit::side
@ side
Definition: HitInfo.h:83
SCT::getChip
unsigned int getChip(const SCT_ID &sct_id, const InDetDD::SiDetectorElement &siElement, const Identifier &stripId)
Get the physical chip ID for the given strip.
Definition: SCT_ChipUtils.h:55
InDetDD::SiDetectorElement::swapPhiReadoutDirection
bool swapPhiReadoutDirection() const
Determine if readout direction between online and offline needs swapping.
SH::MetaObject::swap
void swap(MetaObject &a, MetaObject &b)
standard swap
SCT::N_STRIPS_PER_SIDE
constexpr unsigned int N_STRIPS_PER_SIDE
Definition: SCT_ChipUtils.h:18
SCT::getGeometricalChipID
unsigned int getGeometricalChipID(const SCT_ID &sct_id, const Identifier &stripId)
Get the physical chip ID for the given strip.
Definition: SCT_ChipUtils.h:81
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
SCT::N_CHIPS_PER_SIDE
constexpr unsigned int N_CHIPS_PER_SIDE
Definition: SCT_ChipUtils.h:15