LeadingParticlesFinalState.hh
// -*- C++ -*-
#ifndef RIVET_LeadingParticlesFinalState_HH
#define RIVET_LeadingParticlesFinalState_HH
#include "Rivet/Event.hh"
#include "Rivet/Projection.hh"
#include "Rivet/Projections/FinalState.hh"
namespace Rivet {
class Particle;
class LeadingParticlesFinalState : public FinalState {
public:
LeadingParticlesFinalState(const FinalState& fsp)
: FinalState(), _leading_only(false)
{
setName("LeadingParticlesFinalState");
addProjection(fsp, "FS");
}
virtual const Projection *clone() const {
return new LeadingParticlesFinalState(*this);
}
LeadingParticlesFinalState& addParticleId(long id) {
_ids.insert(id);
return *this;
}
LeadingParticlesFinalState& addParticleIdPair(long id) {
_ids.insert(id);
_ids.insert(-id);
return *this;
}
void setLeadingOnly(const bool& leadingonly) {
_leading_only = leadingonly;
}
// /// Check if a particle of a particular ID was found in the current event
// bool hasParticleId(const PdgId pid) const;
// /// Get a particle of a particular ID (check it exists first)
// bool get(const PdgId pid) const;
protected:
void project(const Event& e);
int compare(const Projection& p) const;
bool inList(const Particle& particle) const;
private:
std::set<long>_ids;
bool _leading_only;
};
}
#endif
Rivet::Projection::setName
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
Rivet::LeadingParticlesFinalState::setLeadingOnly
void setLeadingOnly(const bool &leadingonly)
Definition: LeadingParticlesFinalState.hh:47
Rivet::LeadingParticlesFinalState::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: LeadingParticlesFinalState.hh:27
Rivet::LeadingParticlesFinalState::project
void project(const Event &e)
Apply the projection on the supplied event.
Definition: LeadingParticlesFinalState.cc:27
Rivet::Particle
Representation of particles from a HepMC::GenEvent.
Definition: Particle.hh:16
Rivet::Event
Definition: Event.hh:22
Rivet::LeadingParticlesFinalState::inList
bool inList(const Particle &particle) const
Check if the particle&#39;s ID is in the list.
Definition: LeadingParticlesFinalState.cc:78
Rivet::LeadingParticlesFinalState::compare
int compare(const Projection &p) const
Compare projections.
Definition: LeadingParticlesFinalState.cc:7
Rivet::LeadingParticlesFinalState::addParticleId
LeadingParticlesFinalState & addParticleId(long id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:32
Rivet::FinalState
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
Rivet::LeadingParticlesFinalState::addParticleIdPair
LeadingParticlesFinalState & addParticleIdPair(long id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:38
Rivet::ProjectionApplier::addProjection
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Definition: ProjectionApplier.hh:113
Rivet::LeadingParticlesFinalState
Get the highest-pT occurrences of FS particles with the specified PDG IDs.
Definition: LeadingParticlesFinalState.hh:14
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28
Rivet::LeadingParticlesFinalState::LeadingParticlesFinalState
LeadingParticlesFinalState(const FinalState &fsp)
Constructor: the supplied FinalState projection is assumed to live through the run.
Definition: LeadingParticlesFinalState.hh:19