#include <Event.hh>
In addition to the HepMC::GenEvent object the Event also keeps track of all Projections object which have been applied to the Event so far.
Definition at line 20 of file Event.hh.
Public Member Functions | |
const GenEvent & | genEvent () const |
Return the generated event obtained from an external event generator. | |
double | weight () const |
The weight associated with the event. | |
template<typename PROJ> | |
const PROJ & | applyProjection (PROJ &p) const |
template<typename PROJ> | |
const PROJ & | applyProjection (PROJ *pp) const |
Standard constructors and destructors. | |
Event (const GenEvent &ge) | |
The default constructor. | |
Event (const Event &e) | |
The copy constructor. | |
Event & | operator= (const Event &e) |
Copy assignment operator. | |
Private Attributes | |
GenEvent | _genEvent |
The generated event, obtained from an external generator. Note that it is only externally accessible via a const reference. | |
std::set< ConstProjectionPtr > | _projections |
The set of Projection objects applied so far. | |
double | _weight |
The generation weight associated with the event. Usually 1.0. Only copied from the HepMC event once, at construction time. |
Event | ( | const GenEvent & | ge | ) |
The default constructor.
Definition at line 74 of file Event.cc.
References Event::_genEvent, Rivet::_geNormAlignment(), Rivet::_geNormUnits(), and Event::_weight.
00075 : _genEvent(ge), _weight(1.0) 00076 { 00077 // Set the weight if there is one, otherwise default to 1.0 00078 if (!_genEvent.weights().empty()) { 00079 _weight = ge.weights()[0]; 00080 } 00081 00082 // Use Rivet's preferred units if possible 00083 _geNormUnits(_genEvent); 00084 00085 // Use the conventional alignment 00086 _geNormAlignment(_genEvent); 00087 00088 // Debug printout to check that copying/magling has worked 00089 //_genEvent.print(); 00090 }
Copy assignment operator.
Definition at line 101 of file Event.cc.
References Event::_genEvent, and Event::_weight.
const GenEvent& genEvent | ( | ) | const [inline] |
Return the generated event obtained from an external event generator.
Definition at line 42 of file Event.hh.
References Event::_genEvent.
Referenced by UnstableFinalState::project(), PVertex::project(), InitialQuarks::project(), FinalState::project(), and Beam::project().
00042 { 00043 return _genEvent; 00044 }
double weight | ( | ) | const [inline] |
The weight associated with the event.
Definition at line 47 of file Event.hh.
References Event::_weight.
Referenced by MC_JetAnalysis::analyze(), JADE_OPAL_2000_S4300807::analyze(), D0_2010_S8566488::analyze(), D0_2009_S8320160::analyze(), D0_2009_S8202443::analyze(), D0_2008_S7863608::analyze(), D0_2008_S7554427::analyze(), D0_2007_S7075677::analyze(), CDF_2008_S8093652::analyze(), BELLE_2006_S6265367::analyze(), and ALEPH_2004_S5765862::analyze().
00047 { 00048 return _weight; 00049 }
const PROJ& 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.
Definition at line 61 of file Event.hh.
References Event::_projections, and Projection::project().
Referenced by ProjectionApplier::_applyProjection(), and Event::applyProjection().
00061 { 00062 const Projection* cpp(&p); 00063 std::set<const Projection*>::const_iterator old = _projections.find(cpp); 00064 if (old != _projections.end()) { 00065 const Projection& pRef = **old; 00066 return pcast<PROJ>(pRef); 00067 } 00068 // Add the projection via the Projection base class (only 00069 // possible because Event is a friend of Projection) 00070 Projection* pp = const_cast<Projection*>(cpp); 00071 pp->project(*this); 00072 _projections.insert(pp); 00073 return p; 00074 }
const PROJ& applyProjection | ( | PROJ * | pp | ) | const [inline] |
Definition at line 78 of file Event.hh.
References Event::applyProjection().
00078 { 00079 if (!pp) throw Error("Event::applyProjection(PROJ*): Projection pointer is null."); 00080 return applyProjection(*pp); 00081 }
GenEvent _genEvent [private] |
The generated event, obtained from an external generator. Note that it is only externally accessible via a const reference.
Definition at line 88 of file Event.hh.
Referenced by Event::Event(), Event::genEvent(), and Event::operator=().
std::set<ConstProjectionPtr> _projections [mutable, private] |
The set of Projection objects applied so far.
Definition at line 91 of file Event.hh.
Referenced by Event::applyProjection().
double _weight [private] |
The generation weight associated with the event. Usually 1.0. Only copied from the HepMC event once, at construction time.
Definition at line 95 of file Event.hh.
Referenced by Event::Event(), Event::operator=(), and Event::weight().