class Rivet::Event

Rivet::Event

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

#include <Event.hh>

Public Functions

Name
Event(const GenEvent * ge, const vector< size_t > & indices ={}, bool strip =false)
Constructor from a HepMC GenEvent pointer.
Event(const GenEvent & ge, const vector< size_t > & indices ={}, bool strip =false)
Event(const Event & e)
Copy constructor.
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.
ParticlePairbeams() const
Get the beam particles.
doublesqrtS() const
Get the beam centre-of-mass energy.
doubleasqrtS() const
Get the beam centre-of-mass energy per nucleon.
const Particles &allParticles() const
All the raw GenEvent particles, wrapped in Rivet::Particle objects.
ParticlesallParticles(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.
doubleweight() const
Obsolete weight method. Always returns 1 now.
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

class Rivet::Event;

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.

Public Functions Documentation

function Event

inline Event(
    const GenEvent * ge,
    const vector< size_t > & indices ={},
    bool strip =false
)

Constructor from a HepMC GenEvent pointer.

function Event

inline Event(
    const GenEvent & ge,
    const vector< size_t > & indices ={},
    bool strip =false
)

Deprecated:

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

Constructor from a HepMC GenEvent reference

function Event

inline Event(
    const Event & e
)

Copy constructor.

function genEvent

inline const GenEvent * genEvent() const

The generated event obtained from an external event generator.

function originalGenEvent

inline const GenEvent * originalGenEvent() const

The generated event obtained from an external event generator.

function beams

ParticlePair beams() const

Get the beam particles.

function sqrtS

double sqrtS() const

Get the beam centre-of-mass energy.

function asqrtS

double asqrtS() const

Get the beam centre-of-mass energy per nucleon.

function allParticles

const Particles & allParticles() const

All the raw GenEvent particles, wrapped in Rivet::Particle objects.

function allParticles

inline Particles allParticles(
    const Cut & c
) const

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

function allParticles

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

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

function weights

std::valarray< double > weights() const

The generation weights associated with the event.

function crossSections

std::vector< std::pair< double, double > > crossSections() const

The generation cross-sections associated with the event.

function weight

inline double weight() const

Obsolete weight method. Always returns 1 now.

function applyProjection

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

Add a projection p to this Event.

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

Todo: Can make this non-templated, since only cares about ptr to Projection base class

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.

Currently using reint cast to integer type to bypass operator==(Proj*, Proj*)

function applyProjection

template <typename PROJ >
inline const PROJ & applyProjection(
    PROJ * pp
) const

Add a projection p to this Event by pointer.


Updated on 2022-08-07 at 20:17:16 +0100