thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
ACDCGenerator::ACDCGenCell Class Reference

ACDCGenCell is the class representing a generation cell in ACDCGen. More...

#include <ACDCGenCell.h>

Public Member Functions

 ACDCGenCell (double newG)
 Constructor taking the maximum value as argument.
 
 ACDCGenCell (double newG, double newV)
 Constructor taking the maximum value and the volume as argument.
 
 ~ACDCGenCell ()
 The destuctor will also delete all child cells.
 
template<typename RndType >
ACDCGenCellgenerate (DVector &lo, DVector &up, RndType *rnd)
 Choose a cell recursively according to their relative overestimated integrals. More...
 
ACDCGenCellgenerate (DVector &lo, DVector &up, DVector &rndv)
 Choose a cell recursively according to their relative overestimated integrals. More...
 
ACDCGenCellgetCell (DVector &lo, const DVector &x, DVector &up)
 Find a cell. More...
 
void smooth (double frac)
 Smooth out the levels. More...
 
bool isSplit () const
 Returns true if this cell has been split.
 
double doMaxInt (double rescale=1.0)
 Recalculate (recursively) the overestimated integral for this cell (and of the sub-cells) and return it. More...
 
double maxInt () const
 Return the last calculated the overestimated integral for this cell.
 
void splitme (double lo, double newDiv, double up, DimType newDim)
 Split this cell into two. More...
 
void g (double newG)
 Set a new overestimated maximum function value in this cell.
 
double g () const
 Return the overestimated maximum function value in this cell.
 
double v () const
 Return the volume of this cell.
 
DimType dim () const
 Return the direction in which it has been split. More...
 
double div () const
 Return the point of division in the dim() direction. More...
 
ACDCGenCellupper () const
 Return the upper sub-cell. More...
 
ACDCGenCelllower () const
 Return the lower sub-cell. More...
 
int nBins () const
 Return the number of cells in this sub-tree which have not been split.
 
int depth () const
 Return the maximum depth of this sub-tree.
 
void extract (DVector &lo, DVector &up, vector< ACDCGenCellInfo > &v) const
 Append ACDCGenCellInfo objects describing this subtree to a given vector. More...
 
long getIndex (const ACDCGenCell *c) const
 Get the index of the given cell.
 
long getIndex (const ACDCGenCell *c, long &indx) const
 Helper function for getIndex(const ACDCGenCell *) with an extra argument to use as counter.
 
ACDCGenCellgetCell (long i)
 Return the cell corresponding to the given index i.
 
ACDCGenCellgetCell (long i, long &indx)
 Helper function for getCell(long) with an extra argument to use as counter.
 

Public Attributes

double theG
 If the cell has not been split this is the overestimated maximum function value in this cell. More...
 
double theV
 The volume of this cell.
 
ACDCGenCelltheUpper
 Pointers to the upper sub-cell.
 
ACDCGenCelltheLower
 Pointers to the lower sub-cell.
 
double theDivision
 The point of division in the dim() direction.
 
DimType theSplitDimension
 The direction in which it has been split.
 

Private Member Functions

 ACDCGenCell ()
 Default constructor is private and not implemented.
 
 ACDCGenCell (const ACDCGenCell &)
 Copy constructor is private and not implemented.
 
ACDCGenCelloperator= (const ACDCGenCell &)=delete
 Assignment is private and not implemented.
 

Detailed Description

ACDCGenCell is the class representing a generation cell in ACDCGen.

Definition at line 20 of file ACDCGenCell.h.

Member Function Documentation

◆ dim()

DimType ACDCGenerator::ACDCGenCell::dim ( ) const
inline

Return the direction in which it has been split.

Return -1 if it has not been split.

◆ div()

double ACDCGenerator::ACDCGenCell::div ( ) const
inline

Return the point of division in the dim() direction.

Return -1.0 if it has not been split.

◆ doMaxInt()

double ACDCGenerator::ACDCGenCell::doMaxInt ( double  rescale = 1.0)
inline

Recalculate (recursively) the overestimated integral for this cell (and of the sub-cells) and return it.

Optionally rescale the overestimated integral.

◆ extract()

void ACDCGenerator::ACDCGenCell::extract ( DVector lo,
DVector up,
vector< ACDCGenCellInfo > &  v 
) const
inline

Append ACDCGenCellInfo objects describing this subtree to a given vector.

Parameters
lothe lower-left corner of this cell.
upthe upper-right corner of this cell.
vthe vector where the ACDCGenCellInfo objects will be appended.

◆ generate() [1/2]

template<typename RndType >
ACDCGenCell* ACDCGenerator::ACDCGenCell::generate ( DVector lo,
DVector up,
RndType *  rnd 
)
inline

Choose a cell recursively according to their relative overestimated integrals.

Parameters
lothe lower-left corner of the chosen cell.
upthe upper-right corner of the chosen cell.
rndthe random generator object used to throw dice to choose sub-cell.
Returns
a pointer to the chosen cell.

◆ generate() [2/2]

ACDCGenCell* ACDCGenerator::ACDCGenCell::generate ( DVector lo,
DVector up,
DVector rndv 
)
inline

Choose a cell recursively according to their relative overestimated integrals.

Parameters
lothe lower-left corner of the chosen cell.
upthe upper-right corner of the chosen cell.
rndva pre-generated set of random numbers (one for each dimension) used to choose sub-cell and then rescales that random number to be reused by the sub-cell.
Returns
a pointer to the chosen cell.

◆ getCell()

ACDCGenCell* ACDCGenerator::ACDCGenCell::getCell ( DVector lo,
const DVector x,
DVector up 
)
inline

Find a cell.

For a given phase space point, x, find the corresponding cell. Afterwards, the up and lo vectors will contain the upper-right and lower-left corners of the chosen cell.

◆ lower()

ACDCGenCell* ACDCGenerator::ACDCGenCell::lower ( ) const
inline

Return the lower sub-cell.

Return null if it has not been split.

◆ smooth()

void ACDCGenerator::ACDCGenCell::smooth ( double  frac)
inline

Smooth out the levels.

If one cell has an overestimated integral which is less than frac of the adjacent one, rescale it to avoid situations where it is never sampled.

◆ splitme()

void ACDCGenerator::ACDCGenCell::splitme ( double  lo,
double  newDiv,
double  up,
DimType  newDim 
)
inline

Split this cell into two.

The cell is split along the newDim direction, where the lower and upper limit is given by lo and up and the point of division is given by newDiv.

◆ upper()

ACDCGenCell* ACDCGenerator::ACDCGenCell::upper ( ) const
inline

Return the upper sub-cell.

Return null if it has not been split.

Member Data Documentation

◆ theG

double ACDCGenerator::ACDCGenCell::theG

If the cell has not been split this is the overestimated maximum function value in this cell.

Otherwise it is the weighted average of the sub-cells values.

Definition at line 190 of file ACDCGenCell.h.


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