herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
MatrixElement
Matchbox
Phasespace
MatchboxPhasespace.h
1
// -*- C++ -*-
2
//
3
// MatchboxPhasespace.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_MatchboxPhasespace_H
10
#define HERWIG_MatchboxPhasespace_H
11
//
12
// This is the declaration of the MatchboxPhasespace class.
13
//
14
15
#include "ThePEG/Handlers/StandardXComb.h"
16
#include "ThePEG/Handlers/HandlerBase.h"
17
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
18
#include "Herwig/MatrixElement/Matchbox/Utility/LastMatchboxXCombInfo.h"
19
#include "Herwig/MatrixElement/Matchbox/Utility/ProcessData.fh"
20
#include "Herwig/MatrixElement/Matchbox/MatchboxFactory.fh"
21
#include "Herwig/MatrixElement/Matchbox/Phasespace/PhasespaceCouplings.h"
22
23
namespace
Herwig
{
24
25
using namespace
ThePEG
;
26
34
struct
StreamingRnd
{
35
39
const
double
*
numbers
;
40
44
size_t
nRnd
;
45
49
StreamingRnd
()
50
:
numbers
(0),
nRnd
(0) {}
51
55
explicit
StreamingRnd
(
const
double
* newNumbers,
56
size_t
n)
57
:
numbers
(newNumbers),
nRnd
(n) {}
58
62
inline
double
operator()
() {
63
assert(
numbers
&&
nRnd
> 0);
64
const
double
ret =
numbers
[0];
65
++
numbers
; --
nRnd
;
66
return
ret;
67
}
68
69
};
70
79
class
MatchboxPhasespace
:
80
public
HandlerBase
,
81
public
LastXCombInfo
<StandardXComb>,
82
public
LastMatchboxXCombInfo
{
83
84
public
:
85
89
MatchboxPhasespace
();
90
91
public
:
92
97
virtual
void
setXComb
(tStdXCombPtr xc) {
98
theLastXComb
= xc;
99
lastMatchboxXComb
(xc);
100
}
101
105
Ptr<MatchboxFactory>::tcptr
factory
()
const
;
106
110
Ptr<ProcessData>::tptr
processData
()
const
;
111
115
virtual
double
generateKinematics
(
const
double
* r,
116
vector<Lorentz5Momentum>& momenta);
117
121
virtual
double
generateTwoToNKinematics
(
const
double
*,
122
vector<Lorentz5Momentum>& momenta) = 0;
123
127
virtual
double
generateTwoToOneKinematics
(
const
double
*,
128
vector<Lorentz5Momentum>& momenta);
129
134
virtual
int
nDim
(
const
cPDVector
&)
const
;
135
140
virtual
int
nDimPhasespace
(
int
nFinal)
const
= 0;
141
146
virtual
bool
haveX1X2
()
const
{
return
false
; }
147
152
virtual
bool
wantCMS
()
const
{
return
true
; }
153
157
bool
useMassGenerators
()
const
{
return
theUseMassGenerators
; }
158
162
virtual
Selector<MEBase::DiagramIndex>
selectDiagrams
(
const
MEBase::DiagramVector
&)
const
;
163
168
pair<double,Lorentz5Momentum>
timeLikeWeight
(
const
Tree2toNDiagram
& diag,
169
int
branch,
double
flatCut)
const
;
170
175
double
spaceLikeWeight
(
const
Tree2toNDiagram
& diag,
176
const
Lorentz5Momentum&
incoming
,
177
int
branch,
double
flatCut)
const
;
178
182
double
diagramWeight
(
const
Tree2toNDiagram
& diag)
const
{
183
assert( !
diagramWeights
().empty() );
184
return
diagramWeights
().find(diag.
id
())->second;
185
}
186
190
void
fillDiagramWeights
(
double
flatCut = 0.0);
191
195
void
clearDiagramWeights
() {
196
diagramWeights
().clear();
197
}
198
202
Ptr<MatchboxPhasespace>::ptr
cloneMe
()
const
{
203
return
dynamic_ptr_cast<Ptr<MatchboxPhasespace>::ptr>(
clone
());
204
}
205
209
virtual
void
cloneDependencies
(
const
std::string& prefix =
""
);
210
211
public
:
212
216
virtual
bool
isInvertible
()
const
{
return
false
; }
217
222
virtual
double
invertKinematics
(
const
vector<Lorentz5Momentum>& momenta,
223
double
* r)
const
;
224
229
virtual
double
invertTwoToNKinematics
(
const
vector<Lorentz5Momentum>&,
230
double
*)
const
{
231
return
0.;
232
}
233
238
virtual
double
invertTwoToOneKinematics
(
const
vector<Lorentz5Momentum>&,
double
*)
const
;
239
240
public
:
241
245
void
singularLimit
(
size_t
i,
size_t
j) {
246
if
( i > j )
247
swap(i,j);
248
singularLimits
().insert(make_pair(i,j));
249
}
250
254
const
pair<size_t,size_t>&
lastSingularIndices
()
const
{
255
assert(
lastSingularLimit
() !=
singularLimits
().end());
256
return
*
lastSingularLimit
();
257
}
258
262
bool
matchConstraints
(
const
vector<Lorentz5Momentum>& momenta);
263
264
protected
:
265
271
void
setCoupling
(
long
a,
long
b,
long
c,
272
double
coupling,
bool
includeCrossings =
true
);
273
274
public
:
275
282
void
persistentOutput
(
PersistentOStream
& os)
const
;
283
289
void
persistentInput
(
PersistentIStream
& is,
int
version);
291
292
public
:
293
300
static
void
Init
();
301
302
303
// If needed, insert declarations of virtual function defined in the
304
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
305
306
307
private
:
308
312
Energy
singularCutoff
;
313
317
bool
theUseMassGenerators
;
318
322
Ptr<PhasespaceCouplings>::ptr
theCouplings
;
323
327
string
doSetCoupling
(
string
);
328
332
string
doSetPhysicalCoupling
(
string
);
333
339
int
theLoopParticleIdMin
;
340
346
int
theLoopParticleIdMax
;
347
352
MatchboxPhasespace
&
operator=
(
const
MatchboxPhasespace
&) =
delete
;
353
354
};
355
356
}
357
358
#endif
/* HERWIG_MatchboxPhasespace_H */
Herwig::LastMatchboxXCombInfo
Provide easy access to MatchboxXComb XComb extensions.
Definition:
LastMatchboxXCombInfo.h:27
Herwig::LastMatchboxXCombInfo::singularLimits
const set< pair< size_t, size_t > > & singularLimits() const
Return the singular limits.
Definition:
LastMatchboxXCombInfo.h:271
Herwig::LastMatchboxXCombInfo::diagramWeights
const map< int, double > & diagramWeights() const
Return the diagram weights indexed by diagram id.
Definition:
LastMatchboxXCombInfo.h:266
Herwig::LastMatchboxXCombInfo::lastSingularLimit
const set< pair< size_t, size_t > >::const_iterator & lastSingularLimit() const
Return the last matched singular limit.
Definition:
LastMatchboxXCombInfo.h:276
Herwig::LastMatchboxXCombInfo::lastMatchboxXComb
MatchboxXCombData * lastMatchboxXComb() const
Return a pointer to the last selected XComb.
Definition:
LastMatchboxXCombInfo.h:40
Herwig::MatchboxPhasespace
MatchboxPhasespace defines an abstract interface to a phase space generator.
Definition:
MatchboxPhasespace.h:82
Herwig::MatchboxPhasespace::isInvertible
virtual bool isInvertible() const
Return true, if this phase space generator is invertible.
Definition:
MatchboxPhasespace.h:216
Herwig::MatchboxPhasespace::operator=
MatchboxPhasespace & operator=(const MatchboxPhasespace &)=delete
The assignment operator is private and must never be called.
Herwig::MatchboxPhasespace::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Herwig::MatchboxPhasespace::cloneMe
Ptr< MatchboxPhasespace >::ptr cloneMe() const
Clone this phase space generator.
Definition:
MatchboxPhasespace.h:202
Herwig::MatchboxPhasespace::wantCMS
virtual bool wantCMS() const
Return true, if this phase space generator expects the incoming partons in their center-of-mass syste...
Definition:
MatchboxPhasespace.h:152
Herwig::MatchboxPhasespace::MatchboxPhasespace
MatchboxPhasespace()
The default constructor.
Herwig::MatchboxPhasespace::factory
Ptr< MatchboxFactory >::tcptr factory() const
Return the factory object.
Herwig::MatchboxPhasespace::nDim
virtual int nDim(const cPDVector &) const
Return the number of random numbers required to produce a given multiplicity final state.
Herwig::MatchboxPhasespace::doSetCoupling
string doSetCoupling(string)
Interface function to setcoupling.
Herwig::MatchboxPhasespace::nDimPhasespace
virtual int nDimPhasespace(int nFinal) const =0
Return the number of random numbers required to produce a given multiplicity final state.
Herwig::MatchboxPhasespace::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::MatchboxPhasespace::theLoopParticleIdMax
int theLoopParticleIdMax
The last id in a range of id's meant to denote fictitious 'ghost' particles to be used by the diagram...
Definition:
MatchboxPhasespace.h:346
Herwig::MatchboxPhasespace::cloneDependencies
virtual void cloneDependencies(const std::string &prefix="")
Clone the dependencies, using a given prefix.
Herwig::MatchboxPhasespace::selectDiagrams
virtual Selector< MEBase::DiagramIndex > selectDiagrams(const MEBase::DiagramVector &) const
Fill a diagram selector for the last phase space point.
Herwig::MatchboxPhasespace::processData
Ptr< ProcessData >::tptr processData() const
Return the process data object.
Herwig::MatchboxPhasespace::generateTwoToNKinematics
virtual double generateTwoToNKinematics(const double *, vector< Lorentz5Momentum > &momenta)=0
Generate a phase space point and return its weight.
Herwig::MatchboxPhasespace::singularLimit
void singularLimit(size_t i, size_t j)
Limit phasespace generation to a given collinear or soft limit.
Definition:
MatchboxPhasespace.h:245
Herwig::MatchboxPhasespace::singularCutoff
Energy singularCutoff
A cutoff below which a region is considered singular.
Definition:
MatchboxPhasespace.h:312
Herwig::MatchboxPhasespace::Init
static void Init()
The standard Init function used to initialize the interfaces.
Herwig::MatchboxPhasespace::haveX1X2
virtual bool haveX1X2() const
Return true, if this phasespace generator will generate incoming partons itself.
Definition:
MatchboxPhasespace.h:146
Herwig::MatchboxPhasespace::diagramWeight
double diagramWeight(const Tree2toNDiagram &diag) const
Return the weight appropriate to the given diagram.
Definition:
MatchboxPhasespace.h:182
Herwig::MatchboxPhasespace::generateKinematics
virtual double generateKinematics(const double *r, vector< Lorentz5Momentum > &momenta)
Generate a phase space point and return its weight.
Herwig::MatchboxPhasespace::matchConstraints
bool matchConstraints(const vector< Lorentz5Momentum > &momenta)
Return true, if constraints on phasespace generation have been met.
Herwig::MatchboxPhasespace::theUseMassGenerators
bool theUseMassGenerators
True, if mass generators should be used instead of fixed masses.
Definition:
MatchboxPhasespace.h:317
Herwig::MatchboxPhasespace::lastSingularIndices
const pair< size_t, size_t > & lastSingularIndices() const
Return the last matched singular limit.
Definition:
MatchboxPhasespace.h:254
Herwig::MatchboxPhasespace::setCoupling
void setCoupling(long a, long b, long c, double coupling, bool includeCrossings=true)
Set a coupling for the given vertex; the convention is that all legs are outgoing,...
Herwig::MatchboxPhasespace::invertTwoToNKinematics
virtual double invertTwoToNKinematics(const vector< Lorentz5Momentum > &, double *) const
Invert the given phase space point to the random numbers which would have generated it.
Definition:
MatchboxPhasespace.h:229
Herwig::MatchboxPhasespace::generateTwoToOneKinematics
virtual double generateTwoToOneKinematics(const double *, vector< Lorentz5Momentum > &momenta)
Generate a 2 -> 1 phase space point and return its weight.
Herwig::MatchboxPhasespace::theCouplings
Ptr< PhasespaceCouplings >::ptr theCouplings
Couplings to be used in diagram weighting.
Definition:
MatchboxPhasespace.h:322
Herwig::MatchboxPhasespace::spaceLikeWeight
double spaceLikeWeight(const Tree2toNDiagram &diag, const Lorentz5Momentum &incoming, int branch, double flatCut) const
Return the weight appropriate to the given spacelike branch of the diagram.
Herwig::MatchboxPhasespace::timeLikeWeight
pair< double, Lorentz5Momentum > timeLikeWeight(const Tree2toNDiagram &diag, int branch, double flatCut) const
Return the momentum and weight appropriate to the given timelike branch of the diagram.
Herwig::MatchboxPhasespace::doSetPhysicalCoupling
string doSetPhysicalCoupling(string)
Interface function to setcoupling.
Herwig::MatchboxPhasespace::setXComb
virtual void setXComb(tStdXCombPtr xc)
Set the XComb object steering the Born matrix element this class represents virtual corrections to.
Definition:
MatchboxPhasespace.h:97
Herwig::MatchboxPhasespace::theLoopParticleIdMin
int theLoopParticleIdMin
The first id in a range of id's meant to denote fictitious 'ghost' particles to be used by the diagra...
Definition:
MatchboxPhasespace.h:339
Herwig::MatchboxPhasespace::invertKinematics
virtual double invertKinematics(const vector< Lorentz5Momentum > &momenta, double *r) const
Invert the given phase space point to the random numbers which would have generated it.
Herwig::MatchboxPhasespace::fillDiagramWeights
void fillDiagramWeights(double flatCut=0.0)
Fill the diagram weights.
Herwig::MatchboxPhasespace::invertTwoToOneKinematics
virtual double invertTwoToOneKinematics(const vector< Lorentz5Momentum > &, double *) const
Invert the given 2 -> 1 phase space point to the random numbers which would have generated it.
Herwig::MatchboxPhasespace::useMassGenerators
bool useMassGenerators() const
True, if mass generators should be used instead of fixed masses.
Definition:
MatchboxPhasespace.h:157
Herwig::MatchboxPhasespace::clearDiagramWeights
void clearDiagramWeights()
Clear the diagram weights.
Definition:
MatchboxPhasespace.h:195
ThePEG::DiagramBase::id
int id() const
ThePEG::HandlerBase
ThePEG::InterfacedBase::clone
virtual IBPtr clone() const=0
ThePEG::LastXCombInfo
ThePEG::LastXCombInfo< StandardXComb >::theLastXComb
XCPtr theLastXComb
ThePEG::MEBase::DiagramVector
vector< DiagPtr > DiagramVector
ThePEG::PersistentIStream
ThePEG::PersistentOStream
ThePEG::Selector
ThePEG::Tree2toNDiagram
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG::Helicity::incoming
incoming
ThePEG
ThePEG::cPDVector
vector< cPDPtr > cPDVector
Herwig::StreamingRnd
Wrap around a vector of random numbers to behave as a stream of those.
Definition:
MatchboxPhasespace.h:34
Herwig::StreamingRnd::operator()
double operator()()
Return next random number.
Definition:
MatchboxPhasespace.h:62
Herwig::StreamingRnd::nRnd
size_t nRnd
The number of random numbers available.
Definition:
MatchboxPhasespace.h:44
Herwig::StreamingRnd::numbers
const double * numbers
The random numbers.
Definition:
MatchboxPhasespace.h:39
Herwig::StreamingRnd::StreamingRnd
StreamingRnd()
Default constructor.
Definition:
MatchboxPhasespace.h:49
Herwig::StreamingRnd::StreamingRnd
StreamingRnd(const double *newNumbers, size_t n)
Construct from random numbers.
Definition:
MatchboxPhasespace.h:55
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6