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 
00016   public:
00017 
00018     /// Constructor. The provided FinalState projection must live throughout the run.
00019     inline Multiplicity(FinalState& fsp)
00020       : _totalMult(0), _totalChMult(0), _totalUnchMult(0),
00021         _hadMult(0), _hadChMult(0), _hadUnchMult(0), 
00022         _fsproj(&fsp)
00023     { 
00024       addProjection(fsp);
00025     }
00026 
00027   public:
00028     /// Return the name of the projection
00029     inline string getName() const {
00030       return "Multiplicity";
00031     }
00032 
00033   protected:
00034 
00035     /// Perform the projection on the Event.
00036     void project(const Event& e);
00037 
00038     /// Compare projections.
00039     int compare(const Projection& p) const;
00040 
00041   public:
00042 
00043     /// @name Access the projected multiplicities.
00044     //@ {
00045     /// Total multiplicity
00046     inline const unsigned int totalMultiplicity() const { return _totalMult; }
00047 
00048     /// Charged multiplicity
00049     inline const unsigned int totalChargedMultiplicity() const { return _totalChMult; }
00050 
00051     /// Uncharged multiplicity
00052     inline const unsigned int totalUnchargedMultiplicity() const { return _totalUnchMult; }
00053 
00054     /// Hadron multiplicity
00055     inline const unsigned int hadronMultiplicity() const { return _hadMult; }
00056 
00057     /// Hadronic charged multiplicity
00058     inline const unsigned int hadronChargedMultiplicity() const { return _hadChMult; }
00059 
00060     /// Hadronic uncharged multiplicity
00061     inline const unsigned int hadronUnchargedMultiplicity() const { return _hadUnchMult; }
00062     //@ }
00063 
00064   private:
00065 
00066     /// Total multiplicities
00067     unsigned int _totalMult, _totalChMult, _totalUnchMult;
00068 
00069     /// Hadronic multiplicities
00070     unsigned int _hadMult, _hadChMult, _hadUnchMult;
00071 
00072     /// The FinalState projection used by this projection
00073     FinalState* _fsproj;
00074 
00075   };
00076 
00077 }
00078 
00079 #endif