12 declareInterface< JetFitterTrackSelectorTool >(
this);
20 msg(MSG::ERROR) <<
" Unable to retrieve InDet::InDetDetailedTrackSelectorTool" <<
endmsg;
21 return StatusCode::FAILURE;
25 msg(MSG::ERROR) <<
" Unable to retrieve InDet::InDetJetFitterUtils/InDetJetFitterUtils" <<
endmsg;
26 return StatusCode::FAILURE;
30 msg(MSG::ERROR) <<
" Unable to retrieve Trk::Extrapolator/InDetExtrapolator" <<
endmsg;
31 return StatusCode::FAILURE;
34 return StatusCode::SUCCESS;
39 const TLorentzVector &jetMomentum,
40 const std::vector<const xAOD::IParticle *> &
inputTracks)
const {
54 std::vector< const Trk::ITrackLink* > primaryTrackLinks;
55 std::vector< const Trk::ITrackLink* > secondaryTrackLinks;
58 std::vector<const xAOD::IParticle *>::const_iterator trk_iter =
inputTracks.begin();
59 std::vector<const xAOD::IParticle*>::const_iterator trk_end =
inputTracks.end();
62 for ( ; trk_iter != trk_end; ++trk_iter ) {
65 assert(
tmp !=
nullptr );
80 if (
type == 1) primaryTrackLinks.push_back( link );
81 else if (
type == 2 ) secondaryTrackLinks.push_back( link );
95 return selectedTracks;
102 std::vector<std::string>
out;
106 std::string sub =
toolname.substr(0, firstDelimiter);
110 return std::string(
"JetFitter_TrackCompatibility_") + sub;
116 std::vector<std::string>
123 const TLorentzVector &jetMomentum,
131 compatibilityDecorator (
track ) = 0.;
137 std::unique_ptr<const Trk::TrackParameters> myMeasuredPerigee(
m_extrapolator->extrapolate(
138 Gaudi::Hive::currentContext(),
track.perigeeParameters(),mySurface ));
140 if ( !myMeasuredPerigee) {
141 ATH_MSG_DEBUG(
" Extrapolation to primary vertex failed. Skipping track " );
142 compatibilityDecorator (
track ) = 0.;
150 primaryVertex.covariancePosition(),
154 Amg::Vector3D jetMomSpatial( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() );
155 double compatibilityValue =
m_jetFitterUtils->compatibility( *myMeasuredPerigee,primaryVertexRecVertex ).first;
156 compatibilityValue = fabs( compatibilityValue ) *
m_jetFitterUtils->get3DLifetimeSignOfTrack( *myMeasuredPerigee,
158 primaryVertexRecVertex );
161 ATH_MSG_DEBUG(
"compatibilityValue = " << compatibilityValue );
162 compatibilityDecorator (
track ) = compatibilityValue;
173 if ( ( compatibilityValue < 0 &&
174 TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforNegTracks) ||
175 ( compatibilityValue >= 0 &&
176 TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforPosTracks ) )