ATLAS Offline Software
Loading...
Searching...
No Matches
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 ()
TrkTrackState * getTrackState ()
virtual TrkPlanarSurface * getSurface ()
virtual const PrepRawData * getPrepRawData ()
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
TrkPlanarSurface * m_pSurface
const PrepRawData * m_pPRD
double m_dChi2
int m_ndof
TrkTrackState * m_pTrackState

Detailed Description

Definition at line 81 of file TrkFilteringNodes.h.

Constructor & Destructor Documentation

◆ TrkEndCapClusterNode() [1/3]

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

Definition at line 188 of file TrkFilteringNodes.cxx.

188 {
189 m_pSurface = pS;
190 m_chi2Cut = chi2Cut;
191 m_m = pPRD->localPosition()[0];
192 m_V = pPRD->localCovariance()(0, 0);
193 m_pPRD = pPRD;
194
195 const Trk::SurfaceBounds& rBounds = pPRD->detectorElement()->surface().bounds();
196 const Trk::TrapezoidBounds& ecBounds = dynamic_cast<const Trk::TrapezoidBounds&>(rBounds);
197
198 m_Rc = (ecBounds.maxHalflengthX() + ecBounds.minHalflengthX()) * ecBounds.halflengthY() /
199 (ecBounds.maxHalflengthX() - ecBounds.minHalflengthX());
200 m_nodeType = 2;
201 m_ndof = 1;
202
203 double C[2][2];
204 C[0][0] = pPRD->localCovariance()(0, 0);
205 C[0][1] = C[1][0] = pPRD->localCovariance()(0, 1);
206 C[1][1] = pPRD->localCovariance()(1, 1);
207 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);
208 //printf("EC hit error=%f\n",m_V);
209 }
double halflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame).
double minHalflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame).
double maxHalflengthX() const
This method returns the maximal halflength in X (first coordinate of local surface frame).
const PrepRawData * m_pPRD
Definition TrkBaseNode.h:55
TrkPlanarSurface * m_pSurface
Definition TrkBaseNode.h:54
struct color C

◆ TrkEndCapClusterNode() [2/3]

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

Definition at line 211 of file TrkFilteringNodes.cxx.

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

◆ TrkEndCapClusterNode() [3/3]

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

Definition at line 231 of file TrkFilteringNodes.cxx.

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

◆ ~TrkEndCapClusterNode()

virtual Trk::TrkEndCapClusterNode::~TrkEndCapClusterNode ( )
inlinevirtual

Definition at line 87 of file TrkFilteringNodes.h.

87{};

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

Implements Trk::TrkBaseNode.

Definition at line 259 of file TrkFilteringNodes.cxx.

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

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

Implements Trk::TrkBaseNode.

Definition at line 92 of file TrkFilteringNodes.h.

92{};

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

Implements Trk::TrkBaseNode.

Definition at line 245 of file TrkFilteringNodes.cxx.

245 {
246 FILE* pFile = fopen(fileName, "a");
247 if (!pFile) {
248 std::cerr << "Cannot open file " << fileName << " for write.\n";
249 std::abort();
250 }
251 fclose(pFile);
252 }

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

Implements Trk::TrkBaseNode.

Definition at line 281 of file TrkFilteringNodes.cxx.

281 {
282 if (isValidated()) runKalmanFilter(pTS);
283 m_pTrackState = pTS;
284 }
virtual bool isValidated()
virtual void runKalmanFilter(TrkTrackState *)

◆ updateWithRIO()

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

Implements Trk::TrkBaseNode.

Definition at line 286 of file TrkFilteringNodes.cxx.

286 {
287 /*
288 printf("RIO update, EC cluster: old m=%f new m=%f old V=%f ",
289 m_m,pRIO->localParameters()[Trk::locX],sqrt(m_V));
290 */
291 m_m = pRIO->localParameters()[Trk::locX];
292 double C[2][2];
293 C[0][0] = pRIO->localCovariance()(0, 0);
294 C[0][1] = C[1][0] = pRIO->localCovariance()(0, 1);
295 C[1][1] = pRIO->localCovariance()(1, 1);
296 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);
297 //printf("new V=%f\n",sqrt(m_V));
298 }
@ locX
Definition ParamDefs.h:37

◆ validateMeasurement()

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

Implements Trk::TrkBaseNode.

Definition at line 254 of file TrkFilteringNodes.cxx.

254 {
256 m_nodeState = (m_dChi2 < m_chi2Cut) ? 1 : 0;
257 }
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_Rc

double Trk::TrkEndCapClusterNode::m_Rc
protected

Definition at line 95 of file TrkFilteringNodes.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: