ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterRemoveBad.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// include header files
8#include "CaloEvent/CaloClusterContainer.h"
9#include "GaudiKernel/MsgStream.h"
11
12/********************************************************************
13
14NAME: CaloClusterRemoveBad.cxx
15
16AUTHORS: H. Ma
17CREATED: July 2010
18
19PURPOSE: Remove bad cluster after corrections.
20
21********************************************************************/
22
23
31 const std::string& name,
32 const IInterface* parent)
33 : CaloClusterProcessor(type, name, parent)
34{
35}
36
37
47StatusCode CaloClusterRemoveBad::execute (const EventContext& /*ctx*/,
48 xAOD::CaloCluster* /*cluster*/) const
49{
50 return StatusCode::SUCCESS;
51}
52
53
59StatusCode
60CaloClusterRemoveBad::execute (const EventContext& /*ctx*/,
61 xAOD::CaloClusterContainer* clusColl) const
62{
63
64 ATH_MSG_DEBUG( "Executing CaloClusterRemoveBad" << endmsg);
65
66 using clus_iterator = xAOD::CaloClusterContainer::iterator;
67 clus_iterator iter1 = clusColl->begin();
68
69 ATH_MSG_DEBUG( "Collection has before dup rem size: " << clusColl->size() << endmsg);
70 for( ;iter1!=clusColl->end(); ) {
71 ATH_MSG_DEBUG( " cluster energy " << (*iter1)->e() << endmsg);
72 if ((*iter1)->e()<= m_eThreshold ){
73 ATH_MSG_DEBUG( " Removed cluster with energy below threshold, " << (*iter1)->e() << endmsg);
74 iter1 = clusColl->erase(iter1);
75 continue ;
76 }
77
78 ++iter1;
79
80 }
81 ATH_MSG_DEBUG( "Collection has after dup rem size: " << clusColl->size() << endmsg);
82
83 return StatusCode::SUCCESS;
84}
85
#define endmsg
#define ATH_MSG_DEBUG(x)
An STL vector of pointers that by default owns its pointed-to elements.
CaloClusterProcessor(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
CaloClusterRemoveBad(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Gaudi::Property< float > m_eThreshold
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override
Execute on a single cluster.
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
iterator erase(iterator position)
Remove element at a given position.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.