ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
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 ()
 
TrkTrackStategetTrackState ()
 
virtual TrkPlanarSurfacegetSurface ()
 
virtual const PrepRawDatagetPrepRawData ()
 
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
 
TrkPlanarSurfacem_pSurface
 
const PrepRawDatam_pPRD
 
double m_dChi2
 
int m_ndof
 
TrkTrackStatem_pTrackState
 

Detailed Description

Definition at line 112 of file Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h.

Constructor & Destructor Documentation

◆ TrkTrtNode()

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

Definition at line 410 of file TrkFilteringNodes.cxx.

412  : m_minBound(lmin), m_maxBound(lmax), m_lrSign(0), m_freezeLR(false) {
413  m_pSurface = pS;
414  m_chi2Cut = chi2Cut;
415  m_m = pPRD->localPosition()[0];
416  m_V = pPRD->localCovariance()(0, 0);
417 
418  m_pPRD = pPRD;
419  m_nodeType = 3;
420  m_ndof = 1;
421  }

◆ ~TrkTrtNode()

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

Member Function Documentation

◆ calculateChi2()

double TrkFilteringNode1D::calculateChi2 ( )
virtualinherited

Definition at line 33 of file TrkFilteringNodes.cxx.

33  {
34  return(m_resid * m_resid * m_D);
35  }

◆ getChi2()

double 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 437 of file TrkFilteringNodes.cxx.

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

◆ getInverseResidualVariance()

int 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 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 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  }

◆ getNdof()

int TrkBaseNode::getNdof ( ) const
inherited

Definition at line 65 of file TrkBaseNode.cxx.

65  {
66  return m_ndof;
67  }

◆ getNodeState()

int TrkBaseNode::getNodeState ( )
virtualinherited

Definition at line 53 of file TrkBaseNode.cxx.

53  {
54  return m_nodeState;
55  }

◆ getNodeType()

char TrkBaseNode::getNodeType ( )
virtualinherited

Definition at line 61 of file TrkBaseNode.cxx.

61  {
62  return m_nodeType;
63  }

◆ getPrepRawData()

const PrepRawData * TrkBaseNode::getPrepRawData ( )
virtualinherited

Definition at line 39 of file TrkBaseNode.cxx.

39  {
40  return m_pPRD;
41  }

◆ getResiduals()

int 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  }

◆ getSurface()

TrkPlanarSurface * TrkBaseNode::getSurface ( )
virtualinherited

Definition at line 35 of file TrkBaseNode.cxx.

35  {
36  return m_pSurface;
37  }

◆ getTrackState()

TrkTrackState * TrkBaseNode::getTrackState ( )
inherited

Definition at line 43 of file TrkBaseNode.cxx.

43  {
44  return m_pTrackState;
45  }

◆ isValidated()

bool 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

◆ runKalmanFilter()

void 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  }

◆ serialize()

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

Implements Trk::TrkBaseNode.

Definition at line 423 of file TrkFilteringNodes.cxx.

423  {
424  FILE* pFile;
425 
426  pFile = fopen(fileName, "a");
427  fclose(pFile);
428  }

◆ setNodeState()

void TrkBaseNode::setNodeState ( int  s)
virtualinherited

Definition at line 49 of file TrkBaseNode.cxx.

49  {
50  m_nodeState = s;
51  }

◆ setNodeType()

void 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 470 of file TrkFilteringNodes.cxx.

470  {
471  if (isValidated() && (m_pTrackState != nullptr)) {
472  m_freezeLR = true;
473  m_lrSign = (m_pTrackState->getTrackState(0) < 0.0) ? -1 : 1;
474  }
475  }

◆ updateTrackState()

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

Implements Trk::TrkBaseNode.

Definition at line 465 of file TrkFilteringNodes.cxx.

465  {
466  if (isValidated()) runKalmanFilter(pTS);
467  m_pTrackState = pTS;
468  }

◆ updateWithRIO()

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

Implements Trk::TrkBaseNode.

Definition at line 477 of file TrkFilteringNodes.cxx.

477  {
478  }

◆ validateMeasurement()

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

Implements Trk::TrkBaseNode.

Definition at line 430 of file TrkFilteringNodes.cxx.

430  {
431  if ((pTS->getTrackState(1) > m_minBound) && (pTS->getTrackState(1) < m_maxBound)) {
432  m_dChi2 = getChi2Distance(pTS);
433  m_nodeState = (m_dChi2 < m_chi2Cut) ? 1 : 0;
434  } else m_nodeState = 0;
435  }

Member Data Documentation

◆ m_B

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

◆ m_chi2Cut

double Trk::TrkBaseNode::m_chi2Cut
protectedinherited

◆ m_D

double Trk::TrkFilteringNode1D::m_D
protectedinherited

◆ m_dChi2

double Trk::TrkBaseNode::m_dChi2
protectedinherited

◆ m_freezeLR

bool Trk::TrkTrtNode::m_freezeLR
protected

◆ m_H

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

◆ m_K

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

◆ m_lrSign

char Trk::TrkTrtNode::m_lrSign
protected

◆ m_m

double Trk::TrkFilteringNode1D::m_m
protectedinherited

◆ m_maxBound

double Trk::TrkTrtNode::m_maxBound
protected

◆ m_minBound

double Trk::TrkTrtNode::m_minBound
protected

◆ m_ndof

int Trk::TrkBaseNode::m_ndof
protectedinherited

◆ m_nodeState

int Trk::TrkBaseNode::m_nodeState
protectedinherited

◆ m_nodeType

char Trk::TrkBaseNode::m_nodeType
protectedinherited

◆ m_pPRD

const PrepRawData* Trk::TrkBaseNode::m_pPRD
protectedinherited

◆ m_pSurface

TrkPlanarSurface* Trk::TrkBaseNode::m_pSurface
protectedinherited

◆ m_pTrackState

TrkTrackState* Trk::TrkBaseNode::m_pTrackState
protectedinherited

◆ m_resid

double Trk::TrkFilteringNode1D::m_resid
protectedinherited

◆ m_V

double Trk::TrkFilteringNode1D::m_V
protectedinherited

The documentation for this class was generated from the following files:
Trk::TrkTrtNode::m_minBound
double m_minBound
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:125
Trk::TrkBaseNode::m_pSurface
TrkPlanarSurface * m_pSurface
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:54
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::TrkTrtNode::m_maxBound
double m_maxBound
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:125
TrkTrackState::getSurface
TrkPlanarSurface * getSurface()
TrkTrackState::getTrackState
double getTrackState(int i)
Definition: Trigger/TrigAccel/TrigCudaFitter/src/TrkTrackState.h:40
Trk::TrkFilteringNode1D::m_V
double m_V
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:46
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrkTrackState::updateTrackState
void updateTrackState(double *)
Trk::TrkTrtNode::getChi2Distance
virtual double getChi2Distance(TrkTrackState *)
Definition: TrkFilteringNodes.cxx:437
Trk::TrkTrtNode::m_freezeLR
bool m_freezeLR
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:127
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::TrkBaseNode::m_chi2Cut
double m_chi2Cut
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:52
Trk::TrkBaseNode::m_pTrackState
TrkTrackState * m_pTrackState
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:58
Trk::TrkFilteringNode1D::m_H
double m_H[5]
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:43
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::TrkBaseNode::m_dChi2
double m_dChi2
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:56
Trk::TrkBaseNode::m_nodeType
char m_nodeType
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:53
Trk::TrkFilteringNode1D::m_B
double m_B[5]
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:43
Trk::TrkFilteringNode1D::m_m
double m_m
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:45
Trk::TrkBaseNode::isValidated
virtual bool isValidated()
Definition: TrkBaseNode.cxx:31
Trk::TrkBaseNode::m_ndof
int m_ndof
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:57
Trk::TrkFilteringNode1D::m_D
double m_D
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:43
Trk::TrkBaseNode::m_nodeState
int m_nodeState
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:51
Trk::TrkFilteringNode1D::runKalmanFilter
virtual void runKalmanFilter(TrkTrackState *)
Definition: TrkFilteringNodes.cxx:37
Trk::TrkBaseNode::m_pPRD
const PrepRawData * m_pPRD
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:55
Trk::TrkFilteringNode1D::m_K
double m_K[5]
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:43
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TrkPlanarSurface::rotateVectorToLocal
void rotateVectorToLocal(double *, double *)
Trk::TrkTrackState::getTrackState
double getTrackState(int i)
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkTrackState.h:47
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::TrkFilteringNode1D::calculateChi2
virtual double calculateChi2()
Definition: TrkFilteringNodes.cxx:33
TrkTrackState::updateTrackCovariance
void updateTrackCovariance(double *)
Trk::TrkFilteringNode1D::m_resid
double m_resid
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:44
TileDCSDataPlotter.tx
tx
Definition: TileDCSDataPlotter.py:878
Trk::TrkTrtNode::m_lrSign
char m_lrSign
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:126
TrkTrackState::getTrackCovariance
double getTrackCovariance(int i, int j)
Definition: Trigger/TrigAccel/TrigCudaFitter/src/TrkTrackState.h:44