Rivet  1.8.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 
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