LHAPDF C++ wrapper  5.4
LHAPDF.h
1 #ifndef LHAPDF_H
2 #define LHAPDF_H
3 
4 #include "LHAPDF/LHAPDFConfig.h"
5 
6 #include <string>
7 #include <vector>
8 #include <iostream>
9 #include <sstream>
10 
59 // Compatibility preprocessing of deprecated "M" function names
60 #define initPDFSetM initPDFSet
61 #define initPDFSetByNameM initPDFSetByName
62 #define initPDFM initPDF
63 #define initPDFByNameM initPDFByName
64 #define getDescriptionM getDescription
65 #define xfxM xfx
66 #define xfxpM xfxp
67 #define xfxaM xfxa
68 #define xfxphotonM xfxphoton
69 #define numberPDFM numberPDF
70 #define alphasPDFM alphasPDF
71 #define getOrderPDFM getOrderPDF
72 #define getOrderAlphaSM getOrderAlphaS
73 #define getQMassM getQMass
74 #define getThresholdM getThreshold
75 #define getNfM getNf
76 #define getLam4M getLam4
77 #define getLam5M getLam5
78 #define getXminM getXmin
79 #define getXmaxM getXmax
80 #define getQ2minM getQ2min
81 #define getQ2maxM getQ2max
82 
83 
85 namespace LHAPDF {
86 
91  enum Flavour {
92  TBAR= -6, BBAR = -5, CBAR = -4, SBAR = -3, UBAR = -2, DBAR = -1,
93  GLUON = 0,
94  DOWN = 1, UP = 2, STRANGE = 3, CHARM = 4, BOTTOM = 5, TOP= 6,
95  PHOTON = 7
96  };
97 
101  enum SetType {
102  EVOLVE = 0, LHPDF = 0,
103  INTERPOLATE = 1, LHGRID = 1
104  };
105 
107  enum Verbosity { SILENT=0, LOWKEY=1, DEFAULT=2 };
108 
109 
111 
112 
114  std::string getVersion();
115 
117  void initLHAPDF();
118 
120  void setVerbosity(Verbosity noiselevel);
121 
123  void extrapolate(bool extrapolate=true);
124 
126  void setPDFPath(const std::string& path);
127 
129  void setParameter(const std::string& parm);
131 
132 
134 
135 
137  class PDFSetInfo {
138  public:
139  std::string file;
140  std::string description;
141  int id;
142  int pdflibNType, pdflibNGroup, pdflibNSet;
143  int memberId;
144  double lowx, highx;
145  double lowQ2, highQ2;
146 
148  std::string toString() const {
149  std::ostringstream os;
150  os << "PDF set #" << id
151  << " {"
152  << " file='" << file << "',"
153  << " description='" << description << "',"
154  << " x = [" << lowx << ", " << highx << "],"
155  << " Q2 = [" << lowQ2 << ", " << highQ2 << "]"
156  << " }";
157  return os.str();
158  }
159  };
160 
161 
162  inline std::ostream& operator<<(std::ostream& os, const PDFSetInfo& info) {
163  os << info.toString();
164  return os;
165  }
166 
168  PDFSetInfo getPDFSetInfo(const std::string& filename, int memid);
169 
171  PDFSetInfo getPDFSetInfo(int id);
172 
174  std::vector<PDFSetInfo> getAllPDFSetInfo();
176 
177 
179 
180 
182  std::string prefixPath();
183 
185  std::string pdfsetsPath();
186 
188  std::string pdfsetsIndexPath();
189 
191 
192 
197 
198 
200  void initPDFSet(int setid, int member);
202  void initPDFSet(int nset, int setid, int member); // can't have a default 3rd arg
203 
205  void initPDFSet(const std::string& name, SetType type, int member=0);
207  void initPDFSet(int nset, const std::string& name, SetType type, int member=0);
208 
212  void initPDFSet(const std::string& filename, int member=0);
216  void initPDFSet(int nset, const std::string& filename, int member=0);
217 
220  void usePDFMember(int member);
223  void usePDFMember(int nset, int member);
225 
226 
228 
229 
231  void getDescription();
233  void getDescription(int nset);
234 
236  bool hasPhoton();
237 
239  int numberPDF();
241  int numberPDF(int nset);
242 
244  double alphasPDF(double Q);
246  double alphasPDF(int nset, double Q);
247 
249  int getOrderPDF();
251  int getOrderPDF(int nset);
252 
254  int getOrderAlphaS();
256  int getOrderAlphaS(int nset);
257 
259  double getQMass(int f);
261  double getQMass(int nset, int f);
262 
264  double getThreshold(int f);
266  double getThreshold(int nset, int f);
267 
269  int getNf();
271  int getNf(int nset);
272 
274  double getLam4(int m);
276  double getLam4(int nset, int m);
277 
279  double getLam5(int m);
281  double getLam5(int nset, int m);
282 
284  double getXmin(int m);
286  double getXmin(int nset, int m);
287 
289  double getXmax(int m);
291  double getXmax(int nset, int m);
292 
294  double getQ2min(int m);
296  double getQ2min(int nset, int m);
297 
299  double getQ2max(int m);
301  double getQ2max(int nset, int m);
303 
304 
308 
309 
314  std::vector<double> xfx(double x, double Q);
319  std::vector<double> xfx(int nset, double x, double Q);
320 
326  void xfx(double x, double Q, double* results);
332  void xfx(int nset, double x, double Q, double* results);
333 
334 
340  double xfx(double x, double Q, int fl);
346  double xfx(int nset, double x, double Q, int fl);
348 
349 
351 
352 
359  std::vector<double> xfxp(double x, double Q, double P2, int ip);
366  std::vector<double> xfxp(int nset, double x, double Q, double P2, int ip);
367 
375  void xfxp(double x, double Q, double P2, int ip, double* results);
383  void xfxp(int nset, double x, double Q, double P2, int ip, double* results);
384 
385 
393  double xfxp(double x, double Q, double P2, int ip, int fl);
401  double xfxp(int nset, double x, double Q, double P2, int ip, int fl);
403 
404 
406 
407 
414  std::vector<double> xfxa(double x, double Q, double a);
421  std::vector<double> xfxa(int nset, double x, double Q, double a);
422 
430  void xfxa(double x, double Q, double a, double* results);
438  void xfxa(int nset, double x, double Q, double a, double* results);
439 
447  double xfxa(double x, double Q, double a, int fl);
455  double xfxa(int nset, double x, double Q, double a, int fl);
457 
458 
462 
463 
471  std::vector<double> xfxphoton(double x, double Q);
477  std::vector<double> xfxphoton(int nset, double x, double Q);
478 
479 
488  void xfxphoton(double x, double Q, double* results);
497  void xfxphoton(int nset, double x, double Q, double* results);
498 
499 
508  double xfxphoton(double x, double Q, int fl);
515  double xfxphoton(int nset, double x, double Q, int fl);
517 
518 
524 
525 
527  //void initPDFSet(const std::string& path);
529  //void initPDFSet(int nset, const std::string& path);
530 
532  void initPDFSetByName(const std::string& name, SetType type);
534  void initPDFSetByName(int nset, const std::string& name, SetType type);
535 
537  void initPDFSetByName(const std::string& filename);
539  void initPDFSetByName(int nset, const std::string& filename);
540 
542  void initPDF(int memset);
544  void initPDF(int nset, int memset);
545 
551  void initPDFByName(const std::string& name, SetType type, int memset);
552 
559  void initPDFByName(int nset, const std::string& name, SetType type, int memset);
560 
565  void initPDFByName(const std::string& filename, int memset);
571  void initPDFByName(int nset, const std::string& filename, int memset);
573 
574 
575 }
576 
577 #endif