23#include "GaudiKernel/ThreadLocalContext.h"
33 const std::string& name,
34 ISvcLocator* pSvcLocator)
53 ATH_MSG_INFO(
"Negative energy CaloClusters thinning not required");
55 ATH_MSG_INFO(
"Negative energy CaloClusters will be thinned");
59 ATH_MSG_ERROR(
"StreamName property has not been initialized.");
60 return StatusCode::FAILURE;
69 ATH_MSG_DEBUG(
"==> done with initialize " << name() <<
"...");
71 return StatusCode::SUCCESS;
81 <<
" negative energy CaloClusters ");
82 return StatusCode::SUCCESS;
93 return StatusCode::SUCCESS;
101 std::vector<bool> mask;
102 int nCaloClusters = caloClusters->size();
104 mask.assign(nCaloClusters,
false);
107 unsigned long int nCaloClustersThinned = 0;
108 for (
int i = 0; i < nCaloClusters; ++i) {
111 if (caloCluster->
rawE() > 0.0) {
114 ++nCaloClustersThinned;
118 std::memory_order_relaxed);
121 caloClusters.
keep(mask);
123 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle for requesting thinning for a data object.
An algorithm that can be simultaneously executed in multiple threads.
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.
BooleanProperty m_doThinning
Should the thinning run?
StringProperty m_streamName
virtual StatusCode initialize() override final
Athena algorithm's initalize hook.
ThinNegativeEnergyCaloClustersAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual StatusCode finalize() override final
Athena algorithm's finalize hook.
std::atomic< unsigned long > m_nCaloClustersThinned
std::atomic< unsigned long > m_nCaloClustersProcessed
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_caloClustersKey
Names of the containers to thin.
StatusCode execute(const EventContext &ctx) const override final
Athena algorithm's execute hook.
std::atomic< unsigned long > m_nEventsProcessed
Counters.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.