Rivet  1.8.3
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 
10 namespace Rivet {
11 
12 
33  class Spherocity : public AxesDefinition {
34  public:
35 
36  // Default Constructor
37  Spherocity() {}
38 
40  Spherocity(const FinalState& fsp)
41  : _calculatedSpherocity(false)
42  {
43  setName("Spherocity");
44  addProjection(fsp, "FS");
45  }
46 
48  virtual const Projection* clone() const {
49  return new Spherocity(*this);
50  }
51 
52 
53  protected:
54 
56  void project(const Event& e) {
57  const vector<Particle> ps
58  = applyProjection<FinalState>(e, "FS").particles();
59  calc(ps);
60  }
61 
62 
64  int compare(const Projection& p) const {
65  return mkNamedPCmp(p, "FS");
66  }
67 
68 
69  public:
70 
73  double spherocity() const { return _spherocities[0]; }
75 
76 
79  const Vector3& spherocityAxis() const { return _spherocityAxes[0]; }
81  const Vector3& spherocityMajorAxis() const { return _spherocityAxes[1]; }
83  const Vector3& spherocityMinorAxis() const { return _spherocityAxes[2]; }
85 
86 
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 
98 
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  private:
116 
118  vector<double> _spherocities;
119 
121  vector<Vector3> _spherocityAxes;
122 
124  bool _calculatedSpherocity;
125 
126 
127  private:
128 
130  void _calcSpherocity(const vector<Vector3>& fsmomenta);
131 
132  };
133 
134 }
135 
136 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
virtual const Projection * clone() const
Clone on the heap.
Definition: Spherocity.hh:48
const Vector3 & spherocityAxis() const
Definition: Spherocity.hh:79
Base class for projections which define a spatial basis.
Definition: AxesDefinition.hh:20
Spherocity(const FinalState &fsp)
Constructor.
Definition: Spherocity.hh:40
double spherocity() const
Definition: Spherocity.hh:73
void project(const Event &e)
Perform the projection on the Event.
Definition: Spherocity.hh:56
Get the transverse spherocity scalars for hadron-colliders.
Definition: Spherocity.hh:33
const Vector3 & axis2() const
The 2nd most significant (&quot;major&quot;) axis.
Definition: Spherocity.hh:89
void calc(const FinalState &fs)
Manually calculate the spherocity, without engaging the caching system.
Definition: Spherocity.cc:10
Definition: Event.hh:22
const Vector3 & axis1() const
AxesDefinition axis accessors.
Definition: Spherocity.hh:88
int compare(const Projection &p) const
Compare projections.
Definition: Spherocity.hh:64
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Definition: ProjectionApplier.hh:113
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Definition: Projection.cc:51
Base class for all Rivet projections.
Definition: Projection.hh:28
const Vector3 & spherocityMajorAxis() const
The spherocity major axis (axis of max spherocity perpendicular to spherocity axis).
Definition: Spherocity.hh:81
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26
const Vector3 & spherocityMinorAxis() const
The spherocity minor axis (axis perpendicular to spherocity and spherocity major).
Definition: Spherocity.hh:83
const Vector3 & axis3() const
The least significant (&quot;minor&quot;) axis.
Definition: Spherocity.hh:90