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

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

#include <SCT_OverlapDescriptor.h>

Inheritance diagram for InDet::SCT_OverlapDescriptor:
Collaboration diagram for InDet::SCT_OverlapDescriptor:

Public Member Functions

 SCT_OverlapDescriptor (bool addMoreSurfaces=false, int eta_slices=4)
 Constructor.
virtual ~SCT_OverlapDescriptor ()=default
 Destructor.
SCT_OverlapDescriptorclone () 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

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

Private Attributes

bool m_robustMode
bool m_addMoreSurfaces
int m_etaSlices
std::atomic< const SCT_ID * > m_sctIdHelper {nullptr}

Detailed Description

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

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

Definition at line 73 of file SCT_OverlapDescriptor.h.

Constructor & Destructor Documentation

◆ SCT_OverlapDescriptor()

InDet::SCT_OverlapDescriptor::SCT_OverlapDescriptor ( bool addMoreSurfaces = false,
int eta_slices = 4 )

Constructor.

Definition at line 20 of file SCT_OverlapDescriptor.cxx.

◆ ~SCT_OverlapDescriptor()

virtual InDet::SCT_OverlapDescriptor::~SCT_OverlapDescriptor ( )
virtualdefault

Destructor.

Member Function Documentation

◆ clone()

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

Pseudo-Constructor.

Implements Trk::OverlapDescriptor.

Definition at line 99 of file SCT_OverlapDescriptor.h.

99{ return new SCT_OverlapDescriptor(); }
SCT_OverlapDescriptor(bool addMoreSurfaces=false, int eta_slices=4)
Constructor.

◆ dumpSurfaces()

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

Definition at line 141 of file SCT_OverlapDescriptor.cxx.

141 {
142
143 if (m_sctIdHelper==nullptr) {
144 // get DetectorStore service
145 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
146 if (!detStore.isValid()) {
147 return false;
148 }
149
150 const SCT_ID* sctIdHelper = nullptr;
151 if (detStore->retrieve(sctIdHelper, "SCT_ID").isFailure()) {
152 return false;
153 }
154 m_sctIdHelper = sctIdHelper;
155 }
156
157 std::cout << "Dumping Surfaces for SCT with size = " << surfaces.size() << std::endl;
158 for (auto & surface : surfaces) {
159 Identifier hitId = (surface.object)->associatedDetectorElementIdentifier();
160 std::cout << "barrel_ec " << m_sctIdHelper.load()->barrel_ec(hitId)
161 << ", layer_disk " << m_sctIdHelper.load()->layer_disk(hitId) << ", phi_module " << m_sctIdHelper.load()->phi_module(hitId)
162 << ", eta_module " << m_sctIdHelper.load()->eta_module(hitId) << ", side " << m_sctIdHelper.load()->side(hitId) <<std::endl;
163 }
164 return true;
165}
std::atomic< const SCT_ID * > m_sctIdHelper

◆ reachableSurfaces()

bool InDet::SCT_OverlapDescriptor::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 SCT_OverlapDescriptor.cxx.

34{
35 // first add the target surface and the backside surface (in the if statement)
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
45 if (sElement) {
46
47 size_t newCapacity = cSurfaces.size() + 2;
48 if (m_robustMode and m_addMoreSurfaces and sElement->isBarrel()) {
49 // sum up the defined slices to evaluate the new capacity
50 // only uses one additional slice in phi
51 newCapacity += (2 + 6*m_etaSlices)*2;
52 } else if (m_robustMode) {
53 newCapacity += 16;
54 } else {
55 newCapacity += 6;
56 }
57 cSurfaces.reserve(newCapacity);
58
60 double surfacePhi = tsf.center().phi() + M_PI;
61 double positionPhi = pos.phi() + M_PI;
62
63 // now get the overlap options
64 addOtherSide(sElement, cSurfaces);
65
66 // 8-cell-connectivity depending on track/surface geometry
67 // nPhi - can be jump + or -
68 const InDetDD::SiDetectorElement* nElement = nullptr;
69
70 // robust mode --> return 9 (*2) surfaces
71 if (m_robustMode) {
72 addNextInPhiOS(sElement, cSurfaces);
73 addNextInEtaOS(sElement, cSurfaces);
74
75 addPrevInPhiOS(sElement, cSurfaces);
76 addPrevInEtaOS(sElement, cSurfaces);
77
78 nElement = sElement->nextInPhi();
79 addNextInEtaOS(nElement, cSurfaces);
80 addPrevInEtaOS(nElement, cSurfaces);
81
82 nElement = sElement->prevInPhi();
83 addNextInEtaOS(nElement, cSurfaces);
84 addPrevInEtaOS(nElement, cSurfaces);
85
86 if (m_addMoreSurfaces and sElement->isBarrel()) {
87 unsigned int next = 1;
88 const InDetDD::SiDetectorElement* currentElement = sElement->nextInEta();
89 while (currentElement and next<(unsigned int)m_etaSlices) {
90 addNextInEtaOS(currentElement,cSurfaces);
91 currentElement = currentElement->nextInEta();
92 if (currentElement) {
93 addNextInPhiOS(currentElement,cSurfaces);
94 addPrevInPhiOS(currentElement,cSurfaces);
95 }
96 next++;
97 }
98
99 unsigned int prev = 1;
100 currentElement = sElement->prevInEta();
101 while (currentElement and prev<(unsigned int)m_etaSlices) {
102 addPrevInEtaOS(currentElement,cSurfaces);
103 currentElement = currentElement->prevInEta();
104 if (currentElement) {
105 addNextInPhiOS(currentElement,cSurfaces);
106 addPrevInPhiOS(currentElement,cSurfaces);
107 }
108 prev++;
109 }
110 }
111
112 } else {
113 // get the phi information
114 if (surfacePhi < positionPhi) {
115 addNextInPhiOS(sElement, cSurfaces);
116 nElement = sElement->nextInPhi();
117 } else {
118 addPrevInPhiOS(sElement, cSurfaces);
119 nElement = sElement->prevInPhi();
120 }
121 // get the eta information - also possible
122 double positionEta = pos.eta();
123 double surfaceEta = tsf.center().eta();
124 int side = (sElement->isBarrel() || surfaceEta > 0.) ? 1 : -1;
125 // check the surface / position eta values
126 if (side * surfaceEta < side * positionEta) {
127 // we go next in eta for both, the original and the phi jumped one
128 addNextInEtaOS(sElement, cSurfaces);
129 addNextInEtaOS(nElement, cSurfaces);
130 } else {
131 // opposite direction
132 addPrevInEtaOS(sElement, cSurfaces);
133 addPrevInEtaOS(nElement, cSurfaces);
134 }
135 }
136 }
137
138 return false;
139}
#define M_PI
#define addOtherSide(cur, surfaces)
#define addNextInPhiOS(cur, surfaces)
#define addPrevInEtaOS(cur, surfaces)
#define addPrevInPhiOS(cur, surfaces)
#define addNextInEtaOS(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::SCT_OverlapDescriptor::m_addMoreSurfaces
private

Definition at line 94 of file SCT_OverlapDescriptor.h.

◆ m_etaSlices

int InDet::SCT_OverlapDescriptor::m_etaSlices
private

Definition at line 95 of file SCT_OverlapDescriptor.h.

◆ m_robustMode

bool InDet::SCT_OverlapDescriptor::m_robustMode
private

Definition at line 93 of file SCT_OverlapDescriptor.h.

◆ m_sctIdHelper

std::atomic<const SCT_ID*> InDet::SCT_OverlapDescriptor::m_sctIdHelper {nullptr}
mutableprivate

Definition at line 96 of file SCT_OverlapDescriptor.h.

96{nullptr};

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