15#include "GaudiKernel/ThreadLocalContext.h"
22 const IInterface* p ) :
46 return StatusCode::FAILURE;
47 }
else {
ATH_MSG_INFO(
"Inner detector track particles associated with objects in " <<
m_jetSGKey <<
" will be retained in this format with the rest being thinned away");}
53 return StatusCode::SUCCESS;
61 return StatusCode::SUCCESS;
67 const EventContext& ctx = Gaudi::Hive::currentContext();
74 unsigned int nTracks = importedTrackParticles->size();
75 if (nTracks==0)
return StatusCode::SUCCESS;
78 std::vector<bool> mask;
79 mask.assign(nTracks,
false);
83 if (evtStore()->retrieve(importedJets,
m_jetSGKey).isFailure()) {
85 return StatusCode::FAILURE;
88 unsigned int nJets(importedJets->
size());
89 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
93 std::vector<int>
entries = m_parser->evaluateAsVector();
94 unsigned int nEntries =
entries.size();
96 if (nJets != nEntries ) {
97 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
98 return StatusCode::FAILURE;
101 for (
unsigned int i=0; i<nJets; ++i)
if (
entries[i]==1) jetToCheck.push_back((*importedJets)[i]);
110 const std::vector< ElementLink<xAOD::TrackParticleContainer> >& SV1_trackParticleLinks =
115 int index = (*tp)->index();
120 for (std::vector<const xAOD::Jet*>::iterator jetIt = jetToCheck.begin(); jetIt!=jetToCheck.end(); ++jetIt) {
122 const std::vector< ElementLink<xAOD::TrackParticleContainer> >& SV1_trackParticleLinks =
127 int index = (*tp)->index();
134 for (
unsigned int i=0; i<nTracks; ++i) {
139 importedTrackParticles.
keep (mask);
141 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle for requesting thinning for a data object.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
std::atomic< unsigned int > m_npass
std::string m_selectionString
std::atomic< unsigned int > m_ntot
virtual StatusCode doThinning() const override
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
virtual StatusCode initialize() override
StringProperty m_streamName
virtual StatusCode finalize() override
SV1TrackThinning(const std::string &t, const std::string &n, const IInterface *p)
ElementLink implementation for ROOT usage.
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Handle for requesting thinning for a data object.
const TPELVec_t & SV1_TrackParticleLinks() const
get vector of SV1 TrackParticle ElementLinks
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
BTagging_v1 BTagging
Definition of the current "BTagging version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".