71 const EventContext &ctx = Gaudi::Hive::currentContext();
75 if (!jets.isValid()) {
77 return StatusCode::FAILURE;
81 std::vector<const xAOD::Jet*> selectedJets;
85 std::vector<int>
entries = m_parser->evaluateAsVector();
86 if (
entries.size() != jets->size()) {
88 return StatusCode::FAILURE;
91 for (
size_t i = 0; i < jets->size(); ++i) {
93 selectedJets.push_back((*jets)[i]);
98 for (
const auto*
jet : *jets) {
99 selectedJets.push_back(
jet);
103 ATH_MSG_DEBUG(
"Number of selected jets: " << selectedJets.size()
104 <<
" out of " << jets->size());
109 if (!ghostContainer.isValid()) {
111 return StatusCode::SUCCESS;
114 size_t nObjects = ghostContainer->size();
115 std::vector<bool> mask(nObjects,
false);
116 const int maskSize =
static_cast<int>(mask.size());
121 size_t nGhostLinks = 0;
124 for (
const auto*
jet : selectedJets) {
134 const std::vector<ElementLink<xAOD::IParticleContainer>>& ghostLinks = ghostAcc(*
jet);
139 for (
const auto& link : ghostLinks) {
140 if (!link.isValid())
continue;
142 int index = link.index();
148 if (
index < maskSize) {
154 <<
", eta=" << ghostObj->
eta());
160 size_t nKept = std::count(mask.begin(), mask.end(),
true);
161 ATH_MSG_DEBUG(
"Found " << nGhostLinks <<
" ghost links from selected jets");
163 << nKept <<
" out of " << nObjects <<
" objects");
165 ghostContainer.
keep(mask);
167 return StatusCode::SUCCESS;
Class providing the definition of the 4-vector interface.
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
virtual double pt() const =0
The transverse momentum ( ) of the particle.