rivet is hosted by Hepforge, IPPP Durham
FoxWolframMoments.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_FoxWolframMoments_HH
00003 #define RIVET_FoxWolframMoments_HH
00004 
00005 #include "Rivet/Config/RivetCommon.hh"
00006 #include "Rivet/Projection.hh"
00007 #include "Rivet/Projections/FinalState.hh"
00008 #include "Rivet/Projections/VetoedFinalState.hh"
00009 #include "Rivet/Projections/VisibleFinalState.hh"
00010 #include "Rivet/Particle.hh"
00011 #include "Rivet/Event.hh"
00012 
00013 #include <gsl/gsl_sf_legendre.h>
00014 
00015 #define MAXMOMENT 5
00016 
00017 namespace Rivet {
00018 
00019 
00020   /// @brief Calculate Fox-Wolfram moments
00021   class FoxWolframMoments : public Projection {
00022   public:
00023 
00024     /// Constructor.
00025     FoxWolframMoments(const FinalState& fsp) {
00026       setName("FoxWolframMoments");
00027       addProjection(fsp, "FS");
00028 
00029       /// @todo Let the user supply any projection they like?
00030       VisibleFinalState vfs(fsp);
00031       addProjection(vfs, "VFS");
00032 
00033       // Initialize moments vector
00034       for (int i = 0; i < MAXMOMENT ; ++i) {
00035         _fwmoments.push_back(0.0);
00036       }
00037     }
00038 
00039     /// Clone on the heap.
00040     DEFAULT_RIVET_PROJ_CLONE(FoxWolframMoments);
00041 
00042 
00043     /// The projected Fox-Wolfram Moment of order l
00044     double getFoxWolframMoment(unsigned int l) const {
00045       if (l < MAXMOMENT) {
00046         return _fwmoments[l];
00047       }
00048       /// @todo What?!?
00049       return -666.0;
00050     }
00051 
00052 
00053   protected:
00054 
00055     /// Apply the projection to the event.
00056     void project(const Event& e);
00057 
00058     /// Compare projections.
00059     int compare(const Projection& p) const;
00060 
00061 
00062   private:
00063 
00064     vector<double> _fwmoments;
00065 
00066   };
00067 
00068 
00069 }
00070 
00071 
00072 #endif