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

This object reweights the tracks according to a chi2 value constructed according to the distance to the vertex (the error of the vertex is not considered in constructing the chi squared, because this is an apriori probability which enters the fit) More...

#include <Chi2TrackCompatibilityEstimator.h>

Inheritance diagram for Trk::Chi2TrackCompatibilityEstimator:
Collaboration diagram for Trk::Chi2TrackCompatibilityEstimator:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual void estimate (VxTrackAtVertex &, const Amg::Vector3D &vertex) const override
 Estimate method changing the state of VxTrackAtVertex.
virtual float compatibility (VxTrackAtVertex &vtxTrack, const Amg::Vector3D &vertex) const override
 Compatibility method returning the compatibility value.

Private Member Functions

template<class T>
float _compatibility (T &plane, const Amg::Vector3D &vertex) const
 Compatibility method returning the compatibility value.

Detailed Description

This object reweights the tracks according to a chi2 value constructed according to the distance to the vertex (the error of the vertex is not considered in constructing the chi squared, because this is an apriori probability which enters the fit)

Author
N. Giacinto Piacquadio (for the Freiburg Group)

Changes:

David Shope david.nosp@m..ric.nosp@m.hard..nosp@m.shop.nosp@m.e@cer.nosp@m.n.ch (2016-03-18) EDM Migration to xAOD - move Trk::Vertex to Amg::Vector3D

Definition at line 33 of file Chi2TrackCompatibilityEstimator.h.

Member Function Documentation

◆ _compatibility()

template<class T>
float Trk::Chi2TrackCompatibilityEstimator::_compatibility ( T & plane,
const Amg::Vector3D & vertex ) const
private

Compatibility method returning the compatibility value.

Definition at line 42 of file Chi2TrackCompatibilityEstimator.cxx.

42 {
43
44 ATH_MSG_VERBOSE ("Given plane: " << myAtaPlane->associatedSurface() );
45
46 //now, once you have the AtaPlane, project the actual vertex on the plane.
47 Amg::RotationMatrix3D myPlaneRotation=myAtaPlane->associatedSurface().transform().rotation();
48 Amg::Vector3D myTranslation=myAtaPlane->associatedSurface().transform().translation();
49
50 //get the x and y direction of the plane
51 Amg::Vector3D myXdirPlane=myPlaneRotation.col(0);
52 Amg::Vector3D myYdirPlane=myPlaneRotation.col(1);
53 //CLHEP::Hep3Vector myZdirPlane=myRotation.colZ();
54
55 #ifdef Chi2TrackCompatibilityEstimator_DEBUG
56 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "Position is: " << vertex << std::endl;
57 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "Rotation is: " << myPlaneRotation << std::endl;
58 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "Norm of colX() is: " << myXdirPlane.mag() << " of colY() is: " << myYdirPlane.mag() << std::endl;
59 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "Translation is: " << myTranslation << std::endl;
60 #endif
61
62 Amg::Vector3D vertexMinusCenter=vertex-myTranslation;
63
64 #ifdef Chi2TrackCompatibilityEstimator_DEBUG
65 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "VertexMinusCenter: " << vertexMinusCenter << std::endl;
66 #endif
67
68 Amg::Vector2D myVertexlocXlocY;
69 myVertexlocXlocY[0]=vertexMinusCenter.dot(myXdirPlane);
70 myVertexlocXlocY[1]=vertexMinusCenter.dot(myYdirPlane);
71
72 #ifdef Chi2TrackCompatibilityEstimator_DEBUG
73 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "Vertex local coordinates: " << myVertexlocXlocY << std::endl;
74 #endif
75
76 /* ******Maybe this can be still helpfull
77 //create a default xy plane
78 Plane3D trackPlane();
79
80 //rotate and traslate it according to the plane associated to MeasuredAtaPlane
81 trackPlane.transform(myAtaPlane->associatedSurface()->transform());
82
83 //now project the vertex onto the plane
84 Point3D theVertexOnPlane=trackPlane.point(Point3D(vertex.x(),vertex.y(),vertex.z()));
85
86 //now express the point found in local coordinates
87 */
88
89 const AmgSymMatrix(5) * covar = (myAtaPlane->covariance());
90 AmgSymMatrix(2) myWeightXY = (*covar).block<2,2>(0,0);
91 myWeightXY = myWeightXY.inverse().eval();
92
93 Amg::Vector2D myXY;
94 myXY[0]=myAtaPlane->parameters()[Trk::locX]-myVertexlocXlocY[0];
95 myXY[1]=myAtaPlane->parameters()[Trk::locY]-myVertexlocXlocY[1];
96
97 #ifdef Chi2TrackCompatibilityEstimator_DEBUG
98 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "Parameters local coordinates: " << " x: " <<myAtaPlane->parameters()[Trk::locX] <<
99 " y: " << myAtaPlane->parameters()[Trk::locY] << std::endl;
100 std::cout << std::setprecision(10) << "Chi2TrackCompatibilityEstimator: " << "VertexToTrack coordinates: " << myXY << std::endl;
101 #endif
102
103 ATH_MSG_DEBUG ("The weight assigned to the track is " << myXY.dot(myWeightXY*myXY) );
104 ATH_MSG_VERBOSE ("coming from X: " << myXY[0] << " and error: "
105 << std::sqrt((*(myAtaPlane->covariance()))(Trk::locX,Trk::locX)));
106 ATH_MSG_VERBOSE ("and from z0: " << myXY[1] << " and error: "
107 << std::sqrt((*(myAtaPlane->covariance()))(Trk::locY,Trk::locY)));
108
109 return myXY.dot(myWeightXY*myXY);
110 }
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
#define AmgSymMatrix(dim)
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37

◆ compatibility()

float Trk::Chi2TrackCompatibilityEstimator::compatibility ( VxTrackAtVertex & vtxTrack,
const Amg::Vector3D & vertex ) const
overridevirtual

Compatibility method returning the compatibility value.

Definition at line 113 of file Chi2TrackCompatibilityEstimator.cxx.

114 {
115 //Looking for a AtaPlane object (track)
116 const Trk::AtaPlane * myAtaPlane=vtxTrack.ImpactPoint3dAtaPlane();
117 if (myAtaPlane!=nullptr && myAtaPlane->covariance()!=nullptr) {
118 return _compatibility(myAtaPlane, vertex);
119 }
120
121 //looking for a NeutralAtaPlane object (neutral)
122 const Trk::NeutralAtaPlane * myNeutralAtaPlane=vtxTrack.ImpactPoint3dNeutralAtaPlane();
123 if (myNeutralAtaPlane!=nullptr && myNeutralAtaPlane->covariance()!=nullptr){
124 return _compatibility(myNeutralAtaPlane, vertex);
125 }
126
127 ATH_MSG_WARNING( " No compatibility plane attached to the VxTrackAtVertex. Compatibility couldn't be found... 0 compatibility returned." );
128 return 100;
129 }
#define ATH_MSG_WARNING(x)
float _compatibility(T &plane, const Amg::Vector3D &vertex) const
Compatibility method returning the compatibility value.
ParametersT< NeutralParametersDim, Neutral, PlaneSurface > NeutralAtaPlane
ParametersT< TrackParametersDim, Charged, PlaneSurface > AtaPlane

◆ estimate()

void Trk::Chi2TrackCompatibilityEstimator::estimate ( VxTrackAtVertex & vtxTrack,
const Amg::Vector3D & vertex ) const
overridevirtual

Estimate method changing the state of VxTrackAtVertex.

Definition at line 36 of file Chi2TrackCompatibilityEstimator.cxx.

37 {
38 vtxTrack.setVtxCompatibility(compatibility(vtxTrack,vertex));
39 }
virtual float compatibility(VxTrackAtVertex &vtxTrack, const Amg::Vector3D &vertex) const override
Compatibility method returning the compatibility value.

◆ finalize()

StatusCode Trk::Chi2TrackCompatibilityEstimator::finalize ( )
overridevirtual

Definition at line 29 of file Chi2TrackCompatibilityEstimator.cxx.

30 {
31 ATH_MSG_DEBUG( "Finalize successful" );
32 return StatusCode::SUCCESS;
33 }

◆ initialize()

StatusCode Trk::Chi2TrackCompatibilityEstimator::initialize ( )
overridevirtual

Definition at line 23 of file Chi2TrackCompatibilityEstimator.cxx.

24 {
25 ATH_MSG_DEBUG( "Initialize successful" );
26 return StatusCode::SUCCESS;
27 }

The documentation for this class was generated from the following files: