Jpp
|
Template class for randomly sampling from a JRewindableObjectIterator. More...
#include <JRandomSampler.hh>
Public Member Functions | |
JRandomSampler () | |
Default constructor. More... | |
JRandomSampler (const unsigned int on, const unsigned int off) | |
Constructor. More... | |
const JRandomSampler & | getRandomSampler () const |
Get random sampler. More... | |
JRandomSampler & | getRandomSampler () |
Get random sampler. More... | |
skip_type | operator() (const T &object) const |
Acceptance test operator. More... | |
Protected Attributes | |
skip_type | averageOn |
skip_type | averageOff |
skip_type | count |
Friends | |
std::istream & | operator>> (std::istream &in, JRandomSampler &sampler) |
Read random sampler from input. More... | |
std::ostream & | operator<< (std::ostream &out, const JRandomSampler &sampler) |
Write random sampler to output. More... | |
Template class for randomly sampling from a JRewindableObjectIterator.
Definition at line 28 of file JRandomSampler.hh.
|
inline |
Default constructor.
This constructor will sample all objects.
Definition at line 34 of file JRandomSampler.hh.
|
inline |
Constructor.
on | average number of consecutively accepted events |
off | average number of consecutively rejected events |
Definition at line 47 of file JRandomSampler.hh.
|
inline |
|
inline |
|
inline |
Acceptance test operator.
object | object |
Definition at line 83 of file JRandomSampler.hh.
|
friend |
Read random sampler from input.
in | input stream |
sampler | random sampler |
Definition at line 107 of file JRandomSampler.hh.
|
friend |
Write random sampler to output.
out | output stream |
sampler | random sampler |
Definition at line 125 of file JRandomSampler.hh.
|
protected |
Definition at line 135 of file JRandomSampler.hh.
|
protected |
Definition at line 136 of file JRandomSampler.hh.
|
mutableprotected |
Definition at line 137 of file JRandomSampler.hh.