Rivet  1.8.0
FoxWolframMoments.hh
1 // -*- C++ -*-
2 #ifndef RIVET_FoxWolframMoments_HH
3 #define RIVET_FoxWolframMoments_HH
4 
5 #include "Rivet/Rivet.hh"
6 #include "Rivet/Projection.hh"
7 #include "Rivet/Projections/FinalState.hh"
8 #include "Rivet/Projections/VetoedFinalState.hh"
9 #include "Rivet/Projections/VisibleFinalState.hh"
10 #include "Rivet/Particle.hh"
11 #include "Rivet/Event.hh"
12 
13 #include <gsl/gsl_sf_legendre.h>
14 
15 #define MAXMOMENT 5
16 
17 namespace Rivet {
18 
19 
21  class FoxWolframMoments : public Projection {
22  public:
23 
26  {
27  setName("FoxWolframMoments");
28  addProjection(fsp, "FS");
29 
31  VisibleFinalState vfs(fsp);
32  addProjection(vfs, "VFS");
33 
34  // Initialize moments vector
35  for (int i = 0; i < MAXMOMENT ; ++i) {
36  _fwmoments.push_back(0.0);
37  }
38  }
39 
40 
42  virtual const Projection* clone() const {
43  return new FoxWolframMoments(*this);
44  }
45 
46 
47  public:
48 
50  double getFoxWolframMoment(unsigned int l) const {
51  if (l < MAXMOMENT) {
52  return _fwmoments[l];
53  }
55  return -666.0;
56  }
57 
58 
59  protected:
60 
62  void project(const Event& e);
63 
65  int compare(const Projection& p) const;
66 
67 
68  private:
69 
70  vector<double> _fwmoments;
71 
72  };
73 
74 
75 }
76 
77 
78 #endif