Rivet  1.8.0
Spherocity.hh
00001 // -*- C++ -*-
00002 #ifndef RIVET_Spherocity_HH
00003 #define RIVET_Spherocity_HH
00004 
00005 #include "Rivet/Projection.hh"
00006 #include "Rivet/Projections/AxesDefinition.hh"
00007 #include "Rivet/Projections/FinalState.hh"
00008 #include "Rivet/Event.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00033   class Spherocity : public AxesDefinition {
00034   public:
00035 
00036     // Default Constructor
00037     Spherocity() {}
00038 
00040     Spherocity(const FinalState& fsp)
00041       : _calculatedSpherocity(false)
00042     {
00043       setName("Spherocity");
00044       addProjection(fsp, "FS");
00045     }
00046 
00048     virtual const Projection* clone() const {
00049       return new Spherocity(*this);
00050     }
00051 
00052 
00053   protected:
00054 
00056     void project(const Event& e) {
00057       const vector<Particle> ps
00058         = applyProjection<FinalState>(e, "FS").particles();
00059       calc(ps);
00060     }
00061 
00062 
00064     int compare(const Projection& p) const {
00065       return mkNamedPCmp(p, "FS");
00066     }
00067 
00068 
00069   public:
00070 
00073     double spherocity() const { return _spherocities[0]; }
00075 
00076 
00079     const Vector3& spherocityAxis() const { return _spherocityAxes[0]; }
00081     const Vector3& spherocityMajorAxis() const { return _spherocityAxes[1]; }
00083     const Vector3& spherocityMinorAxis() const { return _spherocityAxes[2]; }
00085 
00086 
00088     const Vector3& axis1() const { return spherocityAxis(); }
00089     const Vector3& axis2() const { return spherocityMajorAxis(); }
00090     const Vector3& axis3() const { return spherocityMinorAxis(); }
00092 
00093 
00094   public:
00095 
00098 
00099 
00101     void calc(const FinalState& fs);
00102 
00104     void calc(const vector<Particle>& fsparticles);
00105 
00107     void calc(const vector<FourMomentum>& fsmomenta);
00108 
00110     void calc(const vector<Vector3>& threeMomenta);
00111 
00113 
00114 
00115   private:
00116 
00118     vector<double> _spherocities;
00119 
00121     vector<Vector3> _spherocityAxes;
00122 
00124     bool _calculatedSpherocity;
00125 
00126 
00127   private:
00128 
00130     void _calcSpherocity(const vector<Vector3>& fsmomenta);
00131 
00132   };
00133 
00134 }
00135 
00136 #endif