ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::TrkClusterNode Class Reference

#include <TrkFilteringNodes.h>

Inheritance diagram for Trk::TrkClusterNode:
Collaboration diagram for Trk::TrkClusterNode:

Public Member Functions

 TrkClusterNode (TrkPlanarSurface *, double, const PrepRawData *)
 TrkClusterNode (TrkPlanarSurface *, double, double, double)
virtual ~TrkClusterNode ()
virtual void validateMeasurement (TrkTrackState *)
virtual void updateTrackState (TrkTrackState *)
virtual double getChi2Distance (TrkTrackState *)
virtual void serialize (char fileName[])
virtual void report ()
virtual void updateWithRIO (const RIO_OnTrack *)
virtual int getKalmanGain (double[5][2])
virtual int getResiduals (double[2])
virtual int getInverseResidualVariance (double[2][2])
virtual int getMeasurementMatrix (double[2][5])
virtual void runKalmanFilter (TrkTrackState *)
virtual double calculateChi2 ()
virtual bool isValidated ()
virtual void setNodeState (int)
virtual int getNodeState ()
virtual void setNodeType (char)
virtual char getNodeType ()
virtual void updateInternal ()
TrkTrackStategetTrackState ()
virtual TrkPlanarSurfacegetSurface ()
virtual const PrepRawDatagetPrepRawData ()
double getChi2 () const
int getNdof () const

Protected Attributes

double m_B [5]
double m_D
double m_H [5]
double m_K [5]
double m_resid
double m_m
double m_V
int m_nodeState
double m_chi2Cut
char m_nodeType
TrkPlanarSurfacem_pSurface
const PrepRawDatam_pPRD
double m_dChi2
int m_ndof
TrkTrackStatem_pTrackState

Detailed Description

Definition at line 67 of file TrkFilteringNodes.h.

Constructor & Destructor Documentation

◆ TrkClusterNode() [1/2]

Trk::TrkClusterNode::TrkClusterNode ( TrkPlanarSurface * pS,
double chi2Cut,
const PrepRawData * pPRD )

Definition at line 127 of file TrkFilteringNodes.cxx.

127 {
128 m_pSurface = pS;
129 m_chi2Cut = chi2Cut;
130 m_m = pPRD->localPosition()[0];
131 m_V = pPRD->localCovariance()(0, 0);
132 m_pPRD = pPRD;
133 m_nodeType = 2;
134 m_ndof = 1;
135 }
const PrepRawData * m_pPRD
Definition TrkBaseNode.h:55
TrkPlanarSurface * m_pSurface
Definition TrkBaseNode.h:54

◆ TrkClusterNode() [2/2]

Trk::TrkClusterNode::TrkClusterNode ( TrkPlanarSurface * pS,
double chi2Cut,
double pos,
double cov )

Definition at line 137 of file TrkFilteringNodes.cxx.

137 {
138 m_pSurface = pS;
139 m_chi2Cut = chi2Cut;
140 m_m = pos;
141 m_V = cov;
142 m_pPRD = nullptr;
143 m_nodeType = 2;
144 m_ndof = 1;
145 }

◆ ~TrkClusterNode()

virtual Trk::TrkClusterNode::~TrkClusterNode ( )
inlinevirtual

Definition at line 72 of file TrkFilteringNodes.h.

72{};

Member Function Documentation

◆ calculateChi2()

double Trk::TrkFilteringNode1D::calculateChi2 ( )
virtualinherited

Definition at line 33 of file TrkFilteringNodes.cxx.

◆ getChi2()

double Trk::TrkBaseNode::getChi2 ( ) const
inherited

Definition at line 69 of file TrkBaseNode.cxx.

69 {
70 return m_dChi2;
71 }

◆ getChi2Distance()

double Trk::TrkClusterNode::getChi2Distance ( TrkTrackState * pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 161 of file TrkFilteringNodes.cxx.

161 {
162 for (int i = 0; i < 5; i++) m_B[i] = pTS->getTrackCovariance(0, i);
163 m_H[0] = 1.0;
164 m_H[1] = 0.0;
165 m_H[2] = 0.0;
166 m_H[3] = 0.0;
167 m_H[4] = 0.0;
168 m_D = 1.0 / (pTS->getTrackCovariance(0, 0) + m_V);
169 m_resid = m_m - pTS->getTrackState(0);
170 return calculateChi2();
171 }

◆ getInverseResidualVariance()

int Trk::TrkFilteringNode1D::getInverseResidualVariance ( double V[2][2])
virtualinherited

Implements Trk::TrkBaseNode.

Definition at line 63 of file TrkFilteringNodes.cxx.

63 {
64 V[0][0] = m_D;
65 return 1;
66 }

◆ getKalmanGain()

int Trk::TrkFilteringNode1D::getKalmanGain ( double K[5][2])
virtualinherited

Implements Trk::TrkBaseNode.

Definition at line 51 of file TrkFilteringNodes.cxx.

51 {
52 int i;
53
54 for (i = 0; i < 5; i++) K[i][0] = m_K[i];
55 return 1;
56 }

◆ getMeasurementMatrix()

int Trk::TrkFilteringNode1D::getMeasurementMatrix ( double H[2][5])
virtualinherited

Implements Trk::TrkBaseNode.

Definition at line 68 of file TrkFilteringNodes.cxx.

68 {
69 int i;
70
71 for (i = 0; i < 5; i++) H[0][i] = m_H[i];
72 return 1;
73 }
#define H(x, y, z)
Definition MD5.cxx:114

◆ getNdof()

int Trk::TrkBaseNode::getNdof ( ) const
inherited

Definition at line 65 of file TrkBaseNode.cxx.

65 {
66 return m_ndof;
67 }

◆ getNodeState()

int Trk::TrkBaseNode::getNodeState ( )
virtualinherited

Definition at line 53 of file TrkBaseNode.cxx.

53 {
54 return m_nodeState;
55 }

◆ getNodeType()

char Trk::TrkBaseNode::getNodeType ( )
virtualinherited

Definition at line 61 of file TrkBaseNode.cxx.

61 {
62 return m_nodeType;
63 }

◆ getPrepRawData()

const PrepRawData * Trk::TrkBaseNode::getPrepRawData ( )
virtualinherited

Definition at line 39 of file TrkBaseNode.cxx.

39 {
40 return m_pPRD;
41 }

◆ getResiduals()

int Trk::TrkFilteringNode1D::getResiduals ( double r[2])
virtualinherited

Implements Trk::TrkBaseNode.

Definition at line 58 of file TrkFilteringNodes.cxx.

58 {
59 r[0] = m_resid;
60 return 1;
61 }
int r
Definition globals.cxx:22

◆ getSurface()

TrkPlanarSurface * Trk::TrkBaseNode::getSurface ( )
virtualinherited

Definition at line 35 of file TrkBaseNode.cxx.

35 {
36 return m_pSurface;
37 }

◆ getTrackState()

TrkTrackState * Trk::TrkBaseNode::getTrackState ( )
inherited

Definition at line 43 of file TrkBaseNode.cxx.

43 {
44 return m_pTrackState;
45 }
TrkTrackState * m_pTrackState
Definition TrkBaseNode.h:58

◆ isValidated()

bool Trk::TrkBaseNode::isValidated ( )
virtualinherited

Definition at line 31 of file TrkBaseNode.cxx.

31 {
32 return (m_nodeState != 0);
33 }

◆ report()

virtual void Trk::TrkClusterNode::report ( )
inlinevirtual

Implements Trk::TrkBaseNode.

Definition at line 77 of file TrkFilteringNodes.h.

77{};

◆ runKalmanFilter()

void Trk::TrkFilteringNode1D::runKalmanFilter ( TrkTrackState * pTS)
virtualinherited

Definition at line 37 of file TrkFilteringNodes.cxx.

37 {
38 int i, j, idx = 0;
39 double updState[5], updCov[15];
40
41 for (i = 0; i < 5; i++) m_K[i] = m_D * m_B[i];
42 for (i = 0; i < 5; i++) updState[i] = m_K[i] * m_resid;
43 pTS->updateTrackState(updState);
44 for (i = 0; i < 5; i++) for (j = i; j < 5; j++) {
45 updCov[idx] = -m_K[i] * m_B[j];
46 idx++;
47 }
48 pTS->updateTrackCovariance(updCov);
49 }
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ serialize()

void Trk::TrkClusterNode::serialize ( char fileName[])
virtual

Implements Trk::TrkBaseNode.

Definition at line 147 of file TrkFilteringNodes.cxx.

147 {
148 FILE* pFile = fopen(fileName, "a");
149 if (!pFile) {
150 std::cerr << "Cannot open file " << fileName << " for write.\n";
151 std::abort();
152 }
153 fclose(pFile);
154 }

◆ setNodeState()

void Trk::TrkBaseNode::setNodeState ( int s)
virtualinherited

Definition at line 49 of file TrkBaseNode.cxx.

49 {
50 m_nodeState = s;
51 }

◆ setNodeType()

void Trk::TrkBaseNode::setNodeType ( char s)
virtualinherited

Definition at line 57 of file TrkBaseNode.cxx.

57 {
58 m_nodeType = s;
59 }

◆ updateInternal()

void Trk::TrkBaseNode::updateInternal ( )
virtualinherited

Reimplemented in Trk::TrkTrtNode.

Definition at line 73 of file TrkBaseNode.cxx.

73 {
74 }

◆ updateTrackState()

void Trk::TrkClusterNode::updateTrackState ( TrkTrackState * pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 173 of file TrkFilteringNodes.cxx.

173 {
174 if (isValidated()) runKalmanFilter(pTS);
175 m_pTrackState = pTS;
176 }
virtual bool isValidated()
virtual void runKalmanFilter(TrkTrackState *)

◆ updateWithRIO()

void Trk::TrkClusterNode::updateWithRIO ( const RIO_OnTrack * pRIO)
virtual

Implements Trk::TrkBaseNode.

Definition at line 178 of file TrkFilteringNodes.cxx.

178 {
179 /*
180 printf("RIO update, SCT cluster: old m=%f new m=%f old V=%f new V=%f\n",
181 m_m,pRIO->localParameters()[Trk::locX],sqrt(m_V),
182 sqrt(pRIO->localErrorMatrix().localCovariance()[0][0]));
183 */
184 m_m = pRIO->localParameters()[Trk::locX];
185 m_V = pRIO->localCovariance()(0, 0);
186 }
@ locX
Definition ParamDefs.h:37

◆ validateMeasurement()

void Trk::TrkClusterNode::validateMeasurement ( TrkTrackState * pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 156 of file TrkFilteringNodes.cxx.

156 {
158 m_nodeState = (m_dChi2 < m_chi2Cut) ? 1 : 0;
159 }
virtual double getChi2Distance(TrkTrackState *)

Member Data Documentation

◆ m_B

double Trk::TrkFilteringNode1D::m_B[5]
protectedinherited

Definition at line 43 of file TrkFilteringNodes.h.

◆ m_chi2Cut

double Trk::TrkBaseNode::m_chi2Cut
protectedinherited

Definition at line 52 of file TrkBaseNode.h.

◆ m_D

double Trk::TrkFilteringNode1D::m_D
protectedinherited

Definition at line 43 of file TrkFilteringNodes.h.

◆ m_dChi2

double Trk::TrkBaseNode::m_dChi2
protectedinherited

Definition at line 56 of file TrkBaseNode.h.

◆ m_H

double Trk::TrkFilteringNode1D::m_H[5]
protectedinherited

Definition at line 43 of file TrkFilteringNodes.h.

◆ m_K

double Trk::TrkFilteringNode1D::m_K[5]
protectedinherited

Definition at line 43 of file TrkFilteringNodes.h.

◆ m_m

double Trk::TrkFilteringNode1D::m_m
protectedinherited

Definition at line 45 of file TrkFilteringNodes.h.

◆ m_ndof

int Trk::TrkBaseNode::m_ndof
protectedinherited

Definition at line 57 of file TrkBaseNode.h.

◆ m_nodeState

int Trk::TrkBaseNode::m_nodeState
protectedinherited

Definition at line 51 of file TrkBaseNode.h.

◆ m_nodeType

char Trk::TrkBaseNode::m_nodeType
protectedinherited

Definition at line 53 of file TrkBaseNode.h.

◆ m_pPRD

const PrepRawData* Trk::TrkBaseNode::m_pPRD
protectedinherited

Definition at line 55 of file TrkBaseNode.h.

◆ m_pSurface

TrkPlanarSurface* Trk::TrkBaseNode::m_pSurface
protectedinherited

Definition at line 54 of file TrkBaseNode.h.

◆ m_pTrackState

TrkTrackState* Trk::TrkBaseNode::m_pTrackState
protectedinherited

Definition at line 58 of file TrkBaseNode.h.

◆ m_resid

double Trk::TrkFilteringNode1D::m_resid
protectedinherited

Definition at line 44 of file TrkFilteringNodes.h.

◆ m_V

double Trk::TrkFilteringNode1D::m_V
protectedinherited

Definition at line 46 of file TrkFilteringNodes.h.


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