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

A class estimating the transverse impact parameter d0 and its error of a given track wrt to the reconstructed vertex. More...

#include <TrackToVertexIPEstimator.h>

Inheritance diagram for Trk::TrackToVertexIPEstimator:
Collaboration diagram for Trk::TrackToVertexIPEstimator:

Public Member Functions

virtual StatusCode initialize () override
 Default Athena interface methods.
 TrackToVertexIPEstimator (const std::string &t, const std::string &n, const IInterface *p)
 Default Athena interface constructor and destructor.
 ~TrackToVertexIPEstimator ()
virtual std::unique_ptr< ImpactParametersAndSigmaestimate (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doRemoval) const override
 Estimate methods returning a d0 and its calculated sigma.
virtual std::unique_ptr< ImpactParametersAndSigmaestimate (const TrackParameters *track, const xAOD::Vertex *vtx, bool doRemoval) const override
virtual std::unique_ptr< ImpactParametersAndSigmaestimate (const xAOD::TrackParticle *track, const xAOD::TrackParticle *newtrack, const xAOD::Vertex *vtx, bool doRemoval) const override
virtual std::unique_ptr< ImpactParametersAndSigmaestimate (const TrackParameters *track, const TrackParameters *newtrack, const xAOD::Vertex *vtx, bool doRemoval) const override
virtual xAOD::VertexgetUnbiasedVertex (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx) const override
virtual xAOD::VertexgetUnbiasedVertex (const TrackParameters *track, const xAOD::Vertex *vtx) const override
virtual std::unique_ptr< ImpactParametersAndSigmaestimate (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx) const override
virtual std::unique_ptr< ImpactParametersAndSigmaestimate (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

Private Member Functions

std::unique_ptr< ImpactParametersAndSigmacalculate (const TrackParameters *track, const xAOD::Vertex &vtx) const
 A method calculating the do and its error.

Private Attributes

ToolHandle< Trk::IExtrapolatorm_extrapolator
ToolHandle< Trk::IVertexUpdatorm_Updator
ToolHandle< Trk::IVertexLinearizedTrackFactorym_linFactory

Detailed Description

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.

Constructor & Destructor Documentation

◆ TrackToVertexIPEstimator()

Trk::TrackToVertexIPEstimator::TrackToVertexIPEstimator ( const std::string & t,
const std::string & n,
const IInterface * p )

Default Athena interface constructor and destructor.

Definition at line 19 of file TrackToVertexIPEstimator.cxx.

19 :
20 base_class(t,n,p)
21 {
22 }

◆ ~TrackToVertexIPEstimator()

Trk::TrackToVertexIPEstimator::~TrackToVertexIPEstimator ( )
default

Member Function Documentation

◆ calculate()

std::unique_ptr< ImpactParametersAndSigma > Trk::TrackToVertexIPEstimator::calculate ( const TrackParameters * track,
const xAOD::Vertex & vtx ) const
private

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.

122 {
123 //estimating the d0 and its significance by propagating the trajectory state towards
124 //the vertex position. By this time the vertex should NOT contain this trajectory anymore
125
126 //estrapolating to the perigee of the reconstructed vertex
127 const Amg::Vector3D & lp = vtx.position();
128 PerigeeSurface perigeeSurface(lp);
129 const Trk::Perigee* extrapolatedParameters =
130 dynamic_cast<const Trk::Perigee*>(
132 ->extrapolate(Gaudi::Hive::currentContext(), *track, perigeeSurface)
133 .release());
134 if (extrapolatedParameters && extrapolatedParameters->covariance()) {
135
136 //actual calculation of d0 and sigma.
137 const AmgVector(5) & par = extrapolatedParameters->parameters();
138 const double d0 = par[Trk::d0];
139 const double z0 = par[Trk::z0];
140 const double phi = par[Trk::phi];
141 const double theta = par[Trk::theta];
142
143 AmgSymMatrix(2) vrtXYCov = vtx.covariancePosition().block<2,2>(0,0);
144
145 const AmgSymMatrix(5) & perigeeCov = *(extrapolatedParameters->covariance());
146 // std::cout<<"Perigee covariance: "<<perigeeCov<<std::endl;
147
148 //d0phi->cartesian Jacobian
149 Amg::Vector2D d0JacXY(-sin(phi), cos(phi));
150
151
152 auto newIPandSigma=std::make_unique<ImpactParametersAndSigma>();
153 newIPandSigma->IPd0=d0;
154 double d0_PVcontrib=d0JacXY.transpose()*(vrtXYCov*d0JacXY);
155 if (d0_PVcontrib>=0)
156 {
157 newIPandSigma->sigmad0=sqrt(d0_PVcontrib+perigeeCov(Trk::d0,Trk::d0));
158 newIPandSigma->PVsigmad0=sqrt(d0_PVcontrib);
159 }
160 else
161 {
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;
163 newIPandSigma->sigmad0=sqrt(perigeeCov(Trk::d0,Trk::d0));
164 newIPandSigma->PVsigmad0=0;
165 }
166
167 AmgSymMatrix(2) covPerigeeZ0Theta;
168 covPerigeeZ0Theta(0,0)=perigeeCov(Trk::z0,Trk::z0);
169 covPerigeeZ0Theta(0,1)=perigeeCov(Trk::z0,Trk::theta);
170 covPerigeeZ0Theta(1,0)=perigeeCov(Trk::theta,Trk::z0);
171 covPerigeeZ0Theta(1,1)=perigeeCov(Trk::theta,Trk::theta);
172
173 double vrtZZCov = vtx.covariancePosition()(Trk::z,Trk::z);
174
175 Amg::Vector2D IPz0JacZ0Theta (sin(theta), z0*cos(theta));
176 if (vrtZZCov>=0)
177 {
178 newIPandSigma->IPz0SinTheta=z0*sin(theta);
179 newIPandSigma->sigmaz0SinTheta=
180 sqrt(IPz0JacZ0Theta.transpose()*(covPerigeeZ0Theta*IPz0JacZ0Theta)+sin(theta)*vrtZZCov*sin(theta));
181 newIPandSigma->PVsigmaz0SinTheta=sqrt(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 );
185 }
186 else
187 {
188 ATH_MSG_WARNING(" The contribution to z0_err: " << vrtZZCov << " from PV is negative: critical error in PV error matrix! Removing contribution from PV ... ");
189 newIPandSigma->IPz0SinTheta=z0*sin(theta);
190 double temp = (IPz0JacZ0Theta.transpose()*(covPerigeeZ0Theta*IPz0JacZ0Theta));
191 newIPandSigma->sigmaz0SinTheta=sqrt(temp);
192 newIPandSigma->PVsigmaz0SinTheta=0;
193
194 newIPandSigma->IPz0 = z0;
195 newIPandSigma->sigmaz0 = std::sqrt( perigeeCov(Trk::z0,Trk::z0) );
196 newIPandSigma->PVsigmaz0 = 0;
197 }
198
199
200 delete extrapolatedParameters;
201 return newIPandSigma;
202 }
203 ATH_MSG_DEBUG ("Cannot extrapolate the trajectory state. Returning null. ");
204 return nullptr;
205 //end of successfull extrapolation check
206 }//end of actual calculation method
#define endmsg
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define AmgSymMatrix(dim)
#define AmgVector(rows)
if(febId1==febId2)
ToolHandle< Trk::IExtrapolator > m_extrapolator
const Amg::Vector3D & position() const
Returns the 3-pos.
static std::string release
Definition computils.h:50
Eigen::Matrix< double, 3, 1 > Vector3D
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ theta
Definition ParamDefs.h:66
@ phi
Definition ParamDefs.h:75
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
MsgStream & msg
Definition testRead.cxx:32

◆ estimate() [1/6]

std::unique_ptr< ImpactParametersAndSigma > Trk::TrackToVertexIPEstimator::estimate ( const TrackParameters * track,
const TrackParameters * newtrack,
const xAOD::Vertex * vtx,
bool doRemoval ) const
overridevirtual

Definition at line 89 of file TrackToVertexIPEstimator.cxx.

90 {
91
92 if (vtx==nullptr)
93 {
94 ATH_MSG_WARNING("Vertex is zero pointer. Will not estimate IP of track.");
95 return nullptr;
96 }
97
98 const xAOD::Vertex *newVertex = vtx;
99 if (doRemoval)
100 {
101 newVertex = getUnbiasedVertex(track,vtx);
102 if (newVertex == nullptr) {
103 ATH_MSG_WARNING("Unbiasing of vertex failed. Will not estimate IP of track.");
104 return nullptr;
105 }
106 }
107
108 std::unique_ptr<ImpactParametersAndSigma> IPandSigma=calculate(newtrack,*newVertex);
109
110 if (doRemoval)
111 {
112 delete newVertex;
113 newVertex=nullptr;
114 }
115
116 return IPandSigma;
117
118 }//end of parameterBase estimate method
std::unique_ptr< ImpactParametersAndSigma > calculate(const TrackParameters *track, const xAOD::Vertex &vtx) const
A method calculating the do and its error.
virtual xAOD::Vertex * getUnbiasedVertex(const xAOD::TrackParticle *track, const xAOD::Vertex *vtx) const override
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ estimate() [2/6]

std::unique_ptr< ImpactParametersAndSigma > Trk::TrackToVertexIPEstimator::estimate ( const TrackParameters * track,
const xAOD::Vertex * vtx ) const
overridevirtual

Definition at line 419 of file TrackToVertexIPEstimator.cxx.

421 {
422
423 if(track && vtx ){
424 return calculate( track , *vtx);
425 }
426 return nullptr;
427
428 }

◆ estimate() [3/6]

std::unique_ptr< ImpactParametersAndSigma > Trk::TrackToVertexIPEstimator::estimate ( const TrackParameters * track,
const xAOD::Vertex * vtx,
bool doRemoval ) const
overridevirtual

Definition at line 78 of file TrackToVertexIPEstimator.cxx.

79 {
80 if(track && vtx){
81 return estimate(track,track,vtx,doRemoval);
82 }
83 ATH_MSG_INFO( "Empty TrackParticle or Vertex pointer passed. Returning zero " );
84 return nullptr;
85 //end of track particle validity check
86
87 }//end of parameterBase estimate method
#define ATH_MSG_INFO(x)
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.

◆ estimate() [4/6]

std::unique_ptr< ImpactParametersAndSigma > Trk::TrackToVertexIPEstimator::estimate ( const xAOD::TrackParticle * track,
const xAOD::TrackParticle * newtrack,
const xAOD::Vertex * vtx,
bool doRemoval ) const
overridevirtual

Definition at line 64 of file TrackToVertexIPEstimator.cxx.

65 {
66 if(track && vtx)
67 {
68 return estimate(&(track->perigeeParameters()),&(newtrack->perigeeParameters()),vtx,doRemoval);
69 }
70 ATH_MSG_INFO( "Empty TrackParticle or Vertex pointer passed. Returning zero " );
71 return nullptr;
72 //end of track particle validity check
73 }//end of method using track particles
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.

◆ estimate() [5/6]

std::unique_ptr< ImpactParametersAndSigma > Trk::TrackToVertexIPEstimator::estimate ( const xAOD::TrackParticle * track,
const xAOD::Vertex * vtx ) const
overridevirtual

Definition at line 408 of file TrackToVertexIPEstimator.cxx.

410 {
411
412 if(track && vtx ){
413 return estimate( &(track->perigeeParameters()), vtx);
414 }
415 return nullptr;
416
417 }

◆ estimate() [6/6]

std::unique_ptr< ImpactParametersAndSigma > Trk::TrackToVertexIPEstimator::estimate ( const xAOD::TrackParticle * track,
const xAOD::Vertex * vtx,
bool doRemoval ) const
overridevirtual

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.

54 {
55 if(track && vtx)
56 {
57 return estimate(&(track->perigeeParameters()),&(track->perigeeParameters()),vtx,doRemoval);
58 }
59 ATH_MSG_INFO( "Empty TrackParticle or Vertex pointer passed. Returning zero " );
60 return nullptr;
61 //end of track particle validity check
62 }//end of method using track particles

◆ get2DLifetimeSignOfTrack() [1/2]

double Trk::TrackToVertexIPEstimator::get2DLifetimeSignOfTrack ( const TrackParameters & track,
const Amg::Vector3D & jetDirection,
const xAOD::Vertex & primaryVertex ) const
overridevirtual

Definition at line 253 of file TrackToVertexIPEstimator.cxx.

256 {
257 const Amg::Vector3D & lp = primaryVertex.position();
258 PerigeeSurface perigeeSurface(lp);
259
260 std::unique_ptr<const Trk::TrackParameters> extrapolatedParameters =
261 m_extrapolator->extrapolate(
262 Gaudi::Hive::currentContext(), track, perigeeSurface);
263
264 if (!extrapolatedParameters) return 0.;
265
266 double trackD0 = extrapolatedParameters->parameters()[Trk::d0];
267 double trackPhi = extrapolatedParameters->parameters()[Trk::phi];
268 double vs = sinf( atan2(jetMomentum.y(),jetMomentum.x()) - trackPhi )*trackD0;
269
270 return (vs>=0. ? 1. : -1.);
271 }
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, float &out)

◆ get2DLifetimeSignOfTrack() [2/2]

double Trk::TrackToVertexIPEstimator::get2DLifetimeSignOfTrack ( const TrackParameters & track,
const CLHEP::Hep3Vector & jetDirection,
const xAOD::Vertex & primaryVertex ) const
overridevirtual

Definition at line 245 of file TrackToVertexIPEstimator.cxx.

248 {
249 Amg::Vector3D eigenJetMomentum(jetMomentum.x(), jetMomentum.y(), jetMomentum.z());
250 return get2DLifetimeSignOfTrack(track, eigenJetMomentum, primaryVertex);
251 }
virtual double get2DLifetimeSignOfTrack(const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override

◆ get3DLifetimeSignOfTrack() [1/2]

double Trk::TrackToVertexIPEstimator::get3DLifetimeSignOfTrack ( const TrackParameters & track,
const Amg::Vector3D & jetDirection,
const xAOD::Vertex & primaryVertex ) const
overridevirtual

Definition at line 221 of file TrackToVertexIPEstimator.cxx.

224 {
225 const Amg::Vector3D & lp = primaryVertex.position();
226 PerigeeSurface perigeeSurface(lp);
227
228 std::unique_ptr<const Trk::TrackParameters> extrapolatedParameters =
229 m_extrapolator->extrapolate(
230 Gaudi::Hive::currentContext(), track, perigeeSurface);
231
232 if (!extrapolatedParameters) return 0.;
233
234 const Amg::Vector3D & primaryPos=primaryVertex.position();
235 const Amg::Vector3D & trackPos=extrapolatedParameters->position();
236 const Amg::Vector3D & trackMom=extrapolatedParameters->momentum();
237
238 double sign=(jetMomentum.cross(trackMom)).dot(trackMom.cross(primaryPos-trackPos));
239
240 return sign>=0.?1.:-1;
241 }
int sign(int a)

◆ get3DLifetimeSignOfTrack() [2/2]

double Trk::TrackToVertexIPEstimator::get3DLifetimeSignOfTrack ( const TrackParameters & track,
const CLHEP::Hep3Vector & jetDirection,
const xAOD::Vertex & primaryVertex ) const
overridevirtual

Definition at line 213 of file TrackToVertexIPEstimator.cxx.

216 {
217 Amg::Vector3D eigenJetMomentum(jetMomentum.x(), jetMomentum.y(), jetMomentum.z());
218 return get3DLifetimeSignOfTrack(track, eigenJetMomentum, primaryVertex);
219 }
virtual double get3DLifetimeSignOfTrack(const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override

◆ getUnbiasedVertex() [1/2]

xAOD::Vertex * Trk::TrackToVertexIPEstimator::getUnbiasedVertex ( const TrackParameters * track,
const xAOD::Vertex * vtx ) const
overridevirtual

Definition at line 320 of file TrackToVertexIPEstimator.cxx.

321 {
322 if (!track) {
323 msg(MSG::INFO) << "Empty Trk::TrackParameter pointer passed. Returning zero " << endmsg;
324 return nullptr;
325 }
326 if (!vtx) {
327 msg(MSG::INFO) << "Empty xAOD::Vertex pointer passed. Returning zero " << endmsg;
328 return nullptr;
329 }
330
331 if (vtx->nTrackParticles() == 0)
332 {
333 ATH_MSG_DEBUG("This vertex has no associated tracks. Normal if beam spot is used. Vertex already unbiased");
334 return new xAOD::Vertex(*vtx);
335 }
336
337 //create new vertex for output
338 xAOD::Vertex *outputVertex = new xAOD::Vertex(*vtx);
339 outputVertex->clearTracks(); //remove all tracks -> will add them back one by one
340 if (outputVertex->vxTrackAtVertexAvailable()) outputVertex->vxTrackAtVertex().clear(); //remove all VxTrackAtVertex
341
342 bool tmpLinTrack = false; //do we created a new linearised track?
343
344 //loop over tracks
345 const Amg::Vector3D & pos = track->position();
346 const Amg::Vector3D & mom = track->momentum();
347 for (unsigned int itrk=0; itrk < vtx->nTrackParticles(); ++itrk) {
348 const Perigee& testTP = vtx->trackParticle(itrk)->perigeeParameters();
349 if ((testTP.position() == pos) and (testTP.momentum() == mom)) {
350 //track found, now unbias the vertex using linearized track
351 const LinearizedTrack *linTrack = nullptr;
352 double trackWeight(0.0);
353 //first check if a VxTrackAtVertex is already available with linearized track
354 if (vtx->vxTrackAtVertexAvailable()) {
355 if (vtx->vxTrackAtVertex().size() > itrk) {
356 linTrack = vtx->vxTrackAtVertex()[itrk].linState();
357 trackWeight = vtx->vxTrackAtVertex()[itrk].weight();
358 }
359 }
360 //if linearized track is not available, create it
361 if (!linTrack) {
362 linTrack = m_linFactory->linearizedTrack(track, vtx->position());
363 trackWeight = vtx->trackWeight(itrk);
364 if (!linTrack) {
365 ATH_MSG_INFO("Failing to linearized track. Returning biased vertex.");
366 outputVertex->addTrackAtVertex(vtx->trackParticleLinks()[itrk], vtx->trackWeight(itrk));
367 if (vtx->vxTrackAtVertexAvailable()) {
368 outputVertex->vxTrackAtVertex().push_back(vtx->vxTrackAtVertex()[itrk]);//will clone everything inside -> output vertex owns all the memory
369 }
370 continue;
371 }
372 tmpLinTrack = true;
373 }
374 //now update vertex position removing the linearized track, and do not add the track back to the output vertex
375 const IVertexUpdator::positionUpdateOutcome & reducedVertex = m_Updator->positionUpdate(*vtx, linTrack, trackWeight,IVertexUpdator::removeTrack);
376
377 //calculate updated chi2
378 double chi2 = vtx->chiSquared();
379 double trk_chi = m_Updator->trackParametersChi2( reducedVertex, linTrack );
380 chi2 += -1 * (m_Updator->vertexPositionChi2(*vtx, reducedVertex) + trackWeight * trk_chi);
381
382 //calculate updated ndf
383 double ndf = vtx->numberDoF();
384 ndf += -1 * trackWeight * (2.0);
385
386 //reducedVertex has the updated position and covariance
387 outputVertex->setPosition(reducedVertex.position);
388 outputVertex->setCovariancePosition(reducedVertex.covariancePosition);
389
390 //chi2 and ndf now store the updated FitQuality
391 outputVertex->setFitQuality( chi2, ndf );
392
393 if (tmpLinTrack) delete linTrack; //only delete if it was created new, and doesn't belong to a vertex
394 } else {
395 //track not to be removed. Add back the track to the vertex collection
396 outputVertex->addTrackAtVertex(vtx->trackParticleLinks()[itrk], vtx->trackWeight(itrk));
397 if (vtx->vxTrackAtVertexAvailable()) {
398 outputVertex->vxTrackAtVertex().push_back(vtx->vxTrackAtVertex()[itrk]);//will clone everything inside -> output vertex owns all the memory
399 }
400 }
401 }
402 return outputVertex;
403
404 }
ToolHandle< Trk::IVertexUpdator > m_Updator
ToolHandle< Trk::IVertexLinearizedTrackFactory > m_linFactory
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
void clearTracks()
Remove all tracks from the vertex.
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
bool vxTrackAtVertexAvailable() const
Check if VxTrackAtVertices are attached to the object.
float chiSquared() const
Returns the of the vertex fit as float.
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
float trackWeight(size_t i) const
Get the weight of a given track in the vertex reconstruction.
double chi2(TH1 *h0, TH1 *h1)

◆ getUnbiasedVertex() [2/2]

xAOD::Vertex * Trk::TrackToVertexIPEstimator::getUnbiasedVertex ( const xAOD::TrackParticle * track,
const xAOD::Vertex * vtx ) const
overridevirtual

Definition at line 309 of file TrackToVertexIPEstimator.cxx.

310 {
311 if(track)
312 {
313 return getUnbiasedVertex(&(track->perigeeParameters()),vtx);
314 }
315 msg(MSG::INFO) << "Empty xAOD::TrackParticle pointer passed. Returning zero " << endmsg;
316 return nullptr;
317 //end of track particle validity check
318 }

◆ getZLifetimeSignOfTrack() [1/2]

double Trk::TrackToVertexIPEstimator::getZLifetimeSignOfTrack ( const TrackParameters & track,
const Amg::Vector3D & jetDirection,
const xAOD::Vertex & primaryVertex ) const
overridevirtual

Definition at line 284 of file TrackToVertexIPEstimator.cxx.

287 {
288
289 const Amg::Vector3D & lp = primaryVertex.position();
290 PerigeeSurface perigeeSurface(lp);
291
292 std::unique_ptr<const Trk::TrackParameters> extrapolatedParameters =
293 m_extrapolator->extrapolate(
294 Gaudi::Hive::currentContext(), track, perigeeSurface);
295
296 if (!extrapolatedParameters) return 0.;
297
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.);
304 }
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, float &out)

◆ getZLifetimeSignOfTrack() [2/2]

double Trk::TrackToVertexIPEstimator::getZLifetimeSignOfTrack ( const TrackParameters & track,
const CLHEP::Hep3Vector & jetDirection,
const xAOD::Vertex & primaryVertex ) const
overridevirtual

Definition at line 276 of file TrackToVertexIPEstimator.cxx.

279 {
280 Amg::Vector3D eigenJetMomentum(jetMomentum.x(), jetMomentum.y(), jetMomentum.z());
281 return getZLifetimeSignOfTrack(track, eigenJetMomentum, primaryVertex);
282 }
virtual double getZLifetimeSignOfTrack(const TrackParameters &track, const Amg::Vector3D &jetDirection, const xAOD::Vertex &primaryVertex) const override

◆ initialize()

StatusCode Trk::TrackToVertexIPEstimator::initialize ( )
overridevirtual

Default Athena interface methods.

Definition at line 26 of file TrackToVertexIPEstimator.cxx.

27 {
28
29 // uploading the corresponding tools
30 // extrapolator
31 if (m_extrapolator.retrieve().isFailure()) {
32 ATH_MSG_FATAL("Failed to retrieve tool " << m_extrapolator);
33 return StatusCode::FAILURE;
34 }
35
36 // updator
37 if (m_Updator.retrieve().isFailure()) {
38 ATH_MSG_FATAL("Failed to retrieve tool " << m_Updator);
39 return StatusCode::FAILURE;
40 }
41
42 // linearized track factory
43 if ( m_linFactory.retrieve().isFailure() )
44 {
45 ATH_MSG_FATAL("Failed to retrieve tool " << m_linFactory );
46 return StatusCode::FAILURE;
47 }
48
49 return StatusCode::SUCCESS;
50 }//end of initialize method
#define ATH_MSG_FATAL(x)

Member Data Documentation

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> Trk::TrackToVertexIPEstimator::m_extrapolator
private
Initial value:
{this, "Extrapolator",
"Trk::Extrapolator"}

Definition at line 148 of file TrackToVertexIPEstimator.h.

148 {this, "Extrapolator",
149 "Trk::Extrapolator"};

◆ m_linFactory

ToolHandle<Trk::IVertexLinearizedTrackFactory> Trk::TrackToVertexIPEstimator::m_linFactory
private
Initial value:
{
this, "LinearizedTrackFactory", "Trk::FullLinearizedTrackFactory"}

Definition at line 152 of file TrackToVertexIPEstimator.h.

152 {
153 this, "LinearizedTrackFactory", "Trk::FullLinearizedTrackFactory"};

◆ m_Updator

ToolHandle<Trk::IVertexUpdator> Trk::TrackToVertexIPEstimator::m_Updator
private
Initial value:
{this, "VertexUpdator",
"Trk::KalmanVertexUpdator"}

Definition at line 150 of file TrackToVertexIPEstimator.h.

150 {this, "VertexUpdator",
151 "Trk::KalmanVertexUpdator"};

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