rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
Rivet::Event Class Reference

Representation of a HepMC event, and enabler of Projection caching. More...

#include <Event.hh>

Public Member Functions

Constructors and destructors.
 Event (GenEvent *ge, const vector< size_t > &weightindices={})
 
 Event (GenEvent &ge, const vector< size_t > &weightindices={})
 
 Event (const Event &e)
 Copy constructor.
 
Major event properties
const GenEvent & hepmcEvent () const
 The generated HepMC event obtained from an external event generator.
 
const GenEvent * hepmcEventPtr () const
 The generated HepMC event pointer obtained from an external event generator.
 
const GenEvent * genEvent () const
 The generated HepMC event pointer obtained from an external event generator.
 
ParticlePair beams () const
 Get the beam particles.
 
double sqrtS () const
 Get the beam centre-of-mass energy.
 
double asqrtS () const
 Get the beam centre-of-mass energy per nucleon.
 
Access to event particles
const ParticlesallParticles () const
 All the raw GenEvent particles, wrapped in Rivet::Particle objects.
 
Particles allParticles (const Cut &c) const
 All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a Cut applied.
 
template<typename FN >
Particles allParticles (const FN &f) const
 All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a selection function applied.
 
std::valarray< double > weights () const
 The generation weights associated with the event.
 
std::vector< std::pair< double, double > > crossSections () const
 The generation cross-sections associated with the event.
 
Projection running
template<typename PROJ >
const PROJ & applyProjection (PROJ &p) const
 Add a projection p to this Event.
 
template<typename PROJ >
const PROJ & applyProjection (PROJ *pp) const
 Add a projection p to this Event by pointer.
 

Detailed Description

Representation of a HepMC event, and enabler of Projection caching.

Event is a concrete class representing an generated event in Rivet. It is constructed given a HepMC::GenEvent, a pointer to which is kept by the Event object throughout its lifetime. The user must therefore make sure that the corresponding HepMC::GenEvent will persist at least as long as the Event object.

In addition to the HepMC::GenEvent object the Event also keeps track of all Projection objects which have been applied to the Event so far.

Constructor & Destructor Documentation

◆ Event() [1/2]

Rivet::Event::Event ( GenEvent *  ge,
const vector< size_t > &  weightindices = {} 
)
inline

Constructor from a HepMC GenEvent pointer

Note
Although Rivet is an analysis system and should not modify the physics of provided events, it needs to ensure that the events are "sane" for analysis purposes, including fixing units and potentially orientations and unphysical graph structures. The passed event pointer is hence not const.

◆ Event() [2/2]

Rivet::Event::Event ( GenEvent &  ge,
const vector< size_t > &  weightindices = {} 
)
inline

Constructor from a HepMC GenEvent reference

Note
See the pointer-based constructor for discussion of the non-constness of the passed GenEvent.
Deprecated:
HepMC uses pointers, so we should talk to HepMC via pointers: no need to duplicate.

Member Function Documentation

◆ allParticles() [1/2]

Particles Rivet::Event::allParticles ( const Cut &  c) const
inline

All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a Cut applied.

Note
Due to the cut, this returns by value, i.e. involves an expensive copy

References allParticles(), and Rivet::select().

◆ allParticles() [2/2]

template<typename FN >
Particles Rivet::Event::allParticles ( const FN &  f) const
inline

All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a selection function applied.

Note
Due to the cut, this returns by value, i.e. involves an expensive copy

References allParticles(), and Rivet::select().

◆ applyProjection()

template<typename PROJ >
const PROJ & Rivet::Event::applyProjection ( PROJ &  p) const
inline

Add a projection p to this Event.

If an equivalent Projection has been applied before, the Projection::project(const Event&) of p is not called and a reference to the previous equivalent projection is returned. If no previous Projection was found, the Projection::project(const Event&) of p is called and a reference to p is returned.

Todo:
Can make this non-templated, since only cares about ptr to Projection base class
Note
Comparisons here are by direct pointer comparison, because equivalence is guaranteed if pointers are equal, and inequivalence guaranteed if they aren't, thanks to the ProjectionHandler registry
Note
Currently using reint cast to integer type to bypass operator==(Proj*, Proj*)

References Rivet::getEnvParam(), MSG_TRACE, and Rivet::Projection::project().

Referenced by applyProjection().

◆ genEvent()

const GenEvent * Rivet::Event::genEvent ( ) const
inline

The generated HepMC event pointer obtained from an external event generator.

Backward-compatibility alias for hepmcEventPtr()


The documentation for this class was generated from the following file:
  • /Users/chrisg/software/rivet/include/Rivet/Event.hh