rivet is hosted by Hepforge, IPPP Durham
HeavyHadrons.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_HeavyHadrons_HH
00003 #define RIVET_HeavyHadrons_HH
00004 
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/UnstableFinalState.hh"
00007 #include "Rivet/Particle.hh"
00008 #include "Rivet/Event.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// @brief Project out the last pre-decay b and c hadrons.
00014   ///
00015   /// This currently defines a c-hadron as one which contains a @a c quark and
00016   /// @a{not} a @a b quark.
00017   ///
00018   /// @todo This assumes that the heavy hadrons are unstable... should we also look for stable ones in case the decays are disabled?
00019   class HeavyHadrons : public FinalState {
00020   public:
00021 
00022     /// @name Constructors and destructors.
00023     //@{
00024 
00025     /// Constructor with specification of the minimum and maximum pseudorapidity
00026     /// \f$ \eta \f$ and the min \f$ p_T \f$ (in GeV).
00027     HeavyHadrons(double mineta = -MAXDOUBLE,
00028                  double maxeta =  MAXDOUBLE,
00029                  double minpt  =  0.0*GeV) {
00030       setName("HeavyHadrons");
00031       addProjection(UnstableFinalState(mineta, maxeta, minpt), "UFS");
00032     }
00033 
00034     /// Clone on the heap.
00035     virtual const Projection* clone() const {
00036       return new HeavyHadrons(*this);
00037     }
00038 
00039     //@}
00040 
00041 
00042     /// @name Particle accessors
00043     //@{
00044 
00045     /// Get all weakly decaying b hadrons (return by reference)
00046     const Particles& bHadrons() const {
00047       return _theBs;
00048     }
00049 
00050     /// Get weakly decaying b hadrons with a pTmin cut (return by value)
00051     Particles bHadrons(double pTmin) const {
00052       Particles rtn;
00053       foreach (const Particle& p, bHadrons())
00054         if (p.pT() > pTmin) rtn += p;
00055       return rtn;
00056     }
00057 
00058     /// Get all weakly decaying c hadrons (return by reference)
00059     const Particles& cHadrons() const {
00060       return _theCs;
00061     }
00062 
00063     /// Get weakly decaying c hadrons with a pTmin cut (return by value)
00064     const Particles cHadrons(double pTmin) const {
00065       Particles rtn;
00066       foreach (const Particle& p, cHadrons())
00067         if (p.pT() > pTmin) rtn += p;
00068       return rtn;
00069     }
00070 
00071     //@}
00072 
00073 
00074   protected:
00075 
00076     /// Apply the projection to the event.
00077     virtual void project(const Event& e);
00078 
00079     /// b and c hadron containers
00080     Particles _theBs, _theCs;
00081 
00082   };
00083 
00084 
00085 }
00086 
00087 
00088 #endif