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/Rivet.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     {
00027       setName("FoxWolframMoments");
00028       addProjection(fsp, "FS");
00029 
00030       /// @todo Let the user supply any projection they like?
00031       VisibleFinalState vfs(fsp);
00032       addProjection(vfs, "VFS");
00033 
00034       // Initialize moments vector
00035       for (int i = 0; i < MAXMOMENT ; ++i) {
00036         _fwmoments.push_back(0.0);
00037       }
00038     }
00039 
00040 
00041     /// Clone on the heap.
00042     virtual const Projection* clone() const {
00043       return new FoxWolframMoments(*this);
00044     }
00045 
00046 
00047   public:
00048 
00049     /// The projected Fox-Wolfram Moment of order l
00050     double getFoxWolframMoment(unsigned int l) const {
00051       if (l < MAXMOMENT) {
00052         return _fwmoments[l];
00053       }
00054       /// @todo What?!?
00055       return -666.0;
00056     }
00057 
00058 
00059   protected:
00060 
00061     /// Apply the projection to the event.
00062     void project(const Event& e);
00063 
00064     /// Compare projections.
00065     int compare(const Projection& p) const;
00066 
00067 
00068   private:
00069 
00070     vector<double> _fwmoments;
00071 
00072   };
00073 
00074 
00075 }
00076 
00077 
00078 #endif