Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-12 09:05:03

0001 #ifndef RIVET_TauFinder_HH
0002 #define RIVET_TauFinder_HH
0003 
0004 #include "Rivet/Projections/UnstableParticles.hh"
0005 #include "Rivet/Projections/FinalState.hh"
0006 
0007 namespace Rivet {
0008 
0009 
0010   /// Enumerate types of tau decay
0011   enum class TauDecay {
0012     ANY = 0,
0013     ALL = 0,
0014     LEPTONIC,
0015     HADRONIC
0016   };
0017 
0018 
0019   
0020   /// @brief Convenience finder of unstable taus
0021   ///
0022   /// @todo Convert to a general ParticleFinder, but this has many knock-on
0023   /// effects and requires e.g. FastJets to also be generalised.
0024   class TauFinder : public FinalState {
0025   public:
0026 
0027     static bool isHadronic(const Particle& tau) {
0028       assert(tau.abspid() == PID::TAU);
0029       return any(tau.stableDescendants(), isHadron);
0030     }
0031 
0032     static bool isLeptonic(const Particle& tau) {
0033       return !isHadronic(tau);
0034     }
0035 
0036 
0037     TauFinder(TauDecay decaymode=TauDecay::ANY, const Cut& cut=Cuts::open()) {
0038       /// @todo What about directness/promptness?
0039       setName("TauFinder");
0040       _decmode = decaymode;
0041       declare(UnstableParticles(cut), "UFS");
0042     }
0043 
0044 
0045     /// Clone on the heap.
0046     RIVET_DEFAULT_PROJ_CLONE(TauFinder);
0047 
0048     /// Import to avoid warnings about overload-hiding
0049     using Projection::operator =;
0050 
0051 
0052     const Particles& taus() const { return _theParticles; }
0053 
0054 
0055   protected:
0056 
0057     /// Apply the projection on the supplied event.
0058     void project(const Event& e);
0059 
0060     /// Compare with other projections.
0061     virtual CmpState compare(const Projection& p) const;
0062 
0063 
0064   protected:
0065 
0066     /// The decay-mode enum
0067     TauDecay _decmode;
0068 
0069   };
0070 
0071 
0072   /// @todo Make this the canonical name in future?
0073   using Taus = TauFinder;
0074 
0075 
0076 }
0077 
0078 
0079 #endif