herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
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
18namespace Herwig {
19
20using namespace ThePEG;
21
30
31public:
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
96public:
97
105
111 void persistentInput(PersistentIStream & is, int version);
113
120 static void Init();
121
122protected:
123
130 virtual IBPtr clone() const;
131
136 virtual IBPtr fullclone() const;
138
139private:
140
146
147};
148
149}
150
151#endif /* Herwig_GluonMassGenerator_H */
Dynamic gluon mass generator; the default returns a constant mass.
virtual Energy generate(Energy) const
Generate a single gluon mass with possible reference to a hard scale Q.
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.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
GluonMassGenerator & operator=(const GluonMassGenerator &)=delete
The assignment operator is private and must never be called.
virtual Energy generate() const
Generate a single gluon mass without further constraints.
virtual IBPtr clone() const
Make a simple clone of this object.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
list< Energy > generateMany(size_t n, Energy QMax) const
Generate a list of n gluon masses, with a maximum available energy.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
static void Init()
The standard Init function used to initialize the interfaces.
PDPtr getParticleData(PID) const
-*- C++ -*-
ThePEG::Ptr< InterfacedBase >::pointer IBPtr