Event Class Reference
Collaboration diagram for Event:
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 Projections object which have been applied to the Event so far. Constructor & Destructor Documentation
Constructor from a HepMC GenEvent reference. Definition at line 29 of file Event.hh. References Event::_init(). : _originalGenEvent(&ge), _genEvent(ge) { _init(ge); }
Constructor from a HepMC GenEvent pointer. Definition at line 34 of file Event.hh. References Event::_init(). : _originalGenEvent(ge), _genEvent(*ge) { assert(ge); _init(*ge); } Copy constructor. Definition at line 39 of file Event.hh. : _originalGenEvent(e._originalGenEvent), _genEvent(e._genEvent) { } Member Function Documentation
Convert the GenEvent to use conventional alignment. For example, FHerwig only produces DIS events in the unconventional hadron-lepton orientation and has to be corrected for DIS analysis portability.
Definition at line 48 of file Event.cc. References Event::_genEvent, Log::getLog(), Rivet::GeV, Log::isActive(), Rivet::PID::PROTON, and Log::TRACE. Referenced by Event::_init(). { if (!_genEvent.valid_beam_particles()) return; typedef pair<HepMC::GenParticle*, HepMC::GenParticle*> GPPair; GPPair bps = _genEvent.beam_particles(); // Rotate e+- p and ppbar to put p along +z /// @todo Is there an e+ e- convention for longitudinal boosting, e.g. at B-factories? Different from LEP? // if (compatible(beamids, make_pdgid_pair(ELECTRON, PROTON)) || // compatible(beamids, make_pdgid_pair(POSITRON, PROTON)) || // compatible(beamids, make_pdgid_pair(ANTIPROTON, PROTON)) ) { // Log::getLog("Rivet.Event") << Log::TRACE << "May need to rotate event..." << endl; bool rot = false; const HepMC::GenParticle* plusgp = 0; if (bps.first->pdg_id() != PID::PROTON || bps.second->pdg_id() != PID::PROTON) { if (bps.first->pdg_id() == PID::PROTON) { plusgp = bps.first; } else if (bps.second->pdg_id() == PID::PROTON) { plusgp = bps.second; } if (plusgp && plusgp->momentum().pz() < 0) { rot = true; } } // Do the rotation if (rot) { if (Log::getLog("Rivet.Event").isActive(Log::TRACE)) { Log::getLog("Rivet.Event") << Log::TRACE << "Rotating event\n" << "Before rotation: " << bps.first->pdg_id() << "@pz=" << bps.first->momentum().pz()/GeV << ", " << bps.second->pdg_id() << "@pz=" << bps.second->momentum().pz()/GeV << endl; } _geRot180x(_genEvent); } }
Actual (shared) implementation of the constructors from GenEvents.
Definition at line 10 of file Event.cc. References Event::_genEvent, and Event::_geNormAlignment(). Referenced by Event::Event(). { // 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(); }
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 72 of file Event.hh. References Event::_projections, and Projection::project(). Referenced by ProjectionApplier::_applyProjection(), and Event::applyProjection(). { 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; }
Definition at line 89 of file Event.hh. References Event::applyProjection(). { if (!pp) throw Error("Event::applyProjection(PROJ*): Projection pointer is null."); return applyProjection(*pp); }
The generated event obtained from an external event generator. Definition at line 49 of file Event.hh. References Event::_genEvent. Referenced by ATLAS_2012_I1118269::analyze(), LHCB_2010_I867355::analyze(), CMS_2011_S8941262::analyze(), MC_PDFS::analyze(), MC_IDENTIFIED::analyze(), InitialQuarks::project(), UnstableFinalState::project(), Beam::project(), and FinalState::project(). { return &_genEvent; }
The generation weight associated with the event.
Definition at line 57 of file Event.hh. References Event::_genEvent. Referenced by BABAR_2003_I593379::analyze(), BABAR_2005_S6181155::analyze(), BABAR_2007_S6895344::analyze(), BELLE_2001_S4598261::analyze(), BELLE_2006_S6265367::analyze(), CLEO_2004_S5809304::analyze(), ARGUS_1993_S2653028::analyze(), MC_JetSplittings::analyze(), MC_JetAnalysis::analyze(), OPAL_1993_S2692198::analyze(), ARGUS_1993_S2669951::analyze(), CDF_2008_S8093652::analyze(), D0_2007_S7075677::analyze(), D0_2010_S8671338::analyze(), D0_2008_S7554427::analyze(), MC_XS::analyze(), MC_WJETS::analyze(), ATLAS_2011_S9035664::analyze(), ATLAS_2011_I930220::analyze(), MC_WINC::analyze(), D0_2010_S8566488::analyze(), D0_2008_S7863608::analyze(), D0_2009_S8320160::analyze(), ATLAS_2011_S9131140::analyze(), MC_ZZJETS::analyze(), MC_WWJETS::analyze(), D0_2009_S8202443::analyze(), CMS_2012_I941555::analyze(), JADE_OPAL_2000_S4300807::analyze(), ARGUS_1993_S2789213::analyze(), MC_WWINC::analyze(), ATLAS_2013_I1217867::analyze(), and ALEPH_2004_S5765862::analyze(). 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 much neater this way. Definition at line 126 of file Event.hh. Referenced by Event::_geNormAlignment(), Event::_init(), Event::genEvent(), and Event::weight().
The set of Projection objects applied so far. Definition at line 129 of file Event.hh. Referenced by Event::applyProjection(). The documentation for this class was generated from the following files: Generated on Thu Feb 6 2014 17:38:57 for The Rivet MC analysis system by 1.7.6.1 |