rivet is hosted by Hepforge, IPPP Durham
Rivet 4.1.0
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#include "Rivet/DressedLepton.hh"
7
8namespace Rivet {
9
10
12 enum class TauDecay {
13 ANY = 0,
14 ALL = 0,
15 LEPTONIC,
16 HADRONIC
17 };
18
19
20
25 class TauFinder : public FinalState {
26 public:
27
28 static bool isHadronic(const Particle& tau) {
29 assert(tau.abspid() == PID::TAU);
30 return any(tau.stableDescendants(), isHadron);
31 }
32
33 static bool isLeptonic(const Particle& tau) {
34 return !isHadronic(tau);
35 }
36
37
38 TauFinder(TauDecay decaymode=TauDecay::ANY,
39 LeptonOrigin origin=LeptonOrigin::ANY,
40 const Cut& cut=Cuts::open()) {
41 setName("TauFinder");
42 _decmode = decaymode;
43 _origin = origin;
44 declare(UnstableParticles(cut), "UFS");
45 }
46
47
48 TauFinder(TauDecay decaymode, const Cut& cut,
49 LeptonOrigin origin=LeptonOrigin::ANY)
50 : TauFinder(decaymode, origin, cut)
51 { }
52
53
54 TauFinder(const Cut& cut,
55 TauDecay decaymode=TauDecay::ANY,
56 LeptonOrigin origin=LeptonOrigin::ANY)
57 : TauFinder(decaymode, origin, cut)
58 { }
59
60
63
65 using Projection::operator =;
66
67
68 const Particles& taus() const { return _theParticles; }
69
70
71 protected:
72
74 void project(const Event& e);
75
77 virtual CmpState compare(const Projection& p) const;
78
79
80 protected:
81
83 TauDecay _decmode;
84
86 LeptonOrigin _origin;
87
88 };
89
90
91 // Alias
92 using Taus = TauFinder;
93
94
95}
96
97
98#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:184
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:25
virtual CmpState compare(const Projection &p) const
Compare with other projections.
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:26
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:12
LeptonOrigin
Possible classes of lepton origin.
Definition DressedLepton.hh:12