Rivet API documentation

Rivet 4.1.3
TauFinder.hh
1#ifndef RIVET_TauFinder_HH
2#define RIVET_TauFinder_HH
3
4#include "Rivet/DressedLepton.hh"
5#include "Rivet/Projections/FinalState.hh"
6#include "Rivet/Projections/UnstableParticles.hh"
7
8namespace Rivet {
9
10
12 enum class TauDecay { ANY = 0, ALL = 0, LEPTONIC, HADRONIC };
13
14
19 class TauFinder : public FinalState {
20 public:
21
22 static bool isHadronic(const Particle& tau) {
23 assert(tau.abspid() == PID::TAU);
24 return any(tau.stableDescendants(), isHadron);
25 }
26
27 static bool isLeptonic(const Particle& tau) {
28 return !isHadronic(tau);
29 }
30
31
32 TauFinder(TauDecay decaymode = TauDecay::ANY,
33 LeptonOrigin origin = LeptonOrigin::ANY,
34 const Cut& cut = Cuts::open()) {
35 setName("TauFinder");
36 _decmode = decaymode;
37 _origin = origin;
38 declare(UnstableParticles(cut), "UFS");
39 }
40
41
42 TauFinder(TauDecay decaymode, const Cut& cut, LeptonOrigin origin = LeptonOrigin::ANY)
43 : TauFinder(decaymode, origin, cut) { }
44
45
46 TauFinder(const Cut& cut, TauDecay decaymode = TauDecay::ANY, LeptonOrigin origin = LeptonOrigin::ANY)
47 : TauFinder(decaymode, origin, cut) { }
48
49
52
54 using Projection::operator=;
55
56
57 const Particles& taus() const {
58 return _theParticles;
59 }
60
61
62 protected:
63
65 void project(const Event& e);
66
68 virtual CmpState compare(const Projection& p) const;
69
70
71 protected:
72
74 TauDecay _decmode;
75
77 LeptonOrigin _origin;
78 };
79
80
81 // Alias
82 using Taus = TauFinder;
83
84
85}
86
87
88#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
FinalState(const Cut &c=Cuts::OPEN)
Construction using Cuts object.
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:50
PdgId abspid() const
Absolute value of the PDG ID code.
Definition Particle.hh:225
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:205
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:146
Convenience finder of unstable taus.
Definition TauFinder.hh:19
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:364
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
const Cut & open()
Fully open cut singleton, accepts everything.
Definition LHCbCommon.hh:9
TauDecay
Enumerate types of tau decay.
Definition TauFinder.hh:12
LeptonOrigin
Possible classes of lepton origin.
Definition DressedLepton.hh:12