ATLAS Offline Software
P4DescendingSorters.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // P4DescendingSorters.h
8 // Header file for 'descending' Sorters
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef FOURMOMUTILS_P4DESCENDINGSORTERS_H
12 #define FOURMOMUTILS_P4DESCENDINGSORTERS_H
13 
14 // AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
15 #ifndef XAOD_ANALYSIS
16 
17 // STL includes
18 #include <cmath>
19 
20 // core includes
21 #include "CxxUtils/fpcompare.h"
22 
23 // EventKernel includes
24 #include "EventKernel/I4Momentum.h"
25 
26 namespace P4Sorters {
27 
28 namespace Descending {
29 
30 class Px
31 {
32 public:
33  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
34  return CxxUtils::fpcompare::greater( a->px(), b->px() );
35  }
36 };
37 
38 class Py
39 {
40 public:
41  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
42  return CxxUtils::fpcompare::greater( a->py(), b->py() );
43  }
44 };
45 
46 class Pz
47 {
48 public:
49  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
50  return CxxUtils::fpcompare::greater( a->pz(), b->pz() );
51  }
52 };
53 
54 
55 class Mass
56 {
57 public:
58  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
59  return CxxUtils::fpcompare::greater( a->m(), b->m() );
60  }
61 };
62 
64 {
65 public:
66  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
67  return CxxUtils::fpcompare::greater( a->m2(), b->m2() );
68  }
69 };
70 
71 class Momentum
72 {
73 public:
74  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
75  return CxxUtils::fpcompare::greater( a->p(), b->p() );
76  }
77 };
78 
80 {
81 public:
82  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
83  return CxxUtils::fpcompare::greater( a->p2(), b->p2() );
84  }
85 };
86 
87 class Eta
88 {
89 public:
90  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
91  return CxxUtils::fpcompare::greater( a->eta(), b->eta() );
92  }
93 };
94 
95 class AbsEta
96 {
97 public:
98  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
99  using std::abs;
100  return CxxUtils::fpcompare::greater( abs(a->eta()), abs(b->eta()) );
101  }
102 };
103 
104 class Ene
105 {
106  public:
107  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
108  return CxxUtils::fpcompare::greater( a->e(), b->e() );
109  }
110 };
111 
112 class Et
113 {
114 public:
115  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
116  return CxxUtils::fpcompare::greater( a->et(), b->et() );
117  }
118 };
119 
120 class Pt
121 {
122 public:
123  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
124  return CxxUtils::fpcompare::greater( a->pt(), b->pt() );
125  }
126 };
127 
128 class InvPt
129 {
130 public:
131  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
132  return CxxUtils::fpcompare::greater( a->iPt(), b->iPt() );
133  }
134 };
135 
136 // Are those usefull anyway ??
137 class CosTh
138 {
139 public:
140  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
141  return CxxUtils::fpcompare::greater( a->cosTh(), b->cosTh() );
142  }
143 };
144 
145 class SinTh
146 {
147 public:
148  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
149  return CxxUtils::fpcompare::greater( a->sinTh(), b->sinTh() );
150  }
151 };
152 
153 class CotTh
154 {
155 public:
156  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
157  return CxxUtils::fpcompare::greater( a->cotTh(), b->cotTh() );
158  }
159 };
160 
161 } // > end namespace Descending
162 } // > end namespace P4Sorters
163 
164 #endif
165 
166 #endif //> FOURMOMUTILS_P4DESCENDINGSORTERS_H
P4Sorters::Descending::Pt::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:123
P4Sorters::Descending::MomentumSquared::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:82
I4Momentum
Definition: I4Momentum.h:31
P4Sorters::Descending::Pz::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:49
P4Sorters::Descending::Ene
Definition: P4DescendingSorters.h:105
P4Sorters::Descending::SinTh::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:148
P4Sorters::Descending::CotTh::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:156
P4Sorters::Descending::Mass
Definition: P4DescendingSorters.h:56
P4Sorters::Descending::Px::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:33
P4Sorters::Descending::Momentum
Definition: P4DescendingSorters.h:72
P4Sorters::Descending::Pz
Definition: P4DescendingSorters.h:47
I4Momentum.h
CxxUtils::fpcompare::greater
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:140
P4Sorters::Descending::SinTh
Definition: P4DescendingSorters.h:146
P4Sorters::Descending::InvPt::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:131
P4Sorters
Definition: P4AscendingSorters.h:26
fpcompare.h
Workaround x86 precision issues for FP inequality comparisons.
P4Sorters::Descending::MomentumSquared
Definition: P4DescendingSorters.h:80
P4Sorters::Descending::Py
Definition: P4DescendingSorters.h:39
P4Sorters::Descending::AbsEta
Definition: P4DescendingSorters.h:96
P4Sorters::Descending::InvPt
Definition: P4DescendingSorters.h:129
P4Sorters::Descending::CosTh::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:140
P4Sorters::Descending::MassSquared
Definition: P4DescendingSorters.h:64
P4Sorters::Descending::Et::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:115
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
P4Sorters::Descending::Py::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:41
P4Sorters::Descending::Et
Definition: P4DescendingSorters.h:113
P4Sorters::Descending::CosTh
Definition: P4DescendingSorters.h:138
P4Sorters::Descending::CotTh
Definition: P4DescendingSorters.h:154
P4Sorters::Descending::Px
Definition: P4DescendingSorters.h:31
a
TList * a
Definition: liststreamerinfos.cxx:10
P4Sorters::Descending::Eta::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:90
P4Sorters::Descending::MassSquared::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:66
P4Sorters::Descending::AbsEta::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:98
P4Sorters::Descending::Momentum::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:74
P4Sorters::Descending::Ene::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:107
P4Sorters::Descending::Pt
Definition: P4DescendingSorters.h:121
P4Sorters::Descending::Mass::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4DescendingSorters.h:58
P4Sorters::Descending::Eta
Definition: P4DescendingSorters.h:88