Rivet API documentation

Rivet 4.1.3
Hemispheres.hh
1// -*- C++ -*-
2#ifndef RIVET_Hemispheres_HH
3#define RIVET_Hemispheres_HH
4
5#include "Rivet/Projections/AxesDefinition.hh"
6#include "Rivet/Projections/FinalState.hh"
7
8namespace Rivet {
9
10
56 class Hemispheres : public Projection {
57 public:
58
61 setName("Hemispheres");
62 declare(ax, "Axes");
63 clear();
64 }
65
68
70 using Projection::operator=;
71
72
74 void clear() {
75 _E2vis = -1;
76 _M2high = -1;
77 _M2low = -1;
78 _Bmax = -1;
79 _Bmin = -1;
80 _highMassEqMaxBroad = true;
81 }
82
84 void calc(const Vector3& n, const std::vector<FourMomentum>& p4s);
86 void calc(const Vector3& n, const Particles& particles);
88 void calc(const Vector3& n, const Jets& jets);
89
90
91 protected:
92
94 void project(const Event& e);
95
97 CmpState compare(const Projection& p) const {
98 return mkNamedPCmp(p, "Axes");
99 }
100
101
102 public:
103
106
107 double E2vis() const {
108 return _E2vis;
109 }
110 double Evis() const {
111 return sqrt(_E2vis);
112 }
113
114 double M2high() const {
115 return _M2high;
116 }
117 double Mhigh() const {
118 return sqrt(M2high());
119 }
120
121 double M2low() const {
122 return _M2low;
123 }
124 double Mlow() const {
125 return sqrt(M2low());
126 }
127
128 double M2diff() const {
129 return _M2high - _M2low;
130 }
131 double Mdiff() const {
132 return sqrt(M2diff());
133 }
134
135 double M2sum() const {
136 return _M2high + _M2low;
137 }
138 double Msum() const {
139 return sqrt(M2sum());
140 }
141
142 double scaledM2high() const {
143 if (isZero(_M2high)) return 0.0;
144 if (!isZero(_E2vis))
145 return _M2high / _E2vis;
146 else
147 return std::numeric_limits<double>::max();
148 }
149 double scaledMhigh() const {
150 return sqrt(scaledM2high());
151 }
152
153 double scaledM2low() const {
154 if (isZero(_M2low)) return 0.0;
155 if (!isZero(_E2vis))
156 return _M2low / _E2vis;
157 else
158 return std::numeric_limits<double>::max();
159 }
160 double scaledMlow() const {
161 return sqrt(scaledM2low());
162 }
163
164 double scaledM2diff() const {
165 if (M2diff() == 0.0) return 0.0;
166 if (_E2vis != 0.0)
167 return M2diff() / _E2vis;
168 else
169 return std::numeric_limits<double>::max();
170 }
171 double scaledMdiff() const {
172 return sqrt(scaledM2diff());
173 }
175
176
179 double Bmax() const {
180 return _Bmax;
181 }
182 double Bmin() const {
183 return _Bmin;
184 }
185 double Bsum() const {
186 return _Bmax + _Bmin;
187 }
188 double Bdiff() const {
189 return fabs(_Bmax - _Bmin);
190 } // <- fabs(), just in case...
192
193
196 return _highMassEqMaxBroad;
197 }
198
200 bool highMassDirection() const {
201 return _highMassDirection;
202 }
203
204
205 protected:
206
208 double _E2vis;
209
211 double _M2high, _M2low;
212
214 double _Bmax, _Bmin;
215
217 bool _highMassEqMaxBroad;
218
220 bool _highMassDirection;
221 };
222
223
224}
225
226#endif
Base class for projections which define a spatial basis.
Definition AxesDefinition.hh:19
RIVET_DEFAULT_PROJ_CLONE(Hemispheres)
Clone on the heap.
void project(const Event &e)
Perform the projection on the Event.
void calc(const Vector3 &n, const Jets &jets)
Use the projection manually (i.e. outside the projection mechanism) with jet inputs.
void calc(const Vector3 &n, const std::vector< FourMomentum > &p4s)
Use the projection manually (i.e. outside the projection mechanism) with raw 4-momentum inputs.
Hemispheres(const AxesDefinition &ax)
Constructor.
Definition Hemispheres.hh:60
void clear()
Reset the projection.
Definition Hemispheres.hh:74
bool massMatchesBroadening() const
Is the hemisphere with the max mass the same as the one with the max broadening?
Definition Hemispheres.hh:195
CmpState compare(const Projection &p) const
Compare with other projections.
Definition Hemispheres.hh:97
void calc(const Vector3 &n, const Particles &particles)
Use the projection manually (i.e. outside the projection mechanism) with particle inputs.
bool highMassDirection() const
Is the hemisphere with the max mass the one in the direction of the axis.
Definition Hemispheres.hh:200
Specialised vector of Jet objects.
Definition Jet.hh:21
Specialised vector of Particle objects.
Definition Particle.hh:21
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version).
Definition ProjectionApplier.hh:205
Projection()
The default constructor.
friend class Event
Event is a friend.
Definition Projection.hh:33
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:146
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Three-dimensional specialisation of Vector.
Definition Vector3.hh:39
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
Definition LHCbCommon.hh:9
std::enable_if_t< std::is_floating_point_v< NUM >, bool > isZero(NUM val, double tolerance=1e-8)
Compare a number to zero.
Definition MathUtils.hh:23