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