ATLAS Offline Software
Loading...
Searching...
No Matches
IdentityHelper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
6
10
11#include <stdexcept>
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}
23
24
25const PixelID*
27{
28 return std::get<const PixelID*>(m_helper);
29}
30const SCT_ID*
32{
33 return std::get<const SCT_ID*>(m_helper);
34}
35
36int
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}
47
48int
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}
59
60int
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}
71
72int
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}
83
84int
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}
95
96int
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}
107
108int
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}
if(febId1==febId2)
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
const InDetDD::SiDetectorElement * m_elem
int phi_module() const
std::variant< const PixelID *, const SCT_ID * > m_helper
int eta_module_max() const
const SCT_ID * getSCTIDHelper() const
int eta_module() const
const PixelID * getPixelIDHelper() const
int layer_disk() const
int phi_module_max() const
IdentityHelper(const InDetDD::SiDetectorElement *detElem)
Class to hold geometrical description of a silicon detector element.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
int layer_disk(const Identifier &id) const
Definition PixelID.h:607
int eta_module_max(const Identifier &id) const
Definition PixelID.cxx:79
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition PixelID.h:600
int eta_module(const Identifier &id) const
Definition PixelID.h:632
int phi_module(const Identifier &id) const
Definition PixelID.h:625
int phi_module_max(const Identifier &id) const
Definition PixelID.cxx:123
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
int phi_module_max(const Identifier &id) const
Definition SCT_ID.cxx:205
int layer_disk(const Identifier &id) const
Definition SCT_ID.h:687
int side(const Identifier &id) const
Definition SCT_ID.h:705
int phi_module(const Identifier &id) const
Definition SCT_ID.h:693
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition SCT_ID.h:681
int eta_module_max(const Identifier &id) const
Definition SCT_ID.cxx:183
int eta_module(const Identifier &id) const
Definition SCT_ID.h:699