Rivet API documentation
![]() |
Rivet 4.1.3
|
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 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. | |
| 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]
|
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.
Referenced by Event().
◆ Event() [2/2]
|
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]
|
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]
|
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()
|
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, Rivet::Kin::p(), and Rivet::Projection::project().
Referenced by applyProjection().
◆ crossSections()
| std::vector< std::pair< double, double > > Rivet::Event::crossSections | ( | ) | const |
The generation cross-sections associated with the event.
This vector contains only the cross-sections selected by the AnalysisHandler, so is of constant length for all events.
- Note
- Excluded cross-sections, and their associated names if set, can be accessed via the GenEvent pointer hepmcEventPtr().
◆ genEvent()
|
inline |
The generated HepMC event pointer obtained from an external event generator.
Backward-compatibility alias for hepmcEventPtr()
◆ weights()
| std::valarray< double > Rivet::Event::weights | ( | ) | const |
The generation weights associated with the event.
This vector contains only the weights selected by the AnalysisHandler, so is of constant length for all events.
- Note
- Excluded generation weights, and their associated weight names if set, can be accessed via the GenEvent pointer hepmcEventPtr().
Referenced by Rivet::EventMixingBase::project().
The documentation for this class was generated from the following file:
- /builds/hepcedar/rivet/include/Rivet/Event.hh
Generated on for Rivet by
