ATLAS Offline Software
Public Member Functions | Private Member Functions | List of all members
Trk::Chi2TrackCompatibilityEstimator Class Reference

#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. More...
 
virtual float compatibility (VxTrackAtVertex &vtxTrack, const Amg::Vector3D &vertex) const override
 Compatibility method returning the compatibility value. More...
 

Private Member Functions

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

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 44 of file Chi2TrackCompatibilityEstimator.cxx.

44  : " << 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  }
111 
112 

◆ compatibility()

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

Compatibility method returning the compatibility value.

Definition at line 115 of file Chi2TrackCompatibilityEstimator.cxx.

117  {
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  }
130 }

◆ estimate()

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

Estimate method changing the state of VxTrackAtVertex.

Definition at line 38 of file Chi2TrackCompatibilityEstimator.cxx.

◆ finalize()

StatusCode Trk::Chi2TrackCompatibilityEstimator::finalize ( )
overridevirtual

Definition at line 31 of file Chi2TrackCompatibilityEstimator.cxx.

◆ initialize()

StatusCode Trk::Chi2TrackCompatibilityEstimator::initialize ( )
overridevirtual

Definition at line 25 of file Chi2TrackCompatibilityEstimator.cxx.

30  {

The documentation for this class was generated from the following files:
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
LB_AnalMapSplitter.of
of
Definition: LB_AnalMapSplitter.py:48
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::Chi2TrackCompatibilityEstimator::_compatibility
float _compatibility(T &plane, const Amg::Vector3D &vertex) const
Compatibility method returning the compatibility value.
Definition: Chi2TrackCompatibilityEstimator.cxx:44
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
JetVoronoiDiagramHelpers::Norm
Point Norm(const Point &a)
Definition: JetVoronoiDiagramHelpers.cxx:79
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26