32 const std::string& name,
33 ISvcLocator* pSvcLocator)
52 ATH_MSG_INFO(
"Negative energy CaloClusters thinning not required");
54 ATH_MSG_INFO(
"Negative energy CaloClusters will be thinned");
58 ATH_MSG_ERROR(
"StreamName property has not been initialized.");
59 return StatusCode::FAILURE;
68 ATH_MSG_DEBUG(
"==> done with initialize " << name() <<
"...");
70 return StatusCode::SUCCESS;
80 <<
" negative energy CaloClusters ");
81 return StatusCode::SUCCESS;
92 return StatusCode::SUCCESS;
100 std::vector<bool> mask;
101 int nCaloClusters = caloClusters->size();
103 mask.assign(nCaloClusters,
false);
106 unsigned long int nCaloClustersThinned = 0;
107 for (
int i = 0; i < nCaloClusters; ++i) {
110 if (caloCluster->
rawE() > 0.0) {
113 ++nCaloClustersThinned;
117 std::memory_order_relaxed);
120 caloClusters.
keep(mask);
122 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.