Rivet  1.8.3
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
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
Definition: MC_JetAnalysis.hh:9
virtual const Projection * clone() const
Clone on the heap.
Definition: FoxWolframMoments.hh:42
Definition: Event.hh:22
int compare(const Projection &p) const
Compare projections.
Definition: FoxWolframMoments.cc:8
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Definition: ProjectionApplier.hh:113
void project(const Event &e)
Apply the projection to the event.
Definition: FoxWolframMoments.cc:13
FoxWolframMoments(const FinalState &fsp)
Constructor.
Definition: FoxWolframMoments.hh:25
Base class for all Rivet projections.
Definition: Projection.hh:28
double getFoxWolframMoment(unsigned int l) const
The projected Fox-Wolfram Moment of order l.
Definition: FoxWolframMoments.hh:50
Calculate Fox-Wolfram moments.
Definition: FoxWolframMoments.hh:21
Final state modifier excluding particles which are not experimentally visible.
Definition: VisibleFinalState.hh:16