Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:31:15

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