rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.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 
30  class Spherocity : public AxesDefinition {
31  public:
32 
33  // Default Constructor
34  Spherocity() {}
35 
37  Spherocity(const FinalState& fsp)
38  : _calculatedSpherocity(false)
39  {
40  setName("Spherocity");
41  addProjection(fsp, "FS");
42  }
43 
46 
47 
48  protected:
49 
51  void project(const Event& e) {
52  const vector<Particle> ps
53  = applyProjection<FinalState>(e, "FS").particles();
54  calc(ps);
55  }
56 
57 
59  int compare(const Projection& p) const {
60  return mkNamedPCmp(p, "FS");
61  }
62 
63 
64  public:
65 
67 
68  double spherocity() const { return _spherocities[0]; }
71 
72 
74 
75  const Vector3& spherocityAxis() const { return _spherocityAxes[0]; }
78  const Vector3& spherocityMajorAxis() const { return _spherocityAxes[1]; }
80  const Vector3& spherocityMinorAxis() const { return _spherocityAxes[2]; }
82 
83 
85 
86  const Vector3& axis1() const { return spherocityAxis(); }
87  const Vector3& axis2() const { return spherocityMajorAxis(); }
88  const Vector3& axis3() const { return spherocityMinorAxis(); }
90 
91 
92  public:
93 
96 
97 
99  void calc(const FinalState& fs);
100 
102  void calc(const vector<Particle>& fsparticles);
103 
105  void calc(const vector<FourMomentum>& fsmomenta);
106 
108  void calc(const vector<Vector3>& threeMomenta);
109 
111 
112 
113  private:
114 
116  vector<double> _spherocities;
117 
119  vector<Vector3> _spherocityAxes;
120 
122  bool _calculatedSpherocity;
123 
124 
125  private:
126 
128  void _calcSpherocity(const vector<Vector3>& fsmomenta);
129 
130  };
131 
132 }
133 
134 #endif
const Vector3 & axis2() const
The 2nd most significant ("major") axis.
Definition: Spherocity.hh:87
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:133
Definition: ALICE_2010_I880049.cc:13
const Vector3 & spherocityMinorAxis() const
The spherocity minor axis (axis perpendicular to spherocity and spherocity major).
Definition: Spherocity.hh:80
Base class for projections which define a spatial basis.
Definition: AxesDefinition.hh:19
std::vector< GenParticle const * > particles(const GenEvent *ge)
Definition: RivetHepMC.hh:36
Spherocity(const FinalState &fsp)
Constructor.
Definition: Spherocity.hh:37
int compare(const Projection &p) const
Compare projections.
Definition: Spherocity.hh:59
void project(const Event &e)
Perform the projection on the Event.
Definition: Spherocity.hh:51
Get the transverse spherocity scalars for hadron-colliders.
Definition: Spherocity.hh:30
void calc(const FinalState &fs)
Manually calculate the spherocity, without engaging the caching system.
Definition: Spherocity.cc:9
Definition: Event.hh:22
const Vector3 & axis3() const
The least significant ("minor") axis.
Definition: Spherocity.hh:88
const Vector3 & spherocityMajorAxis() const
The spherocity major axis (axis of max spherocity perpendicular to spherocity axis).
Definition: Spherocity.hh:78
const Vector3 & axis1() const
Definition: Spherocity.hh:86
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Definition: Projection.cc:51
double spherocity() const
The spherocity scalar, , (minimum spherocity).
Definition: Spherocity.hh:69
DEFAULT_RIVET_PROJ_CLONE(Spherocity)
Clone on the heap.
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:12
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
const Vector3 & spherocityAxis() const
The spherocity axis.
Definition: Spherocity.hh:76
Base class for all Rivet projections.
Definition: Projection.hh:29
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26