21 declareInterface< JetFitterTwoTrackVtxFinderTool >(
this);
30 ATH_MSG_ERROR(
"Cannot retrieve Trk::CrossDistancesSeedFinder/CrossDistancesSeedFinder" );
31 return StatusCode::FAILURE;
35 ATH_MSG_ERROR(
"Cannot retrieve Trk::SequentialVertexFitter/SequentialVertexFitter" );
36 return StatusCode::FAILURE;
39 return StatusCode::SUCCESS;
43 return StatusCode::SUCCESS;
49 const TLorentzVector& jetMomentum,
50 std::vector< const Trk::ITrackLink* >& inputTracks)
const {
52 std::vector< const xAOD::Vertex* > VtxCandidates;
54 ATH_MSG_DEBUG(
"Looping over " << inputTracks.size() <<
" input tracks... " );
57 for (
unsigned int indexA(0); indexA<inputTracks.size(); indexA++ ) {
60 for (
unsigned int indexB(0); indexB<indexA; indexB++ ) {
65 if ( myCandidate ==
nullptr )
continue;
68 std::vector< const Trk::ITrackLink* > associatedTracksAtVertex;
69 associatedTracksAtVertex.push_back( trackA );
70 associatedTracksAtVertex.push_back( trackB );
73 VtxCandidates.push_back( myCandidate );
78 ATH_MSG_DEBUG(
"Found " << VtxCandidates.size() <<
" 2-trk vertex candidates!" );
81 std::vector< const Trk::TrackParticleBase* >() );
82 return twoTrackVerticesInJet;
87 const TLorentzVector& jetMomentum,
94 std::vector< const Trk::TrackParameters* > perigeeToFit;
95 perigeeToFit.push_back( perigeeTrackA );
96 perigeeToFit.push_back( perigeeTrackB );
102 if ( seedVertex.perp() >
m_maxR ||
103 fabs( seedVertex.z() ) >
m_maxZ ) {
104 ATH_MSG_DEBUG(
"Vertex seed outside ID. R=" << seedVertex.perp() <<
" Z=" << seedVertex.z() );
105 seedVertex = primaryVertex.
position();
109 ATH_MSG_DEBUG(
"Seed finding failed. Using primary vertex as seed... (clearly not optimal)" );
114 " y=" << seedVertex.y() <<
115 " z=" << seedVertex.z() );
122 if ( myCandidate ==
nullptr ) {
123 ATH_MSG_DEBUG(
" Sequential fit failed. shouldn't happen... Skipping V0 candidate... " );
130 ATH_MSG_DEBUG(
" Fit for V0 candidate failed: chi2 or ndf negative. Deleting candidate..." );
136 ATH_MSG_DEBUG(
" Candidate not satisfying two-vertex probability " );
141 Amg::Vector3D jetMomSpatial( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() );
143 double sign = ( twoTrkVtxPos-primaryVertex.
position() ).dot( jetMomSpatial );
146 ATH_MSG_DEBUG(
"Not satisfying sign and revertFromPositiveToNegativeTags requirements" );
151 " y=" << myCandidate->
y() <<
152 " z=" << myCandidate->
z() );
154 return myCandidate.release();
An abstract class which is meant to represent an element link to the Trk::Track or Trk::TrackParticle...
virtual const TrackParameters * parameters() const =0
return the track parameters of the track or TrackParticleBase)
float z() const
Returns the z position.
float y() const
Returns the y position.
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
float chiSquared() const
Returns the of the vertex fit as float.
const Amg::Vector3D & position() const
Returns the 3-pos.
float x() const
Returns the x position.
Eigen::Matrix< double, 3, 1 > Vector3D
ParametersBase< TrackParametersDim, Charged > TrackParameters
Vertex_v1 Vertex
Define the latest version of the vertex class.