ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
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 Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h.

Constructor & Destructor Documentation

◆ TrkClusterNode() [1/2]

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  }

◆ TrkClusterNode() [2/2]

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

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

Implements Trk::TrkBaseNode.

Definition at line 159 of file TrkFilteringNodes.cxx.

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

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

Implements Trk::TrkBaseNode.

Definition at line 147 of file TrkFilteringNodes.cxx.

147  {
148  FILE* pFile;
149 
150  pFile = fopen(fileName, "a");
151  fclose(pFile);
152  }

◆ 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 TrkBaseNode::updateInternal ( )
virtualinherited

Reimplemented in Trk::TrkTrtNode.

Definition at line 73 of file TrkBaseNode.cxx.

73  {
74  }

◆ updateTrackState()

void TrkClusterNode::updateTrackState ( TrkTrackState pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 171 of file TrkFilteringNodes.cxx.

171  {
172  if (isValidated()) runKalmanFilter(pTS);
173  m_pTrackState = pTS;
174  }

◆ updateWithRIO()

void TrkClusterNode::updateWithRIO ( const RIO_OnTrack pRIO)
virtual

Implements Trk::TrkBaseNode.

Definition at line 176 of file TrkFilteringNodes.cxx.

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

◆ validateMeasurement()

void TrkClusterNode::validateMeasurement ( TrkTrackState pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 154 of file TrkFilteringNodes.cxx.

154  {
155  m_dChi2 = getChi2Distance(pTS);
156  m_nodeState = (m_dChi2 < m_chi2Cut) ? 1 : 0;
157  }

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_H

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

◆ m_K

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

◆ m_m

double Trk::TrkFilteringNode1D::m_m
protectedinherited

◆ 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::TrkBaseNode::m_pSurface
TrkPlanarSurface * m_pSurface
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkBaseNode.h:54
beamspotman.r
def r
Definition: beamspotman.py:676
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
Trk::locX
@ locX
Definition: ParamDefs.h:37
TrkTrackState::updateTrackState
void updateTrackState(double *)
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
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::TrkClusterNode::getChi2Distance
virtual double getChi2Distance(TrkTrackState *)
Definition: TrkFilteringNodes.cxx:159
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
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
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
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
TrkTrackState::getTrackCovariance
double getTrackCovariance(int i, int j)
Definition: Trigger/TrigAccel/TrigCudaFitter/src/TrkTrackState.h:44