ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
InDetTrackingGeometry
src
SCT_OverlapDescriptor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// SCT_OverlapDescriptor.cxx, (c) ATLAS Detector software
8
9
// Amg
10
#include "
GeoPrimitives/GeoPrimitives.h
"
11
// InDet
12
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
13
#include "
InDetTrackingGeometry/SCT_OverlapDescriptor.h
"
14
#include "
InDetIdentifier/SCT_ID.h
"
15
// Trk
16
#include "
TrkSurfaces/Surface.h
"
17
//
18
#include "
StoreGate/StoreGateSvc.h
"
19
20
InDet::SCT_OverlapDescriptor::SCT_OverlapDescriptor
(
bool
addMoreSurfaces,
int
eta_slices)
21
:
m_robustMode
(true),
22
m_addMoreSurfaces
(addMoreSurfaces),
23
m_etaSlices
(eta_slices)
24
{}
25
27
bool
28
InDet::SCT_OverlapDescriptor::reachableSurfaces
(
29
std::vector<Trk::SurfaceIntersection>& cSurfaces,
30
const
Trk::Surface
& tsf,
31
const
Amg::Vector3D
& pos,
32
const
Amg::Vector3D
&)
const
33
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
}
140
141
bool
InDet::SCT_OverlapDescriptor::dumpSurfaces
(std::vector<Trk::SurfaceIntersection>& surfaces)
const
{
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
}
166
M_PI
#define M_PI
Definition
ActiveFraction.h:14
GeoPrimitives.h
addOtherSide
#define addOtherSide(cur, surfaces)
Definition
PixelOverlapDescriptor.h:30
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
SCT_OverlapDescriptor.h
addNextInPhiOS
#define addNextInPhiOS(cur, surfaces)
Definition
SCT_OverlapDescriptor.h:35
addPrevInEtaOS
#define addPrevInEtaOS(cur, surfaces)
Definition
SCT_OverlapDescriptor.h:47
addPrevInPhiOS
#define addPrevInPhiOS(cur, surfaces)
Definition
SCT_OverlapDescriptor.h:39
addNextInEtaOS
#define addNextInEtaOS(cur, surfaces)
Definition
SCT_OverlapDescriptor.h:43
SiDetectorElement.h
StoreGateSvc.h
Surface.h
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDetDD::SiDetectorElement::prevInPhi
const SiDetectorElement * prevInPhi() const
InDetDD::SiDetectorElement::nextInPhi
const SiDetectorElement * nextInPhi() const
InDetDD::SiDetectorElement::prevInEta
const SiDetectorElement * prevInEta() const
InDetDD::SiDetectorElement::nextInEta
const SiDetectorElement * nextInEta() const
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
InDet::SCT_OverlapDescriptor::reachableSurfaces
bool reachableSurfaces(std::vector< Trk::SurfaceIntersection > &cSurfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
get the compatible surfaces
Definition
SCT_OverlapDescriptor.cxx:28
InDet::SCT_OverlapDescriptor::m_addMoreSurfaces
bool m_addMoreSurfaces
Definition
SCT_OverlapDescriptor.h:94
InDet::SCT_OverlapDescriptor::m_etaSlices
int m_etaSlices
Definition
SCT_OverlapDescriptor.h:95
InDet::SCT_OverlapDescriptor::dumpSurfaces
bool dumpSurfaces(std::vector< Trk::SurfaceIntersection > &surfaces) const
Definition
SCT_OverlapDescriptor.cxx:141
InDet::SCT_OverlapDescriptor::SCT_OverlapDescriptor
SCT_OverlapDescriptor(bool addMoreSurfaces=false, int eta_slices=4)
Constructor.
Definition
SCT_OverlapDescriptor.cxx:20
InDet::SCT_OverlapDescriptor::m_sctIdHelper
std::atomic< const SCT_ID * > m_sctIdHelper
Definition
SCT_OverlapDescriptor.h:96
InDet::SCT_OverlapDescriptor::m_robustMode
bool m_robustMode
Definition
SCT_OverlapDescriptor.h:93
SCT_ID
This is an Identifier helper class for the SCT subdetector.
Definition
SCT_ID.h:68
Trk::Surface
Abstract Base Class for tracking surfaces.
Definition
Surface.h:79
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Identifier
Definition
IdentifierFieldParser.cxx:14
Trk::DetectorElemType::Silicon
@ Silicon
Definition
TrkDetElementBase.h:41
Trk::Intersection
Definition
Intersection.h:24
Generated on
for ATLAS Offline Software by
1.17.0