herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.2.1
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
52
ShowerApproximationKernel
();
53
57
virtual
~
ShowerApproximationKernel
();
59
60
public
:
61
65
void
setBornXComb
(tStdXCombPtr xc) { theBornXComb = xc; }
66
70
tcStdXCombPtr
bornCXComb
()
const
{
return
theBornXComb; }
71
75
tStdXCombPtr
bornXComb
()
const
{
return
theBornXComb; }
76
80
void
setRealXComb
(tStdXCombPtr xc) { theRealXComb = xc; }
81
85
tcStdXCombPtr
realCXComb
()
const
{
return
theRealXComb; }
86
90
tStdXCombPtr
realXComb
()
const
{
return
theRealXComb; }
91
95
void
setTildeXCombs
(
const
vector<StdXCombPtr>& xc) { theTildeXCombs = xc; }
96
100
const
vector<StdXCombPtr>&
tildeXCombs
()
const
{
return
theTildeXCombs; }
101
105
void
setDipole
(Ptr<SubtractionDipole>::tptr dip) { theDipole = dip; }
106
110
Ptr<SubtractionDipole>::tptr
dipole
()
const
{
return
theDipole; }
111
115
void
showerApproximation
(Ptr<ShowerApproximation>::tptr app) { theShowerApproximation = app; }
116
120
Ptr<ShowerApproximation>::tptr
showerApproximation
()
const
{
return
theShowerApproximation; }
121
125
void
showerApproximationGenerator(Ptr<ShowerApproximationGenerator>::tptr);
126
130
Ptr<ShowerApproximationGenerator>::tptr showerApproximationGenerator()
const
;
131
135
double
generate
();
136
137
public
:
138
142
void
ptCut
(Energy pt) { dipole()->ptCut(pt); }
143
148
int
nDim
()
const
{
149
return
150
nDimBorn() +
151
dipole()->nDimRadiation();
152
}
153
158
int
nDimBorn
()
const
{
159
return
bornCXComb()->lastRandomNumbers().size();
160
}
161
165
const
vector<bool>& sampleFlags();
166
173
const
pair<vector<double>,vector<double> >& support();
174
179
const
vector<double>& parameterPoint();
180
186
void
startPresampling();
187
192
void
stopPresampling();
193
197
void
veto
(
const
vector<double>&,
double
,
double
) {
200
}
201
205
void
accept
(
const
vector<double>&,
double
,
double
) {
208
}
209
213
bool
presampling
()
const
{
return
thePresampling; }
214
219
unsigned
long
presamplingPoints
()
const
{
return
thePresamplingPoints; }
220
225
unsigned
long
maxtry
()
const
{
return
theMaxTry; }
226
231
unsigned
long
freezeGrid
()
const
{
return
theFreezeGrid; }
232
237
void
presamplingPoints
(
unsigned
long
p) { thePresamplingPoints = p; }
238
243
void
maxtry
(
unsigned
long
p) { theMaxTry = p; }
244
249
void
freezeGrid
(
unsigned
long
n) { theFreezeGrid = n; }
250
254
double
evaluate(
const
vector<double>&);
255
260
int
evolutionVariable
()
const
{
261
return
262
nDimBorn() +
263
(showerApproximation()->showerInvertedTildeKinematics() ?
264
showerApproximation()->showerInvertedTildeKinematics()->evolutionVariable() :
265
dipole()->invertedTildeKinematics()->evolutionVariable());
266
}
267
272
double
evolutionCutoff
()
const
{
273
return
274
showerApproximation()->showerInvertedTildeKinematics() ?
275
showerApproximation()->showerInvertedTildeKinematics()->evolutionCutoff() :
276
dipole()->invertedTildeKinematics()->evolutionCutoff();
277
}
278
282
void
doCompensate
(
bool
yes =
true
) { theDoCompensate = yes; }
283
284
public
:
285
288
289
inline
const
vector<bool>& variable_flags () {
290
return
sampleFlags();
291
}
292
293
inline
size_t
evolution_variable ()
const
{
return
evolutionVariable(); }
294
295
inline
double
evolution_cutoff ()
const
{
296
return
evolutionCutoff();
297
}
298
299
inline
const
vector<double>& parameter_point () {
300
return
parameterPoint();
301
}
302
303
inline
void
start_presampling () {
304
startPresampling();
305
}
306
307
inline
void
stop_presampling () {
308
stopPresampling();
309
}
310
311
inline
size_t
dimension ()
const
{
312
return
nDim();
313
}
314
315
inline
unsigned
long
presampling_points ()
const
{
316
return
presamplingPoints();
317
}
318
320
321
public
:
322
329
void
persistentOutput(
PersistentOStream
& os)
const
;
330
336
void
persistentInput(
PersistentIStream
& is,
int
version);
338
345
static
void
Init();
346
347
protected
:
348
355
virtual
IBPtr
clone()
const
;
356
361
virtual
IBPtr
fullclone()
const
;
363
364
365
// If needed, insert declarations of virtual function defined in the
366
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
367
368
369
private
:
370
374
Ptr<SubtractionDipole>::ptr
theDipole
;
375
379
Ptr<ShowerApproximation>::ptr
theShowerApproximation
;
380
384
StdXCombPtr
theBornXComb
;
385
389
StdXCombPtr
theRealXComb
;
390
394
vector<StdXCombPtr>
theTildeXCombs
;
395
399
bool
thePresampling
;
400
405
unsigned
long
thePresamplingPoints
;
406
411
unsigned
long
theMaxTry
;
412
417
unsigned
long
theFreezeGrid
;
418
422
vector<bool>
theFlags
;
423
427
pair<vector<double>,vector<double> >
theSupport
;
428
432
Ptr<ShowerApproximationGenerator>::tptr
theShowerApproximationGenerator
;
433
437
vector<double>
theLastParameterPoint
;
438
442
vector<double>
theLastBornPoint
;
443
447
typedef
448
exsample::exponential_generator<ShowerApproximationKernel,UseRandom>
449
ExponentialGenerator
;
450
454
typedef
455
exsample::exponential_generator<ShowerApproximationKernel,UseRandom>
*
456
ExponentialGeneratorPtr
;
457
461
ExponentialGeneratorPtr
sampler
;
462
466
bool
theDoCompensate
;
467
472
ShowerApproximationKernel
& operator=(
const
ShowerApproximationKernel
&) =
delete
;
473
474
};
475
476
}
477
478
#endif
/* Herwig_ShowerApproximationKernel_H */
Herwig::ShowerApproximationKernel::setRealXComb
void setRealXComb(tStdXCombPtr xc)
Set the XComb object describing the real emission process.
Definition:
ShowerApproximationKernel.h:80
Herwig::ShowerApproximationKernel::theLastParameterPoint
vector< double > theLastParameterPoint
The last parameter point.
Definition:
ShowerApproximationKernel.h:437
ThePEG::PersistentIStream
Herwig::ShowerApproximationKernel::evolutionCutoff
double evolutionCutoff() const
Return the cutoff on the evolution random number corresponding to the pt cut.
Definition:
ShowerApproximationKernel.h:272
Herwig::ShowerApproximationKernel::theDipole
Ptr< SubtractionDipole >::ptr theDipole
The dipole in charge of the emission.
Definition:
ShowerApproximationKernel.h:374
Herwig::ShowerApproximationKernel::showerApproximation
Ptr< ShowerApproximation >::tptr showerApproximation() const
Return the shower approximation.
Definition:
ShowerApproximationKernel.h:120
Herwig::ShowerApproximationKernel::thePresamplingPoints
unsigned long thePresamplingPoints
The number of points to presample this splitting generator.
Definition:
ShowerApproximationKernel.h:405
Herwig::ShowerApproximationKernel::realCXComb
tcStdXCombPtr realCXComb() const
Return the XComb object describing the real emission process.
Definition:
ShowerApproximationKernel.h:85
Herwig::ShowerApproximationKernel::ptCut
void ptCut(Energy pt)
Set a pt cut on the dipole to generate the radiation.
Definition:
ShowerApproximationKernel.h:142
Herwig::ShowerApproximationKernel::ExponentialGeneratorPtr
exsample::exponential_generator< ShowerApproximationKernel, UseRandom > * ExponentialGeneratorPtr
Define a pointer to the Sudakov sampler.
Definition:
ShowerApproximationKernel.h:456
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:197
Herwig::ShowerApproximationKernel::freezeGrid
unsigned long freezeGrid() const
Return the number of accepted points after which the grid should be frozen.
Definition:
ShowerApproximationKernel.h:231
ThePEG::PersistentOStream
Herwig::ShowerApproximationKernel::MaxTryException
Exception to communicate sampler maxtry events.
Definition:
ShowerApproximationKernel.h:43
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:205
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
Herwig::ShowerApproximationKernel::setDipole
void setDipole(Ptr< SubtractionDipole >::tptr dip)
Set the dipole in charge for the emission.
Definition:
ShowerApproximationKernel.h:105
Herwig::ShowerApproximationKernel::theFreezeGrid
unsigned long theFreezeGrid
Return the number of accepted points after which the grid should be frozen.
Definition:
ShowerApproximationKernel.h:417
Herwig::ShowerApproximationKernel::theRealXComb
StdXCombPtr theRealXComb
The XComb describing the process after radiation.
Definition:
ShowerApproximationKernel.h:389
Herwig::ShowerApproximationKernel
ShowerApproximationKernel generates emissions according to a shower approximation entering a NLO matc...
Definition:
ShowerApproximationKernel.h:36
Herwig::ShowerApproximationKernel::theLastBornPoint
vector< double > theLastBornPoint
The last random numbers used for Born sampling.
Definition:
ShowerApproximationKernel.h:442
Herwig::ShowerApproximationKernel::realXComb
tStdXCombPtr realXComb() const
Return the XComb object describing the real emission process.
Definition:
ShowerApproximationKernel.h:90
ThePEG
Herwig::ShowerApproximationKernel::theShowerApproximationGenerator
Ptr< ShowerApproximationGenerator >::tptr theShowerApproximationGenerator
The shower approximation generator.
Definition:
ShowerApproximationKernel.h:432
Herwig::ShowerApproximationKernel::dipole
Ptr< SubtractionDipole >::tptr dipole() const
Return the dipole in charge for the emission.
Definition:
ShowerApproximationKernel.h:110
Herwig::ShowerApproximationKernel::bornCXComb
tcStdXCombPtr bornCXComb() const
Return the XComb object describing the Born process.
Definition:
ShowerApproximationKernel.h:70
Herwig::ShowerApproximationKernel::nDim
int nDim() const
Return the number of random numbers needed to sample this kernel.
Definition:
ShowerApproximationKernel.h:148
Herwig::ShowerApproximationKernel::presamplingPoints
void presamplingPoints(unsigned long p)
Set the number of points to presample this splitting generator.
Definition:
ShowerApproximationKernel.h:237
Herwig::ShowerApproximationKernel::thePresampling
bool thePresampling
True, if currently being presampled.
Definition:
ShowerApproximationKernel.h:399
Herwig::ShowerApproximationKernel::setBornXComb
void setBornXComb(tStdXCombPtr xc)
Set the XComb object describing the Born process.
Definition:
ShowerApproximationKernel.h:65
Herwig::ShowerApproximationKernel::doCompensate
void doCompensate(bool yes=true)
True, if sampler should apply compensation.
Definition:
ShowerApproximationKernel.h:282
exsample::exponential_generator< ShowerApproximationKernel, UseRandom >
Herwig::ShowerApproximationKernel::maxtry
void maxtry(unsigned long p)
Set the maximum number of trials to generate a splitting.
Definition:
ShowerApproximationKernel.h:243
Herwig::ShowerApproximationKernel::presamplingPoints
unsigned long presamplingPoints() const
Return the number of points to presample this splitting generator.
Definition:
ShowerApproximationKernel.h:219
Herwig::ShowerApproximationKernel::tildeXCombs
const vector< StdXCombPtr > & tildeXCombs() const
Return the tilde xcomb objects associated to the real xcomb.
Definition:
ShowerApproximationKernel.h:100
Herwig::ShowerApproximationKernel::theShowerApproximation
Ptr< ShowerApproximation >::ptr theShowerApproximation
The shower approximation to consider.
Definition:
ShowerApproximationKernel.h:379
Herwig::ShowerApproximationKernel::sampler
ExponentialGeneratorPtr sampler
The Sudakov sampler.
Definition:
ShowerApproximationKernel.h:461
Herwig::ShowerApproximationKernel::theSupport
pair< vector< double >, vector< double > > theSupport
The support.
Definition:
ShowerApproximationKernel.h:427
Herwig::ShowerApproximationKernel::showerApproximation
void showerApproximation(Ptr< ShowerApproximation >::tptr app)
Set the shower approximation.
Definition:
ShowerApproximationKernel.h:115
Herwig::ShowerApproximationKernel::ExponentialGenerator
exsample::exponential_generator< ShowerApproximationKernel, UseRandom > ExponentialGenerator
Define the Sudakov sampler.
Definition:
ShowerApproximationKernel.h:449
Herwig::ShowerApproximationKernel::freezeGrid
void freezeGrid(unsigned long n)
Set the number of accepted points after which the grid should be frozen.
Definition:
ShowerApproximationKernel.h:249
ThePEG::HandlerBase
Herwig::RandomHelpers::generate
pair< double, double > generate(const Generator< Density > &gen, double r)
Generate a random variable and return its weight.
Definition:
RandomHelpers.h:182
Herwig::ShowerApproximationKernel::theFlags
vector< bool > theFlags
The sampling flags.
Definition:
ShowerApproximationKernel.h:422
Herwig::ShowerApproximationKernel::setTildeXCombs
void setTildeXCombs(const vector< StdXCombPtr > &xc)
Set the tilde xcomb objects associated to the real xcomb.
Definition:
ShowerApproximationKernel.h:95
Herwig::ShowerApproximationKernel::nDimBorn
int nDimBorn() const
Return the number of random numbers needed to sample the Born process.
Definition:
ShowerApproximationKernel.h:158
Herwig::ShowerApproximationKernel::maxtry
unsigned long maxtry() const
Return the maximum number of trials to generate a splitting.
Definition:
ShowerApproximationKernel.h:225
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
Herwig::ShowerApproximationKernel::theMaxTry
unsigned long theMaxTry
The maximum number of trials to generate a splitting.
Definition:
ShowerApproximationKernel.h:411
Herwig::ShowerApproximationKernel::presampling
bool presampling() const
Return true, if currently being presampled.
Definition:
ShowerApproximationKernel.h:213
Herwig::ShowerApproximationKernel::evolutionVariable
int evolutionVariable() const
Return the index of the random number corresponding to the evolution variable.
Definition:
ShowerApproximationKernel.h:260
Herwig::ShowerApproximationKernel::bornXComb
tStdXCombPtr bornXComb() const
Return the XComb object describing the Born process.
Definition:
ShowerApproximationKernel.h:75
Herwig::ShowerApproximationKernel::theDoCompensate
bool theDoCompensate
True, if sampler should apply compensation.
Definition:
ShowerApproximationKernel.h:466
Herwig::ShowerApproximationKernel::theBornXComb
StdXCombPtr theBornXComb
The XComb off which radiation will be generated.
Definition:
ShowerApproximationKernel.h:384
Herwig::ShowerApproximationKernel::theTildeXCombs
vector< StdXCombPtr > theTildeXCombs
The tilde xcomb objects associated to the real xcomb.
Definition:
ShowerApproximationKernel.h:394
Generated on Sat Apr 11 2020 14:50:31 for Herwig by
1.8.13