IdentifiedFinalState.hh
// -*- C++ -*-
#ifndef RIVET_IdentifiedFinalState_HH
#define RIVET_IdentifiedFinalState_HH
#include "Rivet/Tools/Logging.hh"
#include "Rivet/Rivet.hh"
#include "Rivet/Particle.hh"
#include "Rivet/Event.hh"
#include "Rivet/Projection.hh"
#include "Rivet/Projections/FinalState.hh"
namespace Rivet {
class IdentifiedFinalState : public FinalState {
public:
IdentifiedFinalState(const FinalState& fsp);
IdentifiedFinalState(double etamin=-MAXRAPIDITY,
double etamax=MAXRAPIDITY,
double ptMin=0.0*GeV);
IdentifiedFinalState(const vector<pair<double, double> >& etaRanges,
double ptMin=0.0*GeV);
virtual const Projection* clone() const {
return new IdentifiedFinalState(*this);
}
public:
const set<PdgId>& acceptedIds() const {
return _pids;
}
IdentifiedFinalState& acceptId(PdgId pid) {
_pids.insert(pid);
return *this;
}
IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) {
foreach (const PdgId pid, pids) {
_pids.insert(pid);
}
return *this;
}
IdentifiedFinalState& acceptIdPair(PdgId pid) {
_pids.insert(pid);
_pids.insert(-pid);
return *this;
}
IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) {
foreach (const PdgId pid, pids) {
_pids.insert(pid);
_pids.insert(-pid);
}
return *this;
}
IdentifiedFinalState& acceptNeutrinos() {
acceptIdPair(NU_E);
acceptIdPair(NU_MU);
acceptIdPair(NU_TAU);
return *this;
}
IdentifiedFinalState& acceptChLeptons() {
acceptIdPair(ELECTRON);
acceptIdPair(MUON);
acceptIdPair(TAU);
return *this;
}
void reset() {
_pids.clear();
}
protected:
void project(const Event& e);
int compare(const Projection& p) const;
private:
set<PdgId> _pids;
};
}
#endif
Rivet::IdentifiedFinalState::acceptChLeptons
IdentifiedFinalState & acceptChLeptons()
Accept all charged leptons (convenience method).
Definition: IdentifiedFinalState.hh:88
Rivet::PdgId
int PdgId
Typedef for a PDG ID code.
Definition: Particle.fhh:29
Rivet::IdentifiedFinalState::acceptIds
IdentifiedFinalState & acceptIds(const vector< PdgId > &pids)
Add a set of accepted particle IDs.
Definition: IdentifiedFinalState.hh:56
Rivet::IdentifiedFinalState::acceptId
IdentifiedFinalState & acceptId(PdgId pid)
Add an accepted particle ID.
Definition: IdentifiedFinalState.hh:50
Rivet::IdentifiedFinalState
Produce a final state which only contains specified particle IDs.
Definition: IdentifiedFinalState.hh:16
Rivet::IdentifiedFinalState::compare
int compare(const Projection &p) const
Compare projections.
Definition: IdentifiedFinalState.cc:34
Rivet::IdentifiedFinalState::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: IdentifiedFinalState.hh:36
Rivet::Event
Definition: Event.hh:22
Rivet::IdentifiedFinalState::project
void project(const Event &e)
Apply the projection on the supplied event.
Definition: IdentifiedFinalState.cc:45
Rivet::IdentifiedFinalState::acceptIdPair
IdentifiedFinalState & acceptIdPair(PdgId pid)
Add an accepted particle ID and its antiparticle.
Definition: IdentifiedFinalState.hh:64
Rivet::IdentifiedFinalState::acceptIdPairs
IdentifiedFinalState & acceptIdPairs(const vector< PdgId > &pids)
Add a set of accepted particle IDs and their antiparticles.
Definition: IdentifiedFinalState.hh:71
Rivet::IdentifiedFinalState::reset
void reset()
Reset the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:96
Rivet::FinalState
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
Rivet::IdentifiedFinalState::acceptNeutrinos
IdentifiedFinalState & acceptNeutrinos()
Accept all neutrinos (convenience method).
Definition: IdentifiedFinalState.hh:80
Rivet::MAXRAPIDITY
static const double MAXRAPIDITY
A sensible default maximum value of rapidity for Rivet analyses to use.
Definition: Rivet.hh:24
Rivet::IdentifiedFinalState::acceptedIds
const set< PdgId > & acceptedIds() const
Get the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:45
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28
Rivet::FinalState::ptMin
virtual double ptMin() const
Minimum- requirement.
Definition: FinalState.hh:97
Rivet::IdentifiedFinalState::IdentifiedFinalState
IdentifiedFinalState(const FinalState &fsp)
Constructor with specific FinalState.
Definition: IdentifiedFinalState.cc:11