24#include "Gaudi/Property.h"
34 const std::string& name,
35 ISvcLocator* pSvcLocator)
55 ATH_MSG_INFO(
"Negative energy NeutralPFO thinning not required");
57 ATH_MSG_INFO(
"Negative energy NeutralPFOs will be thinned");
61 ATH_MSG_ERROR(
"StreamName property has not been initialized.");
62 return StatusCode::FAILURE;
74 ATH_MSG_DEBUG(
"==> done with initialize " << name() <<
"...");
76 return StatusCode::SUCCESS;
86 <<
" negative energy NeutralPFOs ");
87 return StatusCode::SUCCESS;
98 return StatusCode::SUCCESS;
103 std::vector<bool> mask;
104 int nNeutralFEs = neutralFEs->size();
106 mask.assign(nNeutralFEs,
false);
108 unsigned long int nNeutralPFOsThinned = 0;
109 for (
int i = 0; i < nNeutralFEs; i++) {
111 if (neutralFE->
pt() > 0.0)
114 ++nNeutralPFOsThinned;
119 std::memory_order_relaxed);
120 neutralFEs.
keep(mask);
126 LCNeutralFEs.
keep(mask);
128 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".