rivet is hosted by Hepforge, IPPP Durham
BeamThrust.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_BeamThrust_HH
00003 #define RIVET_BeamThrust_HH
00004 
00005 #include "Rivet/Projection.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Event.hh"
00008 
00009 namespace Rivet {
00010 
00011   class BeamThrust : public Projection {
00012   public:
00013 
00014     /// Constructor.
00015     BeamThrust() {}
00016 
00017     BeamThrust(const FinalState& fsp) {
00018       setName("BeamThrust");
00019       addProjection(fsp, "FS");
00020     }
00021 
00022     /// Clone on the heap.
00023     virtual const Projection* clone() const {
00024       return new BeamThrust(*this);
00025     }
00026 
00027   protected:
00028 
00029     /// Perform the projection on the Event
00030     void project(const Event& e) {
00031       const vector<Particle> ps
00032         = applyProjection<FinalState>(e, "FS").particles();
00033       calc(ps);
00034     }
00035 
00036     /// Compare projections
00037     int compare(const Projection& p) const {
00038       return mkNamedPCmp(p, "FS");
00039     }
00040 
00041 
00042   public:
00043 
00044     double beamthrust() const { return _beamthrust; }
00045 
00046   public:
00047 
00048     /// @name Direct methods
00049     /// Ways to do the calculation directly, without engaging the caching system
00050     //@{
00051 
00052     /// Manually calculate the beamthrust, without engaging the caching system
00053     void calc(const FinalState& fs);
00054 
00055     /// Manually calculate the beamthrust, without engaging the caching system
00056     void calc(const vector<Particle>& fsparticles);
00057 
00058     /// Manually calculate the beamthrust, without engaging the caching system
00059     void calc(const vector<FourMomentum>& fsmomenta);
00060 
00061     //@}
00062 
00063 
00064   private:
00065 
00066     /// The beamthrust scalar.
00067     double _beamthrust;
00068 
00069   private:
00070 
00071     /// Explicitly calculate the beamthrust values.
00072     void _calcBeamThrust(const vector<FourMomentum>& fsmomenta);
00073 
00074   };
00075 
00076 }
00077 
00078 #endif