ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterRemoveBad.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 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 // Energy threshold for cluster removal.
36 declareProperty ("EMin", m_eThreshold = 0.0,
37 "Energy threshold for cluster removal.");
38}
39
40
50StatusCode CaloClusterRemoveBad::execute (const EventContext& /*ctx*/,
51 xAOD::CaloCluster* /*cluster*/) const
52{
53 return StatusCode::SUCCESS;
54}
55
56
62StatusCode
63CaloClusterRemoveBad::execute (const EventContext& /*ctx*/,
64 xAOD::CaloClusterContainer* clusColl) const
65{
66
67 ATH_MSG_DEBUG( "Executing CaloClusterRemoveBad" << endmsg);
68
69 using clus_iterator = xAOD::CaloClusterContainer::iterator;
70 clus_iterator iter1 = clusColl->begin();
71
72 ATH_MSG_DEBUG( "Collection has before dup rem size: " << clusColl->size() << endmsg);
73 for( ;iter1!=clusColl->end(); ) {
74 ATH_MSG_DEBUG( " cluster energy " << (*iter1)->e() << endmsg);
75 if ((*iter1)->e()<= m_eThreshold ){
76 ATH_MSG_DEBUG( " Removed cluster with energy below threshold, " << (*iter1)->e() << endmsg);
77 iter1 = clusColl->erase(iter1);
78 continue ;
79 }
80
81 ++iter1;
82
83 }
84 ATH_MSG_DEBUG( "Collection has after dup rem size: " << clusColl->size() << endmsg);
85
86 return StatusCode::SUCCESS;
87}
88
#define endmsg
#define ATH_MSG_DEBUG(x)
An STL vector of pointers that by default owns its pointed-to elements.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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.
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.