herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.2.1
Shower
Dipole
Base
DipoleSplittingGenerator.h
1
// -*- C++ -*-
2
//
3
// DipoleSplittingGenerator.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_DipoleSplittingGenerator_H
10
#define HERWIG_DipoleSplittingGenerator_H
11
//
12
// This is the declaration of the DipoleSplittingGenerator class.
13
//
14
15
#include "ThePEG/Handlers/HandlerBase.h"
16
17
#include "Herwig/Shower/Dipole/Kernels/DipoleSplittingKernel.h"
18
#include "DipoleSplittingReweight.h"
19
#include "Herwig/Shower/Dipole/Utility/DipoleMCCheck.h"
20
#include "Herwig/Sampling/exsample/exponential_generator.h"
21
22
#include <tuple>
23
24
namespace
Herwig
{
25
26
using namespace
ThePEG
;
27
38
class
DipoleSplittingGenerator
:
public
HandlerBase
{
39
40
public
:
41
47
DipoleSplittingGenerator
();
48
52
virtual
~
DipoleSplittingGenerator
();
54
55
public
:
56
60
Ptr<DipoleSplittingKernel>::tptr splittingKernel()
const
;
61
65
Ptr<DipoleSplittingReweight>::tptr splittingReweight()
const
;
66
70
Ptr<DipoleSplittingKinematics>::tptr splittingKinematics()
const
;
71
75
void
splittingKernel(Ptr<DipoleSplittingKernel>::tptr sp);
76
80
void
splittingReweight(Ptr<DipoleSplittingReweight>::tptr sp);
81
85
void
wrap(Ptr<DipoleSplittingGenerator>::ptr other);
86
91
bool
wrapping
()
const
{
return
theOtherGenerator; }
92
93
public
:
94
98
void
resetVariations();
99
103
void
prepare(
const
DipoleSplittingInfo
&);
104
110
Energy
generate
(
const
DipoleSplittingInfo
&,
111
map<string,double>& variations,
112
Energy optHardPt =
ZERO
,
113
Energy optCutoff =
ZERO
);
114
121
Energy generateWrapped(
DipoleSplittingInfo
&,
122
map<string,double>& variations,
123
Energy optHardPt =
ZERO
,
124
Energy optCutoff =
ZERO
);
125
129
void
completeSplitting(
DipoleSplittingInfo
&)
const
;
130
134
const
DipoleSplittingInfo
&
lastSplitting
()
const
{
return
generatedSplitting; }
135
136
138
double
sudakov(
const
DipoleSplittingInfo
&,Energy down);
140
double
dosudakov(
const
DipoleSplittingInfo
&,Energy down);
142
double
wrappedSudakov(
DipoleSplittingInfo
& split,Energy down);
144
double
sudakovExpansion(
const
DipoleSplittingInfo
&,Energy down,Energy fixedScale);
146
double
dosudakovExpansion(
const
DipoleSplittingInfo
&,Energy down,Energy fixedScale);
148
double
wrappedSudakovExpansion(
DipoleSplittingInfo
& split,Energy down,Energy fixedScale);
149
153
void
doPartialUnweighting
(
double
wref) {
154
partialUnweighting =
true
;
155
theReferenceWeight = wref;
156
}
157
158
public
:
159
164
void
debugGenerator(ostream&)
const
;
165
170
void
debugLastEvent(ostream&)
const
;
171
172
protected
:
173
177
void
fixParameters(
const
DipoleSplittingInfo
&,
178
Energy optHardPt =
ZERO
);
179
185
void
doGenerate(map<string,double>& variations,
186
Energy optCutoff =
ZERO
);
187
188
public
:
189
194
int
nDim()
const
;
195
199
const
vector<bool>& sampleFlags();
200
207
const
pair<vector<double>,vector<double> >& support();
208
213
const
vector<double>&
parameterPoint
()
const
{
return
parameters; }
214
220
void
startPresampling();
221
226
void
stopPresampling();
227
232
unsigned
long
presamplingPoints
()
const
{
return
splittingKernel()->presamplingPoints(); }
233
238
unsigned
long
maxtry
()
const
{
return
splittingKernel()->maxtry(); }
239
244
unsigned
long
freezeGrid
()
const
{
return
splittingKernel()->freezeGrid(); }
245
249
double
detuning
()
const
{
return
splittingKernel()->detuning(); }
250
256
bool
haveOverestimate()
const
;
257
261
double
overestimate(
const
vector<double>&);
262
267
double
invertOverestimateIntegral(
double
)
const
;
268
272
double
evaluate(
const
vector<double>&);
273
277
void
veto(
const
vector<double>&,
double
p,
double
r);
278
282
void
accept(
const
vector<double>&,
double
p,
double
r);
283
287
double
splittingWeight
()
const
{
288
if
( wrapping() )
289
return
theOtherGenerator->splittingWeight();
290
return
theSplittingWeight;
291
}
292
296
void
doCompensate
(
bool
yes =
true
) { theDoCompensate = yes; }
297
301
vector<std::tuple<Energy,double,bool> >
splittingWeightVector
()
const
{
302
if
( wrapping() )
303
return
theOtherGenerator->splittingWeightVector();
304
return
theSplittingWeightVector;
305
}
306
307
public
:
308
311
312
inline
const
vector<bool>& variable_flags () {
313
return
sampleFlags();
314
}
315
316
inline
size_t
evolution_variable ()
const
{
return
0; }
317
318
inline
double
evolution_cutoff () {
return
support().first[0]; }
319
320
inline
const
vector<double>& parameter_point ()
const
{
321
return
parameterPoint();
322
}
323
324
inline
void
start_presampling () {
325
startPresampling();
326
}
327
328
inline
void
stop_presampling () {
329
stopPresampling();
330
}
331
332
inline
size_t
dimension ()
const
{
333
return
nDim();
334
}
335
336
inline
unsigned
long
presampling_points ()
const
{
337
return
presamplingPoints();
338
}
339
341
342
public
:
343
350
void
persistentOutput(
PersistentOStream
& os)
const
;
351
357
void
persistentInput(
PersistentIStream
& is,
int
version);
359
366
static
void
Init();
367
368
protected
:
369
376
virtual
IBPtr
clone()
const
;
377
382
virtual
IBPtr
fullclone()
const
;
384
385
386
// If needed, insert declarations of virtual function defined in the
387
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
388
389
private
:
390
394
Ptr<DipoleSplittingGenerator>::ptr
theOtherGenerator
;
395
400
Ptr<DipoleSplittingKernel>::ptr
theSplittingKernel
;
401
405
Ptr<DipoleSplittingReweight>::ptr
theSplittingReweight
;
406
410
exsample::exponential_generator<DipoleSplittingGenerator,UseRandom>
*
411
theExponentialGenerator
;
412
416
DipoleSplittingInfo
generatedSplitting
;
417
422
DipoleSplittingInfo
presampledSplitting
;
423
428
bool
prepared
;
429
434
bool
presampling
;
435
439
vector<double>
parameters
;
440
444
vector<bool>
theFlags
;
445
449
pair<vector<double>,vector<double> >
theSupport
;
450
454
Ptr<DipoleMCCheck>::ptr
theMCCheck
;
455
459
bool
theDoCompensate
;
460
464
map<string,double>
currentWeights
;
465
469
double
theSplittingWeight
;
470
471
475
double
theSudakovAccuracy=0.05;
476
482
double
theReferenceWeight
;
483
487
bool
partialUnweighting =
false
;
488
493
vector<std::tuple<Energy,double,bool> >
theSplittingWeightVector
;
494
495
private
:
496
501
static
ClassDescription<DipoleSplittingGenerator>
initDipoleSplittingGenerator
;
502
507
DipoleSplittingGenerator
& operator=(
const
DipoleSplittingGenerator
&) =
delete
;
508
509
};
510
511
}
512
513
#include "ThePEG/Utilities/ClassTraits.h"
514
515
namespace
ThePEG
{
516
521
template
<>
522
struct
BaseClassTrait
<Herwig::
DipoleSplittingGenerator
,1> {
524
typedef
HandlerBase
NthBase;
525
};
526
529
template
<>
530
struct
ClassTraits
<Herwig::
DipoleSplittingGenerator
>
531
:
public
ClassTraitsBase
<Herwig::DipoleSplittingGenerator> {
533
static
string
className() {
return
"Herwig::DipoleSplittingGenerator"
; }
541
static
string
library() {
return
"HwDipoleShower.so"
; }
542
};
543
546
}
547
548
#endif
/* HERWIG_DipoleSplittingGenerator_H */
Herwig::DipoleSplittingGenerator::generatedSplitting
DipoleSplittingInfo generatedSplitting
The dipole splitting to be completed.
Definition:
DipoleSplittingGenerator.h:416
Herwig::DipoleSplittingGenerator::initDipoleSplittingGenerator
static ClassDescription< DipoleSplittingGenerator > initDipoleSplittingGenerator
The static object used to initialize the description of this class.
Definition:
DipoleSplittingGenerator.h:501
ThePEG::PersistentIStream
Herwig::DipoleSplittingGenerator::maxtry
unsigned long maxtry() const
Return the maximum number of trials to generate a splitting.
Definition:
DipoleSplittingGenerator.h:238
Herwig::DipoleSplittingGenerator::parameters
vector< double > parameters
The parameter point.
Definition:
DipoleSplittingGenerator.h:439
ThePEG::ClassDescription
ThePEG::PersistentOStream
Herwig::DipoleSplittingGenerator::detuning
double detuning() const
Return the detuning factor applied to the sampling overestimate kernel.
Definition:
DipoleSplittingGenerator.h:249
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
Herwig::DipoleSplittingGenerator::splittingWeightVector
vector< std::tuple< Energy, double, bool > > splittingWeightVector() const
Return the weight vector associated to the currently generated splitting.
Definition:
DipoleSplittingGenerator.h:301
Herwig::DipoleSplittingGenerator::theMCCheck
Ptr< DipoleMCCheck >::ptr theMCCheck
Pointer to a check histogram object.
Definition:
DipoleSplittingGenerator.h:454
ThePEG
Herwig::DipoleSplittingGenerator::theSupport
pair< vector< double >, vector< double > > theSupport
The support.
Definition:
DipoleSplittingGenerator.h:449
Herwig::DipoleSplittingGenerator::doCompensate
void doCompensate(bool yes=true)
True, if sampler should apply compensation.
Definition:
DipoleSplittingGenerator.h:296
exsample::exponential_generator
The generator for sudakov-type distributions.
Definition:
exponential_generator.h:28
Herwig::DipoleSplittingGenerator
DipoleSplittingGenerator is used by the dipole shower to sample splittings from a given dipole splitt...
Definition:
DipoleSplittingGenerator.h:38
Herwig::DipoleSplittingGenerator::freezeGrid
unsigned long freezeGrid() const
Return the number of accepted points after which the grid should be frozen.
Definition:
DipoleSplittingGenerator.h:244
Herwig::DipoleSplittingGenerator::parameterPoint
const vector< double > & parameterPoint() const
Return the parameter point associated to the splitting previously supplied through fixParameters...
Definition:
DipoleSplittingGenerator.h:213
Herwig::DipoleSplittingGenerator::prepared
bool prepared
True, if prepared to sample splittings of a given kind.
Definition:
DipoleSplittingGenerator.h:428
Herwig::DipoleSplittingGenerator::theFlags
vector< bool > theFlags
The sampling flags.
Definition:
DipoleSplittingGenerator.h:444
Herwig::DipoleSplittingGenerator::theDoCompensate
bool theDoCompensate
True, if sampler should apply compensation.
Definition:
DipoleSplittingGenerator.h:459
Herwig::DipoleSplittingGenerator::lastSplitting
const DipoleSplittingInfo & lastSplitting() const
Return the last generated splitting.
Definition:
DipoleSplittingGenerator.h:134
Herwig::DipoleSplittingGenerator::presampling
bool presampling
Wether or not the kernel is currently being presampled.
Definition:
DipoleSplittingGenerator.h:434
ThePEG::HandlerBase
Herwig::DipoleSplittingGenerator::splittingWeight
double splittingWeight() const
Return the weight associated to the currently generated splitting.
Definition:
DipoleSplittingGenerator.h:287
Herwig::DipoleSplittingGenerator::theExponentialGenerator
exsample::exponential_generator< DipoleSplittingGenerator, UseRandom > * theExponentialGenerator
Pointer to the exponential generator.
Definition:
DipoleSplittingGenerator.h:411
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::DipoleSplittingGenerator::wrapping
bool wrapping() const
Return true, if this is actually a wrapper around another splitting generator.
Definition:
DipoleSplittingGenerator.h:91
Herwig::DipoleSplittingGenerator::currentWeights
map< string, double > currentWeights
The currently used weight map.
Definition:
DipoleSplittingGenerator.h:464
Herwig::DipoleSplittingGenerator::theSplittingWeightVector
vector< std::tuple< Energy, double, bool > > theSplittingWeightVector
The scale, weight and a bool for all veto steps and the accept step.
Definition:
DipoleSplittingGenerator.h:493
Herwig::DipoleSplittingGenerator::theOtherGenerator
Ptr< DipoleSplittingGenerator >::ptr theOtherGenerator
Pointer to another generator to wrap around.
Definition:
DipoleSplittingGenerator.h:394
Herwig::DipoleSplittingGenerator::doPartialUnweighting
void doPartialUnweighting(double wref)
Turn on partial unweighting and set the reference weight.
Definition:
DipoleSplittingGenerator.h:153
Herwig::DipoleSplittingGenerator::theSplittingWeight
double theSplittingWeight
The weight associated to the currently generated splitting.
Definition:
DipoleSplittingGenerator.h:469
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG::ClassTraits
Herwig::DipoleSplittingGenerator::theSplittingReweight
Ptr< DipoleSplittingReweight >::ptr theSplittingReweight
The dipole splitting reweight.
Definition:
DipoleSplittingGenerator.h:405
Herwig::DipoleSplittingGenerator::presamplingPoints
unsigned long presamplingPoints() const
Return the number of points to presample this splitting generator.
Definition:
DipoleSplittingGenerator.h:232
Herwig::DipoleSplittingGenerator::theReferenceWeight
double theReferenceWeight
Reference weight to improve convergence for subleading Nc corrections (by reducing time spent on even...
Definition:
DipoleSplittingGenerator.h:482
Herwig::DipoleSplittingInfo
DipoleSplittingInfo contains all parameters to generate a full dipole splitting.
Definition:
DipoleSplittingInfo.h:209
Herwig::DipoleSplittingGenerator::theSplittingKernel
Ptr< DipoleSplittingKernel >::ptr theSplittingKernel
The dipole splitting kernel to sample splitting from.
Definition:
DipoleSplittingGenerator.h:400
ThePEG::BaseClassTrait
ZERO
constexpr ZeroUnit ZERO
Herwig::DipoleSplittingGenerator::presampledSplitting
DipoleSplittingInfo presampledSplitting
A backup of the dipole splitting to be completed, if this generator is presampled.
Definition:
DipoleSplittingGenerator.h:422
ThePEG::ClassTraitsBase
Generated on Sat Apr 11 2020 14:50:29 for Herwig by
1.8.13