Jpp 20.0.0-rc.9-29-gccc23c492-D
the software that should make you happy
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
JFIT::JMatrixNZ Class Reference

Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z). More...

#include <JMatrixNZ.hh>

Inheritance diagram for JFIT::JMatrixNZ:

Classes

struct  variance
 Auxiliary data structure for co-variance calculation. More...
 

Public Member Functions

 JMatrixNZ ()
 Default contructor.
 
template<class T >
 JMatrixNZ (const JVector3D &pos, T __begin, T __end, const double alpha, const double sigma)
 Constructor.
 
template<class T >
void set (const JVector3D &pos, T __begin, T __end, const double alpha, const double sigma)
 Set co-variance matrix.
 

Static Private Member Functions

static double getDot (const variance &first, const variance &second)
 Get dot product.
 

Private Attributes

std::vector< variancebuffer
 

Detailed Description

Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z).

In this, the given angular and time resolution are taken into account.

Definition at line 28 of file JMatrixNZ.hh.

Constructor & Destructor Documentation

◆ JMatrixNZ() [1/2]

JFIT::JMatrixNZ::JMatrixNZ ( )
inline

Default contructor.

Definition at line 39 of file JMatrixNZ.hh.

39 :
40 JMatrixNS()
41 {}

◆ JMatrixNZ() [2/2]

template<class T >
JFIT::JMatrixNZ::JMatrixNZ ( const JVector3D & pos,
T __begin,
T __end,
const double alpha,
const double sigma )
inline

Constructor.

The template argument T refers to an iterator of a data structure which should have the following member methods:

  • double getX(); // [m]
  • double getY(); // [m]
  • double getZ(); // [m]
Parameters
posreference position [m]
__beginbegin of data
__endend of data
alphaangular resolution [deg]
sigmatime resolution [ns]

Definition at line 59 of file JMatrixNZ.hh.

63 :
64 JMatrixNS()
65 {
66 set(pos, __begin, __end, alpha, sigma);
67 }
void set(const JVector3D &pos, T __begin, T __end, const double alpha, const double sigma)
Set co-variance matrix.
Definition JMatrixNZ.hh:85

Member Function Documentation

◆ set()

template<class T >
void JFIT::JMatrixNZ::set ( const JVector3D & pos,
T __begin,
T __end,
const double alpha,
const double sigma )
inline

Set co-variance matrix.

The template argument T refers to an iterator of a data structure which should have the following member methods:

  • double getX(); // [m]
  • double getY(); // [m]
  • double getZ(); // [m]
Parameters
posreference position [m]
__beginbegin of data
__endend of data
alphaangular resolution [deg]
sigmatime resolution [ns]

Definition at line 85 of file JMatrixNZ.hh.

90 {
91 using namespace std;
92 using namespace JPP;
93
94
95 const int N = distance(__begin, __end);
96
97 this ->resize(N);
98 buffer.resize(N);
99
100 const double ta = alpha * PI / 180.0;
101 const double ct = cos(ta);
102 const double st = sin(ta);
103
104
105 // angular resolution
106
107 for (T i = __begin; i != __end; ++i) {
108
109 const double dx = i->getX() - pos.getX();
110 const double dy = i->getY() - pos.getY();
111 const double dz = i->getZ() - pos.getZ();
112
113 const double R = sqrt(dx*dx + dy*dy);
114
115 double x = ta * getKappaC() * getInverseSpeedOfLight();
116 double y = ta * getKappaC() * getInverseSpeedOfLight();
117 double v = ta * getInverseSpeedOfLight();
118 double w = ta * getInverseSpeedOfLight();
119
120 if (R != 0.0) {
121 x *= dx / R;
122 y *= dy / R;
123 }
124
125 x *= (dz*ct - dx*st);
126 y *= (dz*ct - dy*st);
127 v *= -(dx*ct + dz*st);
128 w *= -(dy*ct + dz*st);
129
130 buffer[distance(__begin,i)] = variance(x, y, v, w);
131 }
132
133 for (int i = 0; i != N; ++i) {
134
135 for (int j = 0; j != i; ++j) {
136 (*this)(i, j) = getDot(buffer[i], buffer[j]);
137 (*this)(j, i) = (*this)(i, j);
138 }
139
140 (*this)(i, i) = getDot(buffer[i], buffer[i]) + sigma * sigma;
141 }
142 }
std::vector< variance > buffer
Definition JMatrixNZ.hh:186
static double getDot(const variance &first, const variance &second)
Get dot product.
Definition JMatrixNZ.hh:196

◆ getDot()

static double JFIT::JMatrixNZ::getDot ( const variance & first,
const variance & second )
inlinestaticprivate

Get dot product.

Parameters
firstfirst variance
secondsecond variance
Returns
dot product

Definition at line 196 of file JMatrixNZ.hh.

197 {
198 return (first.x * second.x +
199 first.y * second.y +
200 first.v * second.v +
201 first.w * second.w);
202
203 }

Member Data Documentation

◆ buffer

std::vector<variance> JFIT::JMatrixNZ::buffer
private

Definition at line 186 of file JMatrixNZ.hh.


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