Commit 9542b245 authored by Mark Hodgkinson's avatar Mark Hodgkinson
Browse files

Fill in execute of PFChargedFlowElementCreatorAlgorithm.

parent d6c5bba6
#include "eflowRec/PFChargedFlowElementCreatorAlgorithm.h"
#include "xAODPFlow/FlowElementAuxContainer.h"
PFChargedFlowElementCreatorAlgorithm::PFChargedFlowElementCreatorAlgorithm(const std::string& name, ISvcLocator* pSvcLocator) :
AthReentrantAlgorithm(name,pSvcLocator)
{
......@@ -18,6 +20,15 @@ StatusCode PFChargedFlowElementCreatorAlgorithm::execute(const EventContext& ctx
ATH_MSG_DEBUG("Starting PFOChargedCreatorAlgorithm::execute");
SG::WriteHandle<xAOD::FlowElementContainer> chargedFlowElementContainerWriteHandle(m_chargedFlowElementContainerWriteHandleKey,ctx);
ATH_CHECK(chargedFlowElementContainerWriteHandle.record(std::make_unique<xAOD::FlowElementContainer>(),std::make_unique<xAOD::FlowElementAuxContainer>()));
/* Create Charged FlowElements from all eflowCaloObjects */
SG::ReadHandle<eflowCaloObjectContainer> eflowCaloObjectContainerReadHandle(m_eflowCaloObjectContainerReadHandleKey,ctx);
for (auto thisEflowCaloObject : *eflowCaloObjectContainerReadHandle) createChargedFlowElements(*thisEflowCaloObject,true,chargedFlowElementContainerWriteHandle);
std::sort(chargedFlowElementContainerWriteHandle->begin(), chargedFlowElementContainerWriteHandle->end(), [] (const xAOD::FlowElement* flowElement1, const xAOD::FlowElement* flowElement2) {return flowElement1->pt()>flowElement2->pt();});
return StatusCode::SUCCESS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment