 |
ATLAS Offline Software
|
Go to the documentation of this file.
37 return StatusCode::SUCCESS;
47 return StatusCode::FAILURE;
53 return StatusCode::FAILURE;
63 std::vector< SG::ReadDecorHandle<xAOD::FlowElementContainer, float> > layerAccessors_em;
66 layerAccessors_em.emplace_back(
key, ctx);
68 std::vector< SG::WriteDecorHandle<xAOD::FlowElementContainer, float> > layerDecors_em;
71 layerDecors_em.emplace_back(
key, ctx);
75 std::vector< SG::ReadDecorHandle<xAOD::FlowElementContainer, float> > layerAccessors_had;
78 layerAccessors_had.emplace_back(
key, ctx);
80 std::vector< SG::WriteDecorHandle<xAOD::FlowElementContainer, float> > layerDecors_had;
83 layerDecors_had.emplace_back(
key, ctx);
95 const auto& layerAccessor = layerAccessors_em.at(iem);
96 auto& layerDecor = layerDecors_em.at(iem);
101 const std::vector<ElementLink<xAOD::IParticleContainer>>& pflowLinks =
flow->otherObjectLinks();
103 for (
auto&
el : pflowLinks ) {
104 if ( !
el.isValid() ) {
throw std::runtime_error(
"Invalid ElementLink found.");};
107 if (
c->charge() != 0)
continue;
108 e += layerAccessor(*
c);
110 layerDecor(*
flow) =
e;
118 const auto& layerAccessor = layerAccessors_had.at(ihad);
119 auto& layerDecor = layerDecors_had.at(ihad);
124 const std::vector<ElementLink<xAOD::IParticleContainer>>& pflowLinks =
flow->otherObjectLinks();
127 for (
auto&
el : pflowLinks ) {
128 if ( !
el.isValid() ) {
throw std::runtime_error(
"Invalid ElementLink found.");};
130 if (
c->charge() != 0)
continue;
131 e += layerAccessor(*
c);
133 layerDecor(*
flow) =
e;
138 eEMDecorHandle(*
flow) = eEM;
139 eHADDecorHandle(*
flow) = eHAD;
142 const float eTOT = eEM + eHAD;
144 eFracEMDecorHandle(*
flow) = (!eTotZero) ? (eEM / eTOT) : 0.;
145 eFracHADDecorHandle(*
flow) = (!eTotZero) ? (eHAD / eTOT) : 0.;
148 return StatusCode::SUCCESS;
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
SG::WriteDecorHandleKey< xAOD::FlowElementContainer > m_eFracEMKey
FlowEnergyDecorator(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteDecorHandleKeyArray< xAOD::FlowElementContainer > m_emWriteDecorKeys
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteDecorHandleKeyArray< xAOD::FlowElementContainer > m_hadWriteDecorKeys
int flow(const T &a, int i)
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
SG::WriteDecorHandleKey< xAOD::FlowElementContainer > m_eFracHADKey
virtual StatusCode execute(const EventContext &) const override
SG::WriteDecorHandleKey< xAOD::FlowElementContainer > m_eEMKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadDecorHandleKeyArray< xAOD::FlowElementContainer > m_hadReadDecorKeys
virtual StatusCode initialize() override
test if a value is close enough to zero to be an unreliable denominator.
bool close_to_zero(T value, T eps=std::numeric_limits< T >::epsilon())
SG::WriteDecorHandleKey< xAOD::FlowElementContainer > m_eHADKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_PFlowContainerKey
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
SG::ReadDecorHandleKeyArray< xAOD::FlowElementContainer > m_emReadDecorKeys
SG::ReadHandleKey< xAOD::FlowElementContainer > m_FlowContainerKey
A detector object made of other lower level object(s)