15 #include "GaudiKernel/ThreadLocalContext.h"
22 const IInterface*
p ) :
35 ATH_CHECK( m_inDetSGKey.initialize (m_streamName) );
36 ATH_MSG_INFO(
"Using " << m_inDetSGKey.key() <<
"as the source collection for inner detector track particles");
37 ATH_MSG_INFO(
"Inner detector track particles associated with objects in " << m_ditauKey.key() <<
" will be retained in this format with the rest being thinned away");
40 if (!m_selectionString.empty()) {
41 ATH_CHECK(initializeParser(m_selectionString));
43 return StatusCode::SUCCESS;
49 ATH_MSG_INFO(
"Processed "<< m_ntot <<
" tracks, "<< m_npass<<
" were retained ");
51 return StatusCode::SUCCESS;
58 const EventContext& ctx = Gaudi::Hive::currentContext();
65 unsigned int nTracks = importedTrackParticles->size();
66 if (nTracks==0)
return StatusCode::SUCCESS;
69 std::vector<bool>
mask;
70 mask.assign(nTracks,
false);
76 if (!importedDiTaus.
isValid()) {
77 ATH_MSG_ERROR(
"No ditau collection with name " << m_ditauKey.key() <<
" found in StoreGate!");
78 return StatusCode::FAILURE;
80 unsigned int nDiTaus(importedDiTaus->
size());
81 std::vector<const xAOD::DiTauJet*> ditauToCheck; ditauToCheck.clear();
84 if (!m_selectionString.empty()) {
85 std::vector<int>
entries = m_parser->evaluateAsVector();
89 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used ditaus??");
90 return StatusCode::FAILURE;
93 for (
unsigned int i=0;
i<nDiTaus; ++
i)
if (
entries[
i]==1) ditauToCheck.push_back((*importedDiTaus)[
i]);
99 if (m_selectionString==
"") {
100 for (
const auto *ditauIt : *importedDiTaus) {
101 for (
unsigned int i=0;
i<ditauIt->nTracks(); ++
i) {
102 int index = ditauIt->trackLinks().at(
i).index();
105 for (
unsigned int i=0;
i<ditauIt->nIsoTracks(); ++
i) {
106 int index = ditauIt->isoTrackLinks().at(
i).index();
111 for (
auto & ditauIt : ditauToCheck) {
112 for (
unsigned int i=0;
i<ditauIt->nTracks(); ++
i) {
113 int index = ditauIt->trackLinks().at(
i).index();
116 for (
unsigned int i=0;
i<ditauIt->nIsoTracks(); ++
i) {
117 int index = ditauIt->isoTrackLinks().at(
i).index();
124 unsigned int n_pass=0;
125 for (
unsigned int i=0;
i<nTracks; ++
i) {
126 if (
mask[
i]) ++n_pass;
133 return StatusCode::SUCCESS;