File indexing completed on 2026-08-06 09:24:23
0001
0002
0003
0004
0005
0006 #ifndef matchbox_couplings_alpha_s_h
0007 #define matchbox_couplings_alpha_s_h
0008
0009 #include <string>
0010
0011 #include <array>
0012
0013 #include "ThePEG/Interface/Interfaced.h"
0014 #include "ThePEG/StandardModel/AlphaSBase.h"
0015
0016 #include "gsl.h"
0017
0018 namespace matchbox {
0019
0020 using namespace ThePEG;
0021
0022 template<class AlphaS>
0023 struct solve_lambda_below {
0024
0025 typedef AlphaS alpha_s;
0026
0027 inline solve_lambda_below (alpha_s* a,
0028 unsigned int n,
0029 Energy2 lambda2n,
0030 Energy2 mass2)
0031 : alpha(a), nf_in(n), lambda2_nf_in(lambda2n), threshold(mass2) {}
0032
0033 alpha_s * alpha;
0034 unsigned int nf_in;
0035 Energy2 lambda2_nf_in;
0036 Energy2 threshold;
0037
0038 inline double operator () (double lambda2) {
0039 return ((*alpha)(threshold,lambda2_nf_in,nf_in) -
0040 (*alpha)(threshold,lambda2*MeV2,nf_in-1));
0041 }
0042
0043 };
0044
0045 template<class AlphaS>
0046 struct solve_lambda_above {
0047
0048 typedef AlphaS alpha_s;
0049
0050 inline solve_lambda_above (alpha_s * a,
0051 unsigned int n,
0052 Energy2 lambda2n,
0053 Energy2 mass2)
0054 : alpha(a), nf_in(n), lambda2_nf_in(lambda2n), threshold(mass2) {}
0055
0056 alpha_s * alpha;
0057 unsigned int nf_in;
0058 Energy2 lambda2_nf_in;
0059 Energy2 threshold;
0060
0061 inline double operator () (double lambda2) {
0062 return ((*alpha)(threshold,lambda2_nf_in,nf_in) -
0063 (*alpha)(threshold,lambda2*MeV2,nf_in+1));
0064 }
0065
0066 };
0067
0068 template<class AlphaS>
0069 struct solve_input_lambda {
0070
0071 typedef AlphaS alpha_s;
0072
0073 inline solve_input_lambda (alpha_s * a,
0074 unsigned int n,
0075 double inalpha,
0076 Energy2 inscale)
0077 : alpha(a), nf_in(n), alpha_in(inalpha), scale_in(inscale) {}
0078
0079 alpha_s * alpha;
0080 unsigned int nf_in;
0081 double alpha_in;
0082 Energy2 scale_in;
0083
0084 inline double operator () (double lambda2) {
0085 return ((*alpha)(scale_in,lambda2*MeV2,nf_in) - alpha_in);
0086 }
0087
0088 };
0089
0090
0091
0092
0093
0094
0095
0096 class alpha_s
0097 : public AlphaSBase {
0098
0099 public:
0100
0101
0102
0103
0104 alpha_s();
0105
0106 public:
0107
0108
0109
0110
0111
0112
0113
0114 virtual inline double value(Energy2 scale, const StandardModelBase &) const {
0115 return operator() (scale);
0116 }
0117
0118
0119
0120
0121
0122
0123 virtual inline vector<Energy2> flavourThresholds() const {
0124 assert(!nfvector.empty());
0125 return nfvector;
0126 }
0127
0128
0129
0130
0131
0132 virtual inline vector<Energy> LambdaQCDs() const {
0133 vector<Energy> res;
0134 for (size_t k = 0; k < 7; ++k)
0135 res.push_back(sqrt(lambda_squared_[k]));
0136 return res;
0137 }
0138
0139
0140 public:
0141
0142
0143 inline double operator () (Energy2 scale) const {
0144
0145 if ( fixed_ )
0146 return alpha_s_in_;
0147
0148 assert(matched());
0149 unsigned int active = active_flavours(scale_factor_*scale);
0150 return operator () (scale_factor_*scale,lambda_squared_[active],active);
0151
0152 }
0153
0154
0155
0156 virtual double operator () (Energy2 scale,
0157 Energy2 lambda2,
0158 unsigned int nf) const = 0;
0159
0160
0161
0162
0163 string check (string args);
0164
0165 public:
0166
0167
0168 inline unsigned int min_active_flavours () const { return min_active_flavours_; }
0169
0170
0171 inline void min_active_flavours (unsigned int nf) { min_active_flavours_ = nf; }
0172
0173
0174 inline unsigned int max_active_flavours () const { return max_active_flavours_; }
0175
0176
0177 inline void max_active_flavours (unsigned int nf) { max_active_flavours_ = nf; }
0178
0179
0180 inline unsigned int active_flavours (Energy2 scale) const {
0181 unsigned int active = 0;
0182 if (scale > 0.*GeV2) {
0183 while(quark_mass_squared(active) < scale) {
0184 if (++active == max_active_flavours_+1)
0185 break;
0186 }
0187 active -= 1;
0188 } else {
0189 active = 0;
0190 }
0191 return active;
0192 }
0193
0194
0195 inline Energy2 lambda_squared (unsigned int f) const {
0196 assert(f < 7);
0197 return lambda_squared_[f];
0198 }
0199
0200
0201 inline Energy2 quark_mass_squared (unsigned int f) const {
0202 assert(f < 7);
0203 return quark_masses_squared_[f];
0204 }
0205
0206
0207 inline void quark_mass_squared (unsigned int f, Energy2 m2) {
0208 assert(f < 7);
0209 quark_masses_squared_[f] = m2;
0210 matched_ = false;
0211 }
0212
0213 public:
0214
0215
0216
0217 void match_thresholds ();
0218
0219
0220
0221 inline bool matched () const { return matched_; }
0222
0223 protected:
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233 virtual inline void doinit() {
0234 match_thresholds();
0235 copy(quark_masses_squared_.begin()+1,
0236 quark_masses_squared_.end(),nfvector.begin());
0237 AlphaSBase::doinit();
0238 }
0239
0240
0241
0242
0243 double scale_factor () const { return scale_factor_; }
0244
0245 public:
0246
0247
0248
0249
0250
0251
0252
0253 void persistentOutput(PersistentOStream & os) const;
0254
0255
0256
0257
0258
0259
0260 void persistentInput(PersistentIStream & is, int version);
0261
0262
0263
0264
0265
0266
0267
0268
0269 static void Init();
0270
0271 private:
0272
0273
0274
0275
0276
0277 static AbstractClassDescription<alpha_s> initalpha_s;
0278
0279
0280
0281
0282
0283 alpha_s & operator=(const alpha_s &) = delete;
0284
0285 private:
0286
0287 unsigned int min_active_flavours_;
0288 unsigned int max_active_flavours_;
0289
0290 bool matched_;
0291
0292 double scale_factor_;
0293
0294 std::array<Energy2,7> quark_masses_squared_;
0295 std::array<Energy2,7> lambda_squared_;
0296 vector<Energy2> nfvector=vector<Energy2>(6);
0297
0298 double alpha_s_in_;
0299 Energy scale_in_;
0300
0301 pair<Energy2,Energy2> lambda_range_;
0302
0303 bool fixed_;
0304
0305 };
0306
0307 }
0308
0309 #include "ThePEG/Utilities/ClassTraits.h"
0310
0311 namespace ThePEG {
0312
0313
0314
0315
0316
0317 template <>
0318 struct BaseClassTrait<matchbox::alpha_s,1> {
0319
0320 typedef AlphaSBase NthBase;
0321 };
0322
0323
0324
0325 template <>
0326 struct ClassTraits<matchbox::alpha_s>
0327 : public ClassTraitsBase<matchbox::alpha_s> {
0328
0329 static string className() { return "matchbox::alpha_s"; }
0330
0331
0332
0333
0334
0335
0336
0337 static string library() { return "HwDipoleShowerAlphaS.so"; }
0338 };
0339
0340
0341
0342 }
0343
0344 #endif