ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4
5#ifndef ISOLATIONSELECTION_DEFS_H
6#define ISOLATIONSELECTION_DEFS_H
7
8// EDM include(s):
14
15#include <set>
16#include <unordered_set>
17namespace CP {
18
21
24
25 using SelectionAccessor = std::unique_ptr<CharAccessor>;
26 using SelectionDecorator = std::unique_ptr<CharDecorator>;
27
30
33
36
38 using IsoVector = std::vector<IsoType>;
39
41 template <class Obj> struct SortedObjPtr {
42 SortedObjPtr() = default;
43 SortedObjPtr(const Obj* ptr) : m_ptr{ptr} {}
44
45 const Obj* get() const { return m_ptr; }
46 const Obj* operator->() const { return m_ptr; }
47 const Obj& operator*() const { return *m_ptr; }
48 bool operator!() const { return !m_ptr; }
49 operator bool() const { return m_ptr; }
50 operator const Obj*() const { return m_ptr; }
51 bool operator<(const SortedObjPtr<Obj>& other) const {
52 return other.get() != get() && get() &&
53 (!other || other->pt() < get()->pt() || (other->pt() == get()->pt() && other.get() < get()));
54 }
55
56 private:
57 const Obj* m_ptr{nullptr};
58 };
59
60 struct FlowElementPtr : public SortedObjPtr<xAOD::FlowElement> {
61 FlowElementPtr(const xAOD::FlowElement* ele, float weight_) : SortedObjPtr<xAOD::FlowElement>{ele}, weight{weight_} {}
62 FlowElementPtr() = default;
63 bool operator<(const FlowElementPtr& other) const {
64 if (other.weight != weight) return weight < other.weight;
66 }
67 float weight{1.f};
68 };
69
72
73 using TrackSet = std::set<TrackPtr>;
74 using ClusterSet = std::set<CaloClusterPtr>;
75 using PflowSet = std::set<FlowElementPtr>;
76
77 using UnorderedClusterSet = std::unordered_set<const xAOD::CaloCluster*>;
78 using UnorderedContainerSet = std::unordered_set<const SG::AuxVectorData*>;
79} // namespace CP
80
81#endif
Base class for elements of a container that can have aux data.
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
Select isolated Photons, Electrons and Muons.
std::unordered_set< const xAOD::CaloCluster * > UnorderedClusterSet
std::unordered_set< const SG::AuxVectorData * > UnorderedContainerSet
IsolationType
Overall enumeration for isolation types in xAOD files.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16
setBGCode setTAP setLVL2ErrorBits bool
FlowElementPtr()=default
Small helper struct to have sets of particle pointers sorted by pt.
SortedObjPtr()=default