Rivet  1.8.3
Multiplicity.hh
1 // -*- C++ -*-
2 #ifndef RIVET_Multiplicity_HH
3 #define RIVET_Multiplicity_HH
4 
5 #include "Rivet/Projection.hh"
6 #include "Rivet/Projections/FinalState.hh"
7 #include "Rivet/Particle.hh"
8 #include "Rivet/Event.hh"
9 
10 
11 namespace Rivet {
12 
14  class Multiplicity : public Projection {
15  public:
16 
19  : _totalMult(0), _hadMult(0)
20  {
21  setName("Multiplicity");
22  addProjection(fsp, "FS");
23  }
24 
26  virtual const Projection* clone() const {
27  return new Multiplicity(*this);
28  }
29 
30 
31  protected:
32 
34  void project(const Event& e);
35 
37  int compare(const Projection& p) const;
38 
39 
40  public:
41 
43  //@ {
45  unsigned int totalMultiplicity() const { return _totalMult; }
46 
48  unsigned int hadronMultiplicity() const { return _hadMult; }
49  //@ }
50 
51  private:
52 
54  unsigned int _totalMult;
55 
57  unsigned int _hadMult;
58  };
59 
60 }
61 
62 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
int compare(const Projection &p) const
Compare projections.
Definition: Multiplicity.cc:10
virtual const Projection * clone() const
Clone on the heap.
Definition: Multiplicity.hh:26
Definition: Event.hh:22
unsigned int hadronMultiplicity() const
Hadron multiplicity.
Definition: Multiplicity.hh:48
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
Multiplicity(const FinalState &fsp)
Constructor. The provided FinalState projection must live throughout the run.
Definition: Multiplicity.hh:18
unsigned int totalMultiplicity() const
Total multiplicity.
Definition: Multiplicity.hh:45
Base class for all Rivet projections.
Definition: Projection.hh:28
void project(const Event &e)
Perform the projection on the Event.
Definition: Multiplicity.cc:15
Count the final-state particles in an event.
Definition: Multiplicity.hh:14