ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::PixelOverlapDescriptor Class Reference

Class to describe overlaps in the pixel detector, it extends the Trk::OverlapDescriptor base class. More...

#include <PixelOverlapDescriptor.h>

Inheritance diagram for InDet::PixelOverlapDescriptor:
Collaboration diagram for InDet::PixelOverlapDescriptor:

Public Member Functions

 PixelOverlapDescriptor (bool addMoreSurfaces=false, int eta_slices=3, int phi_slices=1)
 Constructor (area restriction, LC check)
virtual ~PixelOverlapDescriptor ()
 Destructor.
PixelOverlapDescriptorclone () const
 Pseudo-Constructor.
bool reachableSurfaces (std::vector< Trk::SurfaceIntersection > &cSurfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
 get the compatible surfaces

Private Member Functions

void addPhiNeighbours (std::vector< Trk::SurfaceIntersection > &cSurfaces, InDetDD::SiDetectorElement &sElement) const
bool dumpSurfaces (std::vector< Trk::SurfaceIntersection > &surfaces) const

Private Attributes

bool m_robustMode
bool m_addMoreSurfaces
int m_etaSlices
int m_phiSlices
std::atomic< const PixelID * > m_pixIdHelper {nullptr}

Detailed Description

Class to describe overlaps in the pixel detector, it extends the Trk::OverlapDescriptor base class.

There are two interface methods, one provides the most probably overlapcell, the second provides a list of overlap cells, based on an restricted area

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 76 of file PixelOverlapDescriptor.h.

Constructor & Destructor Documentation

◆ PixelOverlapDescriptor()

InDet::PixelOverlapDescriptor::PixelOverlapDescriptor ( bool addMoreSurfaces = false,
int eta_slices = 3,
int phi_slices = 1 )

Constructor (area restriction, LC check)

Definition at line 20 of file PixelOverlapDescriptor.cxx.

◆ ~PixelOverlapDescriptor()

virtual InDet::PixelOverlapDescriptor::~PixelOverlapDescriptor ( )
inlinevirtual

Destructor.

Definition at line 83 of file PixelOverlapDescriptor.h.

83{}

Member Function Documentation

◆ addPhiNeighbours()

void InDet::PixelOverlapDescriptor::addPhiNeighbours ( std::vector< Trk::SurfaceIntersection > & cSurfaces,
InDetDD::SiDetectorElement & sElement ) const
private

◆ clone()

PixelOverlapDescriptor * InDet::PixelOverlapDescriptor::clone ( ) const
inlinevirtual

Pseudo-Constructor.

Implements Trk::OverlapDescriptor.

Definition at line 109 of file PixelOverlapDescriptor.h.

109{ return new PixelOverlapDescriptor(); }
PixelOverlapDescriptor(bool addMoreSurfaces=false, int eta_slices=3, int phi_slices=1)
Constructor (area restriction, LC check)

◆ dumpSurfaces()

bool InDet::PixelOverlapDescriptor::dumpSurfaces ( std::vector< Trk::SurfaceIntersection > & surfaces) const
private

Definition at line 173 of file PixelOverlapDescriptor.cxx.

173 {
174
175 if (m_pixIdHelper==nullptr) {
176 // get DetectorStore service
177 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
178 if (!detStore.isValid()) {
179 return false;
180 }
181
182 const PixelID* pixIdHelper = nullptr;
183 if (detStore->retrieve(pixIdHelper, "PixelID").isFailure()) {
184 return false;
185 }
186 m_pixIdHelper = pixIdHelper;
187 }
188
189 std::cout << "Dumping Surfaces for Pixel with size = " << surfaces.size() << std::endl;
190 for (auto & surface : surfaces) {
191 Identifier hitId = (surface.object)->associatedDetectorElementIdentifier();
192 std::cout << "barrel_ec " << m_pixIdHelper.load()->barrel_ec(hitId) << ", layer_disk " << m_pixIdHelper.load()->layer_disk(hitId) << ", phi_module " << m_pixIdHelper.load()->phi_module(hitId) << ", eta_module " << m_pixIdHelper.load()->eta_module(hitId) << std::endl;
193 }
194 return true;
195}
std::atomic< const PixelID * > m_pixIdHelper

◆ reachableSurfaces()

bool InDet::PixelOverlapDescriptor::reachableSurfaces ( std::vector< Trk::SurfaceIntersection > & cSurfaces,
const Trk::Surface & sf,
const Amg::Vector3D & pos,
const Amg::Vector3D & dir ) const
virtual

get the compatible surfaces

< position phi and surface phi - rescale to 0 -> 2PI

Implements Trk::OverlapDescriptor.

Definition at line 28 of file PixelOverlapDescriptor.cxx.

34{
35 // first add the target surface - it's always worth
36 cSurfaces.emplace_back(Trk::Intersection(pos, 0., true), &tsf);
37
38 // make sure we have the correct associated element
39 const auto* tmp = tsf.associatedDetectorElement();
40 const InDetDD::SiDetectorElement* sElement =
41 tmp->detectorType() == Trk::DetectorElemType::Silicon
42 ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
43 : nullptr;
44 if (sElement) {
45 size_t newCapacity = cSurfaces.size();
46 if (m_robustMode and m_addMoreSurfaces and sElement->isBarrel()) {
47 // sum up the defined slices to evaluate the new capacity
48 newCapacity += (2*m_phiSlices+ 2*(m_etaSlices*(2*m_phiSlices+1)));
49 } else if (m_robustMode) {
50 newCapacity += 8;
51 } else {
52 newCapacity += 1;
53 if (sElement->isBarrel()) {
54 newCapacity += 2;
55 }
56 }
57 cSurfaces.reserve(newCapacity);
58
59 // now get the overlap options
61 double surfacePhi = tsf.center().phi() + M_PI;
62 double positionPhi = pos.phi() + M_PI;
63 // 8-cell-connectivity depending on track/surface geometry
64 // nPhi - can be jump + or -
65 const InDetDD::SiDetectorElement* nElement = nullptr;
66 // robust mode --> return 9 surfaces
67 if (m_robustMode) {
68 addNextInPhi(sElement, cSurfaces);
69 addNextInEta(sElement, cSurfaces);
70
71 addPrevInPhi(sElement, cSurfaces);
72 addPrevInEta(sElement, cSurfaces);
73
74 nElement = sElement->nextInPhi();
75 addNextInEta(nElement, cSurfaces);
76 addPrevInEta(nElement, cSurfaces);
77
78 nElement = sElement->prevInPhi();
79 addNextInEta(nElement, cSurfaces);
80 addPrevInEta(nElement, cSurfaces);
81
82 if (m_addMoreSurfaces and sElement->isBarrel()) {
83
84 unsigned int next = 1;
85 const InDetDD::SiDetectorElement* currentElement = sElement->nextInEta();
86 while (currentElement and next<(unsigned int)m_etaSlices) {
87 addNextInEta(currentElement,cSurfaces);
88 currentElement = currentElement->nextInEta();
89 if (currentElement) {
90 addNextInPhi(currentElement,cSurfaces);
91 addPrevInPhi(currentElement,cSurfaces);
92 }
93 next++;
94 }
95
96 unsigned int prev = 1;
97 currentElement = sElement->prevInEta();
98 while (currentElement and prev<(unsigned int)m_etaSlices) {
99 addPrevInEta(currentElement,cSurfaces);
100 currentElement = currentElement->prevInEta();
101 if (currentElement) {
102 addNextInPhi(currentElement,cSurfaces);
103 addPrevInPhi(currentElement,cSurfaces);
104 }
105 prev++;
106 }
107
108 unsigned int next_phi = 0;
109 const InDetDD::SiDetectorElement* currentElementNextPhi = sElement->nextInPhi()->nextInPhi();
110 const InDetDD::SiDetectorElement* currentElementPrevPhi = sElement->prevInPhi()->prevInPhi();
111
112 while (next_phi<(unsigned int)m_phiSlices) {
113 addSurface(currentElementNextPhi,cSurfaces);
114 addSurface(currentElementPrevPhi,cSurfaces);
115
116 unsigned int next_eta = 0;
117 const InDetDD::SiDetectorElement* currentElement_nextPhi = currentElementNextPhi;
118 const InDetDD::SiDetectorElement* currentElement_prevPhi = currentElementPrevPhi;
119 while (currentElement_nextPhi and currentElement_prevPhi and next_eta<(unsigned int)m_etaSlices) {
120 addNextInEta(currentElement_nextPhi,cSurfaces);
121 currentElement_nextPhi = currentElement_nextPhi->nextInEta();
122 addNextInEta(currentElement_prevPhi,cSurfaces);
123 currentElement_prevPhi = currentElement_prevPhi->nextInEta();
124 next_eta++;
125 }
126
127 unsigned int prev_eta = 0;
128 currentElement_nextPhi = currentElementNextPhi;
129 currentElement_prevPhi = currentElementPrevPhi;
130 while (currentElement_nextPhi and currentElement_prevPhi and prev_eta<(unsigned int)m_etaSlices) {
131 addPrevInEta(currentElement_nextPhi,cSurfaces);
132 currentElement_nextPhi = currentElement_nextPhi->prevInEta();
133 addPrevInEta(currentElement_prevPhi,cSurfaces);
134 currentElement_prevPhi = currentElement_prevPhi->prevInEta();
135 prev_eta++;
136 }
137
138 currentElementNextPhi = currentElementNextPhi->nextInPhi();
139 currentElementPrevPhi = currentElementPrevPhi->prevInPhi();
140
141 next_phi++;
142 }
143 }
144 } else {
145 // we go next in phi
146 if (surfacePhi < positionPhi) {
147 addNextInPhi(sElement, cSurfaces);
148 nElement = sElement->nextInPhi();
149 } else {
150 addPrevInPhi(sElement, cSurfaces);
151 nElement = sElement->prevInPhi();
152 }
153 if (sElement->isBarrel()) {
154 // get the eta information - also possible
155 double positionEta = pos.eta();
156 double surfaceEta = tsf.center().eta();
157 // check the surface / position eta values
158 if (surfaceEta < positionEta) {
159 // we go next in eta for both, the original and the phi jumped one
160 addNextInEta(sElement, cSurfaces);
161 addNextInEta(nElement, cSurfaces);
162 } else {
163 // opposite direction
164 addPrevInEta(sElement, cSurfaces);
165 addPrevInEta(nElement, cSurfaces);
166 }
167 }
168 }
169 }
170 return false;
171}
#define M_PI
#define addSurface(cur, surfaces)
#define addPrevInEta(cur, surfaces)
#define addNextInPhi(cur, surfaces)
#define addPrevInPhi(cur, surfaces)
#define addNextInEta(cur, surfaces)
const SiDetectorElement * prevInPhi() const
const SiDetectorElement * nextInPhi() const
const SiDetectorElement * prevInEta() const
const SiDetectorElement * nextInEta() const

Member Data Documentation

◆ m_addMoreSurfaces

bool InDet::PixelOverlapDescriptor::m_addMoreSurfaces
private

Definition at line 102 of file PixelOverlapDescriptor.h.

◆ m_etaSlices

int InDet::PixelOverlapDescriptor::m_etaSlices
private

Definition at line 103 of file PixelOverlapDescriptor.h.

◆ m_phiSlices

int InDet::PixelOverlapDescriptor::m_phiSlices
private

Definition at line 104 of file PixelOverlapDescriptor.h.

◆ m_pixIdHelper

std::atomic<const PixelID*> InDet::PixelOverlapDescriptor::m_pixIdHelper {nullptr}
mutableprivate

Definition at line 105 of file PixelOverlapDescriptor.h.

105{nullptr};

◆ m_robustMode

bool InDet::PixelOverlapDescriptor::m_robustMode
private

Definition at line 101 of file PixelOverlapDescriptor.h.


The documentation for this class was generated from the following files: