ATLAS Offline Software
Loading...
Searching...
No Matches
CaloChargedFlowDecoratorAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10
11namespace FlavorTagDiscriminants {
12
14 const std::string& name, ISvcLocator* loc)
15 : AthReentrantAlgorithm(name, loc)
16 {
17 }
18
24 return StatusCode::SUCCESS;
25 }
26
28 const EventContext& ctx) const
29 {
33 SG::WriteDecorHandle<IPC, int> usedInChargedPFO(
35
36 // Default all clusters to -1 (not linked to any PFO)
37 for (const auto* obj : *constituents) {
38 usedInChargedPFO(*obj) = -1;
39 }
40
41 // Mark clusters linked to neutral PFOs as 0
42 for (const auto* obj : *neutralPFOs) {
43 const auto* flow = dynamic_cast<const xAOD::FlowElement*>(obj);
44 if (!flow) continue;
45 for (const auto* otherObject : flow->otherObjects()) {
46 if (!otherObject) {
47 ATH_MSG_WARNING("Invalid otherObject link, skipping");
48 continue;
49 }
50 usedInChargedPFO(*otherObject) = 0;
51 }
52 }
53
54 // Mark clusters linked to charged PFOs as 1 (overrides neutral)
55 for (const auto* obj : *chargedPFOs) {
56 const auto* flow = dynamic_cast<const xAOD::FlowElement*>(obj);
57 if (!flow) continue;
58 for (const auto* otherObject : flow->otherObjects()) {
59 if (!otherObject) {
60 ATH_MSG_WARNING("Invalid otherObject link, skipping");
61 continue;
62 }
63 usedInChargedPFO(*otherObject) = 1;
64 }
65 }
66
67 return StatusCode::SUCCESS;
68 }
69
70}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
CaloChargedFlowDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &) const override
Handle class for adding a decoration to an object.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16