rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
TauFinder.hh
1 #ifndef RIVET_TauFinder_HH
2 #define RIVET_TauFinder_HH
3 
4 #include "Rivet/Projections/FinalState.hh"
5 #include "Rivet/Projections/UnstableFinalState.hh"
6 
7 namespace Rivet {
8 
9 
13  class TauFinder : public FinalState {
14  public:
15 
16  enum DecayType { ANY=0, LEPTONIC=1, HADRONIC };
17 
18  static bool isHadronic(const Particle& tau) {
19  assert(tau.abspid() == PID::TAU);
20  return any(tau.stableDescendants(), isHadron);
21  }
22 
23  static bool isLeptonic(const Particle& tau) {
24  return !isHadronic(tau);
25  }
26 
27 
28  TauFinder(DecayType decaytype, const Cut& cut=Cuts::open()) {
30  setName("TauFinder");
31  _dectype = decaytype;
32  addProjection(UnstableFinalState(cut), "UFS");
33  }
34 
35 
38 
39 
40  const Particles& taus() const { return _theParticles; }
41 
42 
43  protected:
44 
46  void project(const Event& e);
47 
49  virtual int compare(const Projection& p) const;
50 
51 
52  private:
53 
55  DecayType _dectype;
56 
57  };
58 
59 
61  using Taus = TauFinder;
62 
63 
64 }
65 
66 
67 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:133
Definition: ALICE_2010_I880049.cc:13
virtual int compare(const Projection &p) const
Compare with other projections.
Definition: TauFinder.cc:19
bool any(const CONTAINER &c)
Return true if x is true for any x in container c, otherwise false.
Definition: Utils.hh:287
Project out all physical-but-decayed particles in an event.
Definition: UnstableFinalState.hh:26
TauFinder(DecayType decaytype, const Cut &cut=Cuts::open())
Definition: TauFinder.hh:28
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
Definition: Event.hh:22
const Cut & open()
Fully open cut singleton, accepts everything.
Definition: Cuts.cc:81
DEFAULT_RIVET_PROJ_CLONE(TauFinder)
Clone on the heap.
Convenience finder of unstable taus.
Definition: TauFinder.hh:13
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:12
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
void project(const Event &e)
Apply the projection on the supplied event.
Definition: TauFinder.cc:8
Base class for all Rivet projections.
Definition: Projection.hh:29
PdgId abspid() const
Absolute value of the PDG ID code.
Definition: Particle.hh:137
Particles stableDescendants(const Cut &c=Cuts::OPEN) const
Definition: Particle.cc:155