class Rivet::PrimaryParticles
Rivet::PrimaryParticles
Project out primary particles according to definition. More…
#include <PrimaryParticles.hh>
Inherits from Rivet::ParticleFinder, Rivet::Projection, Rivet::ProjectionApplier
Inherited by Rivet::ALICE::PrimaryParticles
Public Types
Name | |
---|---|
typedef Particle | entity_type |
typedef Particles | collection_type |
Public Functions
Name | |
---|---|
virtual unique_ptr< Projection > | clone() 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 | particles(const Cut & c) const Get the particles with selection cuts. |
Particles | particles(const ParticleSelector & selector) const Get the particles with selection cuts via a functor. |
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 | rawParticles() 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. |
virtual std::string | name() const Get the name of the projection. |
bool | valid() const Get the state of the projetion. |
bool | failed() const Get the state of the projetion. |
bool | before(const Projection & p) const |
virtual const std::set< PdgIdPair > | beamPairs() const |
Projection & | addPdgIdPair(PdgId beam1, PdgId beam2) |
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 |
const Projection & | getProjection(const std::string & name) const |
template <typename PROJ > const PROJ & | get(const std::string & name) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | applyProjection(const Event & evt, const Projection & proj) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | applyProjection(const Event & evt, const PROJ & proj) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | applyProjection(const Event & evt, const std::string & name) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const Event & evt, const Projection & proj) const Apply the supplied projection on event evt (user-facing alias). |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const Event & evt, const PROJ & proj) const Apply the supplied projection on event evt (user-facing alias). |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const Event & evt, const std::string & name) const Apply the supplied projection on event evt (user-facing alias). |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const std::string & name, const Event & evt) const Apply the supplied projection on event evt (convenience arg-reordering alias). |
void | markAsOwned() const Mark this object as owned by a proj-handler. |
PrimaryParticles(std::initializer_list< int > pids, const Cut & c =Cuts::open()) | |
DEFAULT_RIVET_PROJ_CLONE(PrimaryParticles ) | |
PrimaryParticles(const PrimaryParticles & other) Copy constructor. | |
virtual CmpState | compare(const Projection & p) const |
Protected Functions
Name | |
---|---|
Log & | getLog() 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. |
void | fail() Set the projection in an unvalid state. |
Cmp< Projection > | mkNamedPCmp(const Projection & otherparent, const std::string & pname) const |
Cmp< Projection > | mkPCmp(const Projection & otherparent, const std::string & pname) const |
ProjectionHandler & | getProjHandler() const Get a reference to the ProjectionHandler for this thread. |
virtual bool | isPrimary(ConstGenParticlePtr p) const |
virtual bool | isIgnored(ConstGenParticlePtr p) const Check if the particle should be ignored, via its status code. |
virtual bool | isPrimaryPID(ConstGenParticlePtr p) const |
virtual bool | hasDecayed(ConstGenParticlePtr p) const |
virtual bool | isBeam(ConstGenParticlePtr p) const |
ConstGenParticlePtr | ancestor(ConstGenParticlePtr p) const |
ConstGenParticlePtr | ancestor(ConstGenParticlePtr p, bool ) const |
template <typename PROJ > const PROJ & | declareProjection(const PROJ & proj, const std::string & name) Register a contained projection. |
template <typename PROJ > const PROJ & | declare(const PROJ & proj, const std::string & name) Register a contained projection (user-facing version) |
template <typename PROJ > const PROJ & | declare(const std::string & name, const PROJ & proj) Register a contained projection (user-facing, arg-reordered version) |
virtual void | project(const Event & e) |
Additional inherited members
Public Functions inherited from Rivet::ParticleFinder
Name | |
---|---|
ParticleFinder(const Cut & c =Cuts::OPEN) Construction using Cuts object. | |
virtual | ~ParticleFinder() Virtual destructor for inheritance. |
Public Functions inherited from Rivet::Projection
Name | |
---|---|
Projection() The default constructor. | |
virtual | ~Projection() The destructor. |
Protected Functions inherited from Rivet::Projection
Name | |
---|---|
virtual Projection & | operator=(const Projection & ) Block Projection copying. |
Friends inherited from Rivet::Projection
Name | |
---|---|
class | Event Event is a friend. |
class | Cmp< Projection > The Cmp specialization for Projection is a friend. |
Public Functions inherited from Rivet::ProjectionApplier
Name | |
---|---|
ProjectionApplier() Constructor. | |
virtual | ~ProjectionApplier() |
Detailed Description
class Rivet::PrimaryParticles;
Project out primary particles according to definition.
Author: Christian Holm Christensen cholm@nbi.dk
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.
Public Types Documentation
typedef entity_type
typedef Particle Rivet::ParticleFinder::entity_type;
typedef collection_type
typedef Particles Rivet::ParticleFinder::collection_type;
Public Functions Documentation
function clone
virtual unique_ptr< Projection > clone() const =0
Clone on the heap.
Reimplements: Rivet::Beam::clone
Reimplemented by: Rivet::ALICE::PrimaryParticles::clone
function size
inline size_t size() const
Count the final-state particles.
function size
inline size_t size(
const Cut & c
) const
Count the final-state particles after a Cut is applied.
function size
inline size_t size(
const ParticleSelector & s
) const
Count the final-state particles after a selection functor is applied.
function empty
inline bool empty() const
Is this final state empty?
function empty
inline bool empty(
const Cut & c
) const
Is this final state empty after a Cut is applied?
function empty
inline bool empty(
const ParticleSelector & s
) const
Is this final state empty after a selection functor is applied?
function particles
inline virtual const Particles & particles() const
Get the particles in no particular order, with no cuts.
function particles
inline Particles particles(
const Cut & c
) const
Get the particles with selection cuts.
Note: Returns a copy rather than a reference, due to the cuts.
function particles
inline Particles particles(
const ParticleSelector & selector
) const
Get the particles with selection cuts via a functor.
Note: Returns a copy rather than a reference, due to the cuts.
function particles
inline Particles particles(
const ParticleSorter & sorter,
const Cut & c =Cuts::open()
) const
Note: Returns a copy rather than a reference, due to cuts and sorting.
Get the particles, ordered by supplied sorting function object
function particles
inline Particles particles(
const Cut & c,
const ParticleSorter & sorter
) const
Note: Returns a copy rather than a reference, due to cuts and sorting.
Get the particles, ordered by supplied sorting function object
function particles
inline Particles particles(
const ParticleSelector & selector,
const ParticleSorter & sorter
) const
Note: Returns a copy rather than a reference, due to cuts and sorting.
Get the particles, ordered by a sorting functor and filtered by a selection functor
function particles
inline Particles particles(
const ParticleSorter & sorter,
const ParticleSelector & selector
) const
Note: Returns a copy rather than a reference, due to cuts and sorting.
Get the particles, ordered by a sorting functor and filtered by a selection functor
function rawParticles
inline Particles rawParticles() const
Note: Raw particles are the final-state constituents, as opposed to potentially composite particles returned as the finder’s particles()
Get the raw particles in no particular order, with no cuts
function particlesByPt
inline Particles particlesByPt(
const Cut & c =Cuts::open()
) const
Get the particles, ordered by decreasing ( p_T ) and with optional cuts
This is a very common use-case, so is available as syntatic sugar for particles(c, cmpMomByPt).
function particlesByPt
inline Particles particlesByPt(
const ParticleSelector & selector
) const
Get the particles, ordered by decreasing ( p_T ) and with optional cuts
This is a very common use-case, so is available as syntatic sugar for particles(f, cmpMomByPt).
function particlesByPt
inline Particles particlesByPt(
double ptmin
) const
Get the particles, ordered by decreasing ( p_T ) and with a cut on minimum ( p_T )
This is a very common use-case, so is available as syntatic sugar for particles(Cuts::pT >= ptmin, cmpMomByPt).
function entities
inline const collection_type & entities() const
Template-usable interface common to JetAlg.
function name
inline virtual std::string name() const
Get the name of the projection.
Reimplements: Rivet::ProjectionApplier::name
function valid
inline bool valid() const
Get the state of the projetion.
function failed
inline bool failed() const
Get the state of the projetion.
function before
bool before(
const Projection & p
) const
Determine whether this object should be ordered before the object p given as argument. If p is of a different class than this, the before() function of the corresponding type_info objects is used. Otherwise, if the objects are of the same class, the virtual compare(const Projection &) will be returned.
function beamPairs
virtual const std::set< PdgIdPair > beamPairs() const
Todo: Remove the beam constraints system from projections.
Return the allowed beam pairs on which this projection can operate, not including recursion. Derived classes should ensure that all contained projections are registered in the _projections set for the beam constraint chaining to work.
function addPdgIdPair
inline Projection & addPdgIdPair(
PdgId beam1,
PdgId beam2
)
Todo: This deserves a better name!
Add a colliding beam pair.
function getProjections
inline std::set< ConstProjectionPtr > getProjections() const
Get the contained projections, including recursion.
function hasProjection
inline bool hasProjection(
const std::string & name
) const
Does this applier have a projection registered under the name name?
function getProjection
template <typename PROJ >
inline const PROJ & getProjection(
const std::string & name
) const
Todo: Add SFINAE to require that PROJ inherit from Projection
Get the named projection, specifying return type via a template argument.
function getProjection
inline const Projection & getProjection(
const std::string & name
) const
Get the named projection (non-templated, so returns as a reference to a Projection base class).
function get
template <typename PROJ >
inline const PROJ & get(
const std::string & name
) const
Todo: Add SFINAE to require that PROJ inherit from Projection
Get the named projection, specifying return type via a template argument (user-facing alias).
function applyProjection
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > applyProjection(
const Event & evt,
const Projection & proj
) const
Deprecated:
Prefer the simpler apply<> form
Apply the supplied projection on event evt.
function applyProjection
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > applyProjection(
const Event & evt,
const PROJ & proj
) const
Deprecated:
Prefer the simpler apply<> form
Apply the supplied projection on event evt.
function applyProjection
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > applyProjection(
const Event & evt,
const std::string & name
) const
Deprecated:
Prefer the simpler apply<> form
Apply the named projection on event evt.
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const Event & evt,
const Projection & proj
) const
Apply the supplied projection on event evt (user-facing alias).
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const Event & evt,
const PROJ & proj
) const
Apply the supplied projection on event evt (user-facing alias).
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const Event & evt,
const std::string & name
) const
Apply the supplied projection on event evt (user-facing alias).
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const std::string & name,
const Event & evt
) const
Apply the supplied projection on event evt (convenience arg-reordering alias).
function markAsOwned
inline void markAsOwned() const
Mark this object as owned by a proj-handler.
function PrimaryParticles
inline PrimaryParticles(
std::initializer_list< int > pids,
const Cut & c =Cuts::open()
)
Parameters:
- pids List of PDG IDs which are considered primary
- c Normal particle cuts
Constructor
function DEFAULT_RIVET_PROJ_CLONE
DEFAULT_RIVET_PROJ_CLONE(
PrimaryParticles
)
function PrimaryParticles
inline PrimaryParticles(
const PrimaryParticles & other
)
Copy constructor.
function compare
inline virtual CmpState compare(
const Projection & p
) const
Parameters:
- p Projection to compare to.
Return: Equivalent if the projection p is of the same type as this, the cuts are equal, and the list of PDG IDs is the same.
Reimplements: Rivet::ParticleFinder::compare
Reimplemented by: Rivet::ALICE::PrimaryParticles::compare
Compare to another projection
Protected Functions Documentation
function getLog
inline Log & getLog() const
Get a Log object based on the getName() property of the calling projection object.
function setName
inline void setName(
const std::string & name
)
Used by derived classes to set their name.
function fail
inline void fail()
Set the projection in an unvalid state.
function mkNamedPCmp
Cmp< Projection > mkNamedPCmp(
const Projection & otherparent,
const std::string & pname
) const
Shortcut to make a named Cmp*this
object automatically passed as one of the parent projections.
function mkPCmp
Cmp< Projection > mkPCmp(
const Projection & otherparent,
const std::string & pname
) const
Note: Alias for mkNamedPCmp
Shortcut to make a named Cmp*this
object automatically passed as one of the parent projections.
function getProjHandler
inline ProjectionHandler & getProjHandler() const
Get a reference to the ProjectionHandler for this thread.
function isPrimary
virtual bool isPrimary(
ConstGenParticlePtr p
) const
function isIgnored
virtual bool isIgnored(
ConstGenParticlePtr p
) const
Check if the particle should be ignored, via its status code.
function isPrimaryPID
virtual bool isPrimaryPID(
ConstGenParticlePtr p
) const
Parameters:
- p Particle to investigate.
Return: true if the particle PDG ID is in the list of known primary PDG IDs.
Reimplemented by: Rivet::ALICE::PrimaryParticles::isPrimaryPID
Check PDG ID of particle p is in the list of accepted primaries
function hasDecayed
virtual bool hasDecayed(
ConstGenParticlePtr p
) const
Parameters:
- p Pointer to HepMC particle
Return: true if the particle has decayed according to the status flag of the particle p
Check if a particle p has decayed.
function isBeam
virtual bool isBeam(
ConstGenParticlePtr p
) const
Parameters:
- p Particle to check
Return: true if the particle p is a (remnant) beam particle
Check if a particle is a beam (remnant) particle.
function ancestor
ConstGenParticlePtr ancestor(
ConstGenParticlePtr p
) const
Parameters:
- p Particle for which to get the immediate ancestor
Return: Pointer to immediate ancestor or null if there’s no ancestor.
Get the immediate ancestor of a particle.
function ancestor
ConstGenParticlePtr ancestor(
ConstGenParticlePtr p,
bool
) const
Parameters:
- p Particle for which to get the immediate ancestor
Return: Pointer to immediate ancestor or null if there’s no ancestor.
Get the immediate ancestor of a particle, which is not an ignored particle.
function declareProjection
template <typename PROJ >
inline const PROJ & declareProjection(
const PROJ & proj,
const std::string & name
)
Register a contained projection.
Todo: Add SFINAE to require that PROJ inherit from Projection
The type of the argument is used to instantiate a new projection internally: this new object is applied to events rather than the argument object. Hence you are advised to only use locally-scoped Projection objects in your Projection and Analysis constructors, and to avoid polymorphism (e.g. handling ConcreteProjection
via a pointer or reference to type Projection
) since this will screw up the internal type management.
function declare
template <typename PROJ >
inline const PROJ & declare(
const PROJ & proj,
const std::string & name
)
Register a contained projection (user-facing version)
Todo: Add SFINAE to require that PROJ inherit from Projection
function declare
template <typename PROJ >
inline const PROJ & declare(
const std::string & name,
const PROJ & proj
)
Register a contained projection (user-facing, arg-reordered version)
Todo: Add SFINAE to require that PROJ inherit from Projection
function project
virtual void project(
const Event & e
)
Parameters:
- e Event to project from
Reimplements: Rivet::ParticleFinder::project
Do the projection.
Updated on 2022-08-07 at 20:17:17 +0100