herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
exsample::generator< Function, Random > Class Template Reference

A generator for plain sampling and integrating. More...

#include <generator.h>

Public Member Functions

 generator ()
 default constructor
 
template<class SlaveStatistics >
void initialize (SlaveStatistics &)
 initialize this generator
 
template<class SlaveStatistics >
double generate (SlaveStatistics &)
 generate an event, returning the sign of the weight
 
const std::vector< double > & last_point () const
 return the last sampled phase space point
 
void reject ()
 indicate that the last generated point has been rejected
 
void finalize ()
 finalize this generator
 
bool initialized () const
 return true, if this generator has been initialized
 
bool did_split () const
 return true, if at least one split has been performed
 
Function & function ()
 access the function
 
void function (Function *f)
 set the function
 
const statisticsstats () const
 return the statistics object
 
double volume () const
 return the sampled volume
 
double integral () const
 return the integral
 
double integral_uncertainty () const
 return the error on the integral
 
double current_integral () const
 return the integral
 
double current_integral_uncertainty () const
 return the error on the integral
 
double integral_variance () const
 return the variance of the integral estimate
 
adaption_infosampling_parameters ()
 access the adaption_info object
 
bool compensating () const
 return true, if still compensating
 
template<class OStream >
void put (OStream &os) const
 put to ostream
 
template<class IStream >
void get (IStream &is)
 get from istream
 

Private Member Functions

bool split ()
 check for and possibly split the last selected cell
 
void compensate ()
 compensate the last selected cell indicating the value and position of the new overestimate
 

Private Attributes

Function * function_
 function to be sampled
 
statistics statistics_
 the global statistics object
 
unsigned long check_events_
 the number of events after which a cell is checked for splits
 
adaption_info adaption_info_
 the adaption info object
 
binary_tree< cellroot_cell_
 the root cell
 
rnd_generator< Random > rnd_gen_
 the random number generator to be used
 
bool did_split_
 wether a split has already been performed
 
bool initialized_
 wether this generator has been initialized
 
binary_tree< cell >::iterator last_cell_
 the last selected cell
 
std::vector< double > last_point_
 the last sampled phasespace point
 
double last_value_
 the last function value
 
bool compensating_
 wether or not we are compensating
 

Detailed Description

template<class Function, class Random>
class exsample::generator< Function, Random >

A generator for plain sampling and integrating.

Definition at line 27 of file generator.h.

Constructor & Destructor Documentation

◆ generator()

template<class Function , class Random >
exsample::generator< Function, Random >::generator ( )
inline

default constructor

Definition at line 32 of file generator.h.

Member Function Documentation

◆ compensating()

template<class Function , class Random >
bool exsample::generator< Function, Random >::compensating ( ) const
inline

return true, if still compensating

Definition at line 115 of file generator.h.

References exsample::generator< Function, Random >::compensating_.

◆ current_integral()

template<class Function , class Random >
double exsample::generator< Function, Random >::current_integral ( ) const
inline

◆ current_integral_uncertainty()

template<class Function , class Random >
double exsample::generator< Function, Random >::current_integral_uncertainty ( ) const
inline

◆ did_split()

template<class Function , class Random >
bool exsample::generator< Function, Random >::did_split ( ) const
inline

return true, if at least one split has been performed

Definition at line 70 of file generator.h.

References exsample::generator< Function, Random >::did_split_.

◆ finalize()

template<class Function , class Random >
void exsample::generator< Function, Random >::finalize ( )
inline

finalize this generator

Definition at line 60 of file generator.h.

References exsample::statistics::reset(), and exsample::generator< Function, Random >::statistics_.

◆ function() [1/2]

template<class Function , class Random >
Function & exsample::generator< Function, Random >::function ( )
inline

access the function

Definition at line 73 of file generator.h.

References exsample::generator< Function, Random >::function_.

◆ function() [2/2]

template<class Function , class Random >
void exsample::generator< Function, Random >::function ( Function *  f)
inline

set the function

Definition at line 76 of file generator.h.

References exsample::generator< Function, Random >::function_.

◆ initialized()

template<class Function , class Random >
bool exsample::generator< Function, Random >::initialized ( ) const
inline

return true, if this generator has been initialized

Definition at line 67 of file generator.h.

References exsample::generator< Function, Random >::initialized_.

◆ integral()

template<class Function , class Random >
double exsample::generator< Function, Random >::integral ( ) const
inline

◆ integral_uncertainty()

template<class Function , class Random >
double exsample::generator< Function, Random >::integral_uncertainty ( ) const
inline

◆ integral_variance()

template<class Function , class Random >
double exsample::generator< Function, Random >::integral_variance ( ) const
inline

◆ last_point()

template<class Function , class Random >
const std::vector< double > & exsample::generator< Function, Random >::last_point ( ) const
inline

return the last sampled phase space point

Definition at line 51 of file generator.h.

References exsample::generator< Function, Random >::last_point_.

◆ reject()

template<class Function , class Random >
void exsample::generator< Function, Random >::reject ( )
inline

◆ sampling_parameters()

template<class Function , class Random >
adaption_info & exsample::generator< Function, Random >::sampling_parameters ( )
inline

access the adaption_info object

Definition at line 112 of file generator.h.

References exsample::generator< Function, Random >::adaption_info_.

◆ stats()

template<class Function , class Random >
const statistics & exsample::generator< Function, Random >::stats ( ) const
inline

return the statistics object

Definition at line 79 of file generator.h.

References exsample::generator< Function, Random >::statistics_.

◆ volume()

Member Data Documentation

◆ adaption_info_

template<class Function , class Random >
adaption_info exsample::generator< Function, Random >::adaption_info_
private

◆ check_events_

template<class Function , class Random >
unsigned long exsample::generator< Function, Random >::check_events_
private

the number of events after which a cell is checked for splits

Definition at line 145 of file generator.h.

◆ compensating_

template<class Function , class Random >
bool exsample::generator< Function, Random >::compensating_
private

wether or not we are compensating

Definition at line 172 of file generator.h.

Referenced by exsample::generator< Function, Random >::compensating().

◆ did_split_

template<class Function , class Random >
bool exsample::generator< Function, Random >::did_split_
private

wether a split has already been performed

Definition at line 157 of file generator.h.

Referenced by exsample::generator< Function, Random >::did_split().

◆ function_

template<class Function , class Random >
Function* exsample::generator< Function, Random >::function_
private

function to be sampled

Definition at line 138 of file generator.h.

Referenced by exsample::generator< Function, Random >::function().

◆ initialized_

template<class Function , class Random >
bool exsample::generator< Function, Random >::initialized_
private

wether this generator has been initialized

Definition at line 160 of file generator.h.

Referenced by exsample::generator< Function, Random >::initialized().

◆ last_cell_

template<class Function , class Random >
binary_tree<cell>::iterator exsample::generator< Function, Random >::last_cell_
private

the last selected cell

Definition at line 163 of file generator.h.

Referenced by exsample::generator< Function, Random >::reject().

◆ last_point_

template<class Function , class Random >
std::vector<double> exsample::generator< Function, Random >::last_point_
private

the last sampled phasespace point

Definition at line 166 of file generator.h.

Referenced by exsample::generator< Function, Random >::last_point().

◆ last_value_

template<class Function , class Random >
double exsample::generator< Function, Random >::last_value_
private

the last function value

Definition at line 169 of file generator.h.

Referenced by exsample::generator< Function, Random >::reject().

◆ rnd_gen_

template<class Function , class Random >
rnd_generator<Random> exsample::generator< Function, Random >::rnd_gen_
private

the random number generator to be used

Definition at line 154 of file generator.h.

◆ root_cell_

template<class Function , class Random >
binary_tree<cell> exsample::generator< Function, Random >::root_cell_
private

the root cell

Definition at line 151 of file generator.h.

◆ statistics_


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