rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.2
TauFinder.hh
1#ifndef RIVET_TauFinder_HH
2#define RIVET_TauFinder_HH
3
4#include "Rivet/Projections/UnstableParticles.hh"
5#include "Rivet/Projections/FinalState.hh"
6
7namespace Rivet {
8
9
11 enum class TauDecay {
12 ANY = 0,
13 ALL = 0,
14 LEPTONIC,
15 HADRONIC
16 };
17
18
19
24 class TauFinder : public FinalState {
25 public:
26
27 static bool isHadronic(const Particle& tau) {
28 assert(tau.abspid() == PID::TAU);
29 return any(tau.stableDescendants(), isHadron);
30 }
31
32 static bool isLeptonic(const Particle& tau) {
33 return !isHadronic(tau);
34 }
35
36
37 TauFinder(TauDecay decaymode=TauDecay::ANY, const Cut& cut=Cuts::open()) {
39 setName("TauFinder");
40 _decmode = decaymode;
41 declare(UnstableParticles(cut), "UFS");
42 }
43
44
47
49 using Projection::operator =;
50
51
52 const Particles& taus() const { return _theParticles; }
53
54
55 protected:
56
58 void project(const Event& e);
59
61 virtual CmpState compare(const Projection& p) const;
62
63
64 protected:
65
67 TauDecay _decmode;
68
69 };
70
71
73 using Taus = TauFinder;
74
75
76}
77
78
79#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition FinalState.hh:12
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:45
PdgId abspid() const
Absolute value of the PDG ID code.
Definition Particle.hh:193
Particles stableDescendants(const Cut &c=Cuts::OPEN) const
Specialised vector of Particle objects.
Definition Particle.hh:21
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:175
Base class for all Rivet projections.
Definition Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:148
Convenience finder of unstable taus.
Definition TauFinder.hh:24
virtual CmpState compare(const Projection &p) const
Compare with other projections.
TauFinder(TauDecay decaymode=TauDecay::ANY, const Cut &cut=Cuts::open())
Definition TauFinder.hh:37
RIVET_DEFAULT_PROJ_CLONE(TauFinder)
Clone on the heap.
void project(const Event &e)
Apply the projection on the supplied event.
Project out all physical-but-decayed particles in an event.
Definition UnstableParticles.hh:25
bool any(const CONTAINER &c)
Return true if x is true for any x in container c, otherwise false.
Definition Utils.hh:330
const Cut & open()
Fully open cut singleton, accepts everything.
Definition MC_CENT_PPB_Projections.hh:10
TauDecay
Enumerate types of tau decay.
Definition TauFinder.hh:11