Rivet is hosted by Hepforge, IPPP Durham
ParticleUtils.hh File Reference
Include dependency graph for ParticleUtils.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BoolParticleFunctor
 Base type for Particle -> bool functors. More...
struct  HasPID
 PID matching functor. More...
struct  HasAbsPID
 |PID| matching functor More...
struct  FirstParticleWith
 Determine whether a particle is the first in a decay chain to meet the cut/function. More...
struct  FirstParticleWithout
 Determine whether a particle is the first in a decay chain not to meet the cut/function. More...
struct  LastParticleWith
 Determine whether a particle is the last in a decay chain to meet the cut/function. More...
struct  LastParticleWithout
 Determine whether a particle is the last in a decay chain not to meet the cut/function. More...
struct  HasParticleAncestorWith
 Determine whether a particle has an ancestor which meets the cut/function. More...
struct  HasParticleAncestorWithout
 Determine whether a particle has an ancestor which doesn't meet the cut/function. More...
struct  HasParticleParentWith
 Determine whether a particle has an parent which meets the cut/function. More...
struct  HasParticleParentWithout
 Determine whether a particle has an parent which doesn't meet the cut/function. More...
struct  HasParticleChildWith
 Determine whether a particle has a child which meets the cut/function. More...
struct  HasParticleChildWithout
 Determine whether a particle has a child which doesn't meet the cut/function. More...
struct  HasParticleDescendantWith
 Determine whether a particle has a descendant which meets the cut/function. More...
struct  HasParticleDescendantWithout
 Determine whether a particle has a descendant which doesn't meet the cut/function. More...

Namespaces

namespace  Rivet

Defines

#define PARTICLE_TO_PID_BOOLFN(fname)   inline bool fname (const Particle& p) { return PID:: fname (p.pid()); }
#define PARTICLE_TO_PID_INTFN(fname)   inline int fname (const Particle& p) { return PID:: fname (p.pid()); }
#define PARTICLE_TO_PID_DBLFN(fname)   inline double fname (const Particle& p) { return PID:: fname (p.pid()); }

Functions

Particle classifier functions
int pid (const Particle &p)
 Unbound function access to PID code.
int abspid (const Particle &p)
 Unbound function access to abs PID code.
Particle charge/sign comparison functions

Is this particle species charged?

Is this particle species neutral? Is this a neutrino? Determine if the PID is that of a charged lepton Determine if the PID is that of a photon Determine if the PID is that of an electron or positron Determine if the PID is that of an muon or antimuon Determine if the PID is that of an tau or antitau Determine if the PID is that of a hadron Determine if the PID is that of a meson Determine if the PID is that of a baryon Determine if the PID is that of a quark Determine if the PID is that of a parton (quark or gluon) Determine if the PID is that of a W+ Determine if the PID is that of a W- Determine if the PID is that of a W+- Determine if the PID is that of a Z0 Determine if the PID is that of an SM/lightest SUSY Higgs Determine if the PID is that of an s/sbar Determine if the PID is that of a c/cbar Determine if the PID is that of a b/bbar Determine if the PID is that of a t/tbar Determine if the particle is a heavy flavour hadron or parton Determine if the PID is that of a heavy parton (c,b,t) Determine if the PID is that of a light parton (u,d,s) Determine if the PID is that of a heavy flavour (b or c) meson Determine if the PID is that of a heavy flavour (b or c) baryon Determine if the PID is that of a heavy flavour (b or c) hadron Determine if the PID is that of a light flavour (not b or c) meson Determine if the PID is that of a light flavour (not b or c) baryon Determine if the PID is that of a light flavour (not b or c) hadron Determine if the PID is that of a b-meson. Determine if the PID is that of a b-baryon. Determine if the PID is that of a b-hadron. Determine if the PID is that of a c-meson.

Specifically, the _heaviest_ quark is a c: a B_c is a b-meson and NOT a c-meson. Charmonia (closed charm) are counted as c-mesons here. Determine if the PID is that of a c-baryon.

Specifically, the _heaviest_ quark is a c: a baryon containing a b & c is a b-baryon and NOT a c-baryon. To test for the simpler case, just use a combination of hasCharm() and isBaryon(). Determine if the PID is that of a c-hadron. Is this a pomeron, odderon, or generic reggeon? Determine if the PID is that of a diquark (used in hadronization models) Determine if the PID is that of a pentaquark (hypothetical hadron) Is this a fundamental SUSY particle? Is this an R-hadron? Is this a technicolor particle? Is this an excited (composite) quark or lepton? Is this a Kaluza-Klein excitation? Is this a graviton? Is this a BSM particle (including graviton)? Determine if the PID is in the generator-specific range Determine if the PID is that of an EW scale resonance Check the PID for usability in transport codes like Geant4 Does this particle contain an up quark? Does this particle contain a down quark? Does this particle contain a strange quark? Does this particle contain a charm quark? Does this particle contain a bottom quark? Does this particle contain a top quark? jSpin returns 2J+1, where J is the total spin sSpin returns 2S+1, where S is the spin lSpin returns 2L+1, where L is the orbital angular momentum Return the charge Return 3 times the charge (3 x quark charge is an int) Return the absolute charge Return 3 times the abs charge (3 x quark charge is an int) Alias for charge3

Deprecated:
Use charge3

Get the atomic number (number of protons) in a nucleus/ion Get the atomic weight (number of nucleons) in a nucleus/ion If this is a nucleus (ion), get nLambda

bool oppSign (const Particle &a, const Particle &b)
 Return true if Particles a and b have the opposite charge sign.
bool sameSign (const Particle &a, const Particle &b)
bool oppCharge (const Particle &a, const Particle &b)
bool sameCharge (const Particle &a, const Particle &b)
bool diffCharge (const Particle &a, const Particle &b)
 Return true if Particles a and b have a different (not necessarily opposite) charge.
Non-PID particle properties, via unbound functions
bool isVisible (const Particle &p)
 Is this particle potentially visible in a detector?
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()
bool isStable (const Particle &p)
 Decide if a given particle is stable, via Particle::isStable()
bool hasAncestor (const Particle &p, PdgId pid)
 Check whether a given PID is found in the particle's ancestor list.
bool fromBottom (const Particle &p)
 Determine whether the particle is from a b-hadron decay.
bool fromCharm (const Particle &p)
 Determine whether the particle is from a c-hadron decay.
bool fromHadron (const Particle &p)
 Determine whether the particle is from a hadron decay.
bool fromTau (const Particle &p, bool prompt_taus_only=false)
 Determine whether the particle is from a tau decay.
bool fromPromptTau (const Particle &p)
 Determine whether the particle is from a prompt tau decay.
bool fromDecay (const Particle &p)
 Determine whether the particle is from a hadron or tau decay.
template<typename FN >
bool isFirstWith (const Particle &p, const FN &f)
 Determine whether a particle is the first in a decay chain to meet the function requirement.
template<typename FN >
bool isFirstWithout (const Particle &p, const FN &f)
 Determine whether a particle is the first in a decay chain not to meet the function requirement.
template<typename FN >
bool isLastWith (const Particle &p, const FN &f)
 Determine whether a particle is the last in a decay chain to meet the function requirement.
template<typename FN >
bool isLastWithout (const Particle &p, const FN &f)
 Determine whether a particle is the last in a decay chain not to meet the function requirement.
template<typename FN >
bool hasAncestorWith (const Particle &p, const FN &f)
 Determine whether a particle has an ancestor which meets the function requirement.
template<typename FN >
bool hasAncestorWithout (const Particle &p, const FN &f)
 Determine whether a particle has an ancestor which doesn't meet the function requirement.
template<typename FN >
bool hasParentWith (const Particle &p, const FN &f)
 Determine whether a particle has a parent which meets the function requirement.
template<typename FN >
bool hasParentWithout (const Particle &p, const FN &f)
 Determine whether a particle has a parent which doesn't meet the function requirement.
template<typename FN >
bool hasChildWith (const Particle &p, const FN &f)
 Determine whether a particle has a child which meets the function requirement.
template<typename FN >
bool hasChildWithout (const Particle &p, const FN &f)
 Determine whether a particle has a child which doesn't meet the function requirement.
template<typename FN >
bool hasDescendantWith (const Particle &p, const FN &f)
 Determine whether a particle has a descendant which meets the function requirement.
template<typename FN >
bool hasDescendantWithout (const Particle &p, const FN &f)
 Determine whether a particle has a descendant which doesn't meet the function requirement.
Unbound functions for filtering jets
Jets & ifilter_select (Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that passes the supplied Cut.
Jets & ifilterBy (Jets &jets, const Cut &c)
Jets filter_select (const Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that passes the supplied Cut.
Jets filterBy (const Jets &jets, const Cut &c)
Jets filter_select (const Jets &jets, const Cut &c, Jets &out)
 Filter a jet collection in-place to the subset that passes the supplied Cut.
Jets filterBy (const Jets &jets, const Cut &c, Jets &out)
Jets & ifilter_discard (Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that fails the supplied Cut.
Jets filter_discard (const Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that fails the supplied Cut.
Jets filter_discard (const Jets &jets, const Cut &c, Jets &out)
 Filter a jet collection in-place to the subset that fails the supplied Cut.
Particle pair functions
PdgIdPair pids (const ParticlePair &pp)

Define Documentation

#define PARTICLE_TO_PID_BOOLFN (   fname)    inline bool fname (const Particle& p) { return PID:: fname (p.pid()); }

Definition at line 9 of file ParticleUtils.hh.

#define PARTICLE_TO_PID_DBLFN (   fname)    inline double fname (const Particle& p) { return PID:: fname (p.pid()); }

Definition at line 11 of file ParticleUtils.hh.

#define PARTICLE_TO_PID_INTFN (   fname)    inline int fname (const Particle& p) { return PID:: fname (p.pid()); }

Definition at line 10 of file ParticleUtils.hh.