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;
48 const TLorentzVector& jetMomentum,
49 std::vector< const Trk::ITrackLink* >& inputTracks)
const {
51 std::vector< const xAOD::Vertex* > VtxCandidates;
53 ATH_MSG_DEBUG(
"Looping over " << inputTracks.size() <<
" input tracks... " );
56 for (
unsigned int indexA(0); indexA<inputTracks.size(); indexA++ ) {
59 for (
unsigned int indexB(0); indexB<indexA; indexB++ ) {
64 if ( myCandidate ==
nullptr )
continue;
67 std::vector< const Trk::ITrackLink* > associatedTracksAtVertex;
68 associatedTracksAtVertex.push_back( trackA );
69 associatedTracksAtVertex.push_back( trackB );
72 VtxCandidates.push_back( myCandidate );
77 ATH_MSG_DEBUG(
"Found " << VtxCandidates.size() <<
" 2-trk vertex candidates!" );
80 std::vector< const Trk::TrackParticleBase* >() );
81 return twoTrackVerticesInJet;
85 const TLorentzVector& jetMomentum,
92 std::vector< const Trk::TrackParameters* > perigeeToFit;
93 perigeeToFit.push_back( perigeeTrackA );
94 perigeeToFit.push_back( perigeeTrackB );
100 if ( seedVertex.perp() >
m_maxR ||
101 fabs( seedVertex.z() ) >
m_maxZ ) {
102 ATH_MSG_DEBUG(
"Vertex seed outside ID. R=" << seedVertex.perp() <<
" Z=" << seedVertex.z() );
103 seedVertex = primaryVertex.
position();
107 ATH_MSG_DEBUG(
"Seed finding failed. Using primary vertex as seed... (clearly not optimal)" );
112 " y=" << seedVertex.y() <<
113 " z=" << seedVertex.z() );
120 if ( myCandidate ==
nullptr ) {
121 ATH_MSG_DEBUG(
" Sequential fit failed. shouldn't happen... Skipping V0 candidate... " );
128 ATH_MSG_DEBUG(
" Fit for V0 candidate failed: chi2 or ndf negative. Deleting candidate..." );
134 ATH_MSG_DEBUG(
" Candidate not satisfying two-vertex probability " );
139 Amg::Vector3D jetMomSpatial( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() );
141 double sign = ( twoTrkVtxPos-primaryVertex.
position() ).dot( jetMomSpatial );
144 ATH_MSG_DEBUG(
"Not satisfying sign and revertFromPositiveToNegativeTags requirements" );
149 " y=" << myCandidate->
y() <<
150 " z=" << myCandidate->
z() );
152 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.