ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IdentityHelper Class Reference

#include <IdentityHelper.h>

Collaboration diagram for IdentityHelper:

Public Member Functions

 IdentityHelper (const InDetDD::SiDetectorElement *detElem)
 
int bec () const
 
int layer_disk () const
 
int phi_module () const
 
int eta_module () const
 
int side () const
 
int phi_module_max () const
 
int eta_module_max () const
 

Private Member Functions

const PixelIDgetPixelIDHelper () const
 
const SCT_IDgetSCTIDHelper () const
 

Private Attributes

const InDetDD::SiDetectorElementm_elem
 
std::variant< const PixelID *, const SCT_ID * > m_helper
 

Detailed Description

Definition at line 14 of file IdentityHelper.h.

Constructor & Destructor Documentation

◆ IdentityHelper()

IdentityHelper::IdentityHelper ( const InDetDD::SiDetectorElement detElem)

Definition at line 12 of file IdentityHelper.cxx.

13  : m_elem(elem)
14 {
15  if ( m_elem->isPixel() ) {
16  m_helper = static_cast<const PixelID*>(m_elem->getIdHelper());
17  } else if ( m_elem->isSCT()) {
18  m_helper = static_cast<const SCT_ID*>(m_elem->getIdHelper());
19  } else {
20  throw std::invalid_argument("ActsInterop IdentityHelper can only bes ued fro SCT & Pixel det elements");
21  }
22 }

Member Function Documentation

◆ bec()

int IdentityHelper::bec ( ) const

Definition at line 37 of file IdentityHelper.cxx.

38 {
39  auto id = m_elem->identify();
40  if (m_elem->isPixel()) {
41  return getPixelIDHelper()->barrel_ec(id);
42  }
43  else {
44  return getSCTIDHelper()->barrel_ec(id);
45  }
46 }

◆ eta_module()

int IdentityHelper::eta_module ( ) const

Definition at line 73 of file IdentityHelper.cxx.

74 {
75  auto id = m_elem->identify();
76  if (m_elem->isPixel()) {
77  return getPixelIDHelper()->eta_module(id);
78  }
79  else {
80  return getSCTIDHelper()->eta_module(id);
81  }
82 }

◆ eta_module_max()

int IdentityHelper::eta_module_max ( ) const

Definition at line 109 of file IdentityHelper.cxx.

110 {
111  auto id = m_elem->identify();
112  if (m_elem->isPixel()) {
113  return getPixelIDHelper()->eta_module_max(id);
114  }
115  else {
116  return getSCTIDHelper()->eta_module_max(id);
117  }
118 }

◆ getPixelIDHelper()

const PixelID * IdentityHelper::getPixelIDHelper ( ) const
private

Definition at line 26 of file IdentityHelper.cxx.

27 {
28  return std::get<const PixelID*>(m_helper);
29 }

◆ getSCTIDHelper()

const SCT_ID * IdentityHelper::getSCTIDHelper ( ) const
private

Definition at line 31 of file IdentityHelper.cxx.

32 {
33  return std::get<const SCT_ID*>(m_helper);
34 }

◆ layer_disk()

int IdentityHelper::layer_disk ( ) const

Definition at line 49 of file IdentityHelper.cxx.

50 {
51  auto id = m_elem->identify();
52  if (m_elem->isPixel()) {
53  return getPixelIDHelper()->layer_disk(id);
54  }
55  else {
56  return getSCTIDHelper()->layer_disk(id);
57  }
58 }

◆ phi_module()

int IdentityHelper::phi_module ( ) const

Definition at line 61 of file IdentityHelper.cxx.

62 {
63  auto id = m_elem->identify();
64  if (m_elem->isPixel()) {
65  return getPixelIDHelper()->phi_module(id);
66  }
67  else {
68  return getSCTIDHelper()->phi_module(id);
69  }
70 }

◆ phi_module_max()

int IdentityHelper::phi_module_max ( ) const

Definition at line 97 of file IdentityHelper.cxx.

98 {
99  auto id = m_elem->identify();
100  if (m_elem->isPixel()) {
101  return getPixelIDHelper()->phi_module_max(id);
102  }
103  else {
104  return getSCTIDHelper()->phi_module_max(id);
105  }
106 }

◆ side()

int IdentityHelper::side ( ) const

Definition at line 85 of file IdentityHelper.cxx.

86 {
87  auto id = m_elem->identify();
88  if (m_elem->isPixel()) {
89  return 0;
90  }
91  else {
92  return getSCTIDHelper()->side(id);
93  }
94 }

Member Data Documentation

◆ m_elem

const InDetDD::SiDetectorElement* IdentityHelper::m_elem
private

Definition at line 29 of file IdentityHelper.h.

◆ m_helper

std::variant<const PixelID*, const SCT_ID*> IdentityHelper::m_helper
private

Definition at line 30 of file IdentityHelper.h.


The documentation for this class was generated from the following files:
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
SCT_ID::eta_module_max
int eta_module_max(const Identifier &id) const
Definition: SCT_ID.cxx:191
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
SCT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: SCT_ID.h:740
SCT_ID::phi_module_max
int phi_module_max(const Identifier &id) const
Definition: SCT_ID.cxx:213
PixelID::eta_module_max
int eta_module_max(const Identifier &id) const
Definition: PixelID.cxx:77
InDetDD::SolidStateDetectorElementBase::getIdHelper
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
IdentityHelper::getPixelIDHelper
const PixelID * getPixelIDHelper() const
Definition: IdentityHelper.cxx:26
IdentityHelper::m_helper
std::variant< const PixelID *, const SCT_ID * > m_helper
Definition: IdentityHelper.h:30
IdentityHelper::m_elem
const InDetDD::SiDetectorElement * m_elem
Definition: IdentityHelper.h:29
PixelID::phi_module_max
int phi_module_max(const Identifier &id) const
Definition: PixelID.cxx:121
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
SCT_ID
Definition: SCT_ID.h:68
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
InDetDD::SiDetectorElement::isSCT
bool isSCT() const
IdentityHelper::getSCTIDHelper
const SCT_ID * getSCTIDHelper() const
Definition: IdentityHelper.cxx:31
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
PixelID
Definition: PixelID.h:67
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)