rivet is hosted by Hepforge, IPPP Durham
Rivet  3.1.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 (const GenEvent *ge, bool strip=false)
 Constructor from a HepMC GenEvent pointer.
 
 Event (const GenEvent &ge, bool strip=false)
 
 Event (const Event &e)
 Copy constructor.
 
Major event properties
const GenEvent * genEvent () const
 The generated event obtained from an external event generator.
 
const GenEvent * originalGenEvent () const
 The generated event 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 Particles & allParticles () 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. More...
 
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. More...
 
std::valarray< double > weights () const
 The generation weight associated with the event. More...
 
double weight () const
 Obsolete weight method. Always returns 1 now.
 
Projection running
template<typename PROJ >
const PROJ & applyProjection (PROJ &p) const
 Add a projection p to this Event. More...
 
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()

Rivet::Event::Event ( const GenEvent &  ge,
bool  strip = false 
)
inline

Constructor from a HepMC GenEvent reference

Deprecated:
HepMC uses pointers, so we should talk to HepMC via pointers

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::filter_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(), Rivet::filter_select(), and weights().

◆ 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(), Rivet::Log::getLog(), and Rivet::Projection::project().

Referenced by applyProjection().

◆ weights()

std::valarray<double> Rivet::Event::weights ( ) const

The generation weight associated with the event.

Todo:
This needs to be revisited when we finally add the mechanism to support NLO counter-events and weight vectors.

Referenced by allParticles().


The documentation for this class was generated from the following file:
  • /home/andy/proj/hep/rivet-31x/include/Rivet/Event.hh