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

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

#include <DiscOverlapDescriptor.h>

Inheritance diagram for InDet::DiscOverlapDescriptor:
Collaboration diagram for InDet::DiscOverlapDescriptor:

Public Member Functions

 DiscOverlapDescriptor ()=default
 DiscOverlapDescriptor (const Trk::BinnedArray< Trk::Surface > *bin_array, const std::vector< Trk::BinUtility > &singleBinUtils, bool isPixel=false)
 Constructor.
virtual ~DiscOverlapDescriptor ()=default
 Destructor.
 DiscOverlapDescriptor (const DiscOverlapDescriptor &)=delete
 Delete copy.
DiscOverlapDescriptoroperator= (const DiscOverlapDescriptor &)=delete
 Delete assignment.
virtual DiscOverlapDescriptorclone () const override
 Pseudo-Constructor.
bool reachableSurfaces (std::vector< Trk::SurfaceIntersection > &surfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override
 get the compatible surfaces

Private Member Functions

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

Private Attributes

const Trk::BinnedArray< Trk::Surface > * m_bin_array {nullptr}
std::vector< Trk::BinUtilitym_singleBinUtils {}
bool m_pixelCase {false}

Detailed Description

Class to describe overlaps in the custom 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
Noemi.nosp@m..Cal.nosp@m.ace@c.nosp@m.ern..nosp@m.ch

Definition at line 79 of file DiscOverlapDescriptor.h.

Constructor & Destructor Documentation

◆ DiscOverlapDescriptor() [1/3]

InDet::DiscOverlapDescriptor::DiscOverlapDescriptor ( )
default

◆ DiscOverlapDescriptor() [2/3]

InDet::DiscOverlapDescriptor::DiscOverlapDescriptor ( const Trk::BinnedArray< Trk::Surface > * bin_array,
const std::vector< Trk::BinUtility > & singleBinUtils,
bool isPixel = false )

Constructor.

Definition at line 63 of file DiscOverlapDescriptor.cxx.

65 :
66 m_bin_array(bin_array),
67 m_singleBinUtils(singleBinUtils),
68 m_pixelCase(isPixel)
69{}
std::vector< Trk::BinUtility > m_singleBinUtils
const Trk::BinnedArray< Trk::Surface > * m_bin_array

◆ ~DiscOverlapDescriptor()

virtual InDet::DiscOverlapDescriptor::~DiscOverlapDescriptor ( )
virtualdefault

Destructor.

◆ DiscOverlapDescriptor() [3/3]

InDet::DiscOverlapDescriptor::DiscOverlapDescriptor ( const DiscOverlapDescriptor & )
delete

Delete copy.

Member Function Documentation

◆ clone()

DiscOverlapDescriptor * InDet::DiscOverlapDescriptor::clone ( ) const
inlineoverridevirtual

Pseudo-Constructor.

Implements Trk::OverlapDescriptor.

Definition at line 116 of file DiscOverlapDescriptor.h.

116{ return new DiscOverlapDescriptor(); }

◆ dumpSurfaces()

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

Definition at line 239 of file DiscOverlapDescriptor.cxx.

239 {
240 std::cout << "Dumping Surfaces for " << (m_pixelCase ? "Pixel " : "SCT ")
241 << "with size = " << surfaces.size() << std::endl;
242 static const StoreGateSvc* const detStore = getDetStore();
243 static const PixelID* const pixIdHelper = getPixelID(detStore);
244 static const SCT_ID* const sctIdHelper = getSCT_ID(detStore);
245
246 for (auto & surface : surfaces) {
247 Identifier hitId = (surface.object)->associatedDetectorElementIdentifier();
248 if (m_pixelCase)
249 std::cout << "barrel_ec " << pixIdHelper->barrel_ec(hitId)
250 << ", layer_disk " << pixIdHelper->layer_disk(hitId)
251 << ", phi_module " << pixIdHelper->phi_module(hitId)
252 << ", eta_module " << pixIdHelper->eta_module(hitId) << std::endl;
253 else
254 std::cout << "barrel_ec " << sctIdHelper->barrel_ec(hitId)
255 << ", layer_disk " << sctIdHelper->layer_disk(hitId)
256 << ", phi_module " << sctIdHelper->phi_module(hitId)
257 << ", eta_module " << sctIdHelper->eta_module(hitId)
258 << ", side " << sctIdHelper->side(hitId) << std::endl;
259 }
260 return true;
261}
int layer_disk(const Identifier &id) const
Definition PixelID.h:607
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 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(const Identifier &id) const
Definition SCT_ID.h:699

◆ operator=()

DiscOverlapDescriptor & InDet::DiscOverlapDescriptor::operator= ( const DiscOverlapDescriptor & )
delete

Delete assignment.

◆ reachableSurfaces()

bool InDet::DiscOverlapDescriptor::reachableSurfaces ( std::vector< Trk::SurfaceIntersection > & surfaces,
const Trk::Surface & sf,
const Amg::Vector3D & pos,
const Amg::Vector3D & dir ) const
overridevirtual

get the compatible surfaces

  • return vector : surfaces
  • primary bin surface : sf
  • position & direction : pos, dir

Implements Trk::OverlapDescriptor.

Definition at line 71 of file DiscOverlapDescriptor.cxx.

75{ //These are done once no matter how many
76 //instances of DiscOverlapDescriptor we have
77 static const StoreGateSvc* const detStore = getDetStore();
78 static const PixelID* const pixIdHelper = getPixelID(detStore);
79 static const SCT_ID* const sctIdHelper = getSCT_ID(detStore);
80
81 // get the according detector element
82 const InDetDD::SiDetectorElement* pElement = dynamic_cast<const InDetDD::SiDetectorElement*>(tsf.associatedDetectorElement());
83
84 // first add the target surface
85 surfaces.emplace_back(Trk::Intersection(pos, 0., true),&tsf);
86 int etaModule =
88 ? pixIdHelper->eta_module(tsf.associatedDetectorElementIdentifier())
89 : sctIdHelper->eta_module(tsf.associatedDetectorElementIdentifier());
90
91 // return empty cell vector
92 if (pElement) {
93 size_t newCapacity = surfaces.size() + 19;
94 if (pElement->otherSide()) newCapacity += 19;
95 surfaces.reserve(newCapacity);
96
97 addOtherSideDO(pElement,surfaces);
98
99 addNextInPhiDO(pElement,surfaces);
100 addPrevInPhiDO(pElement,surfaces);
101
102 addNextInPhiDO(pElement->nextInPhi(),surfaces);
103 addPrevInPhiDO(pElement->prevInPhi(),surfaces);
104
105 // First use the bin utiliy to find the surfaces on the same disc but in different rings
106 // This is done as follows:
107 // 1 -> Find at which bin corresponds the surface, i.e. at which ring on the disc it corresponds
108 // 2 -> If it is not 0 (i.e. the surface doesn't belong to the innermost ring),
109 // look for the surfaces in the ring with smaller eta value (it returns 2 or 3 surfaces)
110 // 3 -> If it is smaller than the number of rings (i.e. the surface doen't belong to the outermost ring),
111 // look for the surfaces in the ring with bigger eta value (it returns 2 or 3 surfaces)//
112
113 if (m_bin_array && !m_singleBinUtils.empty()){
114
115 const Trk::Surface* samePhi_PrevEta = nullptr;
116 const Trk::Surface* samePhi_NextEta = nullptr;
117
118 const Trk::Surface* previousPhi_PrevEta = nullptr;
119 const Trk::Surface* nextPhi_PrevEta = nullptr;
120
121 const Trk::Surface* previousPhi_NextEta = nullptr;
122 const Trk::Surface* nextPhi_NextEta = nullptr;
123
124 std::span<Trk::Surface const * const> surf = m_bin_array->arrayObjects();
125 size_t offset = 0;
126 for (unsigned int bin = 0; bin < m_singleBinUtils.size(); bin++) {
127 int etamod =
129 ? pixIdHelper->eta_module(
130 (*(surf[offset])).associatedDetectorElementIdentifier())
131 : sctIdHelper->eta_module(
132 (*(surf[offset])).associatedDetectorElementIdentifier());
133
134 if (etamod == etaModule || etamod < (etaModule - 1) ||
135 etamod > (etaModule + 1)) {
136 offset += (std::as_const(m_singleBinUtils).at(bin)).bins();
137 continue;
138 }
139
140 double PrevDeltaPhi = 9999.;
141 double NextDeltaPhi = -9999.;
142 for (unsigned int ss = offset; ss < (offset+(std::as_const(m_singleBinUtils).at(bin)).bins()); ss++ ) {
143 if (etamod == (etaModule-1) ) {
144 if( tsf.center().phi() == (*(surf[ss])).center().phi() )
145 samePhi_PrevEta = surf[ss];
146 double DeltaPhi = tsf.center().phi() - (*(surf[ss])).center().phi();
147 if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
148 previousPhi_PrevEta = surf[ss];
149 PrevDeltaPhi = DeltaPhi;
150 }
151 if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
152 nextPhi_PrevEta = surf[ss];
153 NextDeltaPhi = DeltaPhi;
154 }
155 } else if (etamod == (etaModule+1) ) {
156 if( tsf.center().phi() == (*(surf[ss])).center().phi() )
157 samePhi_NextEta = surf[ss];
158 double DeltaPhi = tsf.center().phi() - (*(surf[ss])).center().phi();
159 if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
160 previousPhi_NextEta = surf[ss];
161 PrevDeltaPhi = DeltaPhi;
162 }
163
164 if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
165 nextPhi_NextEta = surf[ss];
166 NextDeltaPhi = DeltaPhi;
167 }
168 }
169 }
170 offset += (std::as_const(m_singleBinUtils).at(bin)).bins();
171 }
172
173 if (samePhi_PrevEta) {
174 const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(samePhi_PrevEta->associatedDetectorElement());
175 if (PhiEta_Element) {
176 addSurfaceDO(PhiEta_Element,surfaces);
177 addOtherSideDO(PhiEta_Element, surfaces);
178 }
179 }
180
181 if (previousPhi_PrevEta) {
182 const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(previousPhi_PrevEta->associatedDetectorElement());
183 if (PhiEta_Element) {
184 addSurfaceDO(PhiEta_Element,surfaces);
185 addOtherSideDO(PhiEta_Element, surfaces);
186
187 addPrevInPhiDO(PhiEta_Element,surfaces);
188 addPrevInPhiDO(PhiEta_Element->prevInPhi(),surfaces);
189 }
190 }
191
192 if (nextPhi_PrevEta) {
193 const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(nextPhi_PrevEta->associatedDetectorElement());
194 if (PhiEta_Element) {
195 addSurfaceDO(PhiEta_Element,surfaces);
196 addOtherSideDO(PhiEta_Element, surfaces);
197
198 addNextInPhiDO(PhiEta_Element,surfaces);
199 addNextInPhiDO(PhiEta_Element->nextInPhi(),surfaces);
200 }
201 }
202
203 if (samePhi_NextEta) {
204 const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(samePhi_NextEta->associatedDetectorElement());
205 if (PhiEta_Element) {
206 addSurfaceDO(PhiEta_Element,surfaces);
207 addOtherSideDO(PhiEta_Element, surfaces);
208 }
209 }
210
211 if (previousPhi_NextEta) {
212 const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(previousPhi_NextEta->associatedDetectorElement());
213 if (PhiEta_Element) {
214 addSurfaceDO(PhiEta_Element,surfaces);
215 addOtherSideDO(PhiEta_Element, surfaces);
216
217 addPrevInPhiDO(PhiEta_Element,surfaces);
218 addPrevInPhiDO(PhiEta_Element->prevInPhi(),surfaces);
219 }
220 }
221
222 if (nextPhi_NextEta) {
223 const InDetDD::SiDetectorElement* PhiEta_Element = dynamic_cast<const InDetDD::SiDetectorElement*>(nextPhi_NextEta->associatedDetectorElement());
224 if (PhiEta_Element) {
225 addSurfaceDO(PhiEta_Element,surfaces);
226 addOtherSideDO(PhiEta_Element, surfaces);
227
228 addNextInPhiDO(PhiEta_Element,surfaces);
229 addNextInPhiDO(PhiEta_Element->nextInPhi(),surfaces);
230 }
231 }
232 }
233 }
234
235 return false;
236
237}
#define addNextInPhiDO(cur, surfaces)
#define addPrevInPhiDO(cur, surfaces)
#define addSurfaceDO(cur, surfaces)
#define addOtherSideDO(cur, surfaces)
static Double_t ss
static const std::vector< std::string > bins
const SiDetectorElement * prevInPhi() const
const SiDetectorElement * nextInPhi() const
const SiDetectorElement * otherSide() const
Useful for SCT only.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
etamod(flags, cells_name, *args, **kw)

Member Data Documentation

◆ m_bin_array

const Trk::BinnedArray<Trk::Surface>* InDet::DiscOverlapDescriptor::m_bin_array {nullptr}
private

Definition at line 111 of file DiscOverlapDescriptor.h.

111{nullptr};

◆ m_pixelCase

bool InDet::DiscOverlapDescriptor::m_pixelCase {false}
private

Definition at line 113 of file DiscOverlapDescriptor.h.

113{false};

◆ m_singleBinUtils

std::vector<Trk::BinUtility> InDet::DiscOverlapDescriptor::m_singleBinUtils {}
private

Definition at line 112 of file DiscOverlapDescriptor.h.

112{};

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