rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
Rivet::PrimaryParticles Class Reference

Project out primary particles according to definition. A Rivet projection that mimics an experimental primary partcile definition by projecting out according to particle id. The projection can be further specialized to accomodate specific experimental definitions. More...

#include <PrimaryParticles.hh>

Inheritance diagram for Rivet::PrimaryParticles:
Rivet::ParticleFinder Rivet::Projection Rivet::ProjectionApplier Rivet::ALICE::PrimaryParticles

Public Member Functions

 PrimaryParticles (std::initializer_list< int > pdgIds, const Cut &c=Cuts::open())
 
 DEFAULT_RIVET_PROJ_CLONE (PrimaryParticles)
 
 PrimaryParticles (const PrimaryParticles &other)
 
virtual int compare (const Projection &p) const
 
- Public Member Functions inherited from Rivet::ParticleFinder
 ParticleFinder (const Cut &c=Cuts::OPEN)
 Construction using Cuts object.
 
virtual ~ParticleFinder ()
 Virtual destructor for inheritance.
 
virtual unique_ptr< Projectionclone () const =0
 Clone on the heap.
 
size_t size () const
 Count the final-state particles.
 
size_t size (const Cut &c) const
 Count the final-state particles after a Cut is applied.
 
size_t size (const ParticleSelector &s) const
 Count the final-state particles after a selection functor is applied.
 
bool empty () const
 Is this final state empty?
 
bool empty (const Cut &c) const
 Is this final state empty after a Cut is applied?
 
bool empty (const ParticleSelector &s) const
 Is this final state empty after a selection functor is applied?
 
virtual const Particles & particles () const
 Get the particles in no particular order, with no cuts.
 
Particles rawParticles () const
 
Particles particles (const Cut &c) const
 Get the particles with selection cuts. More...
 
Particles particles (const ParticleSelector &selector) const
 Get the particles with selection cuts via a functor. More...
 
Particles particles (const ParticleSorter &sorter, const Cut &c=Cuts::open()) const
 
Particles particles (const Cut &c, const ParticleSorter &sorter) const
 
Particles particles (const ParticleSelector &selector, const ParticleSorter &sorter) const
 
Particles particles (const ParticleSorter &sorter, const ParticleSelector &selector) const
 
Particles particlesByPt (const Cut &c=Cuts::open()) const
 
Particles particlesByPt (const ParticleSelector &selector) const
 
Particles particlesByPt (double ptmin) const
 
const collection_type & entities () const
 Template-usable interface common to JetAlg.
 
- Public Member Functions inherited from Rivet::Projection
virtual std::string name () const
 Get the name of the projection.
 
 Projection ()
 The default constructor.
 
virtual ~Projection ()
 The destructor.
 
bool before (const Projection &p) const
 
virtual const std::set< PdgIdPair > beamPairs () const
 
ProjectionaddPdgIdPair (PdgId beam1, PdgId beam2)
 
- Public Member Functions inherited from Rivet::ProjectionApplier
 ProjectionApplier ()
 Constructor.
 
void markAsOwned () const
 Mark this object as owned by a proj-handler.
 
std::set< ConstProjectionPtr > getProjections () const
 Get the contained projections, including recursion.
 
bool hasProjection (const std::string &name) const
 Does this applier have a projection registered under the name name?
 
template<typename PROJ >
const PROJ & getProjection (const std::string &name) const
 
template<typename PROJ >
const PROJ & get (const std::string &name) const
 
const ProjectiongetProjection (const std::string &name) const
 
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const Projection &proj) const
 Apply the supplied projection on event evt. More...
 
template<typename PROJ >
const PROJ & apply (const Event &evt, const Projection &proj) const
 
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const PROJ &proj) const
 Apply the supplied projection on event evt. More...
 
template<typename PROJ >
const PROJ & apply (const Event &evt, const PROJ &proj) const
 
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const std::string &name) const
 
template<typename PROJ >
const PROJ & apply (const Event &evt, const std::string &name) const
 
template<typename PROJ >
const PROJ & apply (const std::string &name, const Event &evt) const
 

Protected Member Functions

virtual void project (const Event &e)
 
Internally used member functions
virtual bool isPrimary (const HepMC::GenParticle *p) const
 
virtual bool isIgnored (const HepMC::GenParticle *p) const
 
virtual bool isPrimaryPID (const HepMC::GenParticle *p) const
 
virtual bool hasDecayed (const HepMC::GenParticle *p) const
 
virtual bool isBeam (const HepMC::GenParticle *p) const
 
const HepMC::GenParticle * ancestor (const HepMC::GenParticle *p) const
 
const HepMC::GenParticle * ancestor (const HepMC::GenParticle *p, bool) const
 
- Protected Member Functions inherited from Rivet::Projection
LoggetLog () const
 Get a Log object based on the getName() property of the calling projection object.
 
void setName (const std::string &name)
 Used by derived classes to set their name.
 
Cmp< ProjectionmkNamedPCmp (const Projection &otherparent, const std::string &pname) const
 
Cmp< ProjectionmkPCmp (const Projection &otherparent, const std::string &pname) const
 
virtual Projectionoperator= (const Projection &)
 Block Projection copying.
 
- Protected Member Functions inherited from Rivet::ProjectionApplier
LoggetLog () const
 
ProjectionHandlergetProjHandler () const
 Get a reference to the ProjectionHandler for this thread.
 
template<typename PROJ >
const PROJ & declareProjection (const PROJ &proj, const std::string &name)
 Register a contained projection. More...
 
template<typename PROJ >
const PROJ & declare (const PROJ &proj, const std::string &name)
 Register a contained projection (user-facing version) More...
 
template<typename PROJ >
const PROJ & declare (const std::string &name, const PROJ &proj)
 Register a contained projection (user-facing, arg-reordered version) More...
 
template<typename PROJ >
const PROJ & addProjection (const PROJ &proj, const std::string &name)
 Register a contained projection (user-facing version) More...
 

Additional Inherited Members

- Public Types inherited from Rivet::ParticleFinder
typedef Particle entity_type
 
typedef Particles collection_type
 

Detailed Description

Project out primary particles according to definition. A Rivet projection that mimics an experimental primary partcile definition by projecting out according to particle id. The projection can be further specialized to accomodate specific experimental definitions.

Constructor & Destructor Documentation

◆ PrimaryParticles() [1/2]

Rivet::PrimaryParticles::PrimaryParticles ( std::initializer_list< int >  pdgIds,
const Cut &  c = Cuts::open() 
)
inline

Constructor

Parameters
cutsNormal particle cuts
pdgIdsList of PDG IDs which are considered primary.
Todo:
Instead of using a real vector use an initializer list - more flexible. Also, do not provide a default for the PDG IDs (even if empty) as this will force the user to actively select which codes are primary.

References Rivet::Projection::setName().

◆ PrimaryParticles() [2/2]

Rivet::PrimaryParticles::PrimaryParticles ( const PrimaryParticles other)
inline

Copy constructor

Parameters
otherOther object to copy from

Member Function Documentation

◆ compare()

virtual int Rivet::PrimaryParticles::compare ( const Projection p) const
inlinevirtual

Compare to projections.

Parameters
pProjection to compare to.
Returns
true (EQUIVALENT) if the projection p is of the same type as this, if the cuts are equal, and that the list of PDG IDs are the same.

Reimplemented from Rivet::ParticleFinder.

Reimplemented in Rivet::ALICE::PrimaryParticles.

References isBeam(), isIgnored(), isPrimary(), isPrimaryPID(), and project().

◆ isBeam()

bool Rivet::PrimaryParticles::isBeam ( const HepMC::GenParticle *  p) const
protectedvirtual

Check if a particle is a beam (remnant) particle.

Parameters
pParticle to check
Returns
true if the particle p is a (remnant) beam particle

References isIgnored().

Referenced by compare(), and isPrimary().

◆ isIgnored()

bool Rivet::PrimaryParticles::isIgnored ( const HepMC::GenParticle *  p) const
protectedvirtual

Check if the particle should be ignored by the status code of the particle.

Referenced by compare(), isBeam(), and isPrimary().

◆ isPrimary()

bool Rivet::PrimaryParticles::isPrimary ( const HepMC::GenParticle *  p) const
protectedvirtual

Check if the particle is a priamry.

Parameters
pPointer to a HepMC particle
Returns
true if the particle p is considered primary

References isBeam(), isIgnored(), and isPrimaryPID().

Referenced by compare(), and project().

◆ isPrimaryPID()

bool Rivet::PrimaryParticles::isPrimaryPID ( const HepMC::GenParticle *  p) const
protectedvirtual

Check PDG ID of particle p is in the list of accepted primaries.

Parameters
pParticle to investigate.
Returns
true if the particle PDG ID is in the list of known primary PDG IDs.

Reimplemented in Rivet::ALICE::PrimaryParticles.

References Rivet::pid().

Referenced by compare(), and isPrimary().

◆ project()

void Rivet::PrimaryParticles::project ( const Event e)
protectedvirtual

Do the projection.

Parameters
eEvent to project from

Implements Rivet::ParticleFinder.

References Rivet::Event::genEvent(), isPrimary(), Rivet::Cuts::open(), and Rivet::particles().

Referenced by compare().


The documentation for this class was generated from the following files: