15 #include "GaudiKernel/ThreadLocalContext.h"
30 , m_selectionString(
"")
44 ATH_CHECK(m_TopoClSGKey.initialize(m_streamName));
46 <<
"as the source collection for topo calo clusters");
47 if (m_sgKey.empty()) {
49 return StatusCode::FAILURE;
52 "Calo clusters associated with objects in "
54 <<
" will be retained in this format with the rest being thinned away");
58 for(
unsigned int i=0;
i < m_addClusterSGKey.size();
i++){
59 m_tmpAddClusterKey = m_addClusterSGKey[
i];
60 ATH_CHECK(m_tmpAddClusterKey.initialize(m_streamName));
61 m_addClusterKeys.push_back(m_tmpAddClusterKey);
66 if (!m_selectionString.empty()) {
67 ATH_CHECK(initializeParser(m_selectionString));
70 return StatusCode::SUCCESS;
77 ATH_MSG_INFO(
"Processed " << m_ntotTopo <<
" topo clusters, of which "
78 << m_npassTopo <<
" were retained ");
80 return StatusCode::SUCCESS;
87 const EventContext& ctx = Gaudi::Hive::currentContext();
94 unsigned int nTopoClusters = importedTopoCaloCluster->size();
95 if (nTopoClusters == 0)
96 return StatusCode::SUCCESS;
99 std::vector<bool> topomask;
100 topomask.assign(nTopoClusters,
false);
101 m_ntotTopo += nTopoClusters;
106 importedJets = importedJetsHandle.ptr();
107 if (importedJets ==
nullptr) {
108 ATH_MSG_ERROR(
"No jet collection with name " << m_sgKey.key()
109 <<
" found in StoreGate!");
110 return StatusCode::FAILURE;
112 unsigned int nJets(importedJets->
size());
114 return StatusCode::SUCCESS;
115 std::vector<const xAOD::Jet*> jetToCheck;
119 if (!m_selectionString.empty()) {
120 std::vector<int>
entries = m_parser->evaluateAsVector();
124 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string "
125 "used jets objects??");
126 return StatusCode::FAILURE;
129 for (
unsigned int i = 0;
i < nJets; ++
i)
131 jetToCheck.push_back((*importedJets)[
i]);
134 if(jetToCheck.empty())
135 return StatusCode::SUCCESS;
138 const auto&
links =
jet->constituentLinks();
139 for(
const auto& link :
links ) {
141 if( ! link.isValid() ) {
144 topomask.at( link.index() ) =
true;
150 const auto&
links =
jet->constituentLinks();
151 for(
const auto& link :
links ) {
153 if( ! link.isValid() ) {
156 topomask.at( link.index() ) =
true;
162 for (
unsigned int i = 0;
i < nTopoClusters; ++
i) {
168 importedTopoCaloCluster.
keep(topomask);
170 for(
const auto & addClusterKey : m_addClusterKeys){
172 tempClusters.
keep(topomask);
175 return StatusCode::SUCCESS;