herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
Sampling
MonacoSampler.h
1
// -*- C++ -*-
2
//
3
// MonacoSampler.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4
// Copyright (C) 2002-2019 The Herwig Collaboration
5
//
6
// Herwig 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 Herwig_MonacoSampler_H
10
#define Herwig_MonacoSampler_H
11
//
12
// This is the declaration of the MonacoSampler class.
13
//
14
15
#include "Herwig/Sampling/BinSampler.h"
16
17
#include "Herwig/Utilities/XML/Element.h"
18
19
// work around a Boost 1.64 bug where ublas headers would fail otherwise
20
#include <boost/version.hpp>
21
#if (BOOST_VERSION / 100 >= 1064)
22
#include <boost/serialization/array_wrapper.hpp>
23
#endif
24
25
#include <boost/numeric/ublas/matrix.hpp>
26
27
namespace
Herwig
{
28
29
using namespace
ThePEG
;
30
40
class
MonacoSampler
:
public
Herwig::BinSampler
{
41
42
public
:
43
49
MonacoSampler
();
50
54
virtual
~MonacoSampler
();
56
57
public
:
58
62
Ptr<MonacoSampler>::ptr
cloneMe
()
const
{
63
return
dynamic_ptr_cast<Ptr<MonacoSampler>::ptr>(
clone
());
64
}
65
66
public
:
67
68
73
virtual
double
generate
();
74
78
virtual
void
adapt
();
79
83
virtual
bool
existsGrid
()
const
;
84
88
virtual
void
saveGrid
()
const
;
89
93
virtual
void
initialize
(
bool
progress);
94
98
virtual
void
finalize
(
bool
);
99
103
virtual
void
fromXML
(
const
XML::Element
&);
104
108
virtual
XML::Element
toXML
()
const
;
109
110
111
public
:
112
119
void
persistentOutput
(
PersistentOStream
& os)
const
;
120
126
void
persistentInput
(
PersistentIStream
& is,
int
version);
128
135
static
void
Init
();
136
137
protected
:
138
145
virtual
IBPtr
clone
()
const
;
146
151
virtual
IBPtr
fullclone
()
const
;
153
154
155
// If needed, insert declarations of virtual function defined in the
156
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
157
158
private
:
159
163
double
theAlpha
;
164
168
size_t
theGridDivisions
;
169
175
boost::numeric::ublas::matrix<double>
theGrid
;
176
180
boost::numeric::ublas::matrix<double>
theGridData
;
181
182
private
:
183
187
size_t
theIterationPoints
;
188
189
private
:
190
195
MonacoSampler
&
operator=
(
const
MonacoSampler
&) =
delete
;
196
197
};
198
199
}
200
201
#endif
/* Herwig_MonacoSampler_H */
Herwig::BinSampler
BinSampler samples XCombs bins. This default implementation performs flat MC integration.
Definition:
BinSampler.h:38
Herwig::MonacoSampler
MonacoSampler samples XCombs bins using using Monaco.
Definition:
MonacoSampler.h:40
Herwig::MonacoSampler::initialize
virtual void initialize(bool progress)
Initialize this bin sampler.
Herwig::MonacoSampler::saveGrid
virtual void saveGrid() const
Save grid data.
Herwig::MonacoSampler::MonacoSampler
MonacoSampler()
The default constructor.
Herwig::MonacoSampler::adapt
virtual void adapt()
Adapt this sampler after an iteration has been run.
Herwig::MonacoSampler::clone
virtual IBPtr clone() const
Make a simple clone of this object.
Herwig::MonacoSampler::fromXML
virtual void fromXML(const XML::Element &)
Fill Monaco grid data from an XML element.
Herwig::MonacoSampler::theGridDivisions
size_t theGridDivisions
Number of grid divisions per dimension.
Definition:
MonacoSampler.h:168
Herwig::MonacoSampler::Init
static void Init()
The standard Init function used to initialize the interfaces.
Herwig::MonacoSampler::toXML
virtual XML::Element toXML() const
Return an XML element for the data of the Monaco grid.
Herwig::MonacoSampler::theIterationPoints
size_t theIterationPoints
Number of points collected in iteration so far.
Definition:
MonacoSampler.h:187
Herwig::MonacoSampler::~MonacoSampler
virtual ~MonacoSampler()
The destructor.
Herwig::MonacoSampler::operator=
MonacoSampler & operator=(const MonacoSampler &)=delete
The assignment operator is private and must never be called.
Herwig::MonacoSampler::theGrid
boost::numeric::ublas::matrix< double > theGrid
Grid boundaries (first index: dimension of random numbers, second index: dimension of partitions per ...
Definition:
MonacoSampler.h:175
Herwig::MonacoSampler::theGridData
boost::numeric::ublas::matrix< double > theGridData
Collected value per grid bin.
Definition:
MonacoSampler.h:180
Herwig::MonacoSampler::generate
virtual double generate()
Generate the next point and return its weight; store the point in lastPoint().
Herwig::MonacoSampler::existsGrid
virtual bool existsGrid() const
Return true, if grid data exists for this sampler.
Herwig::MonacoSampler::finalize
virtual void finalize(bool)
Finalize this sampler.
Herwig::MonacoSampler::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Herwig::MonacoSampler::theAlpha
double theAlpha
Rate of grid modification (0 for no modification)
Definition:
MonacoSampler.h:163
Herwig::MonacoSampler::cloneMe
Ptr< MonacoSampler >::ptr cloneMe() const
Clone this object.
Definition:
MonacoSampler.h:62
Herwig::MonacoSampler::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::MonacoSampler::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ThePEG::PersistentIStream
ThePEG::PersistentOStream
XML::Element
Element represents a (tree of) XML elements.
Definition:
Element.h:56
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6