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(const Cut& c=Cuts::open()) {
00028       setName("HeavyHadrons");
00029       addProjection(UnstableFinalState(c), "UFS");
00030     }
00031 
00032     /// Constructor with specification of the minimum and maximum pseudorapidity
00033     /// \f$ \eta \f$ and the min \f$ p_T \f$ (in GeV).
00034     DEPRECATED("Use the version with a Cut argument")
00035     HeavyHadrons(double mineta, double maxeta, double minpt=0.0*GeV) {
00036       setName("HeavyHadrons");
00037       addProjection(UnstableFinalState(Cuts::etaIn(mineta, maxeta) && Cuts::pT > minpt), "UFS");
00038     }
00039 
00040     /// Clone on the heap.
00041     virtual const Projection* clone() const {
00042       return new HeavyHadrons(*this);
00043     }
00044 
00045     //@}
00046 
00047 
00048     /// @name Particle accessors
00049     //@{
00050 
00051     /// Get all weakly decaying b hadrons (return by reference)
00052     const Particles& bHadrons() const {
00053       return _theBs;
00054     }
00055 
00056     /// Get weakly decaying b hadrons with a pTmin cut (return by value)
00057     Particles bHadrons(double pTmin) const {
00058       Particles rtn;
00059       foreach (const Particle& p, bHadrons())
00060         if (p.pT() > pTmin) rtn += p;
00061       return rtn;
00062     }
00063 
00064     /// Get all weakly decaying c hadrons (return by reference)
00065     const Particles& cHadrons() const {
00066       return _theCs;
00067     }
00068 
00069     /// Get weakly decaying c hadrons with a pTmin cut (return by value)
00070     const Particles cHadrons(double pTmin) const {
00071       Particles rtn;
00072       foreach (const Particle& p, cHadrons())
00073         if (p.pT() > pTmin) rtn += p;
00074       return rtn;
00075     }
00076 
00077     //@}
00078 
00079 
00080   protected:
00081 
00082     /// Apply the projection to the event.
00083     virtual void project(const Event& e);
00084 
00085     /// Compare projections (only difference is in UFS definition)
00086     virtual int compare(const Projection& p) const {
00087       return mkNamedPCmp(p, "UFS");
00088     }
00089 
00090     /// b and c hadron containers
00091     Particles _theBs, _theCs;
00092 
00093   };
00094 
00095 
00096 }
00097 
00098 
00099 #endif