61{
62
63
64 SG::ThinningHandle<xAOD::TrackParticleContainer> importedTrackParticles
66
67
68 unsigned int nTracks = importedTrackParticles->size();
69 if (nTracks==0) return StatusCode::SUCCESS;
70
71
72 std::vector<bool>
mask;
73 mask.assign(nTracks,
false);
75
76
77
78 SG::ReadHandle<xAOD::JetContainer> importedJets(
m_jetKey,ctx);
79 if (!importedJets.isValid()) {
81 return StatusCode::FAILURE;
82 }
83 unsigned int nJets(importedJets->size());
84 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
85
86
90
91 if (nJets != nEntries ) {
92 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
93 return StatusCode::FAILURE;
94 } else {
95
96 for (
unsigned int i=0;
i<nJets; ++
i)
if (
entries[i]==1) jetToCheck.push_back((*importedJets)[i]);
97 }
98 }
99
100
101
103 for (const auto *jetIt : *importedJets) {
104 std::vector<const xAOD::TrackParticle*> jetTracks;
106 if ( !haveJetTracks ) {
ATH_MSG_WARNING(
"Associated tracks not found");}
107 else {
108 for (auto & jetTrack : jetTracks) {
109 int index = jetTrack->index();
111 }
112 }
113 }
114 } else {
115 for (auto & jetIt : jetToCheck) {
116 std::vector<const xAOD::TrackParticle*> jetTracks;
118 if ( !haveJetTracks ) {
ATH_MSG_WARNING(
"Associated tracks not found");}
119 else {
120 for (auto & jetTrack : jetTracks) {
121 int index = jetTrack->index();
123 }
124 }
125 }
126 }
127
128
132
133 if (nTracks != nEntries ) {
134 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your track selection string used tracks??");
135 return StatusCode::FAILURE;
136 } else {
137
140 }
141 }
142 }
143
144
145 unsigned int n_pass=0;
146 for (
unsigned int i=0;
i<nTracks; ++
i) {
147 if (mask[i]) ++n_pass;
148 }
150
151
152 importedTrackParticles.keep (mask);
153
154 return StatusCode::SUCCESS;
155}
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< xAOD::JetContainer > m_jetKey
std::atomic< unsigned int > m_ntot
std::atomic< unsigned int > m_npass
StringProperty m_trackSelectionString
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
StringProperty m_selectionString