Rivet: /Users/chrisg/software/rivet/include/Rivet/ParticleBase.hh Source File

| Rivet 3.1.9

ParticleBase.hh
1#ifndef RIVET_ParticleBase_HH
2#define RIVET_ParticleBase_HH
3
4#include "Rivet/Config/RivetCommon.hh"
5#include "Rivet/Jet.fhh"
6#include "Rivet/Tools/Cuts.fhh"
7#include "Rivet/Math/Vectors.hh"
8
9namespace Rivet {
10
11
13 class ParticleBase {
14 public:
15
17 ParticleBase() { }
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
34
35
37 virtual const FourMomentum& momentum() const = 0;
39 const FourMomentum& mom() const { return momentum(); };
40
42 operator const FourMomentum& () const { return momentum(); }
43
45
46
48
49
51 double E() const { return momentum().E(); }
53 double energy() const { return momentum().E(); }
54
56 double E2() const { return momentum().E2(); }
58 double energy2() const { return momentum().E2(); }
59
61 double pt() const { return momentum().pt(); }
63 double pT() const { return pt(); }
65 double perp() const { return pt(); }
66
68 double pt2() const { return momentum().pt2(); }
70 double pT2() const { return pt2(); }
72 double perp2() const { return pt2(); }
73
75 double Et() const { return momentum().Et(); }
77 double Et2() const { return momentum().Et2(); }
78
80 double mass() const { return momentum().mass(); }
82 double mass2() const { return momentum().mass2(); }
83
85 double pseudorapidity() const { return momentum().eta(); }
87 double eta() const { return momentum().eta(); }
89 double abspseudorapidity() const { return momentum().abspseudorapidity(); }
91 double abseta() const { return momentum().abseta(); }
92
94 double rapidity() const { return momentum().rapidity(); }
96 double rap() const { return momentum().rapidity(); }
98 double absrapidity() const { return momentum().absrapidity(); }
100 double absrap() const { return momentum().absrap(); }
101
103 double azimuthalAngle(const PhiMapping mapping=ZERO_2PI) const { return momentum().azimuthalAngle(mapping); }
105 double phi(const PhiMapping mapping=ZERO_2PI) const { return momentum().phi(mapping); }
106
108 ThreeMomentum p3() const { return momentum().vector3(); }
110 double p() const { return momentum().p(); }
112 double p2() const { return momentum().p2(); }
113
115 Vector3 ptvec() const { return momentum().ptvec(); }
117 Vector3 pTvec() const { return momentum().pTvec(); }
118
120 double px() const { return momentum().x(); }
122 double py() const { return momentum().y(); }
124 double pz() const { return momentum().z(); }
125
127 double px2() const { return momentum().x2(); }
129 double py2() const { return momentum().y2(); }
131 double pz2() const { return momentum().z2(); }
132
134 double polarAngle() const { return momentum().polarAngle(); }
136 double theta() const { return momentum().theta(); }
137
139 double angle(const ParticleBase& v) const { return momentum().angle(v.momentum()); }
141 double angle(const FourVector& v) const { return momentum().angle(v); }
143 double angle(const Vector3& v3) const { return momentum().angle(v3); }
144
146 double dot(const ParticleBase& v) const { return momentum().dot(v.momentum()); }
148 double dot(const FourVector& v) const { return momentum().dot(v); }
149
151
152 };
153
154
156
157
158 inline double deltaR(const ParticleBase& p1, const ParticleBase& p2,
159 RapScheme scheme = PSEUDORAPIDITY) {
160 return deltaR(p1.momentum(), p2.momentum(), scheme);
161 }
162
163 inline double deltaR(const ParticleBase& p, const FourMomentum& v,
164 RapScheme scheme = PSEUDORAPIDITY) {
165 return deltaR(p.momentum(), v, scheme);
166 }
167
168 inline double deltaR(const ParticleBase& p, const FourVector& v,
169 RapScheme scheme = PSEUDORAPIDITY) {
170 return deltaR(p.momentum(), v, scheme);
171 }
172
173 inline double deltaR(const ParticleBase& p, const Vector3& v) {
174 return deltaR(p.momentum(), v);
175 }
176
177 inline double deltaR(const ParticleBase& p, double eta, double phi) {
178 return deltaR(p.momentum(), eta, phi);
179 }
180
181 inline double deltaR(const FourMomentum& v, const ParticleBase& p,
182 RapScheme scheme = PSEUDORAPIDITY) {
183 return deltaR(v, p.momentum(), scheme);
184 }
185
186 inline double deltaR(const FourVector& v, const ParticleBase& p,
187 RapScheme scheme = PSEUDORAPIDITY) {
188 return deltaR(v, p.momentum(), scheme);
189 }
190
191 inline double deltaR(const Vector3& v, const ParticleBase& p) {
192 return deltaR(v, p.momentum());
193 }
194
195 inline double deltaR(double eta, double phi, const ParticleBase& p) {
196 return deltaR(eta, phi, p.momentum());
197 }
198
199
200 inline double deltaPhi(const ParticleBase& p1, const ParticleBase& p2, bool sign=false) {
201 return deltaPhi(p1.momentum(), p2.momentum(), sign);
202 }
203
204 inline double deltaPhi(const ParticleBase& p, const FourMomentum& v, bool sign=false) {
205 return deltaPhi(p.momentum(), v, sign);
206 }
207
208 inline double deltaPhi(const ParticleBase& p, const FourVector& v, bool sign=false) {
209 return deltaPhi(p.momentum(), v, sign);
210 }
211
212 inline double deltaPhi(const ParticleBase& p, const Vector3& v, bool sign=false) {
213 return deltaPhi(p.momentum(), v, sign);
214 }
215
216 inline double deltaPhi(const ParticleBase& p, double phi, bool sign=false) {
217 return deltaPhi(p.momentum(), phi, sign);
218 }
219
220 inline double deltaPhi(const FourMomentum& v, const ParticleBase& p, bool sign=false) {
221 return deltaPhi(v, p.momentum(), sign);
222 }
223
224 inline double deltaPhi(const FourVector& v, const ParticleBase& p, bool sign=false) {
225 return deltaPhi(v, p.momentum(), sign);
226 }
227
228 inline double deltaPhi(const Vector3& v, const ParticleBase& p, bool sign=false) {
229 return deltaPhi(v, p.momentum(), sign);
230 }
231
232 inline double deltaPhi(double phi, const ParticleBase& p, bool sign=false) {
233 return deltaPhi(phi, p.momentum(), sign);
234 }
235
236
237 inline double deltaEta(const ParticleBase& p1, const ParticleBase& p2) {
238 return deltaEta(p1.momentum(), p2.momentum());
239 }
240
241 inline double deltaEta(const ParticleBase& p, const FourMomentum& v) {
242 return deltaEta(p.momentum(), v);
243 }
244
245 inline double deltaEta(const ParticleBase& p, const FourVector& v) {
246 return deltaEta(p.momentum(), v);
247 }
248
249 inline double deltaEta(const ParticleBase& p, const Vector3& v) {
250 return deltaEta(p.momentum(), v);
251 }
252
253 inline double deltaEta(const ParticleBase& p, double eta) {
254 return deltaEta(p.momentum(), eta);
255 }
256
257 inline double deltaEta(const FourMomentum& v, const ParticleBase& p) {
258 return deltaEta(v, p.momentum());
259 }
260
261 inline double deltaEta(const FourVector& v, const ParticleBase& p) {
262 return deltaEta(v, p.momentum());
263 }
264
265 inline double deltaEta(const Vector3& v, const ParticleBase& p) {
266 return deltaEta(v, p.momentum());
267 }
268
269 inline double deltaEta(double eta, const ParticleBase& p) {
270 return deltaEta(eta, p.momentum());
271 }
272
273
274 inline double deltaRap(const ParticleBase& p1, const ParticleBase& p2) {
275 return deltaRap(p1.momentum(), p2.momentum());
276 }
277
278 inline double deltaRap(const ParticleBase& p, const FourMomentum& v) {
279 return deltaRap(p.momentum(), v);
280 }
281
282 inline double deltaRap(const ParticleBase& p, double y) {
283 return deltaRap(p.momentum(), y);
284 }
285
286 inline double deltaRap(const FourMomentum& v, const ParticleBase& p) {
287 return deltaRap(v, p.momentum());
288 }
289
290 inline double deltaRap(double y, const ParticleBase& p) {
291 return deltaRap(y, p.momentum());
292 }
293
295
296
297}
298
299#endif
Rivet::FourMomentum
Specialized version of the FourVector with momentum/energy functionality.
Definition Vector4.hh:316
Rivet::FourVector
Specialisation of VectorN to a general (non-momentum) Lorentz 4-vector.
Definition Vector4.hh:30
Rivet::ParticleBase
Base class for particle-like things like Particle and Jet.
Definition ParticleBase.hh:13
Rivet::ParticleBase::py
double py() const
y component of momentum.
Definition ParticleBase.hh:122
Rivet::ParticleBase::polarAngle
double polarAngle() const
Angle subtended by the 3-vector and the z-axis.
Definition ParticleBase.hh:134
Rivet::ParticleBase::mom
const FourMomentum & mom() const
Get equivalent single momentum four-vector (const) (alias).
Definition ParticleBase.hh:39
Rivet::ParticleBase::dot
double dot(const ParticleBase &v) const
Lorentz dot product between this 4-vector and another.
Definition ParticleBase.hh:146
Rivet::ParticleBase::pT
double pT() const
Get the directly (alias).
Definition ParticleBase.hh:63
Rivet::ParticleBase::absrap
double absrap() const
Get the directly (alias).
Definition ParticleBase.hh:100
Rivet::ParticleBase::abspseudorapidity
double abspseudorapidity() const
Get the directly.
Definition ParticleBase.hh:89
Rivet::ParticleBase::angle
double angle(const ParticleBase &v) const
Angle between this vector and another.
Definition ParticleBase.hh:139
Rivet::ParticleBase::dot
double dot(const FourVector &v) const
Angle between this 4-vector and another.
Definition ParticleBase.hh:148
Rivet::ParticleBase::pT2
double pT2() const
Get the directly (alias).
Definition ParticleBase.hh:70
Rivet::ParticleBase::ptvec
Vector3 ptvec() const
Get the transverse 3-momentum directly.
Definition ParticleBase.hh:115
Rivet::ParticleBase::mass2
double mass2() const
Get the mass**2 directly.
Definition ParticleBase.hh:82
Rivet::ParticleBase::perp
double perp() const
Get the directly (alias).
Definition ParticleBase.hh:65
Rivet::ParticleBase::momentum
virtual const FourMomentum & momentum() const =0
Get equivalent single momentum four-vector (const).
Rivet::ParticleBase::phi
double phi(const PhiMapping mapping=ZERO_2PI) const
Get the directly.
Definition ParticleBase.hh:105
Rivet::ParticleBase::p
double p() const
Get the 3-momentum magnitude directly.
Definition ParticleBase.hh:110
Rivet::ParticleBase::energy2
double energy2() const
Get the energy-squared (alias).
Definition ParticleBase.hh:58
Rivet::ParticleBase::ParticleBase
ParticleBase()
Default constructor.
Definition ParticleBase.hh:17
Rivet::ParticleBase::abseta
double abseta() const
Get the directly (alias).
Definition ParticleBase.hh:91
Rivet::ParticleBase::pt2
double pt2() const
Get the directly.
Definition ParticleBase.hh:68
Rivet::ParticleBase::p3
ThreeMomentum p3() const
Get the 3-momentum directly.
Definition ParticleBase.hh:108
Rivet::ParticleBase::theta
double theta() const
Synonym for polarAngle.
Definition ParticleBase.hh:136
Rivet::ParticleBase::perp2
double perp2() const
Get the directly (alias).
Definition ParticleBase.hh:72
Rivet::ParticleBase::mass
double mass() const
Get the mass directly.
Definition ParticleBase.hh:80
Rivet::ParticleBase::pz
double pz() const
z component of momentum.
Definition ParticleBase.hh:124
Rivet::ParticleBase::pt
double pt() const
Get the directly.
Definition ParticleBase.hh:61
Rivet::ParticleBase::Et2
double Et2() const
Get the directly.
Definition ParticleBase.hh:77
Rivet::ParticleBase::rap
double rap() const
Get the directly (alias).
Definition ParticleBase.hh:96
Rivet::ParticleBase::pz2
double pz2() const
z component of momentum, squared.
Definition ParticleBase.hh:131
Rivet::ParticleBase::px
double px() const
x component of momentum.
Definition ParticleBase.hh:120
Rivet::ParticleBase::eta
double eta() const
Get the directly (alias).
Definition ParticleBase.hh:87
Rivet::ParticleBase::Et
double Et() const
Get the directly.
Definition ParticleBase.hh:75
Rivet::ParticleBase::rapidity
double rapidity() const
Get the directly.
Definition ParticleBase.hh:94
Rivet::ParticleBase::pTvec
Vector3 pTvec() const
Get the transverse 3-momentum directly.
Definition ParticleBase.hh:117
Rivet::ParticleBase::~ParticleBase
virtual ~ParticleBase()
Virtual destructor.
Definition ParticleBase.hh:20
Rivet::ParticleBase::pseudorapidity
double pseudorapidity() const
Get the directly.
Definition ParticleBase.hh:85
Rivet::ParticleBase::angle
double angle(const FourVector &v) const
Angle between this vector and another.
Definition ParticleBase.hh:141
Rivet::ParticleBase::E
double E() const
Get the energy directly.
Definition ParticleBase.hh:51
Rivet::ParticleBase::absrapidity
double absrapidity() const
Get the directly.
Definition ParticleBase.hh:98
Rivet::ParticleBase::py2
double py2() const
y component of momentum, squared.
Definition ParticleBase.hh:129
Rivet::ParticleBase::energy
double energy() const
Get the energy directly (alias).
Definition ParticleBase.hh:53
Rivet::ParticleBase::azimuthalAngle
double azimuthalAngle(const PhiMapping mapping=ZERO_2PI) const
Azimuthal angle .
Definition ParticleBase.hh:103
Rivet::ParticleBase::px2
double px2() const
x component of momentum, squared.
Definition ParticleBase.hh:127
Rivet::ParticleBase::angle
double angle(const Vector3 &v3) const
Angle between this vector and another (3-vector)
Definition ParticleBase.hh:143
Rivet::ParticleBase::p2
double p2() const
Get the 3-momentum magnitude-squared directly.
Definition ParticleBase.hh:112
Rivet::ParticleBase::E2
double E2() const
Get the energy-squared.
Definition ParticleBase.hh:56
Rivet::ThreeMomentum
Specialized version of the ThreeVector with momentum functionality.
Definition Vector3.hh:339
Rivet::Vector3
Three-dimensional specialisation of Vector.
Definition Vector3.hh:40
Rivet::FourMomentum::p2
double p2() const
Get the modulus-squared of the 3-momentum.
Definition Vector4.hh:601
Rivet::FourMomentum::E2
double E2() const
Get energy-squared .
Definition Vector4.hh:555
Rivet::FourMomentum::mass
double mass() const
Get the mass (the Lorentz self-invariant).
Definition Vector4.hh:576
Rivet::FourMomentum::rapidity
double rapidity() const
Calculate the rapidity.
Definition Vector4.hh:607
Rivet::FourMomentum::p
double p() const
Get the modulus of the 3-momentum.
Definition Vector4.hh:596
Rivet::FourVector::vector3
Vector3 vector3() const
Get the spatial part of the 4-vector as a 3-vector.
Definition Vector4.hh:177
Rivet::FourVector::angle
double angle(const FourVector &v) const
Angle between this vector and another.
Definition Vector4.hh:95
Rivet::FourMomentum::pt
double pt() const
Calculate the transverse momentum .
Definition Vector4.hh:647
Rivet::FourVector::phi
double phi(const PhiMapping mapping=ZERO_2PI) const
Synonym for azimuthalAngle.
Definition Vector4.hh:149
Rivet::FourVector::abseta
double abseta() const
Get the directly (alias).
Definition Vector4.hh:174
Rivet::FourMomentum::Et
double Et() const
Calculate the transverse energy .
Definition Vector4.hh:656
Rivet::FourMomentum::Et2
double Et2() const
Calculate the transverse energy .
Definition Vector4.hh:652
Rivet::FourVector::azimuthalAngle
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:145
Rivet::FourMomentum::pt2
double pt2() const
Calculate the squared transverse momentum .
Definition Vector4.hh:638
Rivet::FourVector::dot
double dot(const FourVector &v) const
Contract two 4-vectors, with metric signature (+ - - -).
Definition Vector4.hh:194
Rivet::FourMomentum::pTvec
Vector3 pTvec() const
Calculate the transverse momentum vector .
Definition Vector4.hh:625
Rivet::FourVector::eta
double eta() const
Synonym for pseudorapidity.
Definition Vector4.hh:167
Rivet::FourVector::theta
double theta() const
Synonym for polarAngle.
Definition Vector4.hh:158
Rivet::FourMomentum::ptvec
Vector3 ptvec() const
Synonym for pTvec.
Definition Vector4.hh:629
Rivet::FourMomentum::mass2
double mass2() const
Get the squared mass (the Lorentz self-invariant).
Definition Vector4.hh:587
Rivet::FourMomentum::absrap
double absrap() const
Absolute rapidity.
Definition Vector4.hh:620
Rivet::FourMomentum::E
double E() const
Get energy (time component of momentum).
Definition Vector4.hh:553
Rivet::FourVector::polarAngle
double polarAngle() const
Angle subtended by the 3-vector and the z-axis.
Definition Vector4.hh:154
Rivet::FourVector::abspseudorapidity
double abspseudorapidity() const
Get the directly.
Definition Vector4.hh:172
Rivet::FourMomentum::absrapidity
double absrapidity() const
Absolute rapidity.
Definition Vector4.hh:616
Rivet::Kin::eta
double eta(const ParticleBase &p)
Unbound function access to eta.
Definition ParticleBaseUtils.hh:693
Rivet::Kin::p
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
Rivet
Definition MC_Cent_pPb.hh:10
Rivet::deltaR
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:699
Rivet::deltaPhi
double deltaPhi(double phi1, double phi2, bool sign=false)
Calculate the difference between two angles in radians.
Definition MathUtils.hh:669
Rivet::deltaEta
double deltaEta(double eta1, double eta2, bool sign=false)
Definition MathUtils.hh:677
Rivet::PhiMapping
PhiMapping
Enum for range of to be mapped into.
Definition MathConstants.hh:49
Rivet::sign
constexpr std::enable_if< std::is_arithmetic< NUM >::value, int >::type sign(NUM val)
Find the sign of a number.
Definition MathUtils.hh:266
Rivet::RapScheme
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition MathConstants.hh:46
Rivet::deltaRap
double deltaRap(double y1, double y2, bool sign=false)
Definition MathUtils.hh:685