rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
Spherocity.hh
1// -*- C++ -*-
2#ifndef RIVET_Spherocity_HH
3#define RIVET_Spherocity_HH
4
5#include "Rivet/Projection.hh"
6#include "Rivet/Projections/AxesDefinition.hh"
7#include "Rivet/Projections/FinalState.hh"
8#include "Rivet/Event.hh"
9
10namespace Rivet {
11
12
30 class Spherocity : public AxesDefinition {
31 public:
32
33 using AxesDefinition::operator=;
34
35 // Default Constructor
36 Spherocity() {}
37
39 Spherocity(const FinalState& fsp) {
40 setName("Spherocity");
41 declare(fsp, "FS");
42 }
43
46
48 using Projection::operator =;
49
50
51 protected:
52
54 void project(const Event& e) {
55 const vector<Particle> ps = apply<FinalState>(e, "FS").particles();
56 calc(ps);
57 }
58
59
61 CmpState compare(const Projection& p) const {
62 return mkNamedPCmp(p, "FS");
63 }
64
65
66 public:
67
71 double spherocity() const { return _spherocities[0]; }
73
74
78 const Vector3& spherocityAxis() const { return _spherocityAxes[0]; }
80 const Vector3& spherocityMajorAxis() const { return _spherocityAxes[1]; }
82 const Vector3& spherocityMinorAxis() const { return _spherocityAxes[2]; }
84
85
88 const Vector3& axis1() const { return spherocityAxis(); }
89 const Vector3& axis2() const { return spherocityMajorAxis(); }
90 const Vector3& axis3() const { return spherocityMinorAxis(); }
92
93
94 public:
95
99
101 void calc(const FinalState& fs);
102
104 void calc(const vector<Particle>& fsparticles);
105
107 void calc(const vector<FourMomentum>& fsmomenta);
108
110 void calc(const vector<Vector3>& threeMomenta);
111
113
114
115 protected:
116
118 vector<double> _spherocities;
119
121 vector<Vector3> _spherocityAxes;
122
123
124 protected:
125
127 void _calcSpherocity(const vector<Vector3>& fsmomenta);
128
129 };
130
131}
132
133#endif
Base class for projections which define a spatial basis.
Definition AxesDefinition.hh:19
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition FinalState.hh:12
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:175
Base class for all Rivet projections.
Definition Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:148
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Get the transverse spherocity scalars for hadron-colliders.
Definition Spherocity.hh:30
const Vector3 & axis1() const
Definition Spherocity.hh:88
const Vector3 & axis2() const
The 2nd most significant ("major") axis.
Definition Spherocity.hh:89
void project(const Event &e)
Perform the projection on the Event.
Definition Spherocity.hh:54
RIVET_DEFAULT_PROJ_CLONE(Spherocity)
Clone on the heap.
const Vector3 & axis3() const
The least significant ("minor") axis.
Definition Spherocity.hh:90
Spherocity(const FinalState &fsp)
Constructor.
Definition Spherocity.hh:39
const Vector3 & spherocityMajorAxis() const
The spherocity major axis (axis of max spherocity perpendicular to spherocity axis).
Definition Spherocity.hh:80
void calc(const FinalState &fs)
Manually calculate the spherocity, without engaging the caching system.
const Vector3 & spherocityMinorAxis() const
The spherocity minor axis (axis perpendicular to spherocity and spherocity major).
Definition Spherocity.hh:82
void calc(const vector< FourMomentum > &fsmomenta)
Manually calculate the spherocity, without engaging the caching system.
void calc(const vector< Vector3 > &threeMomenta)
Manually calculate the spherocity, without engaging the caching system.
void calc(const vector< Particle > &fsparticles)
Manually calculate the spherocity, without engaging the caching system.
CmpState compare(const Projection &p) const
Compare projections.
Definition Spherocity.hh:61
Three-dimensional specialisation of Vector.
Definition Vector3.hh:40
Definition MC_CENT_PPB_Projections.hh:10