2#ifndef RIVET_VetoedFinalState_HH
3#define RIVET_VetoedFinalState_HH
5#include "Rivet/Projections/FinalState.hh"
44 _vetoCuts.reserve(vetopids.size());
57 _vetoCuts.reserve(vetopids.size());
82 for (
const auto& it : vetocodes) {
83 addVeto(it.first, Cuts::pT > it.second.first && Cuts::pT < it.second.second);
94 using Projection::operator =;
106 _vetoCuts.push_back(cut);
112 _vetoCuts.push_back(Cuts::pid ==
pid && cut);
118 _vetoCuts.push_back(Cuts::abspid ==
pid && cut);
127 return addVeto(
pid, Cuts::ptIn(ptmin, ptmax));
177 const double halfWidth = 0.5*width;
178 pair<double,double> massRange(
mass-halfWidth,
mass+halfWidth);
179 _compositeVetoes.insert(make_pair(nProducts, massRange));
180 _nCompositeDecays.insert(nProducts);
189 _parentVetoes.insert(
pid);
195 const string name =
"FS_" +
to_str(_vetofsnames.size());
197 _vetofsnames.insert(
name);
219 vector<Cut> _vetoCuts;
223 multimap<PdgId, pair<double,double> > _compositeVetoes;
224 set<int> _nCompositeDecays;
227 set<PdgId> _parentVetoes;
230 set<string> _vetofsnames;
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition FinalState.hh:12
Base class for projections which return subsets of an event's particles.
Definition ParticleFinder.hh:11
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:170
Base class for all Rivet projections.
Definition Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:142
virtual std::string name() const
Get the name of the projection.
Definition Projection.hh:56
FS modifier to exclude classes of particles from the final state.
Definition VetoedFinalState.hh:11
const vector< Cut > & vetoDetails() const
Get the list of particle IDs and ranges to veto.
Definition VetoedFinalState.hh:98
VetoedFinalState(const Cut &cut)
Constructor with a default FinalState and a single cut to veto.
Definition VetoedFinalState.hh:36
VetoedFinalState(const FinalState &fsp, const Cut &cut)
Constructor with a specific FinalState and a single cut to veto.
Definition VetoedFinalState.hh:26
VetoedFinalState & addVetoPairId(PdgId pid)
Add a particle/antiparticle pair to veto.
Definition VetoedFinalState.hh:150
VetoedFinalState(const FinalState &fsp, const vector< Cut > &cuts)
Constructor with a specific FinalState and a cuts list to veto.
Definition VetoedFinalState.hh:18
VetoedFinalState & addVetoPair(PdgId pid, const Cut &cut=Cuts::OPEN)
Add a particle/antiparticle selection to be vetoed from the final state.
Definition VetoedFinalState.hh:117
VetoedFinalState(const map< PdgId, pair< double, double > > &vetocodes)
Definition VetoedFinalState.hh:79
VetoedFinalState(const vector< PdgId > &vetopids)
Constructor with a default FinalState and a PID list to veto.
Definition VetoedFinalState.hh:54
VetoedFinalState & reset()
Clear the list of particle IDs and ranges to veto.
Definition VetoedFinalState.hh:203
VetoedFinalState & addVetoPairDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits< double >::max())
Add a particle/antiparticle pair to veto in a given range.
Definition VetoedFinalState.hh:135
VetoedFinalState & setVetoDetails(const vector< Cut > &cuts)
Set the list of particle selections to veto.
Definition VetoedFinalState.hh:157
VetoedFinalState(const FinalState &fsp)
Constructor with specific FinalState but no cuts.
Definition VetoedFinalState.hh:67
VetoedFinalState & vetoNeutrinos()
Veto all neutrinos (convenience method)
Definition VetoedFinalState.hh:165
VetoedFinalState()
Default constructor with default FinalState and no cuts.
Definition VetoedFinalState.hh:72
VetoedFinalState & addCompositeMassVeto(double mass, double width, int nProducts=2)
Definition VetoedFinalState.hh:176
VetoedFinalState(PdgId vetopid)
Constructor with a default FinalState and a PID to veto.
Definition VetoedFinalState.hh:62
VetoedFinalState & addDecayProductsVeto(PdgId pid)
Definition VetoedFinalState.hh:188
VetoedFinalState & addVetoOnThisFinalState(const ParticleFinder &fs)
Veto particles from a supplied final state.
Definition VetoedFinalState.hh:194
void project(const Event &e)
Apply the projection on the supplied event.
VetoedFinalState & addVetoDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits< double >::max())
Add a particle ID and range to veto.
Definition VetoedFinalState.hh:126
VetoedFinalState(const FinalState &fsp, const vector< PdgId > &vetopids)
Constructor with a specific FinalState and a PID list to veto.
Definition VetoedFinalState.hh:41
CmpState compare(const Projection &p) const
Compare projections.
VetoedFinalState(const FinalState &fsp, PdgId vetopid)
Constructor with a specific FinalState and a PID to veto.
Definition VetoedFinalState.hh:49
DEFAULT_RIVET_PROJ_CLONE(VetoedFinalState)
Clone on the heap.
VetoedFinalState & addVeto(const Cut &cut)
Add a particle selection to be vetoed from the final state.
Definition VetoedFinalState.hh:105
VetoedFinalState & addVeto(PdgId pid, const Cut &cut=Cuts::OPEN)
Add a particle selection to be vetoed from the final state.
Definition VetoedFinalState.hh:111
VetoedFinalState & addVetoId(PdgId pid)
Add a particle ID to veto (all range will be vetoed)
Definition VetoedFinalState.hh:141
VetoedFinalState(const vector< Cut > &cuts)
Constructor with a default FinalState and a cuts list to veto.
Definition VetoedFinalState.hh:31
double mass(const ParticleBase &p)
Unbound function access to mass.
Definition ParticleBaseUtils.hh:705
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
int pid(const Particle &p)
Unbound function access to PID code.
Definition ParticleUtils.hh:23
string to_str(const T &x)
Convert any object to a string.
Definition Utils.hh:66
Definition MC_Cent_pPb.hh:10