herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
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
DipoleSplittingGenerator is used by the dipole shower to sample splittings from a given dipole splitt...
Definition:
DipoleSplittingGenerator.h:38
Herwig::DipoleSplittingGenerator::splittingKernel
Ptr< DipoleSplittingKernel >::tptr splittingKernel() const
Return the dipole splitting kernel.
Herwig::DipoleSplittingGenerator::debugLastEvent
void debugLastEvent(ostream &) const
Print debug information on the last generated event.
Herwig::DipoleSplittingGenerator::evaluate
double evaluate(const vector< double > &)
Evalute the splitting kernel.
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::theFlags
vector< bool > theFlags
The sampling flags.
Definition:
DipoleSplittingGenerator.h:444
Herwig::DipoleSplittingGenerator::splittingWeight
double splittingWeight() const
Return the weight associated to the currently generated splitting.
Definition:
DipoleSplittingGenerator.h:287
Herwig::DipoleSplittingGenerator::resetVariations
void resetVariations()
Reset the current variations to one.
Herwig::DipoleSplittingGenerator::splittingReweight
Ptr< DipoleSplittingReweight >::tptr splittingReweight() const
Return the dipole splitting reweight.
Herwig::DipoleSplittingGenerator::stopPresampling
void stopPresampling()
Indicate that presampling of this kernel is done until startPresampling() is called.
Herwig::DipoleSplittingGenerator::theSplittingKernel
Ptr< DipoleSplittingKernel >::ptr theSplittingKernel
The dipole splitting kernel to sample splitting from.
Definition:
DipoleSplittingGenerator.h:400
Herwig::DipoleSplittingGenerator::initDipoleSplittingGenerator
static ClassDescription< DipoleSplittingGenerator > initDipoleSplittingGenerator
The static object used to initialize the description of this class.
Definition:
DipoleSplittingGenerator.h:501
Herwig::DipoleSplittingGenerator::accept
void accept(const vector< double > &, double p, double r)
Indicate that an accept with the given kernel value and overestimate has occured.
Herwig::DipoleSplittingGenerator::overestimate
double overestimate(const vector< double > &)
Return an overestimate to the sampled kernel.
Herwig::DipoleSplittingGenerator::prepare
void prepare(const DipoleSplittingInfo &)
Prepare to fill the given splitting.
Herwig::DipoleSplittingGenerator::fixParameters
void fixParameters(const DipoleSplittingInfo &, Energy optHardPt=ZERO)
Update parameters given a splitting.
Herwig::DipoleSplittingGenerator::generate
Energy generate(const DipoleSplittingInfo &, map< string, double > &variations, Energy optHardPt=ZERO, Energy optCutoff=ZERO)
Fix parameters from the given DipoleSplittingInfo and generate the next splitting.
Herwig::DipoleSplittingGenerator::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
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::doCompensate
void doCompensate(bool yes=true)
True, if sampler should apply compensation.
Definition:
DipoleSplittingGenerator.h:296
Herwig::DipoleSplittingGenerator::haveOverestimate
bool haveOverestimate() const
Return true, if this splitting generator is able to deliver an overestimate to the sampled kernel.
Herwig::DipoleSplittingGenerator::prepared
bool prepared
True, if prepared to sample splittings of a given kind.
Definition:
DipoleSplittingGenerator.h:428
Herwig::DipoleSplittingGenerator::doPartialUnweighting
void doPartialUnweighting(double wref)
Turn on partial unweighting and set the reference weight.
Definition:
DipoleSplittingGenerator.h:153
Herwig::DipoleSplittingGenerator::startPresampling
void startPresampling()
Indicate that presampling of this kernel will be performed in the next calls to evaluate until stopPr...
Herwig::DipoleSplittingGenerator::theOtherGenerator
Ptr< DipoleSplittingGenerator >::ptr theOtherGenerator
Pointer to another generator to wrap around.
Definition:
DipoleSplittingGenerator.h:394
Herwig::DipoleSplittingGenerator::theSplittingReweight
Ptr< DipoleSplittingReweight >::ptr theSplittingReweight
The dipole splitting reweight.
Definition:
DipoleSplittingGenerator.h:405
Herwig::DipoleSplittingGenerator::theSplittingWeight
double theSplittingWeight
The weight associated to the currently generated splitting.
Definition:
DipoleSplittingGenerator.h:469
Herwig::DipoleSplittingGenerator::clone
virtual IBPtr clone() const
Make a simple clone of this object.
Herwig::DipoleSplittingGenerator::maxtry
unsigned long maxtry() const
Return the maximum number of trials to generate a splitting.
Definition:
DipoleSplittingGenerator.h:238
Herwig::DipoleSplittingGenerator::wrappedSudakovExpansion
double wrappedSudakovExpansion(DipoleSplittingInfo &split, Energy down, Energy fixedScale)
wrapper for sudakovExpansion
Herwig::DipoleSplittingGenerator::theSudakovAccuracy
double theSudakovAccuracy
Sudakov sampling accuracy.
Definition:
DipoleSplittingGenerator.h:475
Herwig::DipoleSplittingGenerator::dosudakovExpansion
double dosudakovExpansion(const DipoleSplittingInfo &, Energy down, Energy fixedScale)
do the actual calculation for the sudakov expansion.
Herwig::DipoleSplittingGenerator::wrapping
bool wrapping() const
Return true, if this is actually a wrapper around another splitting generator.
Definition:
DipoleSplittingGenerator.h:91
Herwig::DipoleSplittingGenerator::splittingKinematics
Ptr< DipoleSplittingKinematics >::tptr splittingKinematics() const
Return the dipole splitting kinematics.
Herwig::DipoleSplittingGenerator::sudakov
double sudakov(const DipoleSplittingInfo &, Energy down)
Sample the Sudakov in monte carlo fashion.
Herwig::DipoleSplittingGenerator::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::DipoleSplittingGenerator::doGenerate
void doGenerate(map< string, double > &variations, Energy optCutoff=ZERO)
With the parameters previuosly supplied through fixParameters generate the next splitting.
Herwig::DipoleSplittingGenerator::sudakovExpansion
double sudakovExpansion(const DipoleSplittingInfo &, Energy down, Energy fixedScale)
Sample the Sudakov exponent for sudakovExpansion weights.
Herwig::DipoleSplittingGenerator::theDoCompensate
bool theDoCompensate
True, if sampler should apply compensation.
Definition:
DipoleSplittingGenerator.h:459
Herwig::DipoleSplittingGenerator::generateWrapped
Energy generateWrapped(DipoleSplittingInfo &, map< string, double > &variations, Energy optHardPt=ZERO, Energy optCutoff=ZERO)
Fix parameters from the fiven DipoleSplittingInfo and generate the next splitting.
Herwig::DipoleSplittingGenerator::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Herwig::DipoleSplittingGenerator::theMCCheck
Ptr< DipoleMCCheck >::ptr theMCCheck
Pointer to a check histogram object.
Definition:
DipoleSplittingGenerator.h:454
Herwig::DipoleSplittingGenerator::presamplingPoints
unsigned long presamplingPoints() const
Return the number of points to presample this splitting generator.
Definition:
DipoleSplittingGenerator.h:232
Herwig::DipoleSplittingGenerator::sampleFlags
const vector< bool > & sampleFlags()
Flag, which variables are free variables.
Herwig::DipoleSplittingGenerator::wrap
void wrap(Ptr< DipoleSplittingGenerator >::ptr other)
Make a wrapper around another generator.
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::currentWeights
map< string, double > currentWeights
The currently used weight map.
Definition:
DipoleSplittingGenerator.h:464
Herwig::DipoleSplittingGenerator::completeSplitting
void completeSplitting(DipoleSplittingInfo &) const
Complete the given splitting.
Herwig::DipoleSplittingGenerator::theSupport
pair< vector< double >, vector< double > > theSupport
The support.
Definition:
DipoleSplittingGenerator.h:449
Herwig::DipoleSplittingGenerator::splittingReweight
void splittingReweight(Ptr< DipoleSplittingReweight >::tptr sp)
Set the dipole splitting reweight.
Herwig::DipoleSplittingGenerator::support
const pair< vector< double >, vector< double > > & support()
Return the support of the splitting kernel.
Herwig::DipoleSplittingGenerator::parameters
vector< double > parameters
The parameter point.
Definition:
DipoleSplittingGenerator.h:439
Herwig::DipoleSplittingGenerator::wrappedSudakov
double wrappedSudakov(DipoleSplittingInfo &split, Energy down)
wrapper for sudakovExpansion for identical dipoles.
Herwig::DipoleSplittingGenerator::detuning
double detuning() const
Return the detuning factor applied to the sampling overestimate kernel.
Definition:
DipoleSplittingGenerator.h:249
Herwig::DipoleSplittingGenerator::veto
void veto(const vector< double > &, double p, double r)
Indicate that a veto with the given kernel value and overestimate has occured.
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::invertOverestimateIntegral
double invertOverestimateIntegral(double) const
Invert the integral over the overestimate to equal the given value.
Herwig::DipoleSplittingGenerator::operator=
DipoleSplittingGenerator & operator=(const DipoleSplittingGenerator &)=delete
The assignment operator is private and must never be called.
Herwig::DipoleSplittingGenerator::debugGenerator
void debugGenerator(ostream &) const
Print debug information on the splitting handled.
Herwig::DipoleSplittingGenerator::lastSplitting
const DipoleSplittingInfo & lastSplitting() const
Return the last generated splitting.
Definition:
DipoleSplittingGenerator.h:134
Herwig::DipoleSplittingGenerator::partialUnweighting
bool partialUnweighting
Flag for partial unweighting.
Definition:
DipoleSplittingGenerator.h:487
Herwig::DipoleSplittingGenerator::presampling
bool presampling
Wether or not the kernel is currently being presampled.
Definition:
DipoleSplittingGenerator.h:434
Herwig::DipoleSplittingGenerator::DipoleSplittingGenerator
DipoleSplittingGenerator()
The default constructor.
Herwig::DipoleSplittingGenerator::generatedSplitting
DipoleSplittingInfo generatedSplitting
The dipole splitting to be completed.
Definition:
DipoleSplittingGenerator.h:416
Herwig::DipoleSplittingGenerator::splittingKernel
void splittingKernel(Ptr< DipoleSplittingKernel >::tptr sp)
Set the dipole splitting kernel.
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::DipoleSplittingGenerator::theExponentialGenerator
exsample::exponential_generator< DipoleSplittingGenerator, UseRandom > * theExponentialGenerator
Pointer to the exponential generator.
Definition:
DipoleSplittingGenerator.h:411
Herwig::DipoleSplittingGenerator::Init
static void Init()
The standard Init function used to initialize the interfaces.
Herwig::DipoleSplittingGenerator::presampledSplitting
DipoleSplittingInfo presampledSplitting
A backup of the dipole splitting to be completed, if this generator is presampled.
Definition:
DipoleSplittingGenerator.h:422
Herwig::DipoleSplittingGenerator::~DipoleSplittingGenerator
virtual ~DipoleSplittingGenerator()
The destructor.
Herwig::DipoleSplittingGenerator::nDim
int nDim() const
Return the number of random numbers needed to sample this kernel.
Herwig::DipoleSplittingGenerator::dosudakov
double dosudakov(const DipoleSplittingInfo &, Energy down)
do the actiual calculation of the sudakov exponent.
Herwig::DipoleSplittingInfo
DipoleSplittingInfo contains all parameters to generate a full dipole splitting.
Definition:
DipoleSplittingInfo.h:209
ThePEG::ClassDescription
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
ThePEG::ZERO
constexpr ZeroUnit ZERO
ThePEG::BaseClassTrait
ThePEG::BaseClassTrait::NthBase
int NthBase
ThePEG::ClassTraitsBase
ThePEG::ClassTraitsBase::className
static string className()
ThePEG::ClassTraitsBase::library
static string library()
ThePEG::ClassTraits
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6