FinalState.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_FinalState_HH
00003 #define RIVET_FinalState_HH
00004 
00005 #include "Rivet/Projection.hh"
00006 #include "Rivet/Particle.hh"
00007 #include "Rivet/Event.hh"
00008 
00009 
00010 namespace Rivet {
00011 
00012   /// Project out all final-state particles in an event.
00013   class FinalState: public Projection {
00014     
00015   public:
00016     
00017     /// @name Standard constructors and destructors.
00018     //@{
00019     /// The default constructor. May specify the minimum and maximum
00020     /// pseudorapidity \f$ \eta \f$ and the min \f$ p_T \f$ (in GeV).
00021     inline FinalState(double mineta = -MaxRapidity,
00022                       double maxeta = MaxRapidity,
00023                       double minpt = 0.0)
00024       : _etamin(mineta), _etamax(maxeta), _ptmin(minpt) 
00025     { 
00026       addCut("eta", MORE_EQ, mineta);
00027       addCut("eta", LESS_EQ, maxeta);
00028       addCut("pT",  MORE_EQ, minpt);
00029     }
00030     
00031     /// Return the name of the projection
00032     inline string getName() const {
00033       return "FinalState";
00034     }
00035     
00036     /// Access the projected final-state particles.
00037     inline const ParticleVector& particles() const { return _theParticles; }
00038 
00039     /// Is this final state empty?
00040     inline const bool isEmpty() const { return _theParticles.empty(); }
00041 
00042   protected:
00043     
00044     /// Apply the projection to the event.
00045     void project(const Event& e);
00046     
00047     /// Compare projections.
00048     int compare(const Projection& p) const;
00049     
00050     
00051   private:
00052     
00053     /// The minimum allowed pseudorapidity.
00054     double _etamin;
00055     
00056     /// The maximum allowed pseudorapidity.
00057     double _etamax;
00058     
00059     /// The minimum allowed transverse momentum.
00060     double _ptmin;
00061 
00062   protected:
00063     
00064     /// The final-state particles.
00065     ParticleVector _theParticles;
00066     
00067   };
00068   
00069 }
00070 
00071 
00072 #endif