ATLAS Offline Software
Loading...
Searching...
No Matches
FEAssociationTool.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

namespace ADD_CMODE (ORUtils)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( ORUtils )

Definition at line 1 of file FEAssociationTool.h.

36{
37
38class FEAssociationTool : public asg::AsgTool,
39 virtual public IFEAssociationTool
40{
41 ASG_TOOL_CLASS(FEAssociationTool, IFEAssociationTool)
42
43public:
44 FEAssociationTool(const std::string& name);
45 virtual ~FEAssociationTool() override = default;
46
47 virtual StatusCode initialize() override;
48
49#ifndef XAOD_STANDALONE
50 virtual StatusCode buildAssociations(const EventContext& ctx) const override;
51#else
52 virtual StatusCode buildAssociations() override;
53#endif
54
55private:
56 struct ObjView
57 {
58 enum class Type {
60 Muon,
61 Photon,
62 Tau,
63 SmallRJet,
64 LargeRJet
65 };
66
67 ObjView(Type t, const xAOD::IParticleContainer* c, std::size_t i)
68 : type(t), cont(c), idx(i) {}
69
70 Type type;
71 const xAOD::IParticleContainer* cont = nullptr;
72 std::size_t idx = 0;
73
74 std::unordered_set<const xAOD::FlowElement*> cSet;
75 std::unordered_set<const xAOD::FlowElement*> nSet;
76
77 float EcTot = 0.f;
78 float EnTot = 0.f;
79 };
80
81 struct PairKey
82 {
83 const xAOD::IParticleContainer* c1 = nullptr;
84 std::size_t i1 = 0;
85 const xAOD::IParticleContainer* c2 = nullptr;
86 std::size_t i2 = 0;
87
88 static PairKey make(const xAOD::IParticleContainer* a, std::size_t ia,
89 const xAOD::IParticleContainer* b, std::size_t ib);
90
91 bool operator==(const PairKey& o) const noexcept;
92 };
93
94 struct PairKeyHash
95 {
96 std::size_t operator()(const PairKey& k) const noexcept;
97 };
98
99 struct SharedAcc
100 {
101 float Ec = 0.f;
102 float En = 0.f;
103
104 float AcTot = 0.f;
105 float AnTot = 0.f;
106 float BcTot = 0.f;
107 float BnTot = 0.f;
108
109 int typeA = 0;
110 int typeB = 0;
111 };
112
113#ifndef XAOD_STANDALONE
114 virtual StatusCode collectObjects(const EventContext& ctx,
115 std::vector<ObjView>& objects) const;
116#else
117 virtual StatusCode collectObjects(std::vector<ObjView>& objects) const;
118#endif
119
120#ifndef XAOD_STANDALONE
121 void collectFEsFromIndex(const EventContext& ctx,
122 const ObjView::Type type,
123 const xAOD::IParticleContainer* cont,
124 std::size_t idx,
125 ObjView& view) const;
126#else
127 void collectFEsFromIndex(const ObjView::Type type,
128 const xAOD::IParticleContainer* cont,
129 std::size_t idx,
130 ObjView& view) const;
131#endif
132
133#ifndef XAOD_STANDALONE
134 virtual StatusCode buildMapFromPairs(const EventContext& ctx,
135 const std::vector<ObjView>& objects) const;
136#else
137 virtual StatusCode buildMapFromPairs(const std::vector<ObjView>& objects);
138#endif
139
140 SG::ReadHandleKey<xAOD::ElectronContainer> m_elKey{
141 this, "ElectronContainer", "Electrons", "Input electron container"
142 };
143 SG::ReadHandleKey<xAOD::MuonContainer> m_muKey{
144 this, "MuonContainer", "Muons", "Input muon container"
145 };
146 SG::ReadHandleKey<xAOD::PhotonContainer> m_phKey{
147 this, "PhotonContainer", "Photons", "Input photon container"
148 };
149 SG::ReadHandleKey<xAOD::TauJetContainer> m_tauKey{
150 this, "TauContainer", "TauJets", "Input tau container"
151 };
152 SG::ReadHandleKey<xAOD::JetContainer> m_srjKey{
153 this, "SmallRJetContainer", "AntiKt4EMPFlowJets", "Input small-R jet container"
154 };
155 SG::ReadHandleKey<xAOD::JetContainer> m_lrjKey{
156 this, "LargeRJetContainer", "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets", "Input large-R jet container"
157 };
158
159#ifndef XAOD_STANDALONE
160 SG::ReadDecorHandleKey<xAOD::ElectronContainer> m_elChargedFELinksKey{
161 this, "ElectronChargedFELinksDecorKey",
162 "Electrons.chargedGlobalFELinks",
163 "Electron charged global FE links decoration"
164 };
165 SG::ReadDecorHandleKey<xAOD::ElectronContainer> m_elNeutralFELinksKey{
166 this, "ElectronNeutralFELinksDecorKey",
167 "Electrons.neutralGlobalFELinks",
168 "Electron neutral global FE links decoration"
169 };
170
171 SG::ReadDecorHandleKey<xAOD::MuonContainer> m_muChargedFELinksKey{
172 this, "MuonChargedFELinksDecorKey",
173 "Muons.chargedGlobalFELinks",
174 "Muon charged global FE links decoration"
175 };
176 SG::ReadDecorHandleKey<xAOD::MuonContainer> m_muNeutralFELinksKey{
177 this, "MuonNeutralFELinksDecorKey",
178 "Muons.neutralGlobalFELinks",
179 "Muon neutral global FE links decoration"
180 };
181
182 SG::ReadDecorHandleKey<xAOD::PhotonContainer> m_phChargedFELinksKey{
183 this, "PhotonChargedFELinksDecorKey",
184 "Photons.chargedGlobalFELinks",
185 "Photon charged global FE links decoration"
186 };
187 SG::ReadDecorHandleKey<xAOD::PhotonContainer> m_phNeutralFELinksKey{
188 this, "PhotonNeutralFELinksDecorKey",
189 "Photons.neutralGlobalFELinks",
190 "Photon neutral global FE links decoration"
191 };
192
193 SG::ReadDecorHandleKey<xAOD::TauJetContainer> m_tauChargedFELinksKey{
194 this, "TauChargedFELinksDecorKey",
195 "TauJets.chargedGlobalFELinks",
196 "Tau charged global FE links decoration"
197 };
198 SG::ReadDecorHandleKey<xAOD::TauJetContainer> m_tauNeutralFELinksKey{
199 this, "TauNeutralFELinksDecorKey",
200 "TauJets.neutralGlobalFELinks",
201 "Tau neutral global FE links decoration"
202 };
203
204 SG::ReadDecorHandleKey<xAOD::JetContainer> m_srjChargedFELinksKey{
205 this, "SmallRJetChargedFELinksDecorKey",
206 "AntiKt4EMPFlowJets.chargedGlobalFELinks",
207 "Small-R jet charged global FE links decoration"
208 };
209 SG::ReadDecorHandleKey<xAOD::JetContainer> m_srjNeutralFELinksKey{
210 this, "SmallRJetNeutralFELinksDecorKey",
211 "AntiKt4EMPFlowJets.neutralGlobalFELinks",
212 "Small-R jet neutral global FE links decoration"
213 };
214
215 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lrjChargedFELinksKey{
216 this, "LargeRJetChargedFELinksDecorKey",
217 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.chargedGlobalFELinks",
218 "Large-R jet charged global FE links decoration"
219 };
220 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lrjNeutralFELinksKey{
221 this, "LargeRJetNeutralFELinksDecorKey",
222 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.neutralGlobalFELinks",
223 "Large-R jet neutral global FE links decoration"
224 };
225
226 SG::ReadDecorHandleKey<xAOD::FlowElementContainer> m_chargedOriginalObjectLinkKey{
227 this, "ChargedOriginalObjectLinkDecorKey",
228 "CHSGChargedParticleFlowObjects.originalObjectLink",
229 "Charged FlowElement originalObjectLink decoration"
230 };
231
232 SG::ReadDecorHandleKey<xAOD::FlowElementContainer> m_neutralOriginalObjectLinkKey{
233 this, "NeutralOriginalObjectLinkDecorKey",
234 "CHSGNeutralParticleFlowObjects.originalObjectLink",
235 "Neutral FlowElement originalObjectLink decoration"
236 };
237
238 SG::ReadDecorHandleKey<xAOD::FlowElementContainer> m_lrchargedOriginalObjectLinkKey{
239 this, "ChargedLROriginalObjectLinkDecorKey",
240 "CSSKGChargedParticleFlowObjects.originalObjectLink",
241 "Charged large-R FlowElement originalObjectLink decoration"
242 };
243
244 SG::ReadDecorHandleKey<xAOD::FlowElementContainer> m_lrneutralOriginalObjectLinkKey{
245 this, "NeutralLROriginalObjectLinkDecorKey",
246 "CSSKGNeutralParticleFlowObjects.originalObjectLink",
247 "Neutral large-R FlowElement originalObjectLink decoration"
248 };
249#endif
250
251 SG::WriteHandleKey<xAOD::MissingETAssociationMap> m_outputMapKey{
252 this, "OutputMap", "FEAssociationMap", "Output MissingETAssociationMap"
253 };
254};
255
256} // namespace ADD_CMODE(ORUtils)
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
bool operator==(const DataVector< T > &a, const DataVector< T > &b)
Vector equality comparison.
static Double_t a
void operator()(T1)
RootType Type
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition AsgTool.h:133
::StatusCode StatusCode
StatusCode definition for legacy code.
@ Tau
The object is a tau (jet).
Definition ObjectType.h:49
Muon_v1 Muon
Reference the current persistent version:
Definition Muon.h:13
Photon_v1 Photon
Definition of the current "egamma version".
Definition Photon.h:17
Electron_v1 Electron
Definition of the current "egamma version".
Definition Electron.h:17
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.