|
ATLAS Offline Software
|
#include <SequentialVertexFitter.h>
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
| SequentialVertexFitter (const std::string &t, const std::string &n, const IInterface *p) |
| constructor More...
|
|
virtual | ~SequentialVertexFitter () |
| destructor More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const std::vector< const xAOD::NeutralParticle * > &vectorNeut, const Amg::Vector3D &startingPoint) const override |
| Interface for xAOD::TrackParticle and xAOD::NeutralParticle with starting point. More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const Amg::Vector3D &startingPoint) const override |
| Interface for xAOD::TrackParticle with starting point. More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const std::vector< const xAOD::NeutralParticle * > &vectorNeut, const xAOD::Vertex &constraint) const override |
| Interface for xAOD::TrackParticle and xAOD::NeutralParticle with vertex constraint the position of the constraint is ALWAYS the starting point. More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const xAOD::Vertex &constraint) const override |
| Interface for xAOD::TrackParticle with vertex constraint the position of the constraint is ALWAYS the starting point. More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< const Trk::NeutralParameters * > &neutralPerigeeList, const Amg::Vector3D &startingPoint) const override |
| Vertex fit from list of track and neutral parameters and a starting point. More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const Trk::TrackParameters * > ¶mList, const Amg::Vector3D &startingPoint) const override |
| Vertex fit from list of track and parameters and a starting point. More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< const Trk::NeutralParameters * > &neutralPerigeeList, const xAOD::Vertex &constraint) const override |
| Vertex fit from the vector of track and neutral parameters with a preliminary knowledge (vertex constraint) More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex &constraint) const override |
|
virtual xAOD::Vertex * | fit (const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< const Trk::NeutralParameters * > &neutralPerigeeList) const override |
| Additional fit methods. More...
|
|
virtual xAOD::Vertex * | fit (const std::vector< const Trk::TrackParameters * > &perigeeList) const override |
|
An iterative vertex fitter, updating the vertex estimate with a single at the time. The measurement equation is relinearized with the position of the resulting estimate and the vertex is refit The iterations are performed until the vertex position improves or the maximal niumber of iterations is reached. Smoothing (refit of tracks with the knowledge of the vertex position) is then performed on request.
The fitter can be used with arbitrary VertexUpdator, VertexSmoother and LinearizedTrackFactory
- Author
- Kirill Prokofiev, November 2005
Changes:
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 - from Trk::VxCandidate to xAOD::Vertex, from Trk::RecVertex to xAOD::Vertex, from Trk::Vertex to Amg::Vector3D
Definition at line 55 of file SequentialVertexFitter.h.
◆ SequentialVertexFitter()
Trk::SequentialVertexFitter::SequentialVertexFitter |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~SequentialVertexFitter()
Trk::SequentialVertexFitter::~SequentialVertexFitter |
( |
| ) |
|
|
virtualdefault |
◆ finalize()
StatusCode Trk::SequentialVertexFitter::finalize |
( |
| ) |
|
|
overridevirtual |
◆ fit() [1/10]
Vertex fit from list of track and parameters and a starting point.
Definition at line 117 of file SequentialVertexFitter.h.
119 {
return fit(paramList, std::vector<const Trk::NeutralParameters*>(), startingPoint);};
◆ fit() [2/10]
◆ fit() [3/10]
Additional fit methods.
These will later work with selected finder.. So far these methods work with default (0,0,0) starting point and "huge" diagonal error matrix
Definition at line 135 of file SequentialVertexFitter.cxx.
142 return fit(perigeeList, neutralPerigeeList, start_point);
◆ fit() [4/10]
Vertex fit from list of track and neutral parameters and a starting point.
Definition at line 98 of file SequentialVertexFitter.cxx.
107 xAOD::Vertex * FittedVertex =
fit(perigeeList, neutralPerigeeList, constraint);
110 if(FittedVertex !=
nullptr )
116 for(
unsigned int i = 0;
i <perigeeList.size(); ++
i)
122 for(
unsigned int i = 0;
i <neutralPerigeeList.size(); ++
i) {
124 (FittedVertex->
vxTrackAtVertex())[perigeeList.size()+
i].setInitialPerigee(iPer);
◆ fit() [5/10]
Vertex fit from the vector of track and neutral parameters with a preliminary knowledge (vertex constraint)
Definition at line 148 of file SequentialVertexFitter.cxx.
154 if(perigeeList.empty())
156 ATH_MSG_INFO(
"Empty vector of tracks passed, returning 0" );
163 const AmgSymMatrix(3)& initialVertexError = constraint.covariancePosition();
169 bool priorInfo=false;
172 if(initialVertexError.trace() == 0.)
177 float diag = 1000000.0;
180 priorErrorMatrix = in_m * diag;
188 priorErrorMatrix = initialVertexError;
191 std::unique_ptr<xAOD::Vertex> returnVertex = std::make_unique<xAOD::Vertex>();
199 std::vector<Trk::VxTrackAtVertex> tracks_to_fit =
linearizeTracks(perigeeList, neutralPerigeeList, *returnVertex);
200 std::vector<Trk::VxTrackAtVertex> fittedTracks(0);
208 double previousChi2{};
209 unsigned int n_iter = 0;
215 auto deltaChi2 = [](
double chi1,
double chi0){
216 return std::abs((chi1-chi0)*2./(chi1+chi0+2.));
238 if (new_vertex != returnVertex.get()) {
239 returnVertex.reset( new_vertex );
244 previousPreviousPosition = previousPosition;
245 previousPosition = newPosition;
246 previousChi2 = newChi2;
247 newPosition = returnVertex->
position();
252 deltaR = (previousPosition - newPosition).
perp();
262 ATH_MSG_DEBUG(
" steps. Deltachi2: " << deltaChi2(newChi2, previousChi2) );
264 returnVertex.reset();
268 if(returnVertex !=
nullptr){
271 ATH_MSG_INFO(
"Sequential vertex fit fails:: zero pointer returned" );
275 return returnVertex.release();
◆ fit() [6/10]
◆ fit() [7/10]
◆ fit() [8/10]
◆ fit() [9/10]
Interface for xAOD::TrackParticle and xAOD::NeutralParticle with vertex constraint the position of the constraint is ALWAYS the starting point.
Definition at line 376 of file SequentialVertexFitter.cxx.
379 if(vectorTrk.empty())
385 if(vectorNeut.empty())
394 std::vector<const Trk::TrackParameters*> measuredPerigees;
395 std::vector<const xAOD::TrackParticle*> trkToFit;
397 for(std::vector<const xAOD::TrackParticle*>::const_iterator
i = vectorTrk.begin();
i!= vectorTrk.end();++
i)
400 bool foundDuplicate(
false);
401 for (std::vector<const xAOD::TrackParticle*>::const_iterator j = vectorTrk.begin(); j!=
i; ++j) {
403 ATH_MSG_WARNING(
"Duplicate track given as input to the fitter. Ignored." );
404 foundDuplicate =
true;
408 if (foundDuplicate)
continue;
412 if(tmpMeasPer!=
nullptr) {
413 trkToFit.push_back(*
i);
414 measuredPerigees.push_back(tmpMeasPer);
416 ATH_MSG_INFO(
"Failed to dynamic_cast this track parameters to perigee" );
421 std::vector<const Trk::NeutralParameters*> measuredNeutralPerigees;
422 std::vector<const xAOD::NeutralParticle*> neutToFit;
423 for(std::vector<const xAOD::NeutralParticle*>::const_iterator
i = vectorNeut.begin();
i!= vectorNeut.end();++
i)
426 bool foundDuplicate(
false);
427 for (std::vector<const xAOD::NeutralParticle*>::const_iterator j = vectorNeut.begin(); j!=
i; ++j) {
429 ATH_MSG_WARNING(
"Duplicate neutral given as input to the fitter. Ignored." );
430 foundDuplicate =
true;
434 if (foundDuplicate)
continue;
438 if(tmpMeasPer!=
nullptr) {
439 neutToFit.push_back(*
i);
440 measuredNeutralPerigees.push_back(tmpMeasPer);
442 ATH_MSG_INFO(
"Failed to dynamic_cast this neutral parameters to perigee" );
447 xAOD::Vertex* fittedVertex =
fit( measuredPerigees, measuredNeutralPerigees, constraint );
451 if(fittedVertex ==
nullptr)
460 for(
unsigned int i = 0;
i <trkToFit.size(); ++
i)
463 LinkToXAODTrackParticle* linkTT=
new LinkToXAODTrackParticle();
467 if( ! linkTT->toIndexedElement( *cont, trkToFit[
i ]->index() ) )
480 for(
unsigned int i = 0;
i <neutToFit.size(); ++
i)
482 LinkToXAODNeutralParticle* linkTT =
new LinkToXAODNeutralParticle();
486 if( ! linkTT->toIndexedElement( *cont, neutToFit[
i ]->index() ) )
495 ( fittedVertex->
vxTrackAtVertex() )[trkToFit.size()+
i].setOrigTrack(linkTT);
504 for (
unsigned int i = 0 ;
i < VTAVsize ; ++
i)
509 ATH_MSG_WARNING(
"Trying to set link to xAOD::TrackParticle. The VxTrackAtVertex is not found" );
527 if (!linkToXAODTPneutral) {
528 ATH_MSG_WARNING(
"Skipping track. Trying to set link to something else than xAOD::TrackParticle or xAOD::NeutralParticle." );
◆ fit() [10/10]
Interface for xAOD::TrackParticle with vertex constraint the position of the constraint is ALWAYS the starting point.
Definition at line 100 of file SequentialVertexFitter.h.
102 {
return fit(vectorTrk, std::vector<const xAOD::NeutralParticle*>(), constraint);};
◆ initialize()
StatusCode Trk::SequentialVertexFitter::initialize |
( |
| ) |
|
|
overridevirtual |
◆ linearizeTracks()
Internal method related to the linearization of tracks (initial linearization)
Definition at line 280 of file SequentialVertexFitter.cxx.
286 std::vector<Trk::VxTrackAtVertex> out_tracks(0);
287 for(
const auto *
i : perigeeList)
293 if( loc_per !=
nullptr)
304 out_tracks.push_back(*vTrack);
309 ATH_MSG_WARNING(
"Cannot linearize tracks; treatment of neutrals not yet supported" );
314 for(
const auto *
i : neutralPerigeeList)
320 if( loc_per !=
nullptr)
330 out_tracks.push_back(*vTrack);
335 ATH_MSG_WARNING(
"Cannot linearize tracks; treatment of neutrals not yet supported" );
◆ reLinearizeTracks()
Relinearization on iterations.
Definition at line 343 of file SequentialVertexFitter.cxx.
346 if ( linVertexPos.perp() >
m_maxR || std::abs(linVertexPos.z()) >
m_maxZ )
348 ATH_MSG_DEBUG(
" Linearization position outside ID. Setting back to (0,0,0) " );
354 std::vector<Trk::VxTrackAtVertex>& out_tracks = tracks;
◆ m_doSmoothing
bool Trk::SequentialVertexFitter::m_doSmoothing |
|
private |
◆ m_LinTrkFactory
◆ m_maxDeltaChi2
float Trk::SequentialVertexFitter::m_maxDeltaChi2 |
|
private |
◆ m_maxR
double Trk::SequentialVertexFitter::m_maxR |
|
private |
◆ m_maxShift
float Trk::SequentialVertexFitter::m_maxShift |
|
private |
◆ m_maxStep
unsigned int Trk::SequentialVertexFitter::m_maxStep |
|
private |
◆ m_maxZ
double Trk::SequentialVertexFitter::m_maxZ |
|
private |
◆ m_Smoother
◆ m_Updator
◆ m_useLooseConvergence
bool Trk::SequentialVertexFitter::m_useLooseConvergence |
|
private |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
ToolHandle< IVertexUpdator > m_Updator
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
float m_maxDeltaChi2
Max DeltaChi2 allowed in hard convergence criterium.
Scalar perp() const
perp method - perpenticular length
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
ToolHandle< IVertexSmoother > m_Smoother
const Amg::Vector3D & position() const
Returns the 3-pos.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
void setWeight(const double)
Set method for a weight.
ToolHandle< Trk::IVertexLinearizedTrackFactory > m_LinTrkFactory
AmgSymMatrix(5) &GXFTrackState
void setVertexType(VxType::VertexType vType)
Set the type of the vertex.
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
virtual xAOD::Vertex * fit(const std::vector< const xAOD::TrackParticle * > &vectorTrk, const std::vector< const xAOD::NeutralParticle * > &vectorNeut, const Amg::Vector3D &startingPoint) const override
Interface for xAOD::TrackParticle and xAOD::NeutralParticle with starting point.
ParametersT< NeutralParametersDim, Neutral, PerigeeSurface > NeutralPerigee
Element link to XAOD TrackParticle.
float z() const
Returns the z position.
void makePrivateStore()
Create a new (empty) private store for this object.
Eigen::Matrix< double, 3, 1 > Vector3D
Element link to XAOD NeutralParticle.
bool m_useLooseConvergence
Use loose convergence criterium (maxShift) or hard (+maxDeltaChi2)
void addNeutralAtVertex(const ElementLink< NeutralParticleContainer > &tr, float weight=1.0)
Add a new neutral to the vertex.
float chiSquared() const
Returns the of the vertex fit as float.
Class describing a Vertex.
bool m_doSmoothing
Flag controlling optional smoothing.
#define ATH_MSG_WARNING(x)
void reLinearizeTracks(std::vector< Trk::VxTrackAtVertex > &tracks, const Amg::Vector3D &vrt) const
Relinearization on iterations.
std::vector< Trk::VxTrackAtVertex > linearizeTracks(const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< const Trk::NeutralParameters * > &neutralPerigeeList, const xAOD::Vertex &vrt) const
Internal method related to the linearization of tracks (initial linearization)
float m_maxShift
Max shift (represents the convergence criterion)
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
bool vxTrackAtVertexAvailable() const
Check if VxTrackAtVertices are attached to the object.
@ NotSpecified
Default value, no explicit type set.
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
unsigned int m_maxStep
Max number of iterations to perform (in case of no convergence)