Event Class Reference
Detailed DescriptionRivet wrapper for HepMC event and Projection references. 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
Constructor from a HepMC GenEvent pointer. Definition at line 29 of file Event.hh. : _genevent_original(ge), _genevent(*ge) { assert(ge); _init(*ge); }
Constructor from a HepMC GenEvent reference
Definition at line 35 of file Event.hh. : _genevent_original(&ge), _genevent(ge) { _init(ge); } Copy constructor. Definition at line 40 of file Event.hh. : _genevent_original(e._genevent_original), _genevent(e._genevent) { } Member Function Documentation
Actual (shared) implementation of the constructors from GenEvents.
Definition at line 24 of file Event.cc. { // Use Rivet's preferred units if possible #ifdef HEPMC_HAS_UNITS _genevent.use_units(HepMC::Units::GEV, HepMC::Units::MM); #endif // Use the conventional alignment // _geNormAlignment(); /// @todo Filter the event to remove generator-specific particles: optional /// behaviour? Maybe disableable in an inconvenient way, e.g. with an env /// var, to communicate the appropriate distaste for this sort of truth /// analysis ;-) // Debug printout to check that copying/mangling has worked /// @todo Enable this when HepMC has been fixed to allow printing to a stream like the Rivet logger. //_genevent.print(); }
All the raw GenEvent particles, wrapped in Rivet::Particle objects. Definition at line 99 of file Event.cc. { if (_particles.empty()) { //< assume that empty means no attempt yet made for (const GenParticle* gp : particles(genEvent())) { _particles += Particle(gp); } } return _particles; }
All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a Cut applied.
Definition at line 74 of file Event.hh. { return filter_select(allParticles(), c); }
All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a selection function applied.
Definition at line 82 of file Event.hh. { return filter_select(allParticles(), f); }
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. Definition at line 106 of file Event.hh. { const Projection* cpp(&p); std::set<const Projection*>::const_iterator old = _projections.find(cpp); if (old != _projections.end()) { const Projection& pRef = **old; return pcast<PROJ>(pRef); } // Add the projection via the Projection base class (only // possible because Event is a friend of Projection) Projection* pp = const_cast<Projection*>(cpp); pp->project(*this); _projections.insert(pp); return p; }
Add a projection p to this Event by pointer. Definition at line 123 of file Event.hh. { if (!pp) throw Error("Event::applyProjection(PROJ*): Projection pointer is null."); return applyProjection(*pp); }
Get the beam centre-of-mass energy per nucleon. Definition at line 16 of file Event.cc. { return Rivet::asqrtS(beams()); }
Get the beam centre-of-mass energy. Definition at line 14 of file Event.cc. { return Rivet::sqrtS(beams()); }
Member Data Documentation
The GenEvent used by Rivet analysis projections etc. This version may be rotated to a "normal" alignment, have generator-specific particles stripped out, etc. If an analysis is affected by these modifications, it is probably an unphysical analysis! Stored as a non-pointer since it may get overwritten, and memory for copying and cleanup is neater this way.
All the GenEvent particles, wrapped as Rivet::Particles
The set of Projection objects applied so far. The documentation for this class was generated from the following files: Generated on Tue Dec 13 2016 16:32:46 for The Rivet MC analysis system by ![]() |