#include "smatrix/SVector.hh"
#include "smatrix/Functions.hh"
#include "smatrix/SVertex.hh"
#include "smatrix/BinaryOperators.hh"
Go to the source code of this file.
|
template<unsigned int NTR> |
double | Chi2distance (const SVertex< NTR > &v, const SVector< double, 3 > &x) |
|
template<unsigned int NTR, unsigned int NTR2> |
double | Chi2distance (const SVertex< NTR > &v1, const SVertex< NTR2 > &v2) |
|
double | Chi2distance (const Track &t1, const Track &t2) |
|
double | Sdistance (const SVector< double, 3 > &x1, const SVector< double, 3 > &x2) |
|
double | Sdistance (const Vertex &v, const SVector< double, 3 > &x) |
|
double | Sdistance (const Vertex &v1, const Vertex &v2) |
|
double | SGNdistance (const Track &t, const Vertex &v) |
|
double | SGNVVdistance (const Vertex &v1, const Vertex &v2) |
|
double | Tdistance (const Track &t1, const Track &t2) |
|
double | TVdistance (const Track &t, const Vertex &v) |
|
◆ Chi2distance() [1/3]
template<unsigned int NTR>
double Chi2distance |
( |
const SVertex< NTR > & |
v, |
|
|
const SVector< double, 3 > & |
x |
|
) |
| |
|
inline |
$\chi^2$ distance between SVertex and space point.\ Assumption: SVertex has been fitted with findVertexVt().
197 {
199}
T product(const SMatrix< T, D > &lhs, const SVector< T, D > &rhs)
Definition: MatrixFunctions.hh:451
const SKalman< NTR > & kalman(unsigned int i) const
read only access to Kalman objects
const SVector< double, 3 > & vposR() const
vertex position $\vec{v} = (v_x,v_y,v_z)$ (fast readonly access)
◆ Chi2distance() [2/3]
template<unsigned int NTR, unsigned int NTR2>
double Chi2distance |
( |
const SVertex< NTR > & |
v1, |
|
|
const SVertex< NTR2 > & |
v2 |
|
) |
| |
|
inline |
$\chi^2$ distance between two SVertex objects.\ Assumption: Both SVertex objects have been fitted with findVertexVt().
208 {
212
213 if(Cmat.
sinvert() ==
false) {
return 1.e10; }
214
217}
bool sinvert()
invert symmetric, pos. def. Matrix via Dsinv
◆ Chi2distance() [3/3]
double Chi2distance |
( |
const Track & |
t1, |
|
|
const Track & |
t2 |
|
) |
| |
|
inline |
$\chi^2$ distance between two tracks. Determined by Kalman filter vertex fit.
182 {
184 if(vtx.findVertexVt() == true)
185 return vtx.chi2();
186 else
187 return 1.e10;
188}
Definition: SVertex.hh:73
◆ Sdistance() [1/3]
double Sdistance |
( |
const SVector< double, 3 > & |
x1, |
|
|
const SVector< double, 3 > & |
x2 |
|
) |
| |
|
inline |
Spatial distance between two space points. \begin{displaymath} d = |\vec{x}_1 - \vec{x}_2| \end{displaymath}
45 {
47}
T mag(const SVector< T, D > &rhs)
Definition: Functions.hh:216
◆ Sdistance() [2/3]
double Sdistance |
( |
const Vertex & |
v, |
|
|
const SVector< double, 3 > & |
x |
|
) |
| |
|
inline |
Spatial distance between Vertex and space point. \begin{displaymath} d = |\vec{x}_v - \vec{x}| \end{displaymath}
81 {
82 return mag(v.vpos() - x);
83}
◆ Sdistance() [3/3]
double Sdistance |
( |
const Vertex & |
v1, |
|
|
const Vertex & |
v2 |
|
) |
| |
|
inline |
Spatial distance between two Vertex objects. \begin{displaymath} d = |\vec{v}_1 - \vec{v}_2| \end{displaymath}
57 {
58 return mag(v1.vpos() - v2.vpos());
59}
◆ SGNdistance()
double SGNdistance |
( |
const Track & |
t, |
|
|
const Vertex & |
v |
|
) |
| |
|
inline |
Closest spatial distance between Track and Wire. \begin{displaymath} d = \frac{(\vec{t}_w\times\vec{t}_t) \cdot (\vec{x}_t - \vec{x}_w)}{|\vec{t}_w\times\vec{t}_t|^2} \end{displaymath} $g: \vec{x}_t + m\cdot\vec{t}_t$ track definition\ $w: \vec{x}_w + m'\cdot\vec{t}_w$ wire definition Signed closest distance between Track and Vertex object. The sign is determined by the z component and tells whether the point of closest approach is upstream or downstream of the vertex position. \begin{displaymath} \rho = \frac{\vec{t}\cdot(\vec{x}_t-\vec{x}_v)}{|\vec{t}|} \end{displaymath} \begin{displaymath} d\vec{x} = \vec{x}_t - \rho\cdot\vec{t} - \vec{x}_v \end{displaymath} \begin{displaymath} d = \textrm{sgn}(d\vec{x}_z)\cdot|d\vec{x}| \end{displaymath} $g: \vec{x}_t + m\cdot\vec{t}$ track definition\ $\vec{x}_v$: vertex position\ $\vec{x}_t - \rho\cdot\vec{t}$: point of track closest to vertex
169 {
170
172 t.xvec() -
t.tvec() *
dot(
t.evec(),
t.xvec()-v.vpos()) - v.vpos();
174}
T dot(const SVector< T, D > &lhs, const SVector< T, D > &rhs)
Definition: Functions.hh:132
const int sign(const T &x)
Definition: Functions.hh:97
TTree * t
Definition: check_shower.C:4
◆ SGNVVdistance()
double SGNVVdistance |
( |
const Vertex & |
v1, |
|
|
const Vertex & |
v2 |
|
) |
| |
|
inline |
Signed spatial distance between two Vertex objects. \begin{displaymath} d = |\vec{v}_1 - \vec{v}_2|\times\texttt{sgn}(v_{z,1} - v_{z,2}) \end{displaymath}
69 {
70 return mag(v1.vpos() - v2.vpos()) *
sign(v1.vpos()[2] - v2.vpos()[2]);
71}
◆ Tdistance()
double Tdistance |
( |
const Track & |
t1, |
|
|
const Track & |
t2 |
|
) |
| |
|
inline |
Clostest spatial distance between two Track objects. \begin{eqnarray*} d\vec{x} = \vec{x}_2 - \vec{x}_1\ f_1 = d\vec{x}\cdot\frac{\vec{t}_1}{|\vec{t}_1|}\ f_2 = d\vec{x}\cdot\frac{\vec{t}_2}{|\vec{t}_2|} \end{eqnarray*} \begin{displaymath} d = \left| d\vec{x} + f_2\cdot\frac{\vec{t}_2}{|\vec{t}_2|} - f_1\cdot\frac{\vec{t}_1}{|\vec{t}_1|}\right| \end{displaymath} $g: \vec{x}_1 + m\cdot\vec{t}_1$ track definition 1st track\ $g: \vec{x}_2 + m'\cdot\vec{t}_2$ track definition 2nd track\
115 {
116 const double a = t1.tx();
117 const double b = t1.ty();
118 const double c = 1;
119 const double a1 = t2.tx();
120 const double b1 = t2.ty();
122
125
126 if(det==0)
return mag(
cross(dx,t1.evec()));
127
128 const double det2 = dx[0]*(b*
c1 - c*b1) + dx[1]*(c*a1 -
a*
c1) + dx[2]*(
a*b1 - b*a1);
129
130 return fabs(det2/sqrt(det));
131}
SVector< T, 3 > cross(const SVector< T, 3 > &lhs, const SVector< T, 3 > &rhs)
Definition: Functions.hh:283
const T square(const T &x)
Definition: Functions.hh:46
Expr< UnaryOp< Fabs< T >, Expr< A, T, D >, T >, T, D > fabs(const Expr< A, T, D > &rhs)
Definition: UnaryOperators.hh:96
void a()
Definition: check_aligned.C:59
TCanvas * c1
Definition: energy.C:13
◆ TVdistance()
double TVdistance |
( |
const Track & |
t, |
|
|
const Vertex & |
v |
|
) |
| |
|
inline |
Clostest spatial distance between Track and Vertex object. \begin{displaymath} d = \frac{|(\vec{x}_t - \vec{x}_v) \times \vec{t}|}{|\vec{t}|} \end{displaymath} $g: \vec{x}_t + m\cdot\vec{t}$ track definition\ $\vec{x}_v$: vertex position
95 {
96 return mag(
cross(
t.xvec()-v.vpos(),
t.evec()));
97}