5 #include "Rivet/Config/RivetCommon.hh" 6 #include "Rivet/Particle.hh" 7 #include "Rivet/Projection.hh" 30 : _genevent_original(ge), _genevent(*ge)
31 { assert(ge); _init(*ge); }
36 : _genevent_original(&ge), _genevent(ge)
41 : _genevent_original(e._genevent_original), _genevent(e._genevent)
51 const GenEvent*
genEvent()
const {
return &_genevent; }
60 ParticlePair
beams()
const;
96 template <
typename FN>
114 template <
typename PROJ>
117 log << Log::TRACE <<
"Applying projection " << &p <<
" (" << p.name() <<
") -> comparing to projections " << _projections << endl;
120 std::set<const Projection*>::const_iterator old = _projections.find(cpp);
121 if (old != _projections.end()) {
122 log << Log::TRACE <<
"Equivalent projection found -> returning already-run projection " << *old << endl;
124 return pcast<PROJ>(pRef);
127 log << Log::TRACE <<
"No equivalent projection in the already-run list -> projecting now" << endl;
130 _projections.insert(pp);
136 template <
typename PROJ>
138 if (!pp)
throw Error(
"Event::applyProjection(PROJ*): Projection pointer is null.");
148 void _init(
const GenEvent& ge);
163 const GenEvent* _genevent_original;
174 mutable GenEvent _genevent;
178 mutable Particles _particles;
181 mutable std::set<ConstProjectionPtr> _projections;
Particles allParticles(const FN &f) const
All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a selection function app...
Definition: Event.hh:97
Definition: ALICE_2010_I880049.cc:13
double asqrtS() const
Get the beam centre-of-mass energy per nucleon.
Definition: Event.cc:35
Event(const GenEvent &ge)
Definition: Event.hh:35
Particles allParticles(const Cut &c) const
All the raw GenEvent particles, wrapped in Rivet::Particle objects, but with a Cut applied...
Definition: Event.hh:89
const PROJ & applyProjection(PROJ *pp) const
Add a projection p to this Event by pointer.
Definition: Event.hh:137
static Log & getLog(const std::string &name)
Definition: Logging.cc:55
ParticlePair beams() const
Get the beam particles.
Definition: Event.cc:31
const GenEvent * genEvent() const
The generated event obtained from an external event generator.
Definition: Event.hh:51
Generic runtime Rivet error.
Definition: Exceptions.hh:12
virtual void project(const Event &e)=0
double sqrtS() const
Get the beam centre-of-mass energy.
Definition: Event.cc:33
Jets filter_select(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Definition: JetUtils.hh:143
const PROJ & applyProjection(PROJ &p) const
Add a projection p to this Event.
Definition: Event.hh:115
Event(const Event &e)
Copy constructor.
Definition: Event.hh:40
double weight() const
The generation weight associated with the event.
Definition: Event.cc:11
Event(const GenEvent *ge)
Constructor from a HepMC GenEvent pointer.
Definition: Event.hh:29
double centrality() const
Get the generator centrality (impact-parameter quantile in [0,1]; or -1 if undefined (usual for non-H...
Definition: Event.cc:26
const Particles & allParticles() const
All the raw GenEvent particles, wrapped in Rivet::Particle objects.
Definition: Event.cc:47
Base class for all Rivet projections.
Definition: Projection.hh:29