rivet is hosted by Hepforge, IPPP Durham
ConstRandomFilter Class Reference

Functor used to implement constant random lossiness. More...

#include <ConstLossyFinalState.hh>

List of all members.

Public Member Functions

 ConstRandomFilter (double lossFraction)
bool operator() (const Particle &)
int compare (const ConstRandomFilter &other) const

Private Attributes

double _lossFraction

Detailed Description

Functor used to implement constant random lossiness.

Definition at line 17 of file ConstLossyFinalState.hh.


Constructor & Destructor Documentation

ConstRandomFilter ( double  lossFraction) [inline]

Definition at line 20 of file ConstLossyFinalState.hh.

References ConstRandomFilter::_lossFraction.

      : _lossFraction(lossFraction)
    {
      assert(_lossFraction >= 0);
    }

Member Function Documentation

int compare ( const ConstRandomFilter other) const [inline]

Definition at line 32 of file ConstLossyFinalState.hh.

References ConstRandomFilter::_lossFraction, and Rivet::cmp().

                                                      {
      return cmp(_lossFraction, other._lossFraction);
    }
bool operator() ( const Particle ) [inline]
Todo:
Use a better RNG

Definition at line 27 of file ConstLossyFinalState.hh.

References ConstRandomFilter::_lossFraction.

                                     {
      /// @todo Use a better RNG
      return (rand()/static_cast<double>(RAND_MAX) < _lossFraction);
    }

Member Data Documentation


The documentation for this class was generated from the following file: