FinalState.hh
// -*- C++ -*-
#ifndef RIVET_FinalState_HH
#define RIVET_FinalState_HH
#include "Rivet/Projection.hh"
#include "Rivet/Particle.hh"
#include "Rivet/Event.hh"
namespace Rivet {
class FinalState : public Projection {
public:
FinalState(double mineta = -MAXRAPIDITY,
double maxeta = MAXRAPIDITY,
double minpt = 0.0*GeV);
FinalState(const vector<pair<double, double> >& etaRanges,
double minpt = 0.0*GeV);
virtual const Projection* clone() const {
return new FinalState(*this);
}
virtual const ParticleVector& particles() const { return _theParticles; }
template <typename F>
const ParticleVector& particles(F sorter) const {
std::sort(_theParticles.begin(), _theParticles.end(), sorter);
return _theParticles;
}
const ParticleVector& particlesByPt() const {
return particles(cmpParticleByPt);
}
const ParticleVector& particlesByP() const {
return particles(cmpParticleByP);
}
const ParticleVector& particlesByE() const {
return particles(cmpParticleByE);
}
const ParticleVector& particlesByEt() const {
return particles(cmpParticleByEt);
}
const ParticleVector& particlesByEta() const {
return particles(cmpParticleByAscPseudorapidity);
}
const ParticleVector& particlesByModEta() const {
return particles(cmpParticleByAscAbsPseudorapidity);
}
const ParticleVector& particlesByRapidity() const {
return particles(cmpParticleByAscRapidity);
}
const ParticleVector& particlesByModRapidity() const {
return particles(cmpParticleByAscAbsRapidity);
}
virtual size_t size() const { return _theParticles.size(); }
virtual bool empty() const { return _theParticles.empty(); }
virtual bool isEmpty() const { return _theParticles.empty(); }
virtual double ptMin() const { return _ptmin; }
public:
typedef Particle entity_type;
typedef ParticleVector collection_type;
const collection_type& entities() const {
return particles();
}
protected:
virtual void project(const Event& e);
virtual int compare(const Projection& p) const;
bool accept(const Particle& p) const;
protected:
vector<pair<double,double> > _etaRanges;
double _ptmin;
mutable ParticleVector _theParticles;
};
}
#endif
Rivet
Definition: MC_JetAnalysis.hh:9
Rivet::FinalState::particlesByE
const ParticleVector & particlesByE() const
Get the final-state particles, ordered by decreasing .
Definition: FinalState.hh:59
Rivet::FinalState::particlesByEta
const ParticleVector & particlesByEta() const
Get the final-state particles, ordered by increasing .
Definition: FinalState.hh:69
Rivet::cmpParticleByEt
bool cmpParticleByEt(const Particle &a, const Particle &b)
Sort by descending transverse energy, .
Definition: Particle.hh:170
Rivet::FinalState::particlesByModRapidity
const ParticleVector & particlesByModRapidity() const
Get the final-state particles, ordered by increasing .
Definition: FinalState.hh:84
Rivet::cmpParticleByAscAbsRapidity
bool cmpParticleByAscAbsRapidity(const Particle &a, const Particle &b)
Sort by ascending absolute rapidity, .
Definition: Particle.hh:214
Rivet::cmpParticleByAscRapidity
bool cmpParticleByAscRapidity(const Particle &a, const Particle &b)
Sort by ascending rapidity, .
Definition: Particle.hh:206
Rivet::FinalState::particlesByEt
const ParticleVector & particlesByEt() const
Get the final-state particles, ordered by decreasing .
Definition: FinalState.hh:64
Rivet::FinalState::particles
virtual const ParticleVector & particles() const
Get the final-state particles.
Definition: FinalState.hh:39
Rivet::Particle
Representation of particles from a HepMC::GenEvent.
Definition: Particle.hh:16
Rivet::FinalState::isEmpty
virtual bool isEmpty() const
Definition: FinalState.hh:94
Rivet::FinalState::particlesByPt
const ParticleVector & particlesByPt() const
Get the final-state particles, ordered by decreasing .
Definition: FinalState.hh:49
Rivet::FinalState::particlesByP
const ParticleVector & particlesByP() const
Get the final-state particles, ordered by decreasing .
Definition: FinalState.hh:54
Rivet::FinalState::accept
bool accept(const Particle &p) const
Decide if a particle is to be accepted or not.
Definition: FinalState.cc:95
Rivet::Event
Definition: Event.hh:22
Rivet::cmpParticleByAscPseudorapidity
bool cmpParticleByAscPseudorapidity(const Particle &a, const Particle &b)
Sort by ascending pseudorapidity, .
Definition: Particle.hh:190
Rivet::FinalState::size
virtual size_t size() const
Access the projected final-state particles.
Definition: FinalState.hh:89
Rivet::FinalState
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
Rivet::FinalState::entities
const collection_type & entities() const
Template-usable interface common to JetAlg.
Definition: FinalState.hh:106
Rivet::FinalState::ptMin
virtual double ptMin() const
Minimum- requirement.
Definition: FinalState.hh:97
Rivet::cmpParticleByE
bool cmpParticleByE(const Particle &a, const Particle &b)
Sort by descending energy, .
Definition: Particle.hh:178
Rivet::FinalState::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: FinalState.hh:31
Rivet::FinalState::FinalState
FinalState(double mineta=-MAXRAPIDITY, double maxeta=MAXRAPIDITY, double minpt=0.0 *GeV)
Definition: FinalState.cc:9
Rivet::MAXRAPIDITY
static const double MAXRAPIDITY
A sensible default maximum value of rapidity for Rivet analyses to use.
Definition: Rivet.hh:24
Rivet::FinalState::compare
virtual int compare(const Projection &p) const
Compare projections.
Definition: FinalState.cc:44
Rivet::FinalState::particlesByRapidity
const ParticleVector & particlesByRapidity() const
Get the final-state particles, ordered by increasing .
Definition: FinalState.hh:79
Rivet::FinalState::project
virtual void project(const Event &e)
Apply the projection to the event.
Definition: FinalState.cc:63
Rivet::cmpParticleByP
bool cmpParticleByP(const Particle &a, const Particle &b)
Sort by descending momentum, .
Definition: Particle.hh:162
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28
Rivet::cmpParticleByPt
bool cmpParticleByPt(const Particle &a, const Particle &b)
Sort by descending transverse momentum, .
Definition: Particle.hh:154
Rivet::FinalState::empty
virtual bool empty() const
Is this final state empty?
Definition: FinalState.hh:92
Rivet::FinalState::particles
const ParticleVector & particles(F sorter) const
Get the final-state particles, ordered by supplied sorting function object.
Definition: FinalState.hh:43
Rivet::FinalState::particlesByModEta
const ParticleVector & particlesByModEta() const
Get the final-state particles, ordered by increasing .
Definition: FinalState.hh:74
Rivet::cmpParticleByAscAbsPseudorapidity
bool cmpParticleByAscAbsPseudorapidity(const Particle &a, const Particle &b)
Sort by ascending absolute pseudorapidity, .
Definition: Particle.hh:198