2 #ifndef RIVET_PartonicTops_HH 3 #define RIVET_PartonicTops_HH 5 #include "Rivet/Projections/ParticleFinder.hh" 44 PartonicTops(
DecayMode decaymode,
bool emu_from_prompt_tau=
true,
bool include_hadronic_taus=
false,
const Cut& c=Cuts::OPEN,
WhichTop whichtop=WhichTop::LAST)
46 _emu_from_prompt_tau(emu_from_prompt_tau), _include_hadronic_taus(include_hadronic_taus)
51 :
PartonicTops(decaymode, emu_from_prompt_tau, include_hadronic_taus, c, whichtop)
67 const Particles&
tops()
const {
return _theParticles; }
72 _theParticles.clear();
82 static bool donerubric =
false;
84 MSG_WARNING(
"PartonicTops is not recommended: MC generators do not guarantee physical properties for, or even the existence of, partonic event-record entries. Caveat emptor!");
92 if (_decaymode != DecayMode::ALL) {
93 const auto decaycheck = [&](
const Particle& t) {
94 const Particles descendants = t.allDescendants();
97 if (prompt_e && (_decaymode == DecayMode::ELECTRON || _decaymode == DecayMode::E_MU || _decaymode == DecayMode::E_MU_TAU))
return true;
98 if (prompt_mu && (_decaymode == DecayMode::MUON || _decaymode == DecayMode::E_MU || _decaymode == DecayMode::E_MU_TAU))
return true;
101 if (prompt_tau && (_decaymode == DecayMode::TAU || _decaymode == DecayMode::E_MU_TAU))
return (_include_hadronic_taus || !prompt_hadronic_tau);
102 if (_decaymode == DecayMode::HADRONIC && (!prompt_e && !prompt_mu && (!prompt_tau || (_include_hadronic_taus && prompt_hadronic_tau))))
return true;
109 const auto physcheck = [&](
const Particle& t) {
110 if (t.E() < 0 || t.mass() < 0) {
111 MSG_WARNING(
"Unphysical partonic top with negative E or m found: " << t.mom());
123 return cmp(_cuts, other._cuts) ||
124 cmp(_topmode, other._topmode) ||
125 cmp(_decaymode, other._decaymode) ||
126 cmp(_emu_from_prompt_tau, other._emu_from_prompt_tau) ||
127 cmp(_include_hadronic_taus, other._include_hadronic_taus);
137 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:323
CmpState compare(const Projection &p) const
Compare projections.
Definition: PartonicTops.hh:121
void project(const Event &event)
Apply the projection on the supplied event.
Definition: PartonicTops.hh:79
PartonicTops(const Cut &c=Cuts::OPEN, WhichTop whichtop=WhichTop::LAST)
Simple constructor optionally taking cuts object.
Definition: PartonicTops.hh:55
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:25
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:367
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 a non-optional cuts object)
Definition: PartonicTops.hh:50
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:44
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:71
Convenience finder of partonic top quarks.
Definition: PartonicTops.hh:18
const Particles & tops() const
Access to the found partonic tops.
Definition: PartonicTops.hh:67
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:37
#define MSG_WARNING(x)
Warning messages for non-fatal bad things, using MSG_LVL.
Definition: Logging.hh:200
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