74 if (!jets.isValid()) {
76 return StatusCode::FAILURE;
80 std::vector<const xAOD::Jet*> selectedJets;
84 std::vector<int>
entries = m_parser->evaluateAsVector();
85 if (
entries.size() != jets->size()) {
87 return StatusCode::FAILURE;
90 for (
size_t i = 0; i < jets->size(); ++i) {
92 selectedJets.push_back((*jets)[i]);
97 for (
const auto*
jet : *jets) {
98 selectedJets.push_back(
jet);
102 ATH_MSG_DEBUG(
"Number of selected jets: " << selectedJets.size()
103 <<
" out of " << jets->size());
108 if (!ghostContainer.isValid()) {
110 return StatusCode::SUCCESS;
113 size_t nObjects = ghostContainer->size();
114 std::vector<bool> mask(nObjects,
false);
115 const int maskSize =
static_cast<int>(mask.size());
118 SG::AuxElement::ConstAccessor<std::vector<ElementLink<xAOD::IParticleContainer>>> ghostAcc(
m_ghostName);
120 size_t nGhostLinks = 0;
123 for (
const auto*
jet : selectedJets) {
127 if (!ghostAcc.isAvailable(*
jet)) {
133 const std::vector<ElementLink<xAOD::IParticleContainer>>& ghostLinks = ghostAcc(*
jet);
138 for (
const auto& link : ghostLinks) {
139 if (!link.isValid())
continue;
141 int index = link.index();
147 if (
index < maskSize) {
153 <<
", eta=" << ghostObj->
eta());
159 size_t nKept = std::count(mask.begin(), mask.end(),
true);
160 ATH_MSG_DEBUG(
"Found " << nGhostLinks <<
" ghost links from selected jets");
162 << nKept <<
" out of " << nObjects <<
" objects");
164 ghostContainer.
keep(mask);
166 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.