rivet is hosted by Hepforge, IPPP Durham
Beam.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_Beam_HH
00003 #define RIVET_Beam_HH
00004 
00005 #include "Rivet/Projection.hh"
00006 #include "Rivet/Event.hh"
00007 #include "Rivet/Particle.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @name Stand-alone functions
00013   //@{
00014 
00015   /// Function to get beam particles from an event
00016   ParticlePair beams(const Event& e);
00017 
00018   /// Function to get beam particle IDs from an event
00019   PdgIdPair beamIds(const Event& e);
00020 
00021   /// Function to get beam particle IDs from a pair of particles
00022   PdgIdPair beamIds(const ParticlePair& beams);
00023 
00024   /// Function to get beam centre of mass energy from an event
00025   double sqrtS(const Event& e);
00026 
00027   /// Function to get beam centre of mass energy from a pair of particles
00028   double sqrtS(const ParticlePair& beams);
00029 
00030   /// Function to get beam centre of mass energy from a pair of beam momenta
00031   double sqrtS(const FourMomentum& pa, const FourMomentum& pb);
00032 
00033   //@}
00034 
00035 
00036 
00037 
00038   /// @brief Project out the incoming beams
00039   class Beam : public Projection {
00040   public:
00041 
00042     /// The default constructor.
00043     Beam() {
00044       setName("Beam");
00045     }
00046 
00047     /// Clone on the heap.
00048     virtual const Projection* clone() const {
00049       return new Beam(*this);
00050     }
00051 
00052 
00053   public:
00054 
00055     /// The pair of beam particles in the current collision.
00056     const ParticlePair& beams() const {
00057       return _theBeams;
00058     }
00059 
00060     /// The pair of beam particle PDG codes in the current collision.
00061     const PdgIdPair beamIds() const {
00062       return Rivet::beamIds(beams());
00063     }
00064 
00065     /// Get centre of mass energy, \f$ \sqrt{s} \f$.
00066     double sqrtS() const;
00067 
00068 
00069   public:
00070 
00071     /// Project on to the Event
00072     virtual void project(const Event& e);
00073 
00074 
00075   protected:
00076 
00077     /// Compare with other projections.
00078     virtual int compare(const Projection& UNUSED(p)) const {
00079       return EQUIVALENT;
00080     }
00081 
00082 
00083   private:
00084 
00085     /// The beam particles in the current collision
00086     ParticlePair _theBeams;
00087 
00088   };
00089 
00090 
00091 }
00092 
00093 #endif