2#ifndef RIVET_ConstLossyFinalState_HH
3#define RIVET_ConstLossyFinalState_HH
5#include "Rivet/Tools/Logging.hh"
6#include "Rivet/Tools/Random.hh"
7#include "Rivet/Config/RivetCommon.hh"
8#include "Rivet/Particle.hh"
9#include "Rivet/Event.hh"
10#include "Rivet/Projection.hh"
11#include "Rivet/Projections/FinalState.hh"
12#include "Rivet/Projections/LossyFinalState.hh"
22 : _lossFraction(lossFraction)
24 assert(_lossFraction >= 0);
29 return rand01() < _lossFraction;
33 return cmp(_lossFraction, other._lossFraction);
56 setName(
"ConstLossyFinalState");
63 setName(
"ConstLossyFinalState");
70 using Projection::operator =;
Randomly lose a constant fraction of particles.
Definition ConstLossyFinalState.hh:46
DEFAULT_RIVET_PROJ_CLONE(ConstLossyFinalState)
Clone on the heap.
ConstLossyFinalState(double lossfraction, const Cut &c=Cuts::open())
Stand-alone constructor. Initialises the base FinalState projection.
Definition ConstLossyFinalState.hh:60
ConstLossyFinalState(const FinalState &fsp, double lossfraction)
Constructor from a FinalState.
Definition ConstLossyFinalState.hh:53
Functor used to implement constant random lossiness.
Definition ConstLossyFinalState.hh:18
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition FinalState.hh:12
Templated FS projection which can lose some of the supplied particles.
Definition LossyFinalState.hh:17
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:53
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:142
const Cut & open()
Fully open cut singleton, accepts everything.
Definition MC_Cent_pPb.hh:10
double rand01()
Return a uniformly sampled random number between 0 and 1.
Cmp< T > cmp(const T &t1, const T &t2)
Global helper function for easy creation of Cmp objects.
Definition Cmp.hh:255