herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
Hadronization
GluonMassGenerator.h
1
// -*- C++ -*-
2
//
3
// GluonMassGenerator.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_GluonMassGenerator_H
10
#define Herwig_GluonMassGenerator_H
11
//
12
// This is the declaration of the GluonMassGenerator class.
13
//
14
15
#include "ThePEG/Handlers/HandlerBase.h"
16
#include "ThePEG/EventRecord/Particle.h"
17
18
namespace
Herwig
{
19
20
using namespace
ThePEG
;
21
29
class
GluonMassGenerator
:
public
HandlerBase
{
30
31
public
:
32
37
virtual
Energy
generate
(Energy, Energy)
const
{
38
return
generate
();
39
}
40
45
virtual
Energy
generate
(Energy)
const
{
46
return
generate
();
47
}
48
52
virtual
Energy
generate
()
const
{
53
return
getParticleData
(
ThePEG::ParticleID::g
)->constituentMass();
54
}
55
59
list<Energy>
generateMany
(
size_t
n, Energy QMax)
const
{
60
list<Energy> res;
61
Energy m0, mu, md, ms, mg, summg;
62
63
mu=
getParticleData
(
ThePEG::ParticleID::u
)->constituentMass();
64
md=
getParticleData
(
ThePEG::ParticleID::d
)->constituentMass();
65
ms=
getParticleData
(
ThePEG::ParticleID::s
)->constituentMass();
66
67
m0=md;
68
if
(mu<m0){m0=mu;}
69
if
(ms<m0){m0=ms;}
70
71
if
( QMax<2.0*m0*n ){
72
throw
Exception
() <<
"cannot reshuffle to constituent mass shells"
<<
Exception::eventerror
;
73
}
74
75
bool
repeat=
true
;
76
77
while
( repeat ){
78
repeat=
false
;
79
summg = 0.0*GeV;
80
res.clear();
81
for
(
size_t
k = 0; k < n; ++k ){
82
mg =
generate
();
83
res.push_back(mg);
84
summg += mg;
85
if
( summg > QMax - 2.0*m0*(n-k-1) ){
86
repeat=
true
;
87
break
;
88
}
89
}
90
}
91
92
return
res;
93
94
}
95
96
public
:
97
104
void
persistentOutput
(
PersistentOStream
& os)
const
;
105
111
void
persistentInput
(
PersistentIStream
& is,
int
version);
113
120
static
void
Init
();
121
122
protected
:
123
130
virtual
IBPtr
clone
()
const
;
131
136
virtual
IBPtr
fullclone
()
const
;
138
139
private
:
140
145
GluonMassGenerator
&
operator=
(
const
GluonMassGenerator
&) =
delete
;
146
147
};
148
149
}
150
151
#endif
/* Herwig_GluonMassGenerator_H */
Herwig::GluonMassGenerator
Dynamic gluon mass generator; the default returns a constant mass.
Definition:
GluonMassGenerator.h:29
Herwig::GluonMassGenerator::generate
virtual Energy generate(Energy) const
Generate a single gluon mass with possible reference to a hard scale Q.
Definition:
GluonMassGenerator.h:45
Herwig::GluonMassGenerator::generate
virtual Energy generate(Energy, Energy) const
Generate a single gluon mass with possible reference to a hard scale Q and up to a maximum value.
Definition:
GluonMassGenerator.h:37
Herwig::GluonMassGenerator::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Herwig::GluonMassGenerator::operator=
GluonMassGenerator & operator=(const GluonMassGenerator &)=delete
The assignment operator is private and must never be called.
Herwig::GluonMassGenerator::generate
virtual Energy generate() const
Generate a single gluon mass without further constraints.
Definition:
GluonMassGenerator.h:52
Herwig::GluonMassGenerator::clone
virtual IBPtr clone() const
Make a simple clone of this object.
Herwig::GluonMassGenerator::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::GluonMassGenerator::generateMany
list< Energy > generateMany(size_t n, Energy QMax) const
Generate a list of n gluon masses, with a maximum available energy.
Definition:
GluonMassGenerator.h:59
Herwig::GluonMassGenerator::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Herwig::GluonMassGenerator::Init
static void Init()
The standard Init function used to initialize the interfaces.
ThePEG::Exception
ThePEG::Exception::eventerror
eventerror
ThePEG::HandlerBase
ThePEG::Interfaced::getParticleData
PDPtr getParticleData(PID) const
ThePEG::PersistentIStream
ThePEG::PersistentOStream
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG::ParticleID::u
u
ThePEG::ParticleID::s
s
ThePEG::ParticleID::d
d
ThePEG::ParticleID::g
g
ThePEG
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
Generated on Thu Jun 20 2024 17:50:52 for Herwig by
1.9.6