herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
exsample::cell_info Class Reference

Information contained in a leaf cell. More...

#include <cell.h>

Public Member Functions

 cell_info ()
 the default constructor
 
 cell_info (const std::vector< double > &ll, const std::vector< double > &ur, const adaption_info &ainfo)
 construct from boundaries and adaption info
 
 cell_info (const std::vector< double > &ll, const std::vector< double > &ur, const std::vector< bool > &sampled_variables, const adaption_info &ainfo)
 construct from boundaries, flags for variables to be sampled, and adaption info
 
template<class Random >
void select (Random &, std::vector< double > &)
 generate a flat trial point in this cell
 
template<class Random >
void select (Random &, std::vector< double > &, const std::vector< bool > &)
 generate a flat trial point in this cell only for the variables falgged as true
 
void selected (const std::vector< double > &, double, const adaption_info &)
 indicate a function value for the given point
 
void accept ()
 indicate that a point has been accepted in this cell
 
void reject ()
 reject a previously accepted event
 
bool bad (const adaption_info &ainfo) const
 return true, if below efficiency threshold
 
std::pair< std::size_t, double > get_split (const adaption_info &, bool &) const
 suggest a split and indicate wether it is worth to be performed
 
template<class Random , class Function , class SlaveStatistics >
void explore (Random &, const adaption_info &, Function *, statistics *, SlaveStatistics &opt)
 explore this cell performing a flat sampling, updating the given statistics object and pre-filling the efficiency histogram by a trial unweighting
 
template<class Random , class Function >
void explore (Random &, const adaption_info &, Function *)
 explore this cell in a more refined way, which is however not suited for already calculating integrals and stuff
 
double overestimate () const
 get the current overestimate
 
const std::vector< double > & last_max_position () const
 return the position of the last maximum
 
void overestimate (double v, const std::vector< double > &pos)
 set the current overestimate and maximum position
 
double volume () const
 get the volume
 
const std::vector< double > & lower_left () const
 get the lower left corner
 
const std::vector< double > & upper_right () const
 get the upper right corner
 
unsigned long attempted () const
 get the number of attempted events
 
unsigned long accepted () const
 get the number of accepted events
 
int parametric_missing (const bit_container< parameter_hash_bits > &id) const
 return the number of missing events for the given parameter bin id
 
void parametric_missing (const bit_container< parameter_hash_bits > &id, int n)
 set the number of missing events for the given parameter bin id
 
void increase_parametric_missing (const bit_container< parameter_hash_bits > &id)
 increase to the number of missing events for the given parameter bin id
 
void decrease_parametric_missing (const bit_container< parameter_hash_bits > &id)
 decrease to the number of missing events for the given parameter bin id
 
bool parametric_compensating () const
 return true, if the cell is compensating in at least one parameter bin
 
bool contains_parameter (const std::vector< double > &point, const std::vector< bool > &sampled) const
 return true, if the cell contains the indicated parameter point
 
template<class OStream >
void put (OStream &os) const
 put to ostream
 
template<class IStream >
void get (IStream &is)
 get from istream
 

Private Attributes

double overestimate_
 the value of the overestimate in this cell
 
double volume_
 the volume of this cell
 
std::vector< double > lower_left_
 the lower left corner of this cell
 
std::vector< double > upper_right_
 the upper right corner of this cell
 
std::vector< double > mid_point_
 midpoint of this cell
 
std::vector< double > last_max_position_
 the position of the last encountered maximum in this cell
 
std::vector< std::pair< double, double > > avg_weight_
 left-right statistics of average weight
 
unsigned long attempted_
 the number of attempts in this cell
 
unsigned long accepted_
 the number of accepted events in this cell
 
std::map< bit_container< parameter_hash_bits >, int > parametric_missing_map_
 an optional map of parameter bin ids to the number of missing events
 

Detailed Description

Information contained in a leaf cell.

Definition at line 21 of file cell.h.

Member Function Documentation

◆ accept()

void exsample::cell_info::accept ( )
inline

indicate that a point has been accepted in this cell

Definition at line 61 of file cell.h.

References accepted_.

◆ accepted()

unsigned long exsample::cell_info::accepted ( ) const
inline

get the number of accepted events

Definition at line 119 of file cell.h.

References accepted_.

◆ attempted()

unsigned long exsample::cell_info::attempted ( ) const
inline

get the number of attempted events

Definition at line 116 of file cell.h.

References attempted_.

◆ bad()

bool exsample::cell_info::bad ( const adaption_info ainfo) const
inline

return true, if below efficiency threshold

Definition at line 69 of file cell.h.

References accepted_, attempted_, and exsample::adaption_info::efficiency_threshold.

◆ last_max_position()

const std::vector< double > & exsample::cell_info::last_max_position ( ) const
inline

return the position of the last maximum

Definition at line 98 of file cell.h.

References last_max_position_.

◆ lower_left()

const std::vector< double > & exsample::cell_info::lower_left ( ) const
inline

get the lower left corner

Definition at line 110 of file cell.h.

References lower_left_.

◆ overestimate() [1/2]

double exsample::cell_info::overestimate ( ) const
inline

get the current overestimate

Definition at line 95 of file cell.h.

References overestimate_.

◆ overestimate() [2/2]

void exsample::cell_info::overestimate ( double  v,
const std::vector< double > &  pos 
)
inline

set the current overestimate and maximum position

Definition at line 101 of file cell.h.

References last_max_position_, overestimate_, and v.

◆ parametric_compensating()

bool exsample::cell_info::parametric_compensating ( ) const
inline

return true, if the cell is compensating in at least one parameter bin

Definition at line 141 of file cell.h.

References parametric_missing_map_.

◆ reject()

void exsample::cell_info::reject ( )
inline

reject a previously accepted event

Definition at line 64 of file cell.h.

References accepted_.

◆ upper_right()

const std::vector< double > & exsample::cell_info::upper_right ( ) const
inline

get the upper right corner

Definition at line 113 of file cell.h.

References upper_right_.

◆ volume()

double exsample::cell_info::volume ( ) const
inline

get the volume

Definition at line 107 of file cell.h.

References volume_.

Member Data Documentation

◆ accepted_

unsigned long exsample::cell_info::accepted_
private

the number of accepted events in this cell

Definition at line 188 of file cell.h.

Referenced by accept(), accepted(), bad(), and reject().

◆ attempted_

unsigned long exsample::cell_info::attempted_
private

the number of attempts in this cell

Definition at line 185 of file cell.h.

Referenced by attempted(), and bad().

◆ avg_weight_

std::vector<std::pair<double,double> > exsample::cell_info::avg_weight_
private

left-right statistics of average weight

Definition at line 182 of file cell.h.

◆ last_max_position_

std::vector<double> exsample::cell_info::last_max_position_
private

the position of the last encountered maximum in this cell

Definition at line 179 of file cell.h.

Referenced by last_max_position(), and overestimate().

◆ lower_left_

std::vector<double> exsample::cell_info::lower_left_
private

the lower left corner of this cell

Definition at line 169 of file cell.h.

Referenced by lower_left().

◆ mid_point_

std::vector<double> exsample::cell_info::mid_point_
private

midpoint of this cell

Definition at line 175 of file cell.h.

◆ overestimate_

double exsample::cell_info::overestimate_
private

the value of the overestimate in this cell

Definition at line 163 of file cell.h.

Referenced by overestimate().

◆ parametric_missing_map_

std::map<bit_container<parameter_hash_bits>,int> exsample::cell_info::parametric_missing_map_
private

an optional map of parameter bin ids to the number of missing events

Definition at line 192 of file cell.h.

Referenced by parametric_compensating().

◆ upper_right_

std::vector<double> exsample::cell_info::upper_right_
private

the upper right corner of this cell

Definition at line 172 of file cell.h.

Referenced by upper_right().

◆ volume_

double exsample::cell_info::volume_
private

the volume of this cell

Definition at line 166 of file cell.h.

Referenced by volume().


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