45 <<
"as the source collection for topo calo clusters");
48 return StatusCode::FAILURE;
51 "Calo clusters associated with objects in "
53 <<
" will be retained in this format with the rest being thinned away");
69 return StatusCode::SUCCESS;
79 return StatusCode::SUCCESS;
92 unsigned int nTopoClusters = importedTopoCaloCluster->size();
93 if (nTopoClusters == 0)
94 return StatusCode::SUCCESS;
97 std::vector<bool> topomask;
98 topomask.assign(nTopoClusters,
false);
104 importedJets = importedJetsHandle.
ptr();
105 if (importedJets ==
nullptr) {
107 <<
" found in StoreGate!");
108 return StatusCode::FAILURE;
110 unsigned int nJets(importedJets->
size());
112 return StatusCode::SUCCESS;
113 std::vector<const xAOD::Jet*> jetToCheck;
118 std::vector<int>
entries = m_parser->evaluateAsVector();
119 unsigned int nEntries =
entries.size();
121 if (nJets != nEntries) {
122 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string "
123 "used jets objects??");
124 return StatusCode::FAILURE;
127 for (
unsigned int i = 0; i < nJets; ++i)
129 jetToCheck.push_back((*importedJets)[i]);
132 if(jetToCheck.empty())
133 return StatusCode::SUCCESS;
136 const auto& links =
jet->constituentLinks();
137 for(
const auto& link : links ) {
139 if( ! link.isValid() ) {
142 topomask.at( link.index() ) =
true;
148 const auto& links =
jet->constituentLinks();
149 for(
const auto& link : links ) {
151 if( ! link.isValid() ) {
154 topomask.at( link.index() ) =
true;
160 for (
unsigned int i = 0; i < nTopoClusters; ++i) {
166 importedTopoCaloCluster.
keep(topomask);
170 tempClusters.
keep(topomask);
173 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
This file defines helper classes to deal with jet constituents.
Handle for requesting thinning for a data object.
size_type size() const noexcept
Returns the number of elements in the collection.
std::atomic< unsigned int > m_npassTopo
virtual StatusCode finalize() override
SG::ReadHandleKey< xAOD::JetContainer > m_sgKey
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_TopoClSGKey
virtual StatusCode doThinning(const EventContext &ctx) const override
JetCaloClusterThinning(const std::string &t, const std::string &n, const IInterface *p)
Gaudi::Property< std::vector< std::string > > m_addClusterSGKey
std::string m_selectionString
std::vector< SG::ThinningHandleKey< xAOD::CaloClusterContainer > > m_addClusterKeys
virtual StatusCode initialize() override
StringProperty m_streamName
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_tmpAddClusterKey
virtual ~JetCaloClusterThinning()
std::atomic< unsigned int > m_ntotTopo
const_pointer_type ptr()
Dereference the pointer.
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Handle for requesting thinning for a data object.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".