ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
Trk::TrkEndCapClusterNode Class Reference

#include <TrkFilteringNodes.h>

Inheritance diagram for Trk::TrkEndCapClusterNode:
Collaboration diagram for Trk::TrkEndCapClusterNode:

Public Member Functions

 TrkEndCapClusterNode (TrkPlanarSurface *, double, const PrepRawData *)
 
 TrkEndCapClusterNode (TrkPlanarSurface *, double, const PrepRawData *, double)
 
 TrkEndCapClusterNode (TrkPlanarSurface *, double, double, double, double)
 
virtual ~TrkEndCapClusterNode ()
 
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_Rc
 
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 81 of file Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h.

Constructor & Destructor Documentation

◆ TrkEndCapClusterNode() [1/3]

TrkEndCapClusterNode::TrkEndCapClusterNode ( TrkPlanarSurface pS,
double  chi2Cut,
const PrepRawData pPRD 
)

Definition at line 186 of file TrkFilteringNodes.cxx.

186  {
187  m_pSurface = pS;
188  m_chi2Cut = chi2Cut;
189  m_m = pPRD->localPosition()[0];
190  m_V = pPRD->localCovariance()(0, 0);
191  m_pPRD = pPRD;
192 
193  const Trk::SurfaceBounds& rBounds = pPRD->detectorElement()->surface().bounds();
194  const Trk::TrapezoidBounds& ecBounds = dynamic_cast<const Trk::TrapezoidBounds&>(rBounds);
195 
196  m_Rc = (ecBounds.maxHalflengthX() + ecBounds.minHalflengthX()) * ecBounds.halflengthY() /
197  (ecBounds.maxHalflengthX() - ecBounds.minHalflengthX());
198  m_nodeType = 2;
199  m_ndof = 1;
200 
201  double C[2][2];
202  C[0][0] = pPRD->localCovariance()(0, 0);
203  C[0][1] = C[1][0] = pPRD->localCovariance()(0, 1);
204  C[1][1] = pPRD->localCovariance()(1, 1);
205  m_V = (C[0][0] * m_Rc * m_Rc - 2 * m_m * m_Rc * C[0][1] + C[1][1] * m_m * m_m) / (m_Rc * m_Rc + m_m * m_m);
206  //printf("EC hit error=%f\n",m_V);
207  }

◆ TrkEndCapClusterNode() [2/3]

TrkEndCapClusterNode::TrkEndCapClusterNode ( TrkPlanarSurface pS,
double  chi2Cut,
const PrepRawData pPRD,
double  Rc 
)

Definition at line 209 of file TrkFilteringNodes.cxx.

212  : m_Rc(Rc) {
213  m_pSurface = pS;
214  m_chi2Cut = chi2Cut;
215  m_m = pPRD->localPosition()[0];
216  m_V = pPRD->localCovariance()(0, 0);
217  m_pPRD = pPRD;
218 
219  m_nodeType = 2;
220  m_ndof = 1;
221  double C[2][2];
222  C[0][0] = pPRD->localCovariance()(0, 0);
223  C[0][1] = C[1][0] = pPRD->localCovariance()(0, 1);
224  C[1][1] = pPRD->localCovariance()(1, 1);
225  m_V = (C[0][0] * m_Rc * m_Rc - 2 * m_m * m_Rc * C[0][1] + C[1][1] * m_m * m_m) / (m_Rc * m_Rc + m_m * m_m);
226  //printf("EC hit error=%f\n",m_V);
227  }

◆ TrkEndCapClusterNode() [3/3]

TrkEndCapClusterNode::TrkEndCapClusterNode ( TrkPlanarSurface pS,
double  chi2Cut,
double  Rc,
double  pos,
double  cov 
)

Definition at line 229 of file TrkFilteringNodes.cxx.

232  : m_Rc(Rc) {
233  m_pSurface = pS;
234  m_chi2Cut = chi2Cut;
235  m_m = pos;
236  m_V = cov;
237  m_pPRD = nullptr;
238 
239  m_nodeType = 2;
240  m_ndof = 1;
241  }

◆ ~TrkEndCapClusterNode()

virtual Trk::TrkEndCapClusterNode::~TrkEndCapClusterNode ( )
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 TrkEndCapClusterNode::getChi2Distance ( TrkTrackState pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 255 of file TrkFilteringNodes.cxx.

255  {
256  double corr;
257 
258  corr = 1.0 / (pTS->getTrackState(1) + m_Rc);
259  m_H[0] = m_Rc * corr;
260  m_H[1] = -pTS->getTrackState(0) * m_Rc * corr * corr;
261  m_H[2] = 0.0;
262  m_H[3] = 0.0;
263  m_H[4] = 0.0;
264 
265  m_B[0] = m_H[0] * pTS->getTrackCovariance(0, 0) + m_H[1] * pTS->getTrackCovariance(0, 1);
266  m_B[1] = m_H[0] * pTS->getTrackCovariance(0, 1) + m_H[1] * pTS->getTrackCovariance(1, 1);
267  m_B[2] = m_H[0] * pTS->getTrackCovariance(0, 2) + m_H[1] * pTS->getTrackCovariance(1, 2);
268  m_B[3] = m_H[0] * pTS->getTrackCovariance(0, 3) + m_H[1] * pTS->getTrackCovariance(1, 3);
269  m_B[4] = m_H[0] * pTS->getTrackCovariance(0, 4) + m_H[1] * pTS->getTrackCovariance(1, 4);
270  //corr=1.0+pTS->getTrackState(1)/m_Rc;
271  //m_D=1.0/(m_B[0]*m_H[0]+m_B[1]*m_H[1]+m_V*corr*corr);
272  m_D = 1.0 / (m_B[0] * m_H[0] + m_B[1] * m_H[1] + m_V);
273  m_resid = m_m - pTS->getTrackState(0) * m_Rc / (pTS->getTrackState(1) + m_Rc);
274  return calculateChi2();
275  }

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

Implements Trk::TrkBaseNode.

Definition at line 243 of file TrkFilteringNodes.cxx.

243  {
244  FILE* pFile;
245 
246  pFile = fopen(fileName, "a");
247  fclose(pFile);
248  }

◆ 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 TrkEndCapClusterNode::updateTrackState ( TrkTrackState pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 277 of file TrkFilteringNodes.cxx.

277  {
278  if (isValidated()) runKalmanFilter(pTS);
279  m_pTrackState = pTS;
280  }

◆ updateWithRIO()

void TrkEndCapClusterNode::updateWithRIO ( const RIO_OnTrack pRIO)
virtual

Implements Trk::TrkBaseNode.

Definition at line 282 of file TrkFilteringNodes.cxx.

282  {
283  /*
284  printf("RIO update, EC cluster: old m=%f new m=%f old V=%f ",
285  m_m,pRIO->localParameters()[Trk::locX],sqrt(m_V));
286  */
287  m_m = pRIO->localParameters()[Trk::locX];
288  double C[2][2];
289  C[0][0] = pRIO->localCovariance()(0, 0);
290  C[0][1] = C[1][0] = pRIO->localCovariance()(0, 1);
291  C[1][1] = pRIO->localCovariance()(1, 1);
292  m_V = (C[0][0] * m_Rc * m_Rc - 2 * m_m * m_Rc * C[0][1] + C[1][1] * m_m * m_m) / (m_Rc * m_Rc + m_m * m_m);
293  //printf("new V=%f\n",sqrt(m_V));
294  }

◆ validateMeasurement()

void TrkEndCapClusterNode::validateMeasurement ( TrkTrackState pTS)
virtual

Implements Trk::TrkBaseNode.

Definition at line 250 of file TrkFilteringNodes.cxx.

250  {
251  m_dChi2 = getChi2Distance(pTS);
252  m_nodeState = (m_dChi2 < m_chi2Cut) ? 1 : 0;
253  }

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_Rc

double Trk::TrkEndCapClusterNode::m_Rc
protected

◆ 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
Trk::TrapezoidBounds::maxHalflengthX
double maxHalflengthX() const
This method returns the maximal halflength in X (first coordinate of local surface frame)
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 *)
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
DMTest::C
C_v1 C
Definition: C.h:26
Trk::TrapezoidBounds::halflengthY
double halflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame)
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Trk::TrapezoidBounds::minHalflengthX
double minHalflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame)
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::TrkEndCapClusterNode::m_Rc
double m_Rc
Definition: Tracking/TrkFitter/TrkDistributedKalmanFilter/TrkDistributedKalmanFilter/TrkFilteringNodes.h:95
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::TrkEndCapClusterNode::getChi2Distance
virtual double getChi2Distance(TrkTrackState *)
Definition: TrkFilteringNodes.cxx:255
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::TrapezoidBounds
Definition: TrapezoidBounds.h:43
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