herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
MatrixElement
Matchbox
Base
SubtractedME.h
1
// -*- C++ -*-
2
//
3
// SubtractedME.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_SubtractedME_H
10
#define HERWIG_SubtractedME_H
11
//
12
// This is the declaration of the SubtractedME class.
13
//
14
15
#include "ThePEG/MatrixElement/MEGroup.h"
16
#include "Herwig/MatrixElement/Matchbox/Base/MatchboxMEBase.h"
17
#include "Herwig/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
18
#include "Herwig/MatrixElement/Matchbox/Utility/LastMatchboxXCombInfo.h"
19
#include "Herwig/MatrixElement/Matchbox/MatchboxFactory.fh"
20
21
namespace
Herwig
{
22
23
using namespace
ThePEG
;
24
34
class
SubtractedME
:
35
public
MEGroup
,
36
public
LastMatchboxXCombInfo
{
37
38
public
:
39
43
SubtractedME
();
44
45
public
:
46
50
Ptr<MatchboxFactory>::tcptr
factory
()
const
;
51
54
59
virtual
StdXCombPtr
makeXComb
(Energy newMaxEnergy,
const
cPDPair
& inc,
60
tEHPtr
newEventHandler,tSubHdlPtr newSubProcessHandler,
61
tPExtrPtr
newExtractor,
tCascHdlPtr
newCKKW,
62
const
PBPair & newPartonBins, tCutsPtr newCuts,
63
const
DiagramVector
& newDiagrams,
bool
mir,
64
const
PartonPairVec& allPBins,
65
tStdXCombPtr newHead = tStdXCombPtr(),
66
tMEPtr newME = tMEPtr());
67
72
virtual
void
setXComb
(tStdXCombPtr);
73
79
virtual
bool
uniformAdditional
()
const
{
return
true
; }
80
86
virtual
bool
keepRandomNumbers
()
const
{
return
true
; }
87
93
virtual
MEBase::DiagramVector
dependentDiagrams
(
const
cPDVector
& proc,
94
tMEPtr depME)
const
;
95
102
virtual
bool
subProcessGroups
()
const
;
103
109
virtual
bool
selectDependentSubProcess
()
const
{
return
false
; }
110
115
virtual
void
fillProjectors
();
116
120
virtual
bool
willProject
()
const
{
121
return
virtualShowerSubtraction
() ||
loopSimSubtraction
();
122
}
123
128
virtual
bool
groupReweighted
()
const
{
129
return
showerApproximation
();
130
}
131
135
virtual
double
reweightHead
(
const
vector<tStdXCombPtr>&);
136
140
virtual
double
reweightDependent
(tStdXCombPtr,
const
vector<tStdXCombPtr>&);
141
145
void
doRealEmissionScales
();
146
148
151
157
virtual
void
flushCaches
() {
158
MEGroup::flushCaches
();
159
if
(
showerApproximation
() )
160
showerApproximation
()->resetBelowCutoff();
161
}
162
166
Ptr<ShowerApproximation>::tptr
showerApproximation
()
const
;
167
171
void
doRealShowerSubtraction
();
172
176
bool
realShowerSubtraction
()
const
{
return
theRealShowerSubtraction
; }
177
181
void
doVirtualShowerSubtraction
();
182
186
bool
virtualShowerSubtraction
()
const
{
return
theVirtualShowerSubtraction
; }
187
191
void
doLoopSimSubtraction
();
192
196
bool
loopSimSubtraction
()
const
{
return
theLoopSimSubtraction
; }
197
204
virtual
bool
discard
(
const
CrossSection&,
const
CrossSection&)
const
{
return
false
; }
205
207
210
214
vector<Ptr<SubtractionDipole>::ptr>
dipoles
();
215
219
const
vector<Ptr<MatchboxMEBase>::ptr>&
borns
()
const
;
220
225
void
setBorns
(
const
vector<Ptr<MatchboxMEBase>::ptr>& newBorns) {
theBorns
= newBorns; }
226
230
void
getDipoles
();
231
235
void
cloneDipoles
(
const
string
& prefix =
""
);
236
240
void
cloneRealME
(
const
string
& prefix =
""
);
241
245
void
cloneDependencies
(
const
string
& prefix =
""
) {
246
cloneDipoles
(prefix);
247
cloneRealME
(prefix);
248
}
249
253
vector<Ptr<SubtractionDipole>::ptr>
splitDipoles
(
const
cPDVector
&);
254
256
264
virtual
void
setVetoScales
(
tSubProPtr
)
const
;
266
269
273
void
print
(ostream&)
const
;
274
281
virtual
void
lastEventStatistics
();
282
286
void
printLastEvent
(ostream&)
const
;
287
291
void
lastEventSubtraction
();
292
296
bool
verbose
()
const
;
297
301
bool
initVerbose
()
const
;
302
304
307
314
virtual
bool
preInitialize
()
const
{
return
true
; }
315
319
struct
SubtractionHistogram
{
320
324
double
lower
;
325
329
map<double,pair<double,double> >
bins
;
330
334
SubtractionHistogram
(
double
low = 0.001,
335
double
up = 10.,
336
unsigned
int
nbins = 100);
337
341
void
book
(
double
inv,
double
diff) {
342
map<double,pair<double,double> >::iterator b =
343
bins
.upper_bound(inv);
344
if
( b ==
bins
.end() )
return
;
345
b->second.first = min(b->second.first,diff);
346
b->second.second = max(b->second.second,diff);
347
}
348
352
void
dump
(
const
std::string& prefix,
353
const
int
& plottype,
354
const
bool
& scatterplot,
355
const
cPDVector
& proc,
356
int
i,
int
j)
const
;
357
361
void
persistentOutput
(
PersistentOStream
&)
const
;
362
366
void
persistentInput
(
PersistentIStream
&);
367
368
};
369
371
372
public
:
373
380
void
persistentOutput
(
PersistentOStream
& os)
const
;
381
387
void
persistentInput
(
PersistentIStream
& is,
int
version);
389
396
static
void
Init
();
397
398
protected
:
399
406
virtual
IBPtr
clone
()
const
;
407
412
virtual
IBPtr
fullclone
()
const
;
414
415
416
// If needed, insert declarations of virtual function defined in the
417
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
418
419
420
protected
:
421
429
virtual
void
doinit
();
430
435
virtual
void
doinitrun
();
436
441
virtual
void
dofinish
();
442
444
445
private
:
446
451
vector<Ptr<MatchboxMEBase>::ptr>
theBorns
;
452
457
Ptr<MatchboxMEBase>::ptr
theReal
;
458
462
typedef
pair<cPDVector,pair<size_t, size_t> >
CollinearSubtractionIndex
;
463
467
map<CollinearSubtractionIndex,SubtractionHistogram>
collinearHistograms
;
468
472
map<CollinearSubtractionIndex,string>
fnamesCollinearSubtraction
;
473
477
typedef
pair<cPDVector,size_t>
SoftSubtractionIndex
;
478
482
map<SoftSubtractionIndex,SubtractionHistogram>
softHistograms
;
483
487
map<SoftSubtractionIndex,string>
fnamesSoftSubtraction
;
488
492
bool
theRealShowerSubtraction
;
493
497
bool
theVirtualShowerSubtraction
;
498
502
bool
theLoopSimSubtraction
;
503
504
private
:
505
510
SubtractedME
&
operator=
(
const
SubtractedME
&) =
delete
;
511
512
};
513
514
inline
PersistentOStream
&
operator<<
(
PersistentOStream
& os,
515
const
SubtractedME::SubtractionHistogram
& h) {
516
h.
persistentOutput
(os);
517
return
os;
518
}
519
520
inline
PersistentIStream
&
operator>>
(
PersistentIStream
& is,
521
SubtractedME::SubtractionHistogram& h) {
522
h.persistentInput(is);
523
return
is;
524
}
525
526
}
527
528
#endif
/* HERWIG_SubtractedME_H */
Herwig::LastMatchboxXCombInfo
Provide easy access to MatchboxXComb XComb extensions.
Definition:
LastMatchboxXCombInfo.h:27
Herwig::SubtractedME
SubtractedME represents a subtracted real emission matrix element.
Definition:
SubtractedME.h:36
Herwig::SubtractedME::willProject
virtual bool willProject() const
Return true, if projectors will be used.
Definition:
SubtractedME.h:120
Herwig::SubtractedME::subProcessGroups
virtual bool subProcessGroups() const
Return true, if SubProcessGroups should be setup from this MEGroup.
Herwig::SubtractedME::fillProjectors
virtual void fillProjectors()
Fill the projectors object of xcombs to choose subprocesses different than the one currently integrat...
Herwig::SubtractedME::lastEventStatistics
virtual void lastEventStatistics()
Collect information on the last evaluated phasespace point for verification or debugging purposes.
Herwig::SubtractedME::CollinearSubtractionIndex
pair< cPDVector, pair< size_t, size_t > > CollinearSubtractionIndex
Define the key for the collinear subtraction data.
Definition:
SubtractedME.h:462
Herwig::SubtractedME::selectDependentSubProcess
virtual bool selectDependentSubProcess() const
Return true, if one of the dependent subprocesses should be constructed in place of the one driven by...
Definition:
SubtractedME.h:109
Herwig::SubtractedME::setVetoScales
virtual void setVetoScales(tSubProPtr) const
Set veto scales on the particles at the given SubProcess which has been generated using this matrix e...
Herwig::SubtractedME::doRealEmissionScales
void doRealEmissionScales()
Switch on or off that scales should be calculated from real emission kinematics.
Herwig::SubtractedME::SubtractedME
SubtractedME()
The default constructor.
Herwig::SubtractedME::theReal
Ptr< MatchboxMEBase >::ptr theReal
Pointer to the head real emission ME casted to a MatchboxMEBase object.
Definition:
SubtractedME.h:457
Herwig::SubtractedME::reweightHead
virtual double reweightHead(const vector< tStdXCombPtr > &)
Reweight the head cross section.
Herwig::SubtractedME::setXComb
virtual void setXComb(tStdXCombPtr)
Set the XComb object to be used in the next call to generateKinematics() and dSigHatDR().
Herwig::SubtractedME::Init
static void Init()
The standard Init function used to initialize the interfaces.
Herwig::SubtractedME::theRealShowerSubtraction
bool theRealShowerSubtraction
True, if the shower real emission contribution should be subtracted.
Definition:
SubtractedME.h:492
Herwig::SubtractedME::fnamesSoftSubtraction
map< SoftSubtractionIndex, string > fnamesSoftSubtraction
names of files to which subtraction data is written for all phase space points individually
Definition:
SubtractedME.h:487
Herwig::SubtractedME::reweightDependent
virtual double reweightDependent(tStdXCombPtr, const vector< tStdXCombPtr > &)
Reweight the dependent cross section.
Herwig::SubtractedME::uniformAdditional
virtual bool uniformAdditional() const
Return true, if the same additional random numbers should be presented to any of the dependent matrix...
Definition:
SubtractedME.h:79
Herwig::SubtractedME::fnamesCollinearSubtraction
map< CollinearSubtractionIndex, string > fnamesCollinearSubtraction
names of files to which subtraction data is written for all phase space points individually
Definition:
SubtractedME.h:472
Herwig::SubtractedME::initVerbose
bool initVerbose() const
Return true, if verbose.
Herwig::SubtractedME::setBorns
void setBorns(const vector< Ptr< MatchboxMEBase >::ptr > &newBorns)
Access the underlying born matrix elements, overriding the ones contained in the factory object.
Definition:
SubtractedME.h:225
Herwig::SubtractedME::groupReweighted
virtual bool groupReweighted() const
Return true, if this MEGroup will reweight the contributing cross sections.
Definition:
SubtractedME.h:128
Herwig::SubtractedME::softHistograms
map< SoftSubtractionIndex, SubtractionHistogram > softHistograms
subtraction data for soft limits.
Definition:
SubtractedME.h:482
Herwig::SubtractedME::cloneDipoles
void cloneDipoles(const string &prefix="")
Clone all dipoles.
Herwig::SubtractedME::theLoopSimSubtraction
bool theLoopSimSubtraction
True, if the loopsim matched virtual contribution should be subtracted.
Definition:
SubtractedME.h:502
Herwig::SubtractedME::cloneDependencies
void cloneDependencies(const string &prefix="")
Clone all dependencies.
Definition:
SubtractedME.h:245
Herwig::SubtractedME::discard
virtual bool discard(const CrossSection &, const CrossSection &) const
Return true, if this configuration of cross sections should not be included due to their relative mag...
Definition:
SubtractedME.h:204
Herwig::SubtractedME::doinitrun
virtual void doinitrun()
Initialize this object.
Herwig::SubtractedME::lastEventSubtraction
void lastEventSubtraction()
Check the subtraction for the last event.
Herwig::SubtractedME::flushCaches
virtual void flushCaches()
Inform this matrix element that a new phase space point is about to be generated, so all caches shoul...
Definition:
SubtractedME.h:157
Herwig::SubtractedME::print
void print(ostream &) const
Dump the setup to an ostream.
Herwig::SubtractedME::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::SubtractedME::doLoopSimSubtraction
void doLoopSimSubtraction()
Indicate that the loopsim matched virtual contribution should be subtracted.
Herwig::SubtractedME::doVirtualShowerSubtraction
void doVirtualShowerSubtraction()
Indicate that the shower virtual contribution should be subtracted.
Herwig::SubtractedME::clone
virtual IBPtr clone() const
Make a simple clone of this object.
Herwig::SubtractedME::theBorns
vector< Ptr< MatchboxMEBase >::ptr > theBorns
The underlying born matrix elements, overriding the ones contained in the factory object.
Definition:
SubtractedME.h:451
Herwig::SubtractedME::SoftSubtractionIndex
pair< cPDVector, size_t > SoftSubtractionIndex
Define the key for the soft subtraction data.
Definition:
SubtractedME.h:477
Herwig::SubtractedME::operator=
SubtractedME & operator=(const SubtractedME &)=delete
The assignment operator is private and must never be called.
Herwig::SubtractedME::splitDipoles
vector< Ptr< SubtractionDipole >::ptr > splitDipoles(const cPDVector &)
Return all dipoles matching the given Born process.
Herwig::SubtractedME::theVirtualShowerSubtraction
bool theVirtualShowerSubtraction
True, if the shower virtual contribution should be subtracted.
Definition:
SubtractedME.h:497
Herwig::SubtractedME::preInitialize
virtual bool preInitialize() const
Return true if this object needs to be initialized before all other objects (except those for which t...
Definition:
SubtractedME.h:314
Herwig::SubtractedME::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Herwig::SubtractedME::getDipoles
void getDipoles()
Build up dipoles needed.
Herwig::SubtractedME::keepRandomNumbers
virtual bool keepRandomNumbers() const
Return true, if the XComb steering this matrix element should keep track of the random numbers used t...
Definition:
SubtractedME.h:86
Herwig::SubtractedME::dofinish
virtual void dofinish()
Finalize this object.
Herwig::SubtractedME::virtualShowerSubtraction
bool virtualShowerSubtraction() const
Return true, if the shower virtual contribution should be subtracted.
Definition:
SubtractedME.h:186
Herwig::SubtractedME::verbose
bool verbose() const
Return true, if verbose.
Herwig::SubtractedME::dependentDiagrams
virtual MEBase::DiagramVector dependentDiagrams(const cPDVector &proc, tMEPtr depME) const
Given a process from the head matrix element, return a list of diagrams which should be considered fo...
Herwig::SubtractedME::borns
const vector< Ptr< MatchboxMEBase >::ptr > & borns() const
Return the underlying born matrix elements.
Herwig::SubtractedME::doinit
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
Herwig::SubtractedME::collinearHistograms
map< CollinearSubtractionIndex, SubtractionHistogram > collinearHistograms
subtraction data for collinear limits.
Definition:
SubtractedME.h:467
Herwig::SubtractedME::dipoles
vector< Ptr< SubtractionDipole >::ptr > dipoles()
Return the subtraction dipoles.
Herwig::SubtractedME::factory
Ptr< MatchboxFactory >::tcptr factory() const
Return the factory which produced this matrix element.
Herwig::SubtractedME::realShowerSubtraction
bool realShowerSubtraction() const
Return true, if the shower real emission contribution should be subtracted.
Definition:
SubtractedME.h:176
Herwig::SubtractedME::showerApproximation
Ptr< ShowerApproximation >::tptr showerApproximation() const
Return the shower approximation.
Herwig::SubtractedME::makeXComb
virtual StdXCombPtr makeXComb(Energy newMaxEnergy, const cPDPair &inc, tEHPtr newEventHandler, tSubHdlPtr newSubProcessHandler, tPExtrPtr newExtractor, tCascHdlPtr newCKKW, const PBPair &newPartonBins, tCutsPtr newCuts, const DiagramVector &newDiagrams, bool mir, const PartonPairVec &allPBins, tStdXCombPtr newHead=tStdXCombPtr(), tMEPtr newME=tMEPtr())
For the given event generation setup return an xcomb object appropriate to this matrix element.
Herwig::SubtractedME::doRealShowerSubtraction
void doRealShowerSubtraction()
Indicate that the shower real emission contribution should be subtracted.
Herwig::SubtractedME::loopSimSubtraction
bool loopSimSubtraction() const
Return true, if the loopsim matched virtual contribution should be subtracted.
Definition:
SubtractedME.h:196
Herwig::SubtractedME::cloneRealME
void cloneRealME(const string &prefix="")
Clone the real emission matrix element.
Herwig::SubtractedME::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Herwig::SubtractedME::printLastEvent
void printLastEvent(ostream &) const
Print debug information on the last event.
ThePEG::MEBase::DiagramVector
vector< DiagPtr > DiagramVector
ThePEG::MEGroup
ThePEG::MEGroup::flushCaches
virtual void flushCaches()
ThePEG::PersistentIStream
ThePEG::PersistentOStream
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG
ThePEG::operator>>
PersistentIStream & operator>>(PersistentIStream &is, HandlerGroup< HDLR > &hg)
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::cPDPair
pair< cPDPtr, cPDPtr > cPDPair
ThePEG::tPExtrPtr
ThePEG::Ptr< PartonExtractor >::transient_pointer tPExtrPtr
ThePEG::tSubProPtr
ThePEG::Ptr< SubProcess >::transient_pointer tSubProPtr
ThePEG::tCascHdlPtr
ThePEG::Ptr< CascadeHandler >::transient_pointer tCascHdlPtr
ThePEG::operator<<
ostream & operator<<(ostream &, const Collision &)
ThePEG::tEHPtr
ThePEG::Ptr< EventHandler >::transient_pointer tEHPtr
ThePEG::cPDVector
vector< cPDPtr > cPDVector
Herwig::SubtractedME::SubtractionHistogram
Simple envelope histogram to keep track of subtraction.
Definition:
SubtractedME.h:319
Herwig::SubtractedME::SubtractionHistogram::dump
void dump(const std::string &prefix, const int &plottype, const bool &scatterplot, const cPDVector &proc, int i, int j) const
Write to file given name and invariant.
Herwig::SubtractedME::SubtractionHistogram::SubtractionHistogram
SubtractionHistogram(double low=0.001, double up=10., unsigned int nbins=100)
Constructor.
Herwig::SubtractedME::SubtractionHistogram::persistentOutput
void persistentOutput(PersistentOStream &) const
Write to persistent ostream.
Herwig::SubtractedME::SubtractionHistogram::persistentInput
void persistentInput(PersistentIStream &)
Read from persistent istream.
Herwig::SubtractedME::SubtractionHistogram::bins
map< double, pair< double, double > > bins
The bins, indexed by upper bound.
Definition:
SubtractedME.h:329
Herwig::SubtractedME::SubtractionHistogram::book
void book(double inv, double diff)
Book an event.
Definition:
SubtractedME.h:341
Herwig::SubtractedME::SubtractionHistogram::lower
double lower
The lower bound.
Definition:
SubtractedME.h:324
Generated on Thu Jun 20 2024 17:50:52 for Herwig by
1.9.6