herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
alpha_s.h
1 // -*- C++ -*-
2 
3 // couplings/alpha_s.h is part of matchbox
4 // (C) 2008 Simon Platzer -- sp@particle.uni-karlsruhe.de
5 
6 #ifndef matchbox_couplings_alpha_s_h
7 #define matchbox_couplings_alpha_s_h
8 
9 #include <string>
10 
11 #include <array>
12 
13 #include "ThePEG/Interface/Interfaced.h"
14 #include "ThePEG/StandardModel/AlphaSBase.h"
15 
16 #include "gsl.h"
17 
18 namespace matchbox {
19 
20  using namespace ThePEG;
21 
22  template<class AlphaS>
24 
25  typedef AlphaS alpha_s;
26 
27  inline solve_lambda_below (alpha_s* a,
28  unsigned int n,
29  Energy2 lambda2n,
30  Energy2 mass2)
31  : alpha(a), nf_in(n), lambda2_nf_in(lambda2n), threshold(mass2) {}
32 
33  alpha_s * alpha;
34  unsigned int nf_in;
35  Energy2 lambda2_nf_in;
36  Energy2 threshold;
37 
38  inline double operator () (double lambda2) {
39  return ((*alpha)(threshold,lambda2_nf_in,nf_in) -
40  (*alpha)(threshold,lambda2*MeV2,nf_in-1));
41  }
42 
43  };
44 
45  template<class AlphaS>
47 
48  typedef AlphaS alpha_s;
49 
50  inline solve_lambda_above (alpha_s * a,
51  unsigned int n,
52  Energy2 lambda2n,
53  Energy2 mass2)
54  : alpha(a), nf_in(n), lambda2_nf_in(lambda2n), threshold(mass2) {}
55 
56  alpha_s * alpha;
57  unsigned int nf_in;
58  Energy2 lambda2_nf_in;
59  Energy2 threshold;
60 
61  inline double operator () (double lambda2) {
62  return ((*alpha)(threshold,lambda2_nf_in,nf_in) -
63  (*alpha)(threshold,lambda2*MeV2,nf_in+1));
64  }
65 
66  };
67 
68  template<class AlphaS>
70 
71  typedef AlphaS alpha_s;
72 
73  inline solve_input_lambda (alpha_s * a,
74  unsigned int n,
75  double inalpha,
76  Energy2 inscale)
77  : alpha(a), nf_in(n), alpha_in(inalpha), scale_in(inscale) {}
78 
79  alpha_s * alpha;
80  unsigned int nf_in;
81  double alpha_in;
82  Energy2 scale_in;
83 
84  inline double operator () (double lambda2) {
85  return ((*alpha)(scale_in,lambda2*MeV2,nf_in) - alpha_in);
86  }
87 
88  };
89 
96  class alpha_s
97  : public AlphaSBase {
98 
99  public:
100 
106  alpha_s();
107 
111  virtual ~alpha_s();
113 
114  public:
115 
122  virtual inline double value(Energy2 scale, const StandardModelBase &) const {
123  return operator() (scale);
124  }
125 
131  virtual inline vector<Energy2> flavourThresholds() const {
132  assert(!nfvector.empty());
133  return nfvector;
134  }
135 
140  virtual inline vector<Energy> LambdaQCDs() const {
141  vector<Energy> res;
142  for (size_t k = 0; k < 7; ++k)
143  res.push_back(sqrt(lambda_squared_[k]));
144  return res;
145  }
147 
148  public:
149 
151  inline double operator () (Energy2 scale) const {
152 
153  if ( fixed_ )
154  return alpha_s_in_;
155 
156  assert(matched());
157  unsigned int active = active_flavours(scale_factor_*scale);
158  return operator () (scale_factor_*scale,lambda_squared_[active],active);
159 
160  }
161 
164  virtual double operator () (Energy2 scale,
165  Energy2 lambda2,
166  unsigned int nf) const = 0;
167 
171  string check (string args);
172 
173  public:
174 
176  inline unsigned int min_active_flavours () const { return min_active_flavours_; }
177 
179  inline void min_active_flavours (unsigned int nf) { min_active_flavours_ = nf; }
180 
182  inline unsigned int max_active_flavours () const { return max_active_flavours_; }
183 
185  inline void max_active_flavours (unsigned int nf) { max_active_flavours_ = nf; }
186 
188  inline unsigned int active_flavours (Energy2 scale) const {
189  unsigned int active = 0;
190  if (scale > 0.*GeV2) {
191  while(quark_mass_squared(active) < scale) {
192  if (++active == max_active_flavours_+1)
193  break;
194  }
195  active -= 1;
196  } else {
197  active = 0;
198  }
199  return active;
200  }
201 
203  inline Energy2 lambda_squared (unsigned int f) const {
204  assert(f < 7);
205  return lambda_squared_[f];
206  }
207 
209  inline Energy2 quark_mass_squared (unsigned int f) const {
210  assert(f < 7);
211  return quark_masses_squared_[f];
212  }
213 
215  inline void quark_mass_squared (unsigned int f, Energy2 m2) {
216  assert(f < 7);
217  quark_masses_squared_[f] = m2;
218  matched_ = false;
219  }
220 
221  public:
222 
225  void match_thresholds ();
226 
229  inline bool matched () const { return matched_; }
230 
231  protected:
232 
235 
241  virtual inline void doinit() {
242  match_thresholds();
243  copy(quark_masses_squared_.begin()+1,
244  quark_masses_squared_.end(),nfvector.begin());
246  }
247 
249 
251  double scale_factor () const { return scale_factor_; }
252 
253  public:
254 
261  void persistentOutput(PersistentOStream & os) const;
262 
268  void persistentInput(PersistentIStream & is, int version);
270 
277  static void Init();
278 
279  private:
280 
286 
291  alpha_s & operator=(const alpha_s &) = delete;
292 
293  private:
294 
295  unsigned int min_active_flavours_;
296  unsigned int max_active_flavours_;
297 
298  bool matched_;
299 
300  double scale_factor_;
301 
302  std::array<Energy2,7> quark_masses_squared_;
303  std::array<Energy2,7> lambda_squared_;
304  vector<Energy2> nfvector=vector<Energy2>(6);
305 
306  double alpha_s_in_;
307  Energy scale_in_;
308 
309  pair<Energy2,Energy2> lambda_range_;
310 
311  bool fixed_;
312 
313  };
314 
315 }
316 
317 #include "ThePEG/Utilities/ClassTraits.h"
318 
319 namespace ThePEG {
320 
325  template <>
326  struct BaseClassTrait<matchbox::alpha_s,1> {
328  typedef AlphaSBase NthBase;
329  };
330 
333  template <>
334  struct ClassTraits<matchbox::alpha_s>
335  : public ClassTraitsBase<matchbox::alpha_s> {
337  static string className() { return "matchbox::alpha_s"; }
345  static string library() { return "HwDipoleShowerAlphaS.so"; }
346  };
347 
350 }
351 
352 #endif /* matchbox_couplings_alpha_s_h */
bool matched() const
return true, if threshold matching has been performed
Definition: alpha_s.h:229
double sqrt(int x)
void quark_mass_squared(unsigned int f, Energy2 m2)
set the mass squared for given flavour
Definition: alpha_s.h:215
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
Definition: alpha_s.h:241
unsigned int min_active_flavours() const
return minimum number of active flavours
Definition: alpha_s.h:176
void max_active_flavours(unsigned int nf)
set maximum number of active flavours
Definition: alpha_s.h:185
static AbstractClassDescription< alpha_s > initalpha_s
The static object used to initialize the description of this class.
Definition: alpha_s.h:285
void min_active_flavours(unsigned int nf)
set minimum number of active flavours
Definition: alpha_s.h:179
virtual vector< Energy > LambdaQCDs() const
Return the used for different numbers of active flavours.
Definition: alpha_s.h:140
Energy2 lambda_squared(unsigned int f) const
return the lambda squared for the given number of flavours
Definition: alpha_s.h:203
Base class for the strong coupling.
Definition: alpha_s.h:96
Energy2 quark_mass_squared(unsigned int f) const
return the mass squared for given flavour
Definition: alpha_s.h:209
virtual double value(Energy2 scale, const StandardModelBase &) const
The .
Definition: alpha_s.h:122
virtual vector< Energy2 > flavourThresholds() const
Return the flavour thresholds used.
Definition: alpha_s.h:131
unsigned int active_flavours(Energy2 scale) const
return the number of active flavours at the given scale
Definition: alpha_s.h:188
unsigned int max_active_flavours() const
return maximum number of active flavours
Definition: alpha_s.h:182
virtual void doinit()
double scale_factor() const
return the scale factor
Definition: alpha_s.h:251