herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
MatrixElement
Matchbox
Matching
ShowerApproximationKernel.h
1
// -*- C++ -*-
2
//
3
// ShowerApproximationKernel.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_ShowerApproximationKernel_H
10
#define Herwig_ShowerApproximationKernel_H
11
//
12
// This is the declaration of the ShowerApproximationKernel class.
13
//
14
15
#include "ThePEG/Handlers/HandlerBase.h"
16
#include "ThePEG/Handlers/StandardXComb.h"
17
#include "Herwig/MatrixElement/Matchbox/Matching/ShowerApproximation.h"
18
#include "Herwig/MatrixElement/Matchbox/Phasespace/InvertedTildeKinematics.h"
19
#include "Herwig/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
20
#include "Herwig/Sampling/exsample/exponential_generator.h"
21
22
namespace
Herwig
{
23
24
using namespace
ThePEG
;
25
26
class
ShowerApproximationGenerator;
27
36
class
ShowerApproximationKernel
:
public
HandlerBase
{
37
38
public
:
39
43
struct
MaxTryException
{};
44
45
public
:
46
50
ShowerApproximationKernel
();
51
52
public
:
53
57
void
setBornXComb
(tStdXCombPtr xc) {
theBornXComb
= xc; }
58
62
tcStdXCombPtr
bornCXComb
()
const
{
return
theBornXComb
; }
63
67
tStdXCombPtr
bornXComb
()
const
{
return
theBornXComb
; }
68
72
void
setRealXComb
(tStdXCombPtr xc) {
theRealXComb
= xc; }
73
77
tcStdXCombPtr
realCXComb
()
const
{
return
theRealXComb
; }
78
82
tStdXCombPtr
realXComb
()
const
{
return
theRealXComb
; }
83
87
void
setTildeXCombs
(
const
vector<StdXCombPtr>& xc) {
theTildeXCombs
= xc; }
88
92
const
vector<StdXCombPtr>&
tildeXCombs
()
const
{
return
theTildeXCombs
; }
93
97
void
setDipole
(Ptr<SubtractionDipole>::tptr dip) {
theDipole
= dip; }
98
102
Ptr<SubtractionDipole>::tptr
dipole
()
const
{
return
theDipole
; }
103
107
void
showerApproximation
(Ptr<ShowerApproximation>::tptr app) {
theShowerApproximation
= app; }
108
112
Ptr<ShowerApproximation>::tptr
showerApproximation
()
const
{
return
theShowerApproximation
; }
113
117
void
showerApproximationGenerator
(Ptr<ShowerApproximationGenerator>::tptr);
118
122
Ptr<ShowerApproximationGenerator>::tptr
showerApproximationGenerator
()
const
;
123
127
double
generate
();
128
129
public
:
130
134
void
ptCut
(Energy pt) {
dipole
()->ptCut(pt); }
135
140
int
nDim
()
const
{
141
return
142
nDimBorn
() +
143
dipole
()->nDimRadiation();
144
}
145
150
int
nDimBorn
()
const
{
151
return
bornCXComb
()->lastRandomNumbers().size();
152
}
153
157
const
vector<bool>&
sampleFlags
();
158
165
const
pair<vector<double>,vector<double> >&
support
();
166
171
const
vector<double>&
parameterPoint
();
172
178
void
startPresampling
();
179
184
void
stopPresampling
();
185
189
void
veto
(
const
vector<double>&,
double
,
double
) {
192
}
193
197
void
accept
(
const
vector<double>&,
double
,
double
) {
200
}
201
205
bool
presampling
()
const
{
return
thePresampling
; }
206
211
unsigned
long
presamplingPoints
()
const
{
return
thePresamplingPoints
; }
212
217
unsigned
long
maxtry
()
const
{
return
theMaxTry
; }
218
223
unsigned
long
freezeGrid
()
const
{
return
theFreezeGrid
; }
224
229
void
presamplingPoints
(
unsigned
long
p) {
thePresamplingPoints
= p; }
230
235
void
maxtry
(
unsigned
long
p) {
theMaxTry
= p; }
236
241
void
freezeGrid
(
unsigned
long
n) {
theFreezeGrid
= n; }
242
246
double
evaluate
(
const
vector<double>&);
247
252
int
evolutionVariable
()
const
{
253
return
254
nDimBorn
() +
255
(
showerApproximation
()->showerInvertedTildeKinematics() ?
256
showerApproximation
()->showerInvertedTildeKinematics()->evolutionVariable() :
257
dipole
()->invertedTildeKinematics()->evolutionVariable());
258
}
259
264
double
evolutionCutoff
()
const
{
265
return
266
showerApproximation
()->showerInvertedTildeKinematics() ?
267
showerApproximation
()->showerInvertedTildeKinematics()->evolutionCutoff() :
268
dipole
()->invertedTildeKinematics()->evolutionCutoff();
269
}
270
274
void
doCompensate
(
bool
yes =
true
) {
theDoCompensate
= yes; }
275
276
public
:
277
280
281
inline
const
vector<bool>& variable_flags () {
282
return
sampleFlags
();
283
}
284
285
inline
size_t
evolution_variable ()
const
{
return
evolutionVariable
(); }
286
287
inline
double
evolution_cutoff ()
const
{
288
return
evolutionCutoff
();
289
}
290
291
inline
const
vector<double>& parameter_point () {
292
return
parameterPoint
();
293
}
294
295
inline
void
start_presampling () {
296
startPresampling
();
297
}
298
299
inline
void
stop_presampling () {
300
stopPresampling
();
301
}
302
303
inline
size_t
dimension ()
const
{
304
return
nDim
();
305
}
306
307
inline
unsigned
long
presampling_points ()
const
{
308
return
presamplingPoints
();
309
}
310
312
313
public
:
314
321
void
persistentOutput
(
PersistentOStream
& os)
const
;
322
328
void
persistentInput
(
PersistentIStream
& is,
int
version);
330
337
static
void
Init
();
338
339
protected
:
340
347
virtual
IBPtr
clone
()
const
;
348
353
virtual
IBPtr
fullclone
()
const
;
355
356
357
// If needed, insert declarations of virtual function defined in the
358
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
359
360
361
private
:
362
366
Ptr<SubtractionDipole>::ptr
theDipole
;
367
371
Ptr<ShowerApproximation>::ptr
theShowerApproximation
;
372
376
StdXCombPtr
theBornXComb
;
377
381
StdXCombPtr
theRealXComb
;
382
386
vector<StdXCombPtr>
theTildeXCombs
;
387
391
bool
thePresampling
;
392
397
unsigned
long
thePresamplingPoints
;
398
403
unsigned
long
theMaxTry
;
404
409
unsigned
long
theFreezeGrid
;
410
414
vector<bool>
theFlags
;
415
419
pair<vector<double>,vector<double> >
theSupport
;
420
424
Ptr<ShowerApproximationGenerator>::tptr
theShowerApproximationGenerator
;
425
429
vector<double>
theLastParameterPoint
;
430
434
vector<double>
theLastBornPoint
;
435
439
typedef
440
exsample::exponential_generator<ShowerApproximationKernel,UseRandom>
441
ExponentialGenerator
;
442
446
typedef
447
exsample::exponential_generator<ShowerApproximationKernel,UseRandom>
*
448
ExponentialGeneratorPtr
;
449
453
ExponentialGeneratorPtr
sampler
;
454
458
bool
theDoCompensate
;
459
464
ShowerApproximationKernel
&
operator=
(
const
ShowerApproximationKernel
&) =
delete
;
465
466
};
467
468
}
469
470
#endif
/* Herwig_ShowerApproximationKernel_H */
Herwig::ShowerApproximationKernel
ShowerApproximationKernel generates emissions according to a shower approximation entering a NLO matc...
Definition:
ShowerApproximationKernel.h:36
Herwig::ShowerApproximationKernel::ExponentialGenerator
exsample::exponential_generator< ShowerApproximationKernel, UseRandom > ExponentialGenerator
Define the Sudakov sampler.
Definition:
ShowerApproximationKernel.h:441
Herwig::ShowerApproximationKernel::bornCXComb
tcStdXCombPtr bornCXComb() const
Return the XComb object describing the Born process.
Definition:
ShowerApproximationKernel.h:62
Herwig::ShowerApproximationKernel::operator=
ShowerApproximationKernel & operator=(const ShowerApproximationKernel &)=delete
The assignment operator is private and must never be called.
Herwig::ShowerApproximationKernel::ptCut
void ptCut(Energy pt)
Set a pt cut on the dipole to generate the radiation.
Definition:
ShowerApproximationKernel.h:134
Herwig::ShowerApproximationKernel::setBornXComb
void setBornXComb(tStdXCombPtr xc)
Set the XComb object describing the Born process.
Definition:
ShowerApproximationKernel.h:57
Herwig::ShowerApproximationKernel::theTildeXCombs
vector< StdXCombPtr > theTildeXCombs
The tilde xcomb objects associated to the real xcomb.
Definition:
ShowerApproximationKernel.h:386
Herwig::ShowerApproximationKernel::tildeXCombs
const vector< StdXCombPtr > & tildeXCombs() const
Return the tilde xcomb objects associated to the real xcomb.
Definition:
ShowerApproximationKernel.h:92
Herwig::ShowerApproximationKernel::dipole
Ptr< SubtractionDipole >::tptr dipole() const
Return the dipole in charge for the emission.
Definition:
ShowerApproximationKernel.h:102
Herwig::ShowerApproximationKernel::theBornXComb
StdXCombPtr theBornXComb
The XComb off which radiation will be generated.
Definition:
ShowerApproximationKernel.h:376
Herwig::ShowerApproximationKernel::realXComb
tStdXCombPtr realXComb() const
Return the XComb object describing the real emission process.
Definition:
ShowerApproximationKernel.h:82
Herwig::ShowerApproximationKernel::veto
void veto(const vector< double > &, double, double)
Indicate that a veto with the given kernel value and overestimate has occured.
Definition:
ShowerApproximationKernel.h:189
Herwig::ShowerApproximationKernel::startPresampling
void startPresampling()
Indicate that presampling of this kernel will be performed in the next calls to evaluate until stopPr...
Herwig::ShowerApproximationKernel::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Herwig::ShowerApproximationKernel::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::ShowerApproximationKernel::theSupport
pair< vector< double >, vector< double > > theSupport
The support.
Definition:
ShowerApproximationKernel.h:419
Herwig::ShowerApproximationKernel::showerApproximation
void showerApproximation(Ptr< ShowerApproximation >::tptr app)
Set the shower approximation.
Definition:
ShowerApproximationKernel.h:107
Herwig::ShowerApproximationKernel::doCompensate
void doCompensate(bool yes=true)
True, if sampler should apply compensation.
Definition:
ShowerApproximationKernel.h:274
Herwig::ShowerApproximationKernel::nDim
int nDim() const
Return the number of random numbers needed to sample this kernel.
Definition:
ShowerApproximationKernel.h:140
Herwig::ShowerApproximationKernel::ExponentialGeneratorPtr
exsample::exponential_generator< ShowerApproximationKernel, UseRandom > * ExponentialGeneratorPtr
Define a pointer to the Sudakov sampler.
Definition:
ShowerApproximationKernel.h:448
Herwig::ShowerApproximationKernel::showerApproximation
Ptr< ShowerApproximation >::tptr showerApproximation() const
Return the shower approximation.
Definition:
ShowerApproximationKernel.h:112
Herwig::ShowerApproximationKernel::parameterPoint
const vector< double > & parameterPoint()
Return the parameter point associated to the splitting previously supplied through fixParameters.
Herwig::ShowerApproximationKernel::theShowerApproximation
Ptr< ShowerApproximation >::ptr theShowerApproximation
The shower approximation to consider.
Definition:
ShowerApproximationKernel.h:371
Herwig::ShowerApproximationKernel::accept
void accept(const vector< double > &, double, double)
Indicate that an accept with the given kernel value and overestimate has occured.
Definition:
ShowerApproximationKernel.h:197
Herwig::ShowerApproximationKernel::setRealXComb
void setRealXComb(tStdXCombPtr xc)
Set the XComb object describing the real emission process.
Definition:
ShowerApproximationKernel.h:72
Herwig::ShowerApproximationKernel::realCXComb
tcStdXCombPtr realCXComb() const
Return the XComb object describing the real emission process.
Definition:
ShowerApproximationKernel.h:77
Herwig::ShowerApproximationKernel::theRealXComb
StdXCombPtr theRealXComb
The XComb describing the process after radiation.
Definition:
ShowerApproximationKernel.h:381
Herwig::ShowerApproximationKernel::theFlags
vector< bool > theFlags
The sampling flags.
Definition:
ShowerApproximationKernel.h:414
Herwig::ShowerApproximationKernel::theLastParameterPoint
vector< double > theLastParameterPoint
The last parameter point.
Definition:
ShowerApproximationKernel.h:429
Herwig::ShowerApproximationKernel::sampleFlags
const vector< bool > & sampleFlags()
Flag, which variables are free variables.
Herwig::ShowerApproximationKernel::theDoCompensate
bool theDoCompensate
True, if sampler should apply compensation.
Definition:
ShowerApproximationKernel.h:458
Herwig::ShowerApproximationKernel::freezeGrid
unsigned long freezeGrid() const
Return the number of accepted points after which the grid should be frozen.
Definition:
ShowerApproximationKernel.h:223
Herwig::ShowerApproximationKernel::theLastBornPoint
vector< double > theLastBornPoint
The last random numbers used for Born sampling.
Definition:
ShowerApproximationKernel.h:434
Herwig::ShowerApproximationKernel::theMaxTry
unsigned long theMaxTry
The maximum number of trials to generate a splitting.
Definition:
ShowerApproximationKernel.h:403
Herwig::ShowerApproximationKernel::setTildeXCombs
void setTildeXCombs(const vector< StdXCombPtr > &xc)
Set the tilde xcomb objects associated to the real xcomb.
Definition:
ShowerApproximationKernel.h:87
Herwig::ShowerApproximationKernel::thePresamplingPoints
unsigned long thePresamplingPoints
The number of points to presample this splitting generator.
Definition:
ShowerApproximationKernel.h:397
Herwig::ShowerApproximationKernel::showerApproximationGenerator
Ptr< ShowerApproximationGenerator >::tptr showerApproximationGenerator() const
Return the shower approximation generator.
Herwig::ShowerApproximationKernel::evolutionVariable
int evolutionVariable() const
Return the index of the random number corresponding to the evolution variable.
Definition:
ShowerApproximationKernel.h:252
Herwig::ShowerApproximationKernel::theDipole
Ptr< SubtractionDipole >::ptr theDipole
The dipole in charge of the emission.
Definition:
ShowerApproximationKernel.h:366
Herwig::ShowerApproximationKernel::generate
double generate()
Generate the next emission.
Herwig::ShowerApproximationKernel::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Herwig::ShowerApproximationKernel::bornXComb
tStdXCombPtr bornXComb() const
Return the XComb object describing the Born process.
Definition:
ShowerApproximationKernel.h:67
Herwig::ShowerApproximationKernel::maxtry
void maxtry(unsigned long p)
Set the maximum number of trials to generate a splitting.
Definition:
ShowerApproximationKernel.h:235
Herwig::ShowerApproximationKernel::evolutionCutoff
double evolutionCutoff() const
Return the cutoff on the evolution random number corresponding to the pt cut.
Definition:
ShowerApproximationKernel.h:264
Herwig::ShowerApproximationKernel::theFreezeGrid
unsigned long theFreezeGrid
Return the number of accepted points after which the grid should be frozen.
Definition:
ShowerApproximationKernel.h:409
Herwig::ShowerApproximationKernel::presamplingPoints
unsigned long presamplingPoints() const
Return the number of points to presample this splitting generator.
Definition:
ShowerApproximationKernel.h:211
Herwig::ShowerApproximationKernel::maxtry
unsigned long maxtry() const
Return the maximum number of trials to generate a splitting.
Definition:
ShowerApproximationKernel.h:217
Herwig::ShowerApproximationKernel::support
const pair< vector< double >, vector< double > > & support()
Return the support of the splitting kernel.
Herwig::ShowerApproximationKernel::showerApproximationGenerator
void showerApproximationGenerator(Ptr< ShowerApproximationGenerator >::tptr)
Set the shower approximation generator.
Herwig::ShowerApproximationKernel::setDipole
void setDipole(Ptr< SubtractionDipole >::tptr dip)
Set the dipole in charge for the emission.
Definition:
ShowerApproximationKernel.h:97
Herwig::ShowerApproximationKernel::nDimBorn
int nDimBorn() const
Return the number of random numbers needed to sample the Born process.
Definition:
ShowerApproximationKernel.h:150
Herwig::ShowerApproximationKernel::clone
virtual IBPtr clone() const
Make a simple clone of this object.
Herwig::ShowerApproximationKernel::sampler
ExponentialGeneratorPtr sampler
The Sudakov sampler.
Definition:
ShowerApproximationKernel.h:453
Herwig::ShowerApproximationKernel::stopPresampling
void stopPresampling()
Indicate that presampling of this kernel is done until startPresampling() is called.
Herwig::ShowerApproximationKernel::Init
static void Init()
The standard Init function used to initialize the interfaces.
Herwig::ShowerApproximationKernel::theShowerApproximationGenerator
Ptr< ShowerApproximationGenerator >::tptr theShowerApproximationGenerator
The shower approximation generator.
Definition:
ShowerApproximationKernel.h:424
Herwig::ShowerApproximationKernel::presamplingPoints
void presamplingPoints(unsigned long p)
Set the number of points to presample this splitting generator.
Definition:
ShowerApproximationKernel.h:229
Herwig::ShowerApproximationKernel::freezeGrid
void freezeGrid(unsigned long n)
Set the number of accepted points after which the grid should be frozen.
Definition:
ShowerApproximationKernel.h:241
Herwig::ShowerApproximationKernel::ShowerApproximationKernel
ShowerApproximationKernel()
The default constructor.
Herwig::ShowerApproximationKernel::evaluate
double evaluate(const vector< double > &)
Evalute the splitting kernel.
Herwig::ShowerApproximationKernel::thePresampling
bool thePresampling
True, if currently being presampled.
Definition:
ShowerApproximationKernel.h:391
Herwig::ShowerApproximationKernel::presampling
bool presampling() const
Return true, if currently being presampled.
Definition:
ShowerApproximationKernel.h:205
ThePEG::HandlerBase
ThePEG::PersistentIStream
ThePEG::PersistentOStream
exsample::exponential_generator
The generator for sudakov-type distributions.
Definition:
exponential_generator.h:28
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
Herwig::ShowerApproximationKernel::MaxTryException
Exception to communicate sampler maxtry events.
Definition:
ShowerApproximationKernel.h:43
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6