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

#include <TrkFilteringNodes.h>

Inheritance diagram for Trk::TrkTrtNode:
Collaboration diagram for Trk::TrkTrtNode:

Public Member Functions

 TrkTrtNode (TrkPlanarSurface *, double, double, double, const PrepRawData *)
virtual ~TrkTrtNode ()
virtual void validateMeasurement (TrkTrackState *)
virtual void updateTrackState (TrkTrackState *)
virtual double getChi2Distance (TrkTrackState *)
virtual void serialize (char fileName[])
virtual void updateInternal ()
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 ()
TrkTrackState * getTrackState ()
virtual TrkPlanarSurface * getSurface ()
virtual const PrepRawData * getPrepRawData ()
double getChi2 () const
int getNdof () const

Protected Attributes

double m_minBound
double m_maxBound
char m_lrSign
bool m_freezeLR
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
TrkPlanarSurface * m_pSurface
const PrepRawData * m_pPRD
double m_dChi2
int m_ndof
TrkTrackState * m_pTrackState

Detailed Description

Definition at line 112 of file TrkFilteringNodes.h.

Constructor & Destructor Documentation

◆ TrkTrtNode()

Trk::TrkTrtNode::TrkTrtNode ( TrkPlanarSurface * pS,
double chi2Cut,
double lmin,
double lmax,
const PrepRawData * pPRD )

Definition at line 416 of file TrkFilteringNodes.cxx.

418 : m_minBound(lmin), m_maxBound(lmax), m_lrSign(0), m_freezeLR(false) {
419 m_pSurface = pS;
420 m_chi2Cut = chi2Cut;
421 m_m = pPRD->localPosition()[0];
422 m_V = pPRD->localCovariance()(0, 0);
423
424 m_pPRD = pPRD;
425 m_nodeType = 3;
426 m_ndof = 1;
427 }
const PrepRawData * m_pPRD
Definition TrkBaseNode.h:55
TrkPlanarSurface * m_pSurface
Definition TrkBaseNode.h:54

◆ ~TrkTrtNode()

virtual Trk::TrkTrtNode::~TrkTrtNode ( )
inlinevirtual

Definition at line 116 of file TrkFilteringNodes.h.

116{};

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::TrkTrtNode::getChi2Distance ( TrkTrackState * pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 445 of file TrkFilteringNodes.cxx.

445 {
446 int i;
447 double tx, lV[3], V[3], corr;
448
449 //double lP[3],P[3];
450
451 if (!m_freezeLR) m_lrSign = (pTS->getTrackState(0) < 0.0) ? -1 : 1;
452 V[0] = sin(pTS->getTrackState(3)) * cos(pTS->getTrackState(2));
453 V[1] = sin(pTS->getTrackState(3)) * sin(pTS->getTrackState(2));
454 V[2] = cos(pTS->getTrackState(3));
455 //lP[0]=pTS->getTrackState(0);
456 //lP[1]=pTS->getTrackState(1);
457 //lP[2]=0.0;
458 //pTS->getSurface()->transformPointToGlobal(lP,P);
459 pTS->getSurface()->rotateVectorToLocal(V, lV);
460 tx = lV[0] / lV[2];
461 corr = 1.0 / sqrt(1.0 + tx * tx);
462 for (i = 0; i < 5; i++) m_B[i] = corr * pTS->getTrackCovariance(0, i);
463 m_H[0] = corr;
464 m_H[1] = 0.0;
465 m_H[2] = 0.0;
466 m_H[3] = 0.0;
467 m_H[4] = 0.0;
468 m_D = 1.0 / (corr * corr * pTS->getTrackCovariance(0, 0) + m_V);
469 m_resid = m_lrSign * m_m - corr * pTS->getTrackState(0);
470 return calculateChi2();
471 }

◆ 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::TrkTrtNode::report ( )
inlinevirtual

Implements Trk::TrkBaseNode.

Definition at line 122 of file TrkFilteringNodes.h.

122{};

◆ 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::TrkTrtNode::serialize ( char fileName[])
virtual

Implements Trk::TrkBaseNode.

Definition at line 429 of file TrkFilteringNodes.cxx.

429 {
430 FILE* pFile = fopen(fileName, "a");
431 if (!pFile) {
432 std::cerr << "Cannot open file " << fileName << " for write.\n";
433 std::abort();
434 }
435 fclose(pFile);
436 }

◆ 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::TrkTrtNode::updateInternal ( )
virtual

Reimplemented from Trk::TrkBaseNode.

Definition at line 478 of file TrkFilteringNodes.cxx.

478 {
479 if (isValidated() && (m_pTrackState != nullptr)) {
480 m_freezeLR = true;
481 m_lrSign = (m_pTrackState->getTrackState(0) < 0.0) ? -1 : 1;
482 }
483 }
virtual bool isValidated()

◆ updateTrackState()

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

Implements Trk::TrkBaseNode.

Definition at line 473 of file TrkFilteringNodes.cxx.

473 {
474 if (isValidated()) runKalmanFilter(pTS);
475 m_pTrackState = pTS;
476 }
virtual void runKalmanFilter(TrkTrackState *)

◆ updateWithRIO()

void Trk::TrkTrtNode::updateWithRIO ( const RIO_OnTrack * )
virtual

Implements Trk::TrkBaseNode.

Definition at line 485 of file TrkFilteringNodes.cxx.

485 {
486 }

◆ validateMeasurement()

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

Implements Trk::TrkBaseNode.

Definition at line 438 of file TrkFilteringNodes.cxx.

438 {
439 if ((pTS->getTrackState(1) > m_minBound) && (pTS->getTrackState(1) < m_maxBound)) {
441 m_nodeState = (m_dChi2 < m_chi2Cut) ? 1 : 0;
442 } else m_nodeState = 0;
443 }
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_freezeLR

bool Trk::TrkTrtNode::m_freezeLR
protected

Definition at line 127 of file TrkFilteringNodes.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_lrSign

char Trk::TrkTrtNode::m_lrSign
protected

Definition at line 126 of file TrkFilteringNodes.h.

◆ m_m

double Trk::TrkFilteringNode1D::m_m
protectedinherited

Definition at line 45 of file TrkFilteringNodes.h.

◆ m_maxBound

double Trk::TrkTrtNode::m_maxBound
protected

Definition at line 125 of file TrkFilteringNodes.h.

◆ m_minBound

double Trk::TrkTrtNode::m_minBound
protected

Definition at line 125 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: