24 ATH_MSG_ERROR(
"No jet collection provided for selecting tracks!");
25 return StatusCode::FAILURE;
35 return StatusCode::SUCCESS;
41 return StatusCode::SUCCESS;
51 declareInterface<IVertexWeightCalculator>(
this);
61 ATH_MSG_ERROR (
"HardScatterSelectionTool configured to use jet collection "<<
m_jetContKey.key()<<
", but collection is not found!");
67 std::set<const xAOD::TrackParticle*> tracks_in_jets;
69 std::vector<const xAOD::TrackParticle*> tracks_in_this_jet;
71 tracks_in_jets.insert(tracks_in_this_jet.begin(),tracks_in_this_jet.end());
73 ATH_MSG_VERBOSE(
"Collected " << tracks_in_jets.size() <<
" tracks in " << jetCont->size() <<
" jets");
75 size_t n_selected_tracks{0};
76 double total_pt{0.}, jet_only_pt{0.};
78 <<
vertex.nTrackParticles() <<
" tracks at vertex.");
79 for (
const auto& elTrackParticle :
vertex.trackParticleLinks()) {
81 if (not elTrackParticle.isValid()) {
83 "No valid link to tracks in xAOD::Vertex object. Skipping track for "
84 "signal compatibility (may be serious).");
96 increment = std::fabs(1. / perigee.parameters()[
Trk::qOverP]) *
99 total_pt += increment;
101 if(tracks_in_jets.contains(*elTrackParticle)) {
102 ATH_MSG_VERBOSE(
"Accepted track with index " << (*elTrackParticle)->index() <<
" in jet vicinity.");
104 jet_only_pt += increment;
109 <<
" towards vertex sumpt " << std::setprecision(3) << jet_only_pt <<
" (unrestricted sum: " << total_pt <<
")");
112 (*m_decPlainSumPt)(
vertex) = total_pt;
115 if(jetCont->empty()){
116 ATH_MSG_DEBUG(
"No jets found in this event, fall back to unrestricted sum");
117 jet_only_pt = total_pt;