File indexing completed on 2026-08-06 09:24:06
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef Herwig_GluonMassGenerator_H
0010 #define Herwig_GluonMassGenerator_H
0011
0012
0013
0014
0015 #include "ThePEG/Handlers/HandlerBase.h"
0016 #include "ThePEG/EventRecord/Particle.h"
0017
0018 namespace Herwig {
0019
0020 using namespace ThePEG;
0021
0022
0023
0024
0025
0026
0027
0028
0029 class GluonMassGenerator: public HandlerBase {
0030
0031 public:
0032
0033
0034
0035
0036
0037 virtual Energy generate(Energy, Energy) const {
0038 return generate();
0039 }
0040
0041
0042
0043
0044
0045 virtual Energy generate(Energy) const {
0046 return generate();
0047 }
0048
0049
0050
0051
0052 virtual Energy generate() const {
0053 return getParticleData(ThePEG::ParticleID::g)->constituentMass();
0054 }
0055
0056
0057
0058
0059 list<Energy> generateMany(size_t n, Energy QMax) const {
0060 list<Energy> res;
0061 Energy m0, mu, md, ms, mg, summg;
0062
0063 mu=getParticleData(ThePEG::ParticleID::u)->constituentMass();
0064 md=getParticleData(ThePEG::ParticleID::d)->constituentMass();
0065 ms=getParticleData(ThePEG::ParticleID::s)->constituentMass();
0066
0067 m0=md;
0068 if(mu<m0){m0=mu;}
0069 if(ms<m0){m0=ms;}
0070
0071 if( QMax<2.0*m0*n ){
0072 throw Exception() << "cannot reshuffle to constituent mass shells" << Exception::eventerror;
0073 }
0074
0075 bool repeat=true;
0076
0077 while( repeat ){
0078 repeat=false;
0079 summg = 0.0*GeV;
0080 res.clear();
0081 for( size_t k = 0; k < n; ++k ){
0082 mg = generate();
0083 res.push_back(mg);
0084 summg += mg;
0085 if( summg > QMax - 2.0*m0*(n-k-1) ){
0086 repeat=true;
0087 break;
0088 }
0089 }
0090 }
0091
0092 return res;
0093
0094 }
0095
0096 public:
0097
0098
0099
0100
0101
0102
0103
0104 void persistentOutput(PersistentOStream & os) const;
0105
0106
0107
0108
0109
0110
0111 void persistentInput(PersistentIStream & is, int version);
0112
0113
0114
0115
0116
0117
0118
0119
0120 static void Init();
0121
0122 protected:
0123
0124
0125
0126
0127
0128
0129
0130 virtual IBPtr clone() const;
0131
0132
0133
0134
0135
0136 virtual IBPtr fullclone() const;
0137
0138
0139 private:
0140
0141
0142
0143
0144
0145 GluonMassGenerator & operator=(const GluonMassGenerator &) = delete;
0146
0147 };
0148
0149 }
0150
0151 #endif