VetoedFinalState.hh
// -*- C++ -*-
#ifndef RIVET_VetoedFinalState_HH
#define RIVET_VetoedFinalState_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 VetoedFinalState : public FinalState {
public:
typedef pair<double, double> BinaryCut;
typedef map<long, BinaryCut> VetoDetails;
typedef multimap<int, BinaryCut> CompositeVeto;
VetoedFinalState() {
setName("VetoedFinalState");
addProjection(FinalState(), "FS");
}
VetoedFinalState(const FinalState& fsp)
{
setName("VetoedFinalState");
addProjection(fsp, "FS");
}
VetoedFinalState(const VetoDetails& vetocodes)
: _vetoCodes(vetocodes)
{
setName("VetoedFinalState");
addProjection(FinalState(), "FS");
}
VetoedFinalState(const FinalState& fsp, const VetoDetails& vetocodes)
: _vetoCodes(vetocodes)
{
setName("VetoedFinalState");
addProjection(fsp, "FS");
}
virtual const Projection* clone() const {
return new VetoedFinalState(*this);
}
public:
const VetoDetails& vetoDetails() const {
return _vetoCodes;
}
VetoedFinalState& addVetoDetail(const long id, const double ptmin, const double ptmax) {
BinaryCut ptrange(ptmin, ptmax);
_vetoCodes.insert(make_pair(id, ptrange));
return *this;
}
VetoedFinalState& addVetoPairDetail(const long id, const double ptmin, const double ptmax) {
addVetoDetail(id, ptmin, ptmax);
addVetoDetail(-id, ptmin, ptmax);
return *this;
}
VetoedFinalState& addVetoPairId(const long id) {
addVetoId(id);
addVetoId(-id);
return *this;
}
VetoedFinalState& addVetoId(const long id) {
BinaryCut ptrange(0.0, numeric_limits<double>::max());
_vetoCodes.insert(make_pair(id, ptrange));
return *this;
}
VetoedFinalState& vetoNeutrinos() {
addVetoPairId(NU_E);
addVetoPairId(NU_MU);
addVetoPairId(NU_TAU);
return *this;
}
VetoedFinalState& addCompositeMassVeto(const double &mass, const double &width, int nProducts=2){
double halfWidth = 0.5*width;
BinaryCut massRange(mass - halfWidth, mass + halfWidth);
_compositeVetoes.insert(make_pair(nProducts, massRange));
_nCompositeDecays.insert(nProducts);
return *this;
}
VetoedFinalState& addDecayProductsVeto(const long id){
_parentVetoes.insert(id);
return *this;
}
VetoedFinalState& setVetoDetails(const VetoDetails& ids) {
_vetoCodes = ids;
return *this;
}
VetoedFinalState& reset() {
_vetoCodes.clear();
return *this;
}
VetoedFinalState& addVetoOnThisFinalState(const FinalState& fs) {
stringstream st_name;
st_name << "FS_" << _vetofsnames.size();
string name = st_name.str();
addProjection(fs, name);
_vetofsnames.insert(name);
return *this;
}
protected:
void project(const Event& e);
int compare(const Projection& p) const;
private:
VetoDetails _vetoCodes;
CompositeVeto _compositeVetoes;
set<int> _nCompositeDecays;
typedef set<long> ParentVetos;
ParentVetos _parentVetoes;
set<string> _vetofsnames;
};
}
#endif
Rivet::Projection::setName
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
Rivet
Definition: MC_JetAnalysis.hh:9
Rivet::VetoedFinalState::vetoDetails
const VetoDetails & vetoDetails() const
Get the list of particle IDs and ranges to veto.
Definition: VetoedFinalState.hh:75
Rivet::VetoedFinalState::BinaryCut
pair< double, double > BinaryCut
Typedef for a pair of back-to-back cuts.
Definition: VetoedFinalState.hh:21
Rivet::VetoedFinalState::addDecayProductsVeto
VetoedFinalState & addDecayProductsVeto(const long id)
Definition: VetoedFinalState.hh:132
Rivet::Projection::name
virtual std::string name() const
Get the name of the projection.
Definition: Projection.hh:101
Rivet::FinalState::size
virtual size_t size() const
Access the projected final-state particles.
Definition: FinalState.hh:89
Rivet::VetoedFinalState::vetoNeutrinos
VetoedFinalState & vetoNeutrinos()
Veto all neutrinos (convenience method)
Definition: VetoedFinalState.hh:111
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const VetoDetails &vetocodes)
Definition: VetoedFinalState.hh:47
Rivet::VetoedFinalState::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: VetoedFinalState.hh:66
Rivet::VetoedFinalState::addVetoDetail
VetoedFinalState & addVetoDetail(const long id, const double ptmin, const double ptmax)
Definition: VetoedFinalState.hh:81
Rivet::VetoedFinalState
FS modifier to exclude classes of particles from the final state.
Definition: VetoedFinalState.hh:16
Rivet::Event
Definition: Event.hh:22
Rivet::VetoedFinalState::project
void project(const Event &e)
Apply the projection on the supplied event.
Definition: VetoedFinalState.cc:23
Rivet::VetoedFinalState::addVetoPairId
VetoedFinalState & addVetoPairId(const long id)
Definition: VetoedFinalState.hh:97
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState()
Default constructor.
Definition: VetoedFinalState.hh:33
Rivet::VetoedFinalState::addVetoOnThisFinalState
VetoedFinalState & addVetoOnThisFinalState(const FinalState &fs)
Veto particles from a supplied final state.
Definition: VetoedFinalState.hh:151
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const FinalState &fsp)
Constructor with specific FinalState.
Definition: VetoedFinalState.hh:39
Rivet::VetoedFinalState::reset
VetoedFinalState & reset()
Clear the list of particle IDs and ranges to veto.
Definition: VetoedFinalState.hh:144
Rivet::VetoedFinalState::addCompositeMassVeto
VetoedFinalState & addCompositeMassVeto(const double &mass, const double &width, int nProducts=2)
Definition: VetoedFinalState.hh:121
Rivet::FinalState
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
Rivet::ProjectionApplier::addProjection
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Definition: ProjectionApplier.hh:113
Rivet::VetoedFinalState::addVetoId
VetoedFinalState & addVetoId(const long id)
Add a particle ID to veto (all range will be vetoed).
Definition: VetoedFinalState.hh:104
Rivet::FinalState::FinalState
FinalState(double mineta=-MAXRAPIDITY, double maxeta=MAXRAPIDITY, double minpt=0.0 *GeV)
Definition: FinalState.cc:9
Rivet::VetoedFinalState::setVetoDetails
VetoedFinalState & setVetoDetails(const VetoDetails &ids)
Set the list of particle IDs and ranges to veto.
Definition: VetoedFinalState.hh:138
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const FinalState &fsp, const VetoDetails &vetocodes)
Definition: VetoedFinalState.hh:57
Rivet::mass
double mass(const FourMomentum &v)
Get the mass (the Lorentz self-invariant) of a momentum 4-vector.
Definition: Vector4.hh:539
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28
Rivet::VetoedFinalState::CompositeVeto
multimap< int, BinaryCut > CompositeVeto
Typedef for a veto on a composite particle mass.
Definition: VetoedFinalState.hh:27
Rivet::VetoedFinalState::addVetoPairDetail
VetoedFinalState & addVetoPairDetail(const long id, const double ptmin, const double ptmax)
Definition: VetoedFinalState.hh:89
Rivet::VetoedFinalState::VetoDetails
map< long, BinaryCut > VetoDetails
Typedef for a vetoing entry.
Definition: VetoedFinalState.hh:24
Rivet::VetoedFinalState::compare
int compare(const Projection &p) const
Compare projections.
Definition: VetoedFinalState.cc:11