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
The default constructor. Definition at line 66 of file Event.cc. References Event::_genEvent, Event::_geNormAlignment(), Event::_modGenEvent, and Event::_weight. : _genEvent(ge), _modGenEvent(NULL), _weight(1.0) { // Set the weight if there is one, otherwise default to 1.0 if (!_genEvent.weights().empty()) { _weight = ge.weights()[0]; } // Use Rivet's preferred units if possible #ifdef HEPMC_HAS_UNITS if (_genEvent.momentum_unit() != HepMC::Units::GEV || _genEvent.length_unit() != HepMC::Units::MM) { if (!_modGenEvent) _modGenEvent = new GenEvent(ge); _modGenEvent->use_units(HepMC::Units::GEV, HepMC::Units::MM); } #endif // Use the conventional alignment _geNormAlignment(); // Debug printout to check that copying/mangling has worked //_genEvent.print(); } The copy constructor. Definition at line 91 of file Event.cc. : _genEvent(e._genEvent), _modGenEvent(e._modGenEvent), _weight(e._weight) { // }
The destructor. Definition at line 99 of file Event.cc. References Event::_modGenEvent. { if (_modGenEvent) delete _modGenEvent; } Member Function Documentation
Definition at line 26 of file Event.cc. References Event::_genEvent, Rivet::_geRot180x(), Event::_modGenEvent, Log::getLog(), Rivet::GeV, Log::isActive(), Rivet::PROTON, and Log::TRACE. Referenced by Event::Event(). { if (!_genEvent.valid_beam_particles()) return; typedef pair<HepMC::GenParticle*, HepMC::GenParticle*> GPPair; GPPair bps = _genEvent.beam_particles(); //const PdgIdPair beamids = make_pdgid_pair(bps.first->pdg_id(), bps.second->pdg_id()); //Log::getLog("Rivet.Event") << Log::TRACE << "Beam IDs: " << beamids << endl; const HepMC::GenParticle* plusgp = 0; bool rot = false; // Rotate e+- p and ppbar to put p along +z /// @todo e+ e- convention? 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; if (bps.first->pdg_id() != PROTON || bps.second->pdg_id() != PROTON) { if (bps.first->pdg_id() == PROTON) { plusgp = bps.first; } else if (bps.second->pdg_id() == 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" << endl; Log::getLog("Rivet.Event") << Log::TRACE << "Before rotation: " << bps.first->pdg_id() << "@pz=" << bps.first->momentum().pz()/GeV << ", " << bps.second->pdg_id() << "@pz=" << bps.second->momentum().pz()/GeV << endl; } if (!_modGenEvent) _modGenEvent = new GenEvent(_genEvent); _geRot180x(*_modGenEvent); } }
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 60 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 77 of file Event.hh. References Event::applyProjection(). { if (!pp) throw Error("Event::applyProjection(PROJ*): Projection pointer is null."); return applyProjection(*pp); }
Return the generated event obtained from an external event generator. Definition at line 103 of file Event.cc. References Event::_genEvent, and Event::_modGenEvent. Referenced by CMS_2011_S8941262::analyze(), MC_PDFS::analyze(), MC_IDENTIFIED::analyze(), InitialQuarks::project(), UnstableFinalState::project(), Beam::project(), and FinalState::project(). { if (_modGenEvent) return *_modGenEvent; return _genEvent; }
The weight associated with the event. Definition at line 46 of file Event.hh. References Event::_weight. Referenced by BABAR_2005_S6181155::analyze(), BABAR_2007_S6895344::analyze(), BELLE_2001_S4598261::analyze(), BELLE_2006_S6265367::analyze(), CLEO_2004_S5809304::analyze(), ARGUS_1993_S2653028::analyze(), ARGUS_1993_S2789213::analyze(), MC_JetAnalysis::analyze(), ARGUS_1993_S2669951::analyze(), OPAL_1993_S2692198::analyze(), CDF_2008_S8093652::analyze(), D0_2007_S7075677::analyze(), MC_XS::analyze(), D0_2010_S8671338::analyze(), D0_2008_S7554427::analyze(), D0_2010_S8566488::analyze(), D0_2009_S8320160::analyze(), ATLAS_2011_S9131140::analyze(), ATLAS_2011_I954993::analyze(), D0_2008_S7863608::analyze(), JADE_OPAL_2000_S4300807::analyze(), D0_2009_S8202443::analyze(), MC_ZZJETS::analyze(), MC_WWJETS::analyze(), and ALEPH_2004_S5765862::analyze(). { return _weight; } Member Data Documentation
The generated event, obtained from an external generator. Note that it is only externally accessible via a const reference. Definition at line 89 of file Event.hh. Referenced by Event::_geNormAlignment(), Event::Event(), and Event::genEvent().
Definition at line 91 of file Event.hh. Referenced by Event::_geNormAlignment(), Event::Event(), Event::genEvent(), and Event::~Event().
The set of Projection objects applied so far. Definition at line 94 of file Event.hh. Referenced by Event::applyProjection().
The generation weight associated with the event. Usually 1.0. Only copied from the HepMC event once, at construction time. Definition at line 98 of file Event.hh. Referenced by Event::Event(), and Event::weight(). The documentation for this class was generated from the following files: Generated on Fri Dec 21 2012 15:03:50 for The Rivet MC analysis system by ![]() |