Multiplicity.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_Multiplicity_HH
00003 #define RIVET_Multiplicity_HH
00004 
00005 #include "Rivet/Projection.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Particle.hh"
00008 #include "Rivet/Event.hh"
00009 
00010 
00011 namespace Rivet {
00012 
00013   /// Count the final-state particles in an event.
00014   class Multiplicity : public Projection {
00015   public:
00016 
00017     /// Constructor. The provided FinalState projection must live throughout the run.
00018     Multiplicity(const FinalState& fsp)
00019       : _totalMult(0), _hadMult(0)
00020     {
00021       setName("Multiplicity");
00022       addProjection(fsp, "FS");
00023     }
00024 
00025     /// Clone on the heap.
00026     virtual const Projection* clone() const {
00027       return new Multiplicity(*this);
00028     }
00029 
00030 
00031   protected:
00032 
00033     /// Perform the projection on the Event.
00034     void project(const Event& e);
00035 
00036     /// Compare projections.
00037     int compare(const Projection& p) const;
00038 
00039 
00040   public:
00041 
00042     /// @name Access the projected multiplicities.
00043     //@ {
00044     /// Total multiplicity
00045     unsigned int totalMultiplicity() const { return _totalMult; }
00046 
00047     /// Hadron multiplicity
00048     unsigned int hadronMultiplicity() const { return _hadMult; }
00049     //@ }
00050 
00051   private:
00052 
00053     /// Total multiplicity.
00054     unsigned int _totalMult;
00055 
00056     /// Hadronic multiplicity.
00057     unsigned int _hadMult;
00058   };
00059 
00060 }
00061 
00062 #endif