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     DEFAULT_RIVET_PROJ_CLONE(HeavyHadrons);
00042 
00043     //@}
00044 
00045 
00046     /// @name Particle accessors
00047     //@{
00048 
00049     /// Get all weakly decaying b hadrons (return by reference)
00050     const Particles& bHadrons() const {
00051       return _theBs;
00052     }
00053 
00054     /// Get weakly decaying b hadrons with a pTmin cut (return by value)
00055     Particles bHadrons(double pTmin) const {
00056       Particles rtn;
00057       foreach (const Particle& p, bHadrons())
00058         if (p.pT() > pTmin) rtn += p;
00059       return rtn;
00060     }
00061 
00062     /// Get all weakly decaying c hadrons (return by reference)
00063     const Particles& cHadrons() const {
00064       return _theCs;
00065     }
00066 
00067     /// Get weakly decaying c hadrons with a pTmin cut (return by value)
00068     const Particles cHadrons(double pTmin) const {
00069       Particles rtn;
00070       foreach (const Particle& p, cHadrons())
00071         if (p.pT() > pTmin) rtn += p;
00072       return rtn;
00073     }
00074 
00075     //@}
00076 
00077 
00078   protected:
00079 
00080     /// Apply the projection to the event.
00081     virtual void project(const Event& e);
00082 
00083     /// Compare projections (only difference is in UFS definition)
00084     virtual int compare(const Projection& p) const {
00085       return mkNamedPCmp(p, "UFS");
00086     }
00087 
00088     /// b and c hadron containers
00089     Particles _theBs, _theCs;
00090 
00091   };
00092 
00093 
00094 }
00095 
00096 
00097 #endif