thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
ACDC
ACDCGenCell.h
1
// -*- C++ -*-
2
//
3
// ACDCGenCell.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ACDCGenCell_H
10
#define ACDCGenCell_H
11
12
#include "
ACDCGenConfig.h
"
13
#include "ACDCTraits.h"
14
15
namespace
ACDCGenerator
{
16
17
struct
ACDCGenCellInfo;
18
20
class
ACDCGenCell
{
21
22
public
:
23
27
inline
ACDCGenCell
(
double
newG);
28
32
inline
ACDCGenCell
(
double
newG,
double
newV);
33
37
inline
~ACDCGenCell
();
38
48
template
<
typename
RndType>
49
inline
ACDCGenCell
*
generate
(
DVector
& lo,
DVector
& up, RndType * rnd);
50
61
inline
ACDCGenCell
*
generate
(
DVector
& lo,
DVector
& up,
DVector
& rndv);
62
69
inline
ACDCGenCell
*
getCell
(
DVector
& lo,
const
DVector
& x,
DVector
& up);
70
76
inline
void
smooth
(
double
frac);
77
81
inline
bool
isSplit
()
const
;
82
88
inline
double
doMaxInt
(
double
rescale = 1.0);
89
94
inline
double
maxInt
()
const
;
95
101
inline
void
splitme
(
double
lo,
double
newDiv,
double
up,
DimType
newDim);
102
106
inline
void
g
(
double
newG);
107
111
inline
double
g
()
const
;
112
116
inline
double
v
()
const
;
117
122
inline
DimType
dim
()
const
;
123
128
inline
double
div
()
const
;
129
133
inline
ACDCGenCell
*
upper
()
const
;
134
138
inline
ACDCGenCell
*
lower
()
const
;
139
144
inline
int
nBins
()
const
;
145
149
inline
int
depth
()
const
;
150
158
inline
void
extract
(
DVector
& lo,
DVector
& up,
159
vector<ACDCGenCellInfo> &
v
)
const
;
160
164
inline
long
getIndex
(
const
ACDCGenCell
* c)
const
;
165
170
inline
long
getIndex
(
const
ACDCGenCell
* c,
long
& indx)
const
;
171
175
inline
ACDCGenCell
*
getCell
(
long
i);
176
181
inline
ACDCGenCell
*
getCell
(
long
i,
long
& indx);
182
183
public
:
184
190
double
theG
;
191
195
double
theV
;
196
200
ACDCGenCell
*
theUpper
;
201
205
ACDCGenCell
*
theLower
;
206
210
double
theDivision
;
211
215
DimType
theSplitDimension
;
216
217
private
:
218
222
ACDCGenCell
();
223
227
ACDCGenCell
(
const
ACDCGenCell
&);
228
232
ACDCGenCell
&
operator=
(
const
ACDCGenCell
&) =
delete
;
233
234
};
235
236
242
struct
ACDCGenCellInfo
{
243
245
typedef
vector<ACDCGenCellInfo>::size_type
Index
;
246
250
double
g
;
251
255
double
v
;
256
260
DVector
up
;
264
DVector
lo
;
265
270
Index
iup
;
271
276
Index
ilo
;
277
278
};
279
280
}
281
282
#include "ACDCGenCell.icc"
283
284
#endif
ACDCGenConfig.h
is the main config header file for ACDCGen.
ACDCGenerator::ACDCGenCell
ACDCGenCell is the class representing a generation cell in ACDCGen.
Definition:
ACDCGenCell.h:20
ACDCGenerator::ACDCGenCell::~ACDCGenCell
~ACDCGenCell()
The destuctor will also delete all child cells.
ACDCGenerator::ACDCGenCell::g
double g() const
Return the overestimated maximum function value in this cell.
ACDCGenerator::ACDCGenCell::getCell
ACDCGenCell * getCell(long i)
Return the cell corresponding to the given index i.
ACDCGenerator::ACDCGenCell::getCell
ACDCGenCell * getCell(long i, long &indx)
Helper function for getCell(long) with an extra argument to use as counter.
ACDCGenerator::ACDCGenCell::getIndex
long getIndex(const ACDCGenCell *c, long &indx) const
Helper function for getIndex(const ACDCGenCell *) with an extra argument to use as counter.
ACDCGenerator::ACDCGenCell::generate
ACDCGenCell * generate(DVector &lo, DVector &up, DVector &rndv)
Choose a cell recursively according to their relative overestimated integrals.
ACDCGenerator::ACDCGenCell::theG
double theG
If the cell has not been split this is the overestimated maximum function value in this cell.
Definition:
ACDCGenCell.h:190
ACDCGenerator::ACDCGenCell::isSplit
bool isSplit() const
Returns true if this cell has been split.
ACDCGenerator::ACDCGenCell::ACDCGenCell
ACDCGenCell()
Default constructor is private and not implemented.
ACDCGenerator::ACDCGenCell::getIndex
long getIndex(const ACDCGenCell *c) const
Get the index of the given cell.
ACDCGenerator::ACDCGenCell::theSplitDimension
DimType theSplitDimension
The direction in which it has been split.
Definition:
ACDCGenCell.h:215
ACDCGenerator::ACDCGenCell::splitme
void splitme(double lo, double newDiv, double up, DimType newDim)
Split this cell into two.
ACDCGenerator::ACDCGenCell::nBins
int nBins() const
Return the number of cells in this sub-tree which have not been split.
ACDCGenerator::ACDCGenCell::generate
ACDCGenCell * generate(DVector &lo, DVector &up, RndType *rnd)
Choose a cell recursively according to their relative overestimated integrals.
ACDCGenerator::ACDCGenCell::v
double v() const
Return the volume of this cell.
ACDCGenerator::ACDCGenCell::operator=
ACDCGenCell & operator=(const ACDCGenCell &)=delete
Assignment is private and not implemented.
ACDCGenerator::ACDCGenCell::theDivision
double theDivision
The point of division in the dim() direction.
Definition:
ACDCGenCell.h:210
ACDCGenerator::ACDCGenCell::depth
int depth() const
Return the maximum depth of this sub-tree.
ACDCGenerator::ACDCGenCell::ACDCGenCell
ACDCGenCell(double newG, double newV)
Constructor taking the maximum value and the volume as argument.
ACDCGenerator::ACDCGenCell::theLower
ACDCGenCell * theLower
Pointers to the lower sub-cell.
Definition:
ACDCGenCell.h:205
ACDCGenerator::ACDCGenCell::ACDCGenCell
ACDCGenCell(double newG)
Constructor taking the maximum value as argument.
ACDCGenerator::ACDCGenCell::getCell
ACDCGenCell * getCell(DVector &lo, const DVector &x, DVector &up)
Find a cell.
ACDCGenerator::ACDCGenCell::dim
DimType dim() const
Return the direction in which it has been split.
ACDCGenerator::ACDCGenCell::smooth
void smooth(double frac)
Smooth out the levels.
ACDCGenerator::ACDCGenCell::theV
double theV
The volume of this cell.
Definition:
ACDCGenCell.h:195
ACDCGenerator::ACDCGenCell::ACDCGenCell
ACDCGenCell(const ACDCGenCell &)
Copy constructor is private and not implemented.
ACDCGenerator::ACDCGenCell::lower
ACDCGenCell * lower() const
Return the lower sub-cell.
ACDCGenerator::ACDCGenCell::g
void g(double newG)
Set a new overestimated maximum function value in this cell.
ACDCGenerator::ACDCGenCell::doMaxInt
double doMaxInt(double rescale=1.0)
Recalculate (recursively) the overestimated integral for this cell (and of the sub-cells) and return ...
ACDCGenerator::ACDCGenCell::theUpper
ACDCGenCell * theUpper
Pointers to the upper sub-cell.
Definition:
ACDCGenCell.h:200
ACDCGenerator::ACDCGenCell::extract
void extract(DVector &lo, DVector &up, vector< ACDCGenCellInfo > &v) const
Append ACDCGenCellInfo objects describing this subtree to a given vector.
ACDCGenerator::ACDCGenCell::upper
ACDCGenCell * upper() const
Return the upper sub-cell.
ACDCGenerator::ACDCGenCell::div
double div() const
Return the point of division in the dim() direction.
ACDCGenerator::ACDCGenCell::maxInt
double maxInt() const
Return the last calculated the overestimated integral for this cell.
ACDCGenerator
The namespace in which all ACDCGen classes are defined.
Definition:
ACDCGen.h:18
ACDCGenerator::DimType
short DimType
The integer type used to represent the dimension of the a functions to be sampled-.
Definition:
ACDCGenConfig.h:45
ACDCGenerator::DVector
vector< double > DVector
A vector of doubles.
Definition:
ACDCGenConfig.h:58
ACDCGenerator::ACDCGenCellInfo
This is a class describing cells to the outside world to be used for debugging purposes.
Definition:
ACDCGenCell.h:242
ACDCGenerator::ACDCGenCellInfo::Index
vector< ACDCGenCellInfo >::size_type Index
the integer used for indices.
Definition:
ACDCGenCell.h:245
ACDCGenerator::ACDCGenCellInfo::up
DVector up
The upper-right corner of the corresponding cell.
Definition:
ACDCGenCell.h:260
ACDCGenerator::ACDCGenCellInfo::g
double g
The overestimated maximum function value of this cell.
Definition:
ACDCGenCell.h:250
ACDCGenerator::ACDCGenCellInfo::iup
Index iup
The index of the upper sub-cells in the vector in which the corresponding cell was inserted.
Definition:
ACDCGenCell.h:270
ACDCGenerator::ACDCGenCellInfo::v
double v
The volume of the corresponding cell.
Definition:
ACDCGenCell.h:255
ACDCGenerator::ACDCGenCellInfo::lo
DVector lo
The lower-left corner of the corresponding cell.
Definition:
ACDCGenCell.h:264
ACDCGenerator::ACDCGenCellInfo::ilo
Index ilo
The index of the lower sub-cell in the vector in which the corresponding cell was inserted.
Definition:
ACDCGenCell.h:276
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6