16 #include "GaudiKernel/ThreadLocalContext.h"
23 const IInterface*
p ) :
36 ATH_CHECK( m_inDetSGKey.initialize (m_streamName) );
37 ATH_MSG_INFO(
"Using " << m_inDetSGKey <<
"as the source collection for inner detector track particles");
38 if (m_jetKey.key().empty()) {
40 return StatusCode::FAILURE;
43 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");
46 if (!m_selectionString.empty() || !m_trackSelectionString.empty()) {
48 ATH_CHECK( initializeParser( {m_selectionString, m_trackSelectionString } ));
50 return StatusCode::SUCCESS;
56 ATH_MSG_INFO(
"Processed "<< m_ntot <<
" tracks, "<< m_npass<<
" were retained ");
57 return StatusCode::SUCCESS;
63 const EventContext& ctx = Gaudi::Hive::currentContext();
70 unsigned int nTracks = importedTrackParticles->size();
71 if (nTracks==0)
return StatusCode::SUCCESS;
74 std::vector<bool>
mask;
75 mask.assign(nTracks,
false);
82 ATH_MSG_ERROR(
"No jet collection with name " << m_jetKey.key() <<
" found in StoreGate!");
83 return StatusCode::FAILURE;
85 unsigned int nJets(importedJets->
size());
86 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
89 if (!m_selectionString.empty()) {
94 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
95 return StatusCode::FAILURE;
98 for (
unsigned int i=0;
i<nJets; ++
i)
if (
entries[
i]==1) jetToCheck.push_back((*importedJets)[
i]);
104 if (m_selectionString.empty()) {
105 for (
const auto *jetIt : *importedJets) {
106 std::vector<const xAOD::TrackParticle*> jetTracks;
108 if ( !haveJetTracks ) {
ATH_MSG_WARNING(
"Associated tracks not found");}
110 for (
auto & jetTrack : jetTracks) {
111 int index = jetTrack->index();
117 for (
auto & jetIt : jetToCheck) {
118 std::vector<const xAOD::TrackParticle*> jetTracks;
120 if ( !haveJetTracks ) {
ATH_MSG_WARNING(
"Associated tracks not found");}
122 for (
auto & jetTrack : jetTracks) {
123 int index = jetTrack->index();
131 if (!m_trackSelectionString.empty()) {
136 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your track selection string used tracks??");
137 return StatusCode::FAILURE;
147 unsigned int n_pass=0;
148 for (
unsigned int i=0;
i<nTracks; ++
i) {
149 if (
mask[
i]) ++n_pass;
156 return StatusCode::SUCCESS;