24#include "Gaudi/Property.h"
25#include "GaudiKernel/ThreadLocalContext.h"
35 const std::string& name,
36 ISvcLocator* pSvcLocator)
56 ATH_MSG_INFO(
"Negative energy NeutralPFO thinning not required");
58 ATH_MSG_INFO(
"Negative energy NeutralPFOs will be thinned");
62 ATH_MSG_ERROR(
"StreamName property has not been initialized.");
63 return StatusCode::FAILURE;
75 ATH_MSG_DEBUG(
"==> done with initialize " << name() <<
"...");
77 return StatusCode::SUCCESS;
87 <<
" negative energy NeutralPFOs ");
88 return StatusCode::SUCCESS;
99 return StatusCode::SUCCESS;
104 std::vector<bool> mask;
105 int nNeutralFEs = neutralFEs->size();
107 mask.assign(nNeutralFEs,
false);
109 unsigned long int nNeutralPFOsThinned = 0;
110 for (
int i = 0; i < nNeutralFEs; i++) {
112 if (neutralFE->
pt() > 0.0)
115 ++nNeutralPFOsThinned;
120 std::memory_order_relaxed);
121 neutralFEs.
keep(mask);
127 LCNeutralFEs.
keep(mask);
129 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?
ThinNegativeEnergyNeutralPFOsAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual StatusCode finalize() override final
Athena algorithm's finalize hook.
std::atomic< unsigned long > m_nNeutralPFOsThinned
virtual StatusCode execute(const EventContext &ctx) const override final
Athena algorithm's execute hook.
SG::ThinningHandleKey< xAOD::FlowElementContainer > m_LCNeutralPFOsKey
virtual StatusCode initialize() override final
Athena algorithm's initalize hook.
SG::ThinningHandleKey< xAOD::FlowElementContainer > m_neutralPFOsKey
Names of the containers to thin.
std::atomic< unsigned long > m_nNeutralPFOsProcessed
StringProperty m_streamName
std::atomic< unsigned long > m_nEventsProcessed
Counters.
virtual double pt() const override
FlowElement_v1 FlowElement
Definition of the current "pfo version".