2 #ifndef RIVET_ParticleSmearingFunctions_HH 3 #define RIVET_ParticleSmearingFunctions_HH 5 #include "Rivet/Particle.hh" 6 #include "Rivet/Tools/MomentumSmearingFunctions.hh" 7 #include "Rivet/Tools/Random.hh" 44 double operator () (
const Particle& )
const {
return _x; }
75 pair<Particle,double> operator() (
const Particle& p)
const {
76 return make_pair(sfn(p), efn(p));
83 if (get_address(sfn) == 0 || get_address(other.sfn) == 0)
return CmpState::NEQ;
84 if (get_address(efn) == 0 || get_address(other.efn) == 0)
return CmpState::NEQ;
85 return Rivet::cmp(get_address(sfn), get_address(other.sfn)) ||
Rivet::cmp(get_address(efn), get_address(other.efn));
94 const ParticleSmearFn sfn;
95 const ParticleEffFn efn;
101 return rand01() < feff(p);
108 template <
typename FN>
111 bool operator () (
const Particle& p)
const {
return efffilt(p, _feff); }
113 const ParticleEffFn _feff;
Definition: MC_Cent_pPb.hh:10
bool efffilt(const Jet &j, FN &feff)
Return true if Jet j is chosen to survive a random efficiency selection.
Definition: JetSmearingFunctions.hh:138
double PARTICLE_EFF_0(const Particle &)
Alias for PARTICLE_EFF_ZERO.
Definition: ParticleSmearingFunctions.hh:28
double PARTICLE_EFF_1(const Particle &)
Alias for PARTICLE_EFF_ONE.
Definition: ParticleSmearingFunctions.hh:35
Take a Particle and return a constant number.
Definition: ParticleSmearingFunctions.hh:42
A functor to return true if Particle p survives a random efficiency selection.
Definition: ParticleSmearingFunctions.hh:107
double PARTICLE_FN1(const Particle &)
Alias for PARTICLE_EFF_ONE.
Definition: ParticleSmearingFunctions.hh:39
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
double PARTICLE_EFF_ONE(const Particle &)
Take a Particle and return 1.
Definition: ParticleSmearingFunctions.hh:33
Particle PARTICLE_SMEAR_IDENTITY(const Particle &p)
Take a Particle and return it unmodified.
Definition: ParticleSmearingFunctions.hh:50
Functor for simultaneous efficiency-filtering and smearing of Particles.
Definition: ParticleSmearingFunctions.hh:58
double PARTICLE_FN0(const Particle &)
Alias for PARTICLE_EFF_ZERO.
Definition: ParticleSmearingFunctions.hh:30
double PARTICLE_EFF_ZERO(const Particle &)
Take a Particle and return 0.
Definition: ParticleSmearingFunctions.hh:26
CmpState cmp(const ParticleEffSmearFn &other) const
Compare to another, for use in the projection system.
Definition: ParticleSmearingFunctions.hh:80
function< Particle(const Particle &)> ParticleSmearFn
Typedef for Particle smearing functions/functors.
Definition: ParticleSmearingFunctions.hh:19
function< double(const Particle &)> ParticleEffFn
Typedef for Particle efficiency functions/functors.
Definition: ParticleSmearingFunctions.hh:22
double PARTICLE_EFF_PERFECT(const Particle &)
Alias for PARTICLE_EFF_ONE.
Definition: ParticleSmearingFunctions.hh:37
Particle PARTICLE_SMEAR_PERFECT(const Particle &p)
Alias for PARTICLE_SMEAR_IDENTITY.
Definition: ParticleSmearingFunctions.hh:52
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