Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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):
11 #include <xAODPFlow/FlowElement.h>
14 
15 #include <set>
16 #include <unordered_set>
17 namespace 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  };
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
CP::SortedObjPtr::operator<
bool operator<(const SortedObjPtr< Obj > &other) const
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:51
IsolationType.h
CP::PflowSet
std::set< FlowElementPtr > PflowSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:75
CP::TrackSet
std::set< TrackPtr > TrackSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:73
CP::FlowElementPtr::operator<
bool operator<(const FlowElementPtr &other) const
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:63
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
CP::SortedObjPtr
Small helper struct to have sets of particle pointers sorted by pt.
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:41
CP::SortedObjPtr::operator!
bool operator!() const
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:48
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
CP::SortedObjPtr::SortedObjPtr
SortedObjPtr(const Obj *_ptr)
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:43
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
CP::SortedObjPtr::get
const Obj * get() const
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:45
FlowElement.h
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
CaloCluster.h
xAOD::Iso::IsolationType
IsolationType
Overall enumeration for isolation types in xAOD files.
Definition: IsolationType.h:26
CP::SortedObjPtr::SortedObjPtr
SortedObjPtr()=default
CP::SortedObjPtr::m_ptr
const Obj * m_ptr
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:57
CP::SelectionAccessor
std::unique_ptr< CharAccessor > SelectionAccessor
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:25
CP::FlowElementPtr
For the flow elements we need a special derivate which also contains the weights.
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:60
CP::ClusterSet
std::set< CaloClusterPtr > ClusterSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:74
TrackParticle.h
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
CP::SortedObjPtr::operator->
const Obj * operator->() const
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:46
CP::UnorderedClusterSet
std::unordered_set< const xAOD::CaloCluster * > UnorderedClusterSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:77
CP::UnorderedContainerSet
std::unordered_set< const SG::AuxVectorData * > UnorderedContainerSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:78
CP::FlowElementPtr::FlowElementPtr
FlowElementPtr(const xAOD::FlowElement *ele, float _weight)
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:61
CP::FlowElementPtr::FlowElementPtr
FlowElementPtr()=default
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
CP::SortedObjPtr::operator*
const Obj & operator*() const
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:47
CP::FlowElementPtr::weight
float weight
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:67
CP::SelectionDecorator
std::unique_ptr< CharDecorator > SelectionDecorator
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:26
CP::IsoVector
std::vector< IsoType > IsoVector
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:38
AuxElement.h
Base class for elements of a container that can have aux data.
xAOD::FlowElement_v1
A detector object made of other lower level object(s)
Definition: FlowElement_v1.h:25