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
0011 enum class TauDecay {
0012 ANY = 0,
0013 ALL = 0,
0014 LEPTONIC,
0015 HADRONIC
0016 };
0017
0018
0019
0020
0021
0022
0023
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
0039 setName("TauFinder");
0040 _decmode = decaymode;
0041 declare(UnstableParticles(cut), "UFS");
0042 }
0043
0044
0045
0046 RIVET_DEFAULT_PROJ_CLONE(TauFinder);
0047
0048
0049 using Projection::operator =;
0050
0051
0052 const Particles& taus() const { return _theParticles; }
0053
0054
0055 protected:
0056
0057
0058 void project(const Event& e);
0059
0060
0061 virtual CmpState compare(const Projection& p) const;
0062
0063
0064 protected:
0065
0066
0067 TauDecay _decmode;
0068
0069 };
0070
0071
0072
0073 using Taus = TauFinder;
0074
0075
0076 }
0077
0078
0079 #endif