ATLAS Offline Software
P4AscendingSorters.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 // P4AscendingSorters.h
8 // Header file for 'ascending' Sorters
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef FOURMOMUTILS_P4ASCENDINGSORTERS_H
12 #define FOURMOMUTILS_P4ASCENDINGSORTERS_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 Ascending {
29 
30 class Px
31 {
32 public:
33  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
34  return CxxUtils::fpcompare::less( 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::less( 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::less( 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::less( a->m(), b->m() );
60  }
61 };
62 
64 {
65 public:
66  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
67  return CxxUtils::fpcompare::less( 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::less( a->p(), b->p() );
76  }
77 };
78 
80 {
81 public:
82  bool operator()( const I4Momentum* a, const I4Momentum* b ) const {
83  return CxxUtils::fpcompare::less( 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::less( 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::less( 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::less( 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::less( 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::less( 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::less( 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::less( 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::less( 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::less( a->cotTh(), b->cotTh() );
158  }
159 };
160 
161 } // > end namespace Ascending
162 } // > end namespace P4Sorters
163 
164 #endif
165 
166 #endif //> FOURMOMUTILS_P4ASCENDINGSORTERS_H
P4Sorters::Ascending::InvPt
Definition: P4AscendingSorters.h:129
P4Sorters::Ascending::MomentumSquared
Definition: P4AscendingSorters.h:80
I4Momentum
Definition: I4Momentum.h:31
P4Sorters::Ascending::Eta::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:90
P4Sorters::Ascending::AbsEta::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:98
P4Sorters::Ascending::Pt::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:123
P4Sorters::Ascending::Pz::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:49
P4Sorters::Ascending::Ene
Definition: P4AscendingSorters.h:105
I4Momentum.h
P4Sorters::Ascending::Momentum::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:74
P4Sorters::Ascending::Et::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:115
P4Sorters::Ascending::MassSquared::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:66
P4Sorters::Ascending::InvPt::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:131
P4Sorters::Ascending::Pz
Definition: P4AscendingSorters.h:47
P4Sorters::Ascending::CosTh::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:140
P4Sorters::Ascending::Px::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:33
P4Sorters::Ascending::Ene::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:107
P4Sorters::Ascending::CotTh
Definition: P4AscendingSorters.h:154
P4Sorters::Ascending::CosTh
Definition: P4AscendingSorters.h:138
P4Sorters
Definition: P4AscendingSorters.h:26
P4Sorters::Ascending::SinTh
Definition: P4AscendingSorters.h:146
fpcompare.h
Workaround x86 precision issues for FP inequality comparisons.
P4Sorters::Ascending::MassSquared
Definition: P4AscendingSorters.h:64
P4Sorters::Ascending::Mass
Definition: P4AscendingSorters.h:56
P4Sorters::Ascending::Py::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:41
P4Sorters::Ascending::Py
Definition: P4AscendingSorters.h:39
P4Sorters::Ascending::Mass::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:58
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
P4Sorters::Ascending::AbsEta
Definition: P4AscendingSorters.h:96
CxxUtils::fpcompare::less
bool less(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:166
P4Sorters::Ascending::SinTh::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:148
P4Sorters::Ascending::MomentumSquared::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:82
a
TList * a
Definition: liststreamerinfos.cxx:10
P4Sorters::Ascending::Eta
Definition: P4AscendingSorters.h:88
P4Sorters::Ascending::Et
Definition: P4AscendingSorters.h:113
P4Sorters::Ascending::Pt
Definition: P4AscendingSorters.h:121
P4Sorters::Ascending::CotTh::operator()
bool operator()(const I4Momentum *a, const I4Momentum *b) const
Definition: P4AscendingSorters.h:156
P4Sorters::Ascending::Px
Definition: P4AscendingSorters.h:31
P4Sorters::Ascending::Momentum
Definition: P4AscendingSorters.h:72