ATLAS Offline Software
Loading...
Searching...
No Matches
BoundaryCheck.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6// BoundaryCheck.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_BOUNDARYCHECK_H
10#define TRKSURFACES_BOUNDARYCHECK_H
11
15namespace Trk {
16
33
34// maint struct for comparing the extent of arbitrary convex polygons relative to prefixed axes
35struct KDOP
36{
37 float min;
38 // Minimum distance (from origin) along axes
39 float max;
40 // Maximum distance (from origin) along axes
41};
42
43// struct needed for FastSinCos method (see below)
45{
46 double sinC;
47 double cosC;
48};
49
51{
52 // saves us a lot of function calls in the EllipseToPoly method
53 static constexpr double s_cos22 = 0.923879532511286756128183189396788286822416625863642486115097;
54 static constexpr double s_cos45 = 0.707106781186547524400844362104849039284835937688474036588339;
55 static constexpr double s_cos67 = 0.382683432365089771728459984030398866761344562485627041433800;
56
57public:
59 {
62 };
63
64
65 bool checkLoc1;
66 bool checkLoc2;
67 int nSigmas;
71 AmgSymMatrix(2) lCovariance;
72
73
75 BoundaryCheck(bool sCheck)
76 : checkLoc1(sCheck)
77 , checkLoc2(sCheck)
78 , nSigmas(-1)
79 , toleranceLoc1(0.)
80 , toleranceLoc2(0.)
82 , lCovariance(AmgSymMatrix(2)::Identity())
83 {}
84
86 BoundaryCheck(bool chkL1, bool chkL2, double tloc1 = 0., double tloc2 = 0.)
87 : checkLoc1(chkL1)
88 , checkLoc2(chkL2)
89 , nSigmas(-1)
90 , toleranceLoc1(tloc1)
91 , toleranceLoc2(tloc2)
93 , lCovariance(AmgSymMatrix(2)::Identity())
94 {}
95
97 BoundaryCheck(const AmgSymMatrix(2) & lCov, int nsig = 1, bool chkL1 = true, bool chkL2 = true)
98 : checkLoc1(chkL1)
99 , checkLoc2(chkL2)
100 , nSigmas(nsig)
101 , toleranceLoc1(0.)
102 , toleranceLoc2(0.)
104 , lCovariance(lCov)
105 {}
106
108 operator bool() const { return (checkLoc1 || checkLoc2); }
109
112 void ComputeKDOP(const std::vector<Amg::Vector2D> &v, const std::vector<Amg::Vector2D> &KDOPAxes,
113 std::vector<KDOP>& kdop) const;
114
115 std::vector<Amg::Vector2D> EllipseToPoly(int resolution = 3) const;
116
117 bool TestKDOPKDOP(const std::vector<KDOP>& a, const std::vector<KDOP>& b) const;
118
119 double FastArcTan(double x) const;
120
121 sincosCache FastSinCos(double x) const;
122};
123
124}
125
127#endif // TRKSURFACES_BOUNDARYCHECK_H
#define AmgSymMatrix(dim)
static Double_t a
BoundaryCheck(bool sCheck)
Constructor for single boolean behavious.
BoundaryCheck(bool chkL1, bool chkL2, double tloc1=0., double tloc2=0.)
Constructor for tolerance based check.
int nSigmas
allowed sigmas for chi2 boundary check
AmgSymMatrix(2) lCovariance
local covariance matrix
BoundaryCheckType bcType
std::vector< Amg::Vector2D > EllipseToPoly(int resolution=3) const
bool TestKDOPKDOP(const std::vector< KDOP > &a, const std::vector< KDOP > &b) const
void ComputeKDOP(const std::vector< Amg::Vector2D > &v, const std::vector< Amg::Vector2D > &KDOPAxes, std::vector< KDOP > &kdop) const
Each Bounds has a method inside, which checks if a LocalPosition is inside the bounds.
double toleranceLoc2
absolute tolerance in local 2 coordinate
bool checkLoc2
check local 2 coordinate
bool checkLoc1
check local 1 coordinate
static constexpr double s_cos67
@ chi2corr
relative (chi2 based) with full correlations
@ absolute
absolute check including tolerances
BoundaryCheck(const AmgSymMatrix(2) &lCov, int nsig=1, bool chkL1=true, bool chkL2=true)
Constructor for chi2 based check.
double FastArcTan(double x) const
static constexpr double s_cos45
sincosCache FastSinCos(double x) const
static constexpr double s_cos22
double toleranceLoc1
absolute tolerance in local 1 coordinate
Ensure that the ATLAS eigen extensions are properly loaded.
@ x
Definition ParamDefs.h:55
@ v
Definition ParamDefs.h:78