Rivet API documentation
![]() |
Rivet 4.1.3
|
ParticleUtils.hh
9#define PARTICLE_TO_PID_BOOLFN(fname) inline bool fname (const Particle& p) { return PID:: fname (p.pid()); }
10#define PARTICLE_TO_PID_INTFN(fname) inline int fname (const Particle& p) { return PID:: fname (p.pid()); }
11#define PARTICLE_TO_PID_DBLFN(fname) inline double fname (const Particle& p) { return PID:: fname (p.pid()); }
364 inline bool hasAncestorWith(const Particle& p, const ParticleSelector& f, bool only_physical = true) {
369 inline bool hasAncestorWithout(const Particle& p, const ParticleSelector& f, bool only_physical = true) {
397 inline bool hasDescendantWith(const Particle& p, const ParticleSelector& f, bool remove_duplicates = true) {
970 bool cascadeContains(const Particles& parts, const vector<int>& pids, bool absolute, bool ignorephoton);
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:50
Particles parents(const Cut &c=Cuts::OPEN) const
Particles children(const Cut &c=Cuts::OPEN) const
Get a list of the direct descendants from the current particle (with optional selection Cut).
int charge3() const
Three times the charge of this Particle (i.e. integer multiple of smallest quark charge).
Definition Particle.hh:246
STL class.
bool any(const CONTAINER &c)
Return true if x is true for any x in container c, otherwise false.
Definition Utils.hh:364
Jets & idiscard(Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that fails the supplied Cut.
Jets select(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Definition JetUtils.hh:183
Jets & iselect(Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Jets discard(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that fails the supplied Cut.
Definition JetUtils.hh:201
double pT(const ParticleBase &p)
Unbound function access to pT.
Definition ParticleBaseUtils.hh:824
FourMomentum p4(const ParticleBase &p)
Unbound function access to momentum.
Definition ParticleBaseUtils.hh:804
Vector3 p3(const ParticleBase &p)
Unbound function access to p3.
Definition ParticleBaseUtils.hh:809
double mass(const ParticleBase &p)
Unbound function access to mass.
Definition ParticleBaseUtils.hh:859
double mass2(const ParticleBase &p, const P4 &p4)
Get the mass^2 of a ParticleBase and a P4.
Definition ParticleBaseUtils.hh:887
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
double mT(const ParticleBase &p, const P4 &p4)
Get the transverse mass of a ParticleBase and a P4.
Definition ParticleBaseUtils.hh:905
bool sameCharge(const Particle &a, const Particle &b)
Definition ParticleUtils.hh:323
bool oppSign(const Particle &a, const Particle &b)
Return true if Particles a and b have the opposite charge sign.
Definition ParticleUtils.hh:305
bool diffCharge(const Particle &a, const Particle &b)
Return true if Particles a and b have a different (not necessarily opposite) charge.
Definition ParticleUtils.hh:328
int pid(const Particle &p)
Unbound function access to PID code.
Definition ParticleUtils.hh:23
int abspid(const Particle &p)
Unbound function access to abs PID code.
Definition ParticleUtils.hh:28
bool isSame(const Particle &a, const Particle &b)
Check Particle equivalence.
Definition ParticleUtils.hh:941
bool isVisible(const Particle &p)
Is this particle potentially visible in a detector?
Definition ParticleUtils.hh:421
bool hasParentWith(const Particle &p, const ParticleSelector &f)
Determine whether a particle has a parent which meets the function requirement.
Definition ParticleUtils.hh:375
bool fromHadron(const Particle &p)
Determine whether the particle is from a hadron decay.
Definition ParticleUtils.hh:481
bool hasStableDescendantWith(const Particle &p, const ParticleSelector &f)
Determine whether a particle has a stable descendant which meets the function requirement.
Definition ParticleUtils.hh:410
bool isFirstWithout(const Particle &p, const ParticleSelector &f)
Determine whether a particle is the first in a decay chain not to meet the function requirement.
Definition ParticleUtils.hh:347
bool isLastWithout(const Particle &p, const ParticleSelector &f)
Determine whether a particle is the last in a decay chain not to meet the function requirement.
Definition ParticleUtils.hh:358
bool isDirect(const Particle &p, bool allow_from_direct_tau=false, bool allow_from_direct_mu=false)
Decide if a given particle is direct, via Particle::isDirect().
Definition ParticleUtils.hh:433
bool isFirstWith(const Particle &p, const ParticleSelector &f)
Determine whether a particle is the first in a decay chain to meet the function requirement.
Definition ParticleUtils.hh:342
bool fromTau(const Particle &p, bool prompt_taus_only=false)
Determine whether the particle is from a tau decay.
Definition ParticleUtils.hh:486
bool hasParentWithout(const Particle &p, const ParticleSelector &f)
Determine whether a particle has a parent which doesn't meet the function requirement.
Definition ParticleUtils.hh:380
bool fromPromptTau(const Particle &p)
Determine whether the particle is from a prompt tau decay.
Definition ParticleUtils.hh:491
bool hasChildWithout(const Particle &p, const ParticleSelector &f)
Determine whether a particle has a child which doesn't meet the function requirement.
Definition ParticleUtils.hh:391
bool fromCharm(const Particle &p)
Determine whether the particle is from a c-hadron decay.
Definition ParticleUtils.hh:476
bool hasDescendantWith(const Particle &p, const ParticleSelector &f, bool remove_duplicates=true)
Determine whether a particle has a descendant which meets the function requirement.
Definition ParticleUtils.hh:397
bool hasAncestorWith(const Particle &p, const ParticleSelector &f, bool only_physical=true)
Determine whether a particle has an ancestor which meets the function requirement.
Definition ParticleUtils.hh:364
bool hasHadronicDecay(const Particle &p)
Decide if a given particle decays hadronically.
Definition ParticleUtils.hh:456
bool isStable(const Particle &p)
Decide if a given particle is stable, via Particle::isStable().
Definition ParticleUtils.hh:451
bool hasChildWith(const Particle &p, const ParticleSelector &f)
Determine whether a particle has a child which meets the function requirement.
Definition ParticleUtils.hh:386
bool isPrompt(const Particle &p, bool allow_from_prompt_tau=false, bool allow_from_prompt_mu=false)
Decide if a given particle is prompt, via Particle::isPrompt().
Definition ParticleUtils.hh:443
bool isLastWith(const Particle &p, const ParticleSelector &f)
Determine whether a particle is the last in a decay chain to meet the function requirement.
Definition ParticleUtils.hh:353
bool hasLeptonicDecay(const Particle &p)
Decide if a given particle decays leptonically (decays, and no hadrons).
Definition ParticleUtils.hh:463
bool hasStableDescendantWithout(const Particle &p, const ParticleSelector &f)
Determine whether a particle has a stable descendant which doesn't meet the function requirement.
Definition ParticleUtils.hh:415
bool hasAncestorWithout(const Particle &p, const ParticleSelector &f, bool only_physical=true)
Determine whether a particle has an ancestor which doesn't meet the function requirement.
Definition ParticleUtils.hh:369
bool fromBottom(const Particle &p)
Determine whether the particle is from a b-hadron decay.
Definition ParticleUtils.hh:471
bool hasDescendantWithout(const Particle &p, const ParticleSelector &f, bool remove_duplicates=true)
Determine whether a particle has a descendant which doesn't meet the function requirement.
Definition ParticleUtils.hh:402
PdgIdPair pids(const ParticlePair &pp)
Get the PDG ID codes of a ParticlePair.
Definition ParticleUtils.hh:804
bool isRadiative(const Particle &part)
Check whether a particle is radiative.
Definition ParticleUtils.hh:958
bool containsPID(const Particles &parts, int id, bool abs=false)
Check for pid membership in a list of particles.
Definition ParticleUtils.hh:950
bool cascadeContains(const Particles &parts, const vector< int > &pids, bool absolute, bool ignorephoton)
Check whether a set of particles' decay chains can contain the requested list of pids.
Definition LHCbCommon.hh:9
constexpr std::enable_if_t< std::is_arithmetic_v< NUM >, int > sign(NUM val)
Find the sign of a number.
Definition MathUtils.hh:295
Cut operator&&(const Cut &aptr, const Cut &bptr)
std::pair< Particle, Particle > ParticlePair
Typedef for a pair of Particle objects.
Definition Particle.hh:43
T sum(const DressedLeptons &c, FN &&fn, const T &start=T())
Generic sum function, adding fn(x) for all x in container c, starting with start.
Definition DressedLepton.hh:66
bool contains(const std::string &s, const std::string &sub)
Does s contain sub as a substring?
Definition RivetSTL.hh:213
Cut operator||(const Cut &aptr, const Cut &bptr)
Determine whether a particle is the first in a decay chain to meet the cut/function.
Definition ParticleUtils.hh:599
Determine whether a particle is the first in a decay chain not to meet the cut/function.
Definition ParticleUtils.hh:611
Determine whether a particle has an ancestor which meets the cut/function.
Definition ParticleUtils.hh:650
Determine whether a particle has an ancestor which doesn't meet the cut/function.
Definition ParticleUtils.hh:663
Determine whether a particle has a child which meets the cut/function.
Definition ParticleUtils.hh:702
Determine whether a particle has a child which doesn't meet the cut/function.
Definition ParticleUtils.hh:714
Determine whether a particle has a descendant which meets the cut/function.
Definition ParticleUtils.hh:727
Determine whether a particle has a descendant which doesn't meet the cut/function.
Definition ParticleUtils.hh:740
Determine whether a particle has an parent which meets the cut/function.
Definition ParticleUtils.hh:677
Determine whether a particle has an parent which doesn't meet the cut/function.
Definition ParticleUtils.hh:689
Determine whether a particle is the last in a decay chain to meet the cut/function.
Definition ParticleUtils.hh:624
Determine whether a particle is the last in a decay chain not to meet the cut/function.
Definition ParticleUtils.hh:637
Generated on for Rivet by
