22 #include "GaudiKernel/ThreadLocalContext.h"
29 const IInterface*
p ) :
43 ATH_CHECK( m_inDetSGKey.initialize (m_streamName) );
44 ATH_MSG_INFO(
"Using " << m_inDetSGKey <<
"as the source collection for inner detector track particles");
45 if (m_jetKey.key().empty()) {
47 return StatusCode::FAILURE;
50 ATH_MSG_INFO(
"Inner detector track particles associated with objects in " << m_jetKey.key() <<
" will be retained in this format with the rest being thinned away");
53 if (!m_selectionString.empty() || !m_trackSelectionString.empty()) {
55 ATH_CHECK( initializeParser( {m_selectionString, m_trackSelectionString } ));
57 return StatusCode::SUCCESS;
63 ATH_MSG_INFO(
"Processed "<< m_ntot <<
" tracks, "<< m_npass<<
" were retained ");
64 return StatusCode::SUCCESS;
70 const EventContext& ctx = Gaudi::Hive::currentContext();
78 unsigned int nTracks = importedTrackParticles->size();
79 if (nTracks==0)
return StatusCode::SUCCESS;
82 std::vector<bool>
mask;
83 mask.assign(nTracks,
false);
90 ATH_MSG_ERROR(
"No jet collection with name " << m_jetKey.key() <<
" found in StoreGate!");
91 return StatusCode::FAILURE;
93 unsigned int nJets(importedJets->
size());
94 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
97 if (!m_selectionString.empty()) {
102 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
103 return StatusCode::FAILURE;
106 for (
unsigned int i=0;
i<nJets; ++
i)
if (
entries[
i]==1) jetToCheck.push_back((*importedJets)[
i]);
114 if (m_selectionString.empty()) {
116 const std::vector< ElementLink<DataVector<xAOD::IParticle> > > &jetTrackLinks = ghostTrackLRT( **jetIt );
117 for (
const auto &jetTrkIt : jetTrackLinks) {
124 for (std::vector<const xAOD::Jet*>::const_iterator jetIt=jetToCheck.begin(); jetIt!=jetToCheck.end(); ++jetIt) {
125 const std::vector< ElementLink<DataVector<xAOD::IParticle> > > &jetTrackLinks = ghostTrackLRT( **jetIt );
126 for (
const auto &jetTrkIt : jetTrackLinks) {
135 if (!m_trackSelectionString.empty()) {
140 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your track selection string used tracks??");
141 return StatusCode::FAILURE;
151 unsigned int n_pass=0;
152 for (
unsigned int i=0;
i<nTracks; ++
i) {
153 if (
mask[
i]) ++n_pass;
160 return StatusCode::SUCCESS;