15 using namespace InDet;
19 m_tracksDecorator(
"VxTrackAtVertex" )
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;
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();