62{
63 const EventContext& ctx = Gaudi::Hive::currentContext();
64
65
66 SG::ThinningHandle<xAOD::TrackParticleContainer> importedTrackParticles
68
69
70 unsigned int nTracks = importedTrackParticles->size();
71 if (nTracks==0) return StatusCode::SUCCESS;
72
73
74 std::vector<bool>
mask;
75 mask.assign(nTracks,
false);
77
78
79
80 SG::ReadHandle<xAOD::JetContainer> importedJets(
m_jetKey,ctx);
81 if (!importedJets.isValid()) {
83 return StatusCode::FAILURE;
84 }
85 unsigned int nJets(importedJets->size());
86 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
87
88
92
93 if (nJets != nEntries ) {
94 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
95 return StatusCode::FAILURE;
96 } else {
97
98 for (
unsigned int i=0;
i<nJets; ++
i)
if (
entries[i]==1) jetToCheck.push_back((*importedJets)[i]);
99 }
100 }
101
102
103
105 for (const auto *jetIt : *importedJets) {
106 std::vector<const xAOD::TrackParticle*> jetTracks;
108 if ( !haveJetTracks ) {
ATH_MSG_WARNING(
"Associated tracks not found");}
109 else {
110 for (auto & jetTrack : jetTracks) {
111 int index = jetTrack->index();
113 }
114 }
115 }
116 } else {
117 for (auto & jetIt : jetToCheck) {
118 std::vector<const xAOD::TrackParticle*> jetTracks;
120 if ( !haveJetTracks ) {
ATH_MSG_WARNING(
"Associated tracks not found");}
121 else {
122 for (auto & jetTrack : jetTracks) {
123 int index = jetTrack->index();
125 }
126 }
127 }
128 }
129
130
134
135 if (nTracks != nEntries ) {
136 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your track selection string used tracks??");
137 return StatusCode::FAILURE;
138 } else {
139
142 }
143 }
144 }
145
146
147 unsigned int n_pass=0;
148 for (
unsigned int i=0;
i<nTracks; ++
i) {
149 if (mask[i]) ++n_pass;
150 }
152
153
154 importedTrackParticles.keep (mask);
155
156 return StatusCode::SUCCESS;
157}
#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