Rivet API documentation

Rivet 4.1.3
ParticleBase.hh
1#ifndef RIVET_ParticleBase_HH
2#define RIVET_ParticleBase_HH
3
4#include "Rivet/Jet.fhh"
5#include "Rivet/Config/RivetCommon.hh"
6#include "Rivet/Math/Vectors.hh"
7#include "Rivet/Tools/Cuts.fhh"
8
9namespace Rivet {
10
11
14 public:
15
18
20 virtual ~ParticleBase() { }
21
22
23 // /// @name Constituent accessors
24 // /// @{
25
26 // /// @todo Can't do this because a) ParticleBase is pure-virtual; b) inheritance causality for Particle... urk
27 // virtual const vector<ParticleBase>& constituents() const = 0;
28 // virtual const vector<ParticleBase>& rawConstituents() const = 0;
29
30 // /// @}
31
32
35
37 virtual const FourMomentum& momentum() const = 0;
39 const FourMomentum& mom() const {
40 return momentum();
41 };
42
43 const FourMomentum& p4() const {
44 return momentum();
45 };
46
48 operator const FourMomentum&() const {
49 return momentum();
50 }
51
53
54
57
59 double E() const {
60 return momentum().E();
61 }
62
63 double energy() const {
64 return momentum().E();
65 }
66
68 double E2() const {
69 return momentum().E2();
70 }
71
72 double energy2() const {
73 return momentum().E2();
74 }
75
77 double pt() const {
78 return momentum().pt();
79 }
80
81 double pT() const {
82 return pt();
83 }
84
85 double perp() const {
86 return pt();
87 }
88
90 double pt2() const {
91 return momentum().pt2();
92 }
93
94 double pT2() const {
95 return pt2();
96 }
97
98 double perp2() const {
99 return pt2();
100 }
101
103 double Et() const {
104 return momentum().Et();
105 }
106
107 double Et2() const {
108 return momentum().Et2();
109 }
110
112 double mass() const {
113 return momentum().mass();
114 }
115
116 double mass2() const {
117 return momentum().mass2();
118 }
119
121 double pseudorapidity() const {
122 return momentum().eta();
123 }
124
125 double eta() const {
126 return momentum().eta();
127 }
128
129 double abspseudorapidity() const {
130 return momentum().abspseudorapidity();
131 }
132
133 double abseta() const {
134 return momentum().abseta();
135 }
136
138 double rapidity() const {
139 return momentum().rapidity();
140 }
141
142 double rap() const {
143 return momentum().rapidity();
144 }
145
146 double absrapidity() const {
147 return momentum().absrapidity();
148 }
149
150 double absrap() const {
151 return momentum().absrap();
152 }
153
155 double azimuthalAngle(const PhiMapping mapping = ZERO_2PI) const {
156 return momentum().azimuthalAngle(mapping);
157 }
158
159 double phi(const PhiMapping mapping = ZERO_2PI) const {
160 return momentum().phi(mapping);
161 }
162
165 return momentum().vector3();
166 }
167
168 double p() const {
169 return momentum().p();
170 }
171
172 double p2() const {
173 return momentum().p2();
174 }
175
177 Vector3 ptvec() const {
178 return momentum().ptvec();
179 }
180
181 Vector3 pTvec() const {
182 return momentum().pTvec();
183 }
184
186 double px() const {
187 return momentum().x();
188 }
189
190 double py() const {
191 return momentum().y();
192 }
193
194 double pz() const {
195 return momentum().z();
196 }
197
199 double px2() const {
200 return momentum().x2();
201 }
202
203 double py2() const {
204 return momentum().y2();
205 }
206
207 double pz2() const {
208 return momentum().z2();
209 }
210
212 double polarAngle() const {
213 return momentum().polarAngle();
214 }
215
216 double theta() const {
217 return momentum().theta();
218 }
219
221 double angle(const ParticleBase& v) const {
222 return momentum().angle(v.momentum());
223 }
224
225 double angle(const FourVector& v) const {
226 return momentum().angle(v);
227 }
228
229 double angle(const Vector3& v3) const {
230 return momentum().angle(v3);
231 }
232
234 double dot(const ParticleBase& v) const {
235 return momentum().dot(v.momentum());
236 }
237
238 double dot(const FourVector& v) const {
239 return momentum().dot(v);
240 }
241
243 };
244
245
248
249 inline double deltaR(const ParticleBase& p1, const ParticleBase& p2, RapScheme scheme = PSEUDORAPIDITY) {
250 return deltaR(p1.momentum(), p2.momentum(), scheme);
251 }
252
253 inline double deltaR(const ParticleBase& p, const FourMomentum& v, RapScheme scheme = PSEUDORAPIDITY) {
254 return deltaR(p.momentum(), v, scheme);
255 }
256
257 inline double deltaR(const ParticleBase& p, const FourVector& v, RapScheme scheme = PSEUDORAPIDITY) {
258 return deltaR(p.momentum(), v, scheme);
259 }
260
261 inline double deltaR(const ParticleBase& p, const Vector3& v) {
262 return deltaR(p.momentum(), v);
263 }
264
265 inline double deltaR(const ParticleBase& p, double eta, double phi) {
266 return deltaR(p.momentum(), eta, phi);
267 }
268
269 inline double deltaR(const FourMomentum& v, const ParticleBase& p, RapScheme scheme = PSEUDORAPIDITY) {
270 return deltaR(v, p.momentum(), scheme);
271 }
272
273 inline double deltaR(const FourVector& v, const ParticleBase& p, RapScheme scheme = PSEUDORAPIDITY) {
274 return deltaR(v, p.momentum(), scheme);
275 }
276
277 inline double deltaR(const Vector3& v, const ParticleBase& p) {
278 return deltaR(v, p.momentum());
279 }
280
281 inline double deltaR(double eta, double phi, const ParticleBase& p) {
282 return deltaR(eta, phi, p.momentum());
283 }
284
285
286 inline double deltaPhi(const ParticleBase& p1, const ParticleBase& p2, bool sign = false) {
287 return deltaPhi(p1.momentum(), p2.momentum(), sign);
288 }
289
290 inline double deltaPhi(const ParticleBase& p, const FourMomentum& v, bool sign = false) {
291 return deltaPhi(p.momentum(), v, sign);
292 }
293
294 inline double deltaPhi(const ParticleBase& p, const FourVector& v, bool sign = false) {
295 return deltaPhi(p.momentum(), v, sign);
296 }
297
298 inline double deltaPhi(const ParticleBase& p, const Vector3& v, bool sign = false) {
299 return deltaPhi(p.momentum(), v, sign);
300 }
301
302 inline double deltaPhi(const ParticleBase& p, double phi, bool sign = false) {
303 return deltaPhi(p.momentum(), phi, sign);
304 }
305
306 inline double deltaPhi(const FourMomentum& v, const ParticleBase& p, bool sign = false) {
307 return deltaPhi(v, p.momentum(), sign);
308 }
309
310 inline double deltaPhi(const FourVector& v, const ParticleBase& p, bool sign = false) {
311 return deltaPhi(v, p.momentum(), sign);
312 }
313
314 inline double deltaPhi(const Vector3& v, const ParticleBase& p, bool sign = false) {
315 return deltaPhi(v, p.momentum(), sign);
316 }
317
318 inline double deltaPhi(double phi, const ParticleBase& p, bool sign = false) {
319 return deltaPhi(phi, p.momentum(), sign);
320 }
321
322
323 inline double deltaEta(const ParticleBase& p1, const ParticleBase& p2) {
324 return deltaEta(p1.momentum(), p2.momentum());
325 }
326
327 inline double deltaEta(const ParticleBase& p, const FourMomentum& v) {
328 return deltaEta(p.momentum(), v);
329 }
330
331 inline double deltaEta(const ParticleBase& p, const FourVector& v) {
332 return deltaEta(p.momentum(), v);
333 }
334
335 inline double deltaEta(const ParticleBase& p, const Vector3& v) {
336 return deltaEta(p.momentum(), v);
337 }
338
339 inline double deltaEta(const ParticleBase& p, double eta) {
340 return deltaEta(p.momentum(), eta);
341 }
342
343 inline double deltaEta(const FourMomentum& v, const ParticleBase& p) {
344 return deltaEta(v, p.momentum());
345 }
346
347 inline double deltaEta(const FourVector& v, const ParticleBase& p) {
348 return deltaEta(v, p.momentum());
349 }
350
351 inline double deltaEta(const Vector3& v, const ParticleBase& p) {
352 return deltaEta(v, p.momentum());
353 }
354
355 inline double deltaEta(double eta, const ParticleBase& p) {
356 return deltaEta(eta, p.momentum());
357 }
358
359
360 inline double deltaRap(const ParticleBase& p1, const ParticleBase& p2) {
361 return deltaRap(p1.momentum(), p2.momentum());
362 }
363
364 inline double deltaRap(const ParticleBase& p, const FourMomentum& v) {
365 return deltaRap(p.momentum(), v);
366 }
367
368 inline double deltaRap(const ParticleBase& p, double y) {
369 return deltaRap(p.momentum(), y);
370 }
371
372 inline double deltaRap(const FourMomentum& v, const ParticleBase& p) {
373 return deltaRap(v, p.momentum());
374 }
375
376 inline double deltaRap(double y, const ParticleBase& p) {
377 return deltaRap(y, p.momentum());
378 }
379
381
382
383}
384
385#endif
Specialized version of the FourVector with momentum/energy functionality.
Definition Vector4.hh:363
double p2() const
Get the modulus-squared of the 3-momentum.
Definition Vector4.hh:656
double E2() const
Get energy-squared .
Definition Vector4.hh:594
double mass() const
Get the mass (the Lorentz self-invariant).
Definition Vector4.hh:629
double rapidity() const
Calculate the rapidity.
Definition Vector4.hh:662
double p() const
Get the modulus of the 3-momentum.
Definition Vector4.hh:651
double pt() const
Calculate the transverse momentum .
Definition Vector4.hh:704
double Et() const
Calculate the transverse energy .
Definition Vector4.hh:713
double Et2() const
Calculate the transverse energy .
Definition Vector4.hh:709
double pt2() const
Calculate the squared transverse momentum .
Definition Vector4.hh:695
Vector3 pTvec() const
Calculate the transverse momentum vector .
Definition Vector4.hh:682
Vector3 ptvec() const
Synonym for pTvec.
Definition Vector4.hh:686
double mass2() const
Get the squared mass (the Lorentz self-invariant).
Definition Vector4.hh:640
double absrap() const
Absolute rapidity.
Definition Vector4.hh:677
double E() const
Get energy (time component of momentum).
Definition Vector4.hh:590
double absrapidity() const
Absolute rapidity.
Definition Vector4.hh:673
Specialisation of VectorN to a general (non-momentum) Lorentz 4-vector.
Definition Vector4.hh:32
Vector3 vector3() const
Get the spatial part of the 4-vector as a 3-vector.
Definition Vector4.hh:219
double angle(const FourVector &v) const
Angle between this vector and another.
Definition Vector4.hh:133
double phi(const PhiMapping mapping=ZERO_2PI) const
Synonym for azimuthalAngle.
Definition Vector4.hh:187
double abseta() const
Get the directly (alias).
Definition Vector4.hh:214
double azimuthalAngle(const PhiMapping mapping=ZERO_2PI) const
Angle subtended by the 3-vector's projection in x-y and the x-axis.
Definition Vector4.hh:183
double dot(const FourVector &v) const
Contract two 4-vectors, with metric signature (+ - - -).
Definition Vector4.hh:242
double eta() const
Synonym for pseudorapidity.
Definition Vector4.hh:205
double theta() const
Synonym for polarAngle.
Definition Vector4.hh:196
double polarAngle() const
Angle subtended by the 3-vector and the z-axis.
Definition Vector4.hh:192
double abspseudorapidity() const
Get the directly.
Definition Vector4.hh:210
Base class for particle-like things like Particle and Jet.
Definition ParticleBase.hh:13
double py() const
y component of momentum.
Definition ParticleBase.hh:190
double polarAngle() const
Angle subtended by the 3-vector and the z-axis.
Definition ParticleBase.hh:212
const FourMomentum & p4() const
Get the equivalent momentum four-vector (const) (alias).
Definition ParticleBase.hh:43
const FourMomentum & mom() const
Get the equivalent momentum four-vector (const) (alias).
Definition ParticleBase.hh:39
double dot(const ParticleBase &v) const
Lorentz dot product between this 4-vector and another.
Definition ParticleBase.hh:234
double pT() const
Get the directly (alias).
Definition ParticleBase.hh:81
double absrap() const
Get the directly (alias).
Definition ParticleBase.hh:150
double abspseudorapidity() const
Get the directly.
Definition ParticleBase.hh:129
double angle(const ParticleBase &v) const
Angle between this vector and another.
Definition ParticleBase.hh:221
double dot(const FourVector &v) const
Angle between this 4-vector and another.
Definition ParticleBase.hh:238
double pT2() const
Get the directly (alias).
Definition ParticleBase.hh:94
Vector3 ptvec() const
Get the transverse 3-momentum directly.
Definition ParticleBase.hh:177
double mass2() const
Get the mass**2 directly.
Definition ParticleBase.hh:116
double perp() const
Get the directly (alias).
Definition ParticleBase.hh:85
virtual const FourMomentum & momentum() const =0
Get the equivalent momentum four-vector (const).
double phi(const PhiMapping mapping=ZERO_2PI) const
Get the directly.
Definition ParticleBase.hh:159
double p() const
Get the 3-momentum magnitude directly.
Definition ParticleBase.hh:168
double energy2() const
Get the energy-squared (alias).
Definition ParticleBase.hh:72
ParticleBase()
Default constructor.
Definition ParticleBase.hh:17
double abseta() const
Get the directly (alias).
Definition ParticleBase.hh:133
double pt2() const
Get the directly.
Definition ParticleBase.hh:90
ThreeMomentum p3() const
Get the 3-momentum directly.
Definition ParticleBase.hh:164
double theta() const
Synonym for polarAngle.
Definition ParticleBase.hh:216
double perp2() const
Get the directly (alias).
Definition ParticleBase.hh:98
double mass() const
Get the mass directly.
Definition ParticleBase.hh:112
double pz() const
z component of momentum.
Definition ParticleBase.hh:194
double pt() const
Get the directly.
Definition ParticleBase.hh:77
double Et2() const
Get the directly.
Definition ParticleBase.hh:107
double rap() const
Get the directly (alias).
Definition ParticleBase.hh:142
double pz2() const
z component of momentum, squared.
Definition ParticleBase.hh:207
double px() const
x component of momentum.
Definition ParticleBase.hh:186
double eta() const
Get the directly (alias).
Definition ParticleBase.hh:125
double Et() const
Get the directly.
Definition ParticleBase.hh:103
double rapidity() const
Get the directly.
Definition ParticleBase.hh:138
Vector3 pTvec() const
Get the transverse 3-momentum directly.
Definition ParticleBase.hh:181
virtual ~ParticleBase()
Virtual destructor.
Definition ParticleBase.hh:20
double pseudorapidity() const
Get the directly.
Definition ParticleBase.hh:121
double angle(const FourVector &v) const
Angle between this vector and another.
Definition ParticleBase.hh:225
double E() const
Get the energy directly.
Definition ParticleBase.hh:59
double absrapidity() const
Get the directly.
Definition ParticleBase.hh:146
double py2() const
y component of momentum, squared.
Definition ParticleBase.hh:203
double energy() const
Get the energy directly (alias).
Definition ParticleBase.hh:63
double azimuthalAngle(const PhiMapping mapping=ZERO_2PI) const
Azimuthal angle .
Definition ParticleBase.hh:155
double px2() const
x component of momentum, squared.
Definition ParticleBase.hh:199
double angle(const Vector3 &v3) const
Angle between this vector and another (3-vector).
Definition ParticleBase.hh:229
double p2() const
Get the 3-momentum magnitude-squared directly.
Definition ParticleBase.hh:172
double E2() const
Get the energy-squared.
Definition ParticleBase.hh:68
Specialized version of the ThreeVector with momentum functionality.
Definition Vector3.hh:377
Three-dimensional specialisation of Vector.
Definition Vector3.hh:39
double eta(const ParticleBase &p)
Unbound function access to eta.
Definition ParticleBaseUtils.hh:839
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
Definition LHCbCommon.hh:9
constexpr std::enable_if_t< std::is_arithmetic_v< NUM >, int > sign(NUM val)
Find the sign of a number.
Definition MathUtils.hh:295
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:754
double deltaPhi(double phi1, double phi2, bool sign=false)
Calculate the difference between two angles in radians.
Definition MathUtils.hh:724
double deltaEta(double eta1, double eta2, bool sign=false)
Definition MathUtils.hh:732
PhiMapping
Enum for range of to be mapped into.
Definition MathConstants.hh:49
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition MathConstants.hh:46
double deltaRap(double y1, double y2, bool sign=false)
Definition MathUtils.hh:740