2 #ifndef RIVET_PartonicTops_HH 3 #define RIVET_PartonicTops_HH 5 #include "Rivet/Projections/ParticleFinder.hh" 42 _emu_from_prompt_tau(true), _include_hadronic_taus(false)
46 PartonicTops(
DecayMode decaymode,
bool emu_from_prompt_tau=
true,
bool include_hadronic_taus=
false,
const Cut& c=Cuts::OPEN,
WhichTop whichtop=WhichTop::LAST)
48 _emu_from_prompt_tau(emu_from_prompt_tau), _include_hadronic_taus(include_hadronic_taus)
54 _emu_from_prompt_tau(emu_from_prompt_tau), _include_hadronic_taus(include_hadronic_taus)
65 const Particles&
tops()
const {
return _theParticles; }
70 _theParticles.clear();
81 if (_decaymode != DecayMode::ALL) {
82 const auto fn = [&](
const Particle& t) {
83 const Particles descendants = t.allDescendants();
86 if (prompt_e && (_decaymode == DecayMode::ELECTRON || _decaymode == DecayMode::E_MU || _decaymode == DecayMode::E_MU_TAU))
return true;
87 if (prompt_mu && (_decaymode == DecayMode::MUON || _decaymode == DecayMode::E_MU || _decaymode == DecayMode::E_MU_TAU))
return true;
90 if (prompt_tau && (_decaymode == DecayMode::TAU || _decaymode == DecayMode::E_MU_TAU))
return (_include_hadronic_taus || !prompt_hadronic_tau);
91 if (_decaymode == DecayMode::HADRONIC && (!prompt_e && !prompt_mu && (!prompt_tau || (_include_hadronic_taus && prompt_hadronic_tau))))
return true;
102 return cmp(_cuts, other._cuts) ||
103 cmp(_topmode, other._topmode) ||
104 cmp(_decaymode, other._decaymode) ||
105 cmp(_emu_from_prompt_tau, other._emu_from_prompt_tau) ||
106 cmp(_include_hadronic_taus, other._include_hadronic_taus);
116 bool _emu_from_prompt_tau, _include_hadronic_taus;
Definition: MC_Cent_pPb.hh:10
bool any(const CONTAINER &c)
Return true if x is true for any x in container c, otherwise false.
Definition: Utils.hh:311
CmpState compare(const Projection &p) const
Compare projections.
Definition: PartonicTops.hh:100
void project(const Event &event)
Apply the projection on the supplied event.
Definition: PartonicTops.hh:77
PartonicTops(const Cut &c=Cuts::OPEN, WhichTop whichtop=WhichTop::LAST)
Constructor optionally taking cuts object.
Definition: PartonicTops.hh:40
const Particles & allParticles() const
All the raw GenEvent particles, wrapped in Rivet::Particle objects.
Jets filter_select(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Definition: JetUtils.hh:160
DecayMode
Enum for categorising top quark decay modes.
Definition: PartonicTops.hh:21
Particles children(const Cut &c=Cuts::OPEN) const
Get a list of the direct descendants from the current particle (with optional selection Cut) ...
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
Base class for projections which return subsets of an event's particles.
Definition: ParticleFinder.hh:11
bool none(const CONTAINER &c)
Return true if x is false for all x in container c, otherwise false.
Definition: Utils.hh:355
PartonicTops(DecayMode decaymode, const Cut &c, bool emu_from_prompt_tau=true, bool include_hadronic_taus=false, WhichTop whichtop=WhichTop::LAST)
Constructor taking decay mode details (and an optional cuts object)
Definition: PartonicTops.hh:52
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
Determine whether a particle is the first in a decay chain to meet the cut/function.
Definition: ParticleUtils.hh:556
bool isTop(int pid)
Determine if the PID is that of a t/tbar.
Definition: ParticleIdUtils.hh:223
DEFAULT_RIVET_PROJ_CLONE(PartonicTops)
Clone on the heap.
PartonicTops(DecayMode decaymode, bool emu_from_prompt_tau=true, bool include_hadronic_taus=false, const Cut &c=Cuts::OPEN, WhichTop whichtop=WhichTop::LAST)
Constructor taking decay mode details (and an optional cuts object)
Definition: PartonicTops.hh:46
Jets & ifilter_select(Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
void clear()
Clear the projection.
Definition: PartonicTops.hh:69
Convenience finder of partonic top quarks.
Definition: PartonicTops.hh:14
const Particles & tops() const
Access to the found partonic tops.
Definition: PartonicTops.hh:65
Determine whether a particle is the last in a decay chain to meet the cut/function.
Definition: ParticleUtils.hh:575
Base class for all Rivet projections.
Definition: Projection.hh:29
PdgId abspid() const
Absolute value of the PDG ID code.
Definition: Particle.hh:164
WhichTop
Enum for categorising which top quark to be selected: last (weakly decaying) or first?
Definition: PartonicTops.hh:33
bool isPrompt(bool allow_from_prompt_tau=false, bool allow_from_prompt_mu=false) const
Alias for isDirect.
Definition: Particle.hh:518
bool hasAncestor(PdgId pid, bool only_physical=true) const
bool isChargedLepton(int pid)
Determine if the PID is that of a charged lepton.
Definition: ParticleIdUtils.hh:158
Cmp< T > cmp(const T &t1, const T &t2)
Global helper function for easy creation of Cmp objects.
Definition: Cmp.hh:255