rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
FoxWolframMoments.hh
1 // -*- C++ -*-
2 #ifndef RIVET_FoxWolframMoments_HH
3 #define RIVET_FoxWolframMoments_HH
4 
5 #include "Rivet/Config/RivetCommon.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  setName("FoxWolframMoments");
27  addProjection(fsp, "FS");
28 
30  VisibleFinalState vfs(fsp);
31  addProjection(vfs, "VFS");
32 
33  // Initialize moments vector
34  for (int i = 0; i < MAXMOMENT ; ++i) {
35  _fwmoments.push_back(0.0);
36  }
37  }
38 
41 
42 
44  double getFoxWolframMoment(unsigned int l) const {
45  if (l < MAXMOMENT) {
46  return _fwmoments[l];
47  }
49  return -666.0;
50  }
51 
52 
53  protected:
54 
56  void project(const Event& e);
57 
59  int compare(const Projection& p) const;
60 
61 
62  private:
63 
64  vector<double> _fwmoments;
65 
66  };
67 
68 
69 }
70 
71 
72 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:133
Definition: ALICE_2010_I880049.cc:13
Definition: Event.hh:22
int compare(const Projection &p) const
Compare projections.
Definition: FoxWolframMoments.cc:6
double getFoxWolframMoment(unsigned int l) const
The projected Fox-Wolfram Moment of order l.
Definition: FoxWolframMoments.hh:44
DEFAULT_RIVET_PROJ_CLONE(FoxWolframMoments)
Clone on the heap.
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:12
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
void project(const Event &e)
Apply the projection to the event.
Definition: FoxWolframMoments.cc:11
FoxWolframMoments(const FinalState &fsp)
Constructor.
Definition: FoxWolframMoments.hh:25
Base class for all Rivet projections.
Definition: Projection.hh:29
Calculate Fox-Wolfram moments.
Definition: FoxWolframMoments.hh:21
Final state modifier excluding particles which are not experimentally visible.
Definition: VisibleFinalState.hh:16