ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
InDetTrackingGeometry
src
TRT_OverlapDescriptor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// TRT_OverlapDescriptor.cxx, (c) ATLAS Detector software
8
9
// InDet
10
#include "
InDetTrackingGeometry/TRT_OverlapDescriptor.h
"
11
#include "
TRT_ReadoutGeometry/TRT_BaseElement.h
"
12
// Trk
13
#include "
TrkSurfaces/Surface.h
"
14
#include "
TrkSurfaces/SurfaceBounds.h
"
15
17
bool
18
InDet::TRT_OverlapDescriptor::reachableSurfaces
(
19
std::vector<Trk::SurfaceIntersection>& cSurfaces,
20
const
Trk::Surface
& tsf,
21
const
Amg::Vector3D
& position,
22
const
Amg::Vector3D
& momentum)
const
23
24
{
25
const
Amg::Vector3D
dir = momentum.unit();
26
// first add the target surface - if it fits
27
int
nextInt =
checkAndFill
(cSurfaces, tsf, position, dir);
28
if
(!nextInt)
29
return
true
;
30
31
// make sure we have the correct associated element
32
const
auto
* tmp = tsf.
associatedDetectorElement
();
33
const
InDetDD::TRT_BaseElement
* trtBaseElement =
34
tmp->detectorType() ==
Trk::DetectorElemType::TRT
35
?
static_cast<
const
InDetDD::TRT_BaseElement
*
>
(tmp)
36
:
nullptr
;
37
38
// we have a trt base element
39
if
(trtBaseElement) {
40
41
Identifier
strawID = tsf.
associatedDetectorElementIdentifier
();
42
43
// straw Max
44
int
strawMax = trtBaseElement->
nStraws
() - 1;
45
int
strawInt =
m_trtIdHelper
->straw(strawID);
46
47
if
(strawInt != 0 && strawInt < strawMax && strawMax != -999) {
48
// get the next straw
49
Identifier
nextID =
50
m_trtIdHelper
->straw_id(trtBaseElement->
identify
(), strawInt + nextInt);
51
const
Trk::Surface
* nextStraw = (strawInt > 1 && strawInt < strawMax)
52
? (&(trtBaseElement->
surface
(nextID)))
53
:
nullptr
;
54
if
(nextStraw)
55
nextInt =
checkAndFill
(cSurfaces, *nextStraw, position, dir);
56
}
57
}
58
59
return
true
;
60
}
61
62
int
63
InDet::TRT_OverlapDescriptor::checkAndFill
(
64
std::vector<Trk::SurfaceIntersection>& cSurfaces,
65
const
Trk::Surface
& sf,
66
const
Amg::Vector3D
& pos,
67
const
Amg::Vector3D
& dir)
const
68
{
69
Trk::Intersection
sfIntersection =
70
sf.straightLineIntersection(pos, dir,
false
,
false
);
71
// we have a valid intersection - is it within tolerance ?
72
if
(sfIntersection.
valid
) {
73
// this is the boundary cylinder of the straw surface
74
double
rSurface2 = sf.bounds().r() * sf.bounds().r();
75
// what's the distance - hess' normal form
76
const
Amg::Vector3D
& sCenter = sf.center();
77
const
Amg::Vector3D
sDirection = sf.transform().rotation().col(2);
78
// d^2 = | (dir) x
79
double
d2 =
80
(sDirection.cross((sfIntersection.
position
- sCenter))).squaredNorm();
81
// check it
82
bool
acceptSurface =
83
d2 < (
m_outsideTolerance
*
m_outsideTolerance
* rSurface2);
84
if
(acceptSurface)
85
cSurfaces.emplace_back(sfIntersection, &sf);
86
// give the break signal if it's really inside
87
return
(d2 < (
m_breakTolerance
*
m_breakTolerance
* rSurface2)
88
? 0
89
: (sfIntersection.
position
.phi() > sf.center().phi() ? 1 : -1));
90
}
91
// base the decision on the position phi value
92
return
(pos.phi() > sf.center().phi() ? 1 : -1);
93
}
SurfaceBounds.h
Surface.h
TRT_BaseElement.h
TRT_OverlapDescriptor.h
InDetDD::TRT_BaseElement
Virtual base class of TRT readout elements.
Definition
TRT_BaseElement.h:56
InDetDD::TRT_BaseElement::nStraws
unsigned int nStraws() const
Number of straws in the element.
InDetDD::TRT_BaseElement::identify
virtual Identifier identify() const override final
identifier of this detector element:
InDetDD::TRT_BaseElement::surface
virtual const Trk::Surface & surface() const override final
Element Surface: access to the Surface (straw layer).
InDet::TRT_OverlapDescriptor::m_outsideTolerance
double m_outsideTolerance
accept even if it outside the bounds by this tolerance
Definition
TRT_OverlapDescriptor.h:71
InDet::TRT_OverlapDescriptor::m_breakTolerance
double m_breakTolerance
if the straight line intersection is within this fraction of the bounds - don't look for neighbours
Definition
TRT_OverlapDescriptor.h:70
InDet::TRT_OverlapDescriptor::checkAndFill
int checkAndFill(std::vector< Trk::SurfaceIntersection > &cSurfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
Definition
TRT_OverlapDescriptor.cxx:63
InDet::TRT_OverlapDescriptor::m_trtIdHelper
const TRT_ID * m_trtIdHelper
the Id helper
Definition
TRT_OverlapDescriptor.h:69
InDet::TRT_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
TRT_OverlapDescriptor.cxx:18
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::associatedDetectorElementIdentifier
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Identifier
Definition
IdentifierFieldParser.cxx:14
Trk::DetectorElemType::TRT
@ TRT
Definition
TrkDetElementBase.h:42
Trk::Intersection
Definition
Intersection.h:24
Trk::Intersection::valid
bool valid
Definition
Intersection.h:28
Trk::Intersection::position
Amg::Vector3D position
Definition
Intersection.h:25
Generated on
for ATLAS Offline Software by
1.17.0