|
ATLAS Offline Software
|
A class estimating the transverse impact parameter d0 and its error of a given track wrt to the reconstructed vertex.
More...
#include <TrackToVertexIPEstimator.h>
|
virtual StatusCode | initialize () override |
| Default Athena interface methods. More...
|
|
| TrackToVertexIPEstimator (const std::string &t, const std::string &n, const IInterface *p) |
| Default Athena interface constructor and destructor. More...
|
|
| ~TrackToVertexIPEstimator () |
|
virtual std::unique_ptr< ImpactParametersAndSigma > | estimate (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doRemoval) const override |
| Estimate methods returning a d0 and its calculated sigma. More...
|
|
virtual std::unique_ptr< ImpactParametersAndSigma > | estimate (const TrackParameters *track, const xAOD::Vertex *vtx, bool doRemoval) const override |
|
virtual std::unique_ptr< ImpactParametersAndSigma > | estimate (const xAOD::TrackParticle *track, const xAOD::TrackParticle *newtrack, const xAOD::Vertex *vtx, bool doRemoval) const override |
|
virtual std::unique_ptr< ImpactParametersAndSigma > | estimate (const TrackParameters *track, const TrackParameters *newtrack, const xAOD::Vertex *vtx, bool doRemoval) const override |
|
virtual xAOD::Vertex * | getUnbiasedVertex (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx) const override |
|
virtual xAOD::Vertex * | getUnbiasedVertex (const TrackParameters *track, const xAOD::Vertex *vtx) const override |
|
virtual std::unique_ptr< ImpactParametersAndSigma > | estimate (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx) const override |
|
virtual std::unique_ptr< ImpactParametersAndSigma > | estimate (const TrackParameters *track, const xAOD::Vertex *vtx) const override |
|
virtual double | get3DLifetimeSignOfTrack (const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override |
|
virtual double | get3DLifetimeSignOfTrack (const TrackParameters &track, const CLHEP::Hep3Vector &jetDirection, const xAOD::Vertex &primaryVertex) const override |
|
virtual double | get2DLifetimeSignOfTrack (const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override |
|
virtual double | get2DLifetimeSignOfTrack (const TrackParameters &track, const CLHEP::Hep3Vector &jetDirection, const xAOD::Vertex &primaryVertex) const override |
|
virtual double | getZLifetimeSignOfTrack (const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override |
|
virtual double | getZLifetimeSignOfTrack (const TrackParameters &track, const CLHEP::Hep3Vector &jetDirection, const xAOD::Vertex &primaryVertex) const override |
|
A class estimating the transverse impact parameter d0 and its error of a given track wrt to the reconstructed vertex.
Algorithm:
(a) Provided track or track particle are checked, whether they do already belong to the vertex. (b) In the positive case, the vertex is reduced by removing the track or track particle in question. (c) The trajectory state is extrapolated to the perigee with the vertex in question, the d0 and its error is estimated. The error on the vertex position is included in this calculation.
Kiril.nosp@m.l.Pr.nosp@m.okofi.nosp@m.ev@c.nosp@m.ern.c.nosp@m.h February 2008
Changes:
Giaci.nosp@m.nto..nosp@m.Piacq.nosp@m.uadi.nosp@m.o@phy.nosp@m.sik..nosp@m.uni-f.nosp@m.reib.nosp@m.urg.d.nosp@m.e (update of 11.September 2008)
In addition the tool is now able to provide the impact parameter z0 and its error.
At the same time an option can be passed not to remove the track from the vertex (non-default)
In addition, the lifetime sign of the Impact Parameter given a lifetime direction of flight is also provided with 3 methods: 2D, Z and full 3D.
Johanna Fleckner (03.12.2009) allow for estimation of IP parameter even if vertex doesn't contain any tracks as can happen in BeamSpot or early running when PV is not reconstructed degrade some INFO/WARNINGS to DEBUG
David Shope david.nosp@m..ric.nosp@m.hard..nosp@m.shop.nosp@m.e@cer.nosp@m.n.ch (2016-04-19) EDM Migration to xAOD - Remove methods involving Trk::VxCandidate and Trk::RecVertex
Definition at line 71 of file TrackToVertexIPEstimator.h.
◆ TrackToVertexIPEstimator()
Trk::TrackToVertexIPEstimator::TrackToVertexIPEstimator |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TrackToVertexIPEstimator()
Trk::TrackToVertexIPEstimator::~TrackToVertexIPEstimator |
( |
| ) |
|
|
default |
◆ calculate()
A method calculating the do and its error.
At this stage the trajectory is removed from the vertex.
Definition at line 121 of file TrackToVertexIPEstimator.cxx.
128 PerigeeSurface perigeeSurface(lp);
132 ->extrapolate(Gaudi::Hive::currentContext(), *
track, perigeeSurface)
134 if (extrapolatedParameters && extrapolatedParameters->covariance()) {
137 const AmgVector(5) &
par = extrapolatedParameters->parameters();
143 AmgSymMatrix(2) vrtXYCov = vtx.covariancePosition().block<2,2>(0,0);
152 auto newIPandSigma=std::
make_unique<ImpactParametersAndSigma>();
153 newIPandSigma->IPd0=
d0;
154 double d0_PVcontrib=d0JacXY.transpose()*(vrtXYCov*d0JacXY);
157 newIPandSigma->sigmad0=sqrt(d0_PVcontrib+perigeeCov(
Trk::d0,
Trk::d0));
158 newIPandSigma->PVsigmad0=sqrt(d0_PVcontrib);
162 msg(MSG::WARNING) <<
" The contribution to d0_err: " << d0_PVcontrib <<
" from PV is negative: critical error in PV error matrix! Removing contribution from PV ... " <<
endmsg;
164 newIPandSigma->PVsigmad0=0;
168 covPerigeeZ0Theta(0,0)=perigeeCov(
Trk::
z0,
Trk::
z0);
173 double vrtZZCov = vtx.covariancePosition()(
Trk::
z,
Trk::
z);
179 newIPandSigma->sigmaz0SinTheta=
180 sqrt(IPz0JacZ0Theta.transpose()*(covPerigeeZ0Theta*IPz0JacZ0Theta)+
sin(
theta)*vrtZZCov*
sin(
theta));
182 newIPandSigma->IPz0 =
z0;
183 newIPandSigma->sigmaz0 = std::sqrt( vrtZZCov + perigeeCov(
Trk::z0,
Trk::z0) );
184 newIPandSigma->PVsigmaz0 = std::sqrt( vrtZZCov );
188 ATH_MSG_WARNING(
" The contribution to z0_err: " << vrtZZCov <<
" from PV is negative: critical error in PV error matrix! Removing contribution from PV ... ");
190 double temp = (IPz0JacZ0Theta.transpose()*(covPerigeeZ0Theta*IPz0JacZ0Theta));
191 newIPandSigma->sigmaz0SinTheta=sqrt(temp);
192 newIPandSigma->PVsigmaz0SinTheta=0;
194 newIPandSigma->IPz0 =
z0;
195 newIPandSigma->sigmaz0 = std::sqrt( perigeeCov(
Trk::z0,
Trk::z0) );
196 newIPandSigma->PVsigmaz0 = 0;
200 delete extrapolatedParameters;
201 return newIPandSigma;
203 ATH_MSG_DEBUG (
"Cannot extrapolate the trajectory state. Returning null. ");
◆ estimate() [1/6]
◆ estimate() [2/6]
◆ estimate() [3/6]
◆ estimate() [4/6]
◆ estimate() [5/6]
◆ estimate() [6/6]
Estimate methods returning a d0 and its calculated sigma.
All methods do check whether a track is actually fitted to a vertex
Definition at line 53 of file TrackToVertexIPEstimator.cxx.
57 return estimate(&(
track->perigeeParameters()),&(
track->perigeeParameters()),vtx,doRemoval);
59 ATH_MSG_INFO(
"Empty TrackParticle or Vertex pointer passed. Returning zero " );
◆ get2DLifetimeSignOfTrack() [1/2]
Definition at line 253 of file TrackToVertexIPEstimator.cxx.
258 PerigeeSurface perigeeSurface(lp);
260 std::unique_ptr<const Trk::TrackParameters> extrapolatedParameters =
262 Gaudi::Hive::currentContext(),
track, perigeeSurface);
264 if (!extrapolatedParameters)
return 0.;
266 double trackD0 = extrapolatedParameters->parameters()[
Trk::d0];
268 double vs = sinf( atan2(jetMomentum.y(),jetMomentum.x()) -
trackPhi )*trackD0;
270 return (vs>=0. ? 1. : -1.);
◆ get2DLifetimeSignOfTrack() [2/2]
◆ get3DLifetimeSignOfTrack() [1/2]
Definition at line 221 of file TrackToVertexIPEstimator.cxx.
226 PerigeeSurface perigeeSurface(lp);
228 std::unique_ptr<const Trk::TrackParameters> extrapolatedParameters =
230 Gaudi::Hive::currentContext(),
track, perigeeSurface);
232 if (!extrapolatedParameters)
return 0.;
238 double sign=(jetMomentum.cross(trackMom)).
dot(trackMom.cross(primaryPos-trackPos));
240 return sign>=0.?1.:-1;
◆ get3DLifetimeSignOfTrack() [2/2]
◆ getUnbiasedVertex() [1/2]
Definition at line 320 of file TrackToVertexIPEstimator.cxx.
323 msg(MSG::INFO) <<
"Empty Trk::TrackParameter pointer passed. Returning zero " <<
endmsg;
327 msg(MSG::INFO) <<
"Empty xAOD::Vertex pointer passed. Returning zero " <<
endmsg;
333 ATH_MSG_DEBUG(
"This vertex has no associated tracks. Normal if beam spot is used. Vertex already unbiased");
342 bool tmpLinTrack =
false;
349 if ((testTP.position() ==
pos) and (testTP.momentum() ==
mom)) {
351 const LinearizedTrack *linTrack =
nullptr;
352 double trackWeight(0.0);
365 ATH_MSG_INFO(
"Failing to linearized track. Returning biased vertex.");
379 double trk_chi =
m_Updator->trackParametersChi2( reducedVertex, linTrack );
380 chi2 += -1 * (
m_Updator->vertexPositionChi2(*vtx, reducedVertex) + trackWeight * trk_chi);
384 ndf += -1 * trackWeight * (2.0);
393 if (tmpLinTrack)
delete linTrack;
◆ getUnbiasedVertex() [2/2]
◆ getZLifetimeSignOfTrack() [1/2]
Definition at line 284 of file TrackToVertexIPEstimator.cxx.
290 PerigeeSurface perigeeSurface(lp);
292 std::unique_ptr<const Trk::TrackParameters> extrapolatedParameters =
294 Gaudi::Hive::currentContext(),
track, perigeeSurface);
296 if (!extrapolatedParameters)
return 0.;
298 double trackTheta = extrapolatedParameters->parameters()[
Trk::theta];
299 double trackZ0 = extrapolatedParameters->parameters()[
Trk::z0];
300 double trackEta = -logf(tanf(trackTheta/2.));
301 double jetEta = jetMomentum.eta();
302 double zs = (jetEta -
trackEta)*trackZ0;
303 return (zs>=0. ? 1. : -1.);
◆ getZLifetimeSignOfTrack() [2/2]
◆ initialize()
StatusCode Trk::TrackToVertexIPEstimator::initialize |
( |
| ) |
|
|
overridevirtual |
Default Athena interface methods.
Definition at line 26 of file TrackToVertexIPEstimator.cxx.
33 return StatusCode::FAILURE;
39 return StatusCode::FAILURE;
46 return StatusCode::FAILURE;
49 return StatusCode::SUCCESS;
◆ m_extrapolator
◆ m_linFactory
◆ m_Updator
The documentation for this class was generated from the following files:
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
@ z
global position (cartesian)
Vertex_v1 Vertex
Define the latest version of the vertex class.
const Amg::Vector3D & position() const
Access method for the position.
Eigen::Matrix< double, 2, 1 > Vector2D
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
const Amg::Vector3D & position() const
Returns the 3-pos.
std::unique_ptr< ImpactParametersAndSigma > calculate(const TrackParameters *track, const xAOD::Vertex &vtx) const
A method calculating the do and its error.
bool const RAWDATA *ch2 const
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
virtual xAOD::Vertex * getUnbiasedVertex(const xAOD::TrackParticle *track, const xAOD::Vertex *vtx) const override
AmgSymMatrix(5) &GXFTrackState
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
virtual double get2DLifetimeSignOfTrack(const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override
ToolHandle< Trk::IExtrapolator > m_extrapolator
double chi2(TH1 *h0, TH1 *h1)
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
void clearTracks()
Remove all tracks from the vertex.
def dot(G, fn, nodesToHighlight=[])
Ensure that the ATLAS eigen extensions are properly loaded.
Definition of ATLAS Math & Geometry primitives (Amg)
float trackWeight(size_t i) const
Get the weight of a given track in the vertex reconstruction.
Eigen::Matrix< double, 3, 1 > Vector3D
ToolHandle< Trk::IVertexLinearizedTrackFactory > m_linFactory
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
const Amg::Vector3D & momentum() const
Access method for the momentum.
float chiSquared() const
Returns the of the vertex fit as float.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
virtual double get3DLifetimeSignOfTrack(const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override
virtual double getZLifetimeSignOfTrack(const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
virtual std::unique_ptr< ImpactParametersAndSigma > estimate(const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doRemoval) const override
Estimate methods returning a d0 and its calculated sigma.
bool vxTrackAtVertexAvailable() const
Check if VxTrackAtVertices are attached to the object.
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
ToolHandle< Trk::IVertexUpdator > m_Updator
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)