00001 #ifndef LHAPDF_H
00002 #define LHAPDF_H
00003
00004 #include "LHAPDF/LHAPDFConfig.h"
00005
00006 #include <string>
00007 #include <vector>
00008 #include <iostream>
00009 #include <sstream>
00010
00059
00060 #define initPDFSetM initPDFSet
00061 #define initPDFSetByNameM initPDFSetByName
00062 #define initPDFM initPDF
00063 #define initPDFByNameM initPDFByName
00064 #define getDescriptionM getDescription
00065 #define xfxM xfx
00066 #define xfxpM xfxp
00067 #define xfxaM xfxa
00068 #define xfxphotonM xfxphoton
00069 #define numberPDFM numberPDF
00070 #define alphasPDFM alphasPDF
00071 #define getOrderPDFM getOrderPDF
00072 #define getOrderAlphaSM getOrderAlphaS
00073 #define getQMassM getQMass
00074 #define getThresholdM getThreshold
00075 #define getNfM getNf
00076 #define getLam4M getLam4
00077 #define getLam5M getLam5
00078 #define getXminM getXmin
00079 #define getXmaxM getXmax
00080 #define getQ2minM getQ2min
00081 #define getQ2maxM getQ2max
00082
00083
00085 namespace LHAPDF {
00086
00091 enum Flavour {
00092 TBAR= -6, BBAR = -5, CBAR = -4, SBAR = -3, UBAR = -2, DBAR = -1,
00093 GLUON = 0,
00094 DOWN = 1, UP = 2, STRANGE = 3, CHARM = 4, BOTTOM = 5, TOP= 6,
00095 PHOTON = 7
00096 };
00097
00101 enum SetType {
00102 EVOLVE = 0, LHPDF = 0,
00103 INTERPOLATE = 1, LHGRID = 1
00104 };
00105
00107 enum Verbosity { SILENT=0, LOWKEY=1, DEFAULT=2 };
00108
00109
00111
00112
00114 std::string getVersion();
00115
00117 int getMaxNumSets();
00118
00120 void initLHAPDF();
00121
00123 void setVerbosity(Verbosity noiselevel);
00124
00126 void extrapolate(bool extrapolate=true);
00127
00129 void setPDFPath(const std::string& path);
00130
00132 void setParameter(const std::string& parm);
00133
00135
00136
00138
00139
00141 class PDFSetInfo {
00142 public:
00143 std::string file;
00144 std::string description;
00145 int id;
00146 int pdflibNType, pdflibNGroup, pdflibNSet;
00147 int memberId;
00148 double lowx, highx;
00149 double lowQ2, highQ2;
00150
00152 std::string toString() const {
00153 std::ostringstream os;
00154 os << "PDF set #" << id
00155 << " {"
00156 << " file='" << file << "',"
00157 << " description='" << description << "',"
00158 << " x = [" << lowx << ", " << highx << "],"
00159 << " Q2 = [" << lowQ2 << ", " << highQ2 << "]"
00160 << " }";
00161 return os.str();
00162 }
00163 };
00164
00165
00166 inline std::ostream& operator<<(std::ostream& os, const PDFSetInfo& info) {
00167 os << info.toString();
00168 return os;
00169 }
00170
00172 PDFSetInfo getPDFSetInfo(const std::string& filename, int memid);
00173
00175 PDFSetInfo getPDFSetInfo(int id);
00176
00178 std::vector<PDFSetInfo> getAllPDFSetInfo();
00180
00181
00183
00184
00186 std::string prefixPath();
00187
00189 std::string pdfsetsPath();
00190
00192 std::string pdfsetsIndexPath();
00193
00195
00196
00201
00202
00204 void initPDFSet(int setid, int member);
00206 void initPDFSet(int nset, int setid, int member);
00207
00209 void initPDFSet(const std::string& name, SetType type, int member=0);
00211 void initPDFSet(int nset, const std::string& name, SetType type, int member=0);
00212
00216 void initPDFSet(const std::string& filename, int member=0);
00220 void initPDFSet(int nset, const std::string& filename, int member=0);
00221
00224 void usePDFMember(int member);
00227 void usePDFMember(int nset, int member);
00229
00230
00232
00233
00235 void getDescription();
00237 void getDescription(int nset);
00238
00240 bool hasPhoton();
00241
00243 int numberPDF();
00245 int numberPDF(int nset);
00246
00248 double alphasPDF(double Q);
00250 double alphasPDF(int nset, double Q);
00251
00253 int getOrderPDF();
00255 int getOrderPDF(int nset);
00256
00258 int getOrderAlphaS();
00260 int getOrderAlphaS(int nset);
00261
00263 double getQMass(int f);
00265 double getQMass(int nset, int f);
00266
00268 double getThreshold(int f);
00270 double getThreshold(int nset, int f);
00271
00273 int getNf();
00275 int getNf(int nset);
00276
00278 double getLam4(int m);
00280 double getLam4(int nset, int m);
00281
00283 double getLam5(int m);
00285 double getLam5(int nset, int m);
00286
00288 double getXmin(int m);
00290 double getXmin(int nset, int m);
00291
00293 double getXmax(int m);
00295 double getXmax(int nset, int m);
00296
00298 double getQ2min(int m);
00300 double getQ2min(int nset, int m);
00301
00303 double getQ2max(int m);
00305 double getQ2max(int nset, int m);
00307
00308
00312
00313
00318 std::vector<double> xfx(double x, double Q);
00323 std::vector<double> xfx(int nset, double x, double Q);
00324
00330 void xfx(double x, double Q, double* results);
00336 void xfx(int nset, double x, double Q, double* results);
00337
00338
00344 double xfx(double x, double Q, int fl);
00350 double xfx(int nset, double x, double Q, int fl);
00352
00353
00355
00356
00363 std::vector<double> xfxp(double x, double Q, double P2, int ip);
00370 std::vector<double> xfxp(int nset, double x, double Q, double P2, int ip);
00371
00379 void xfxp(double x, double Q, double P2, int ip, double* results);
00387 void xfxp(int nset, double x, double Q, double P2, int ip, double* results);
00388
00389
00397 double xfxp(double x, double Q, double P2, int ip, int fl);
00405 double xfxp(int nset, double x, double Q, double P2, int ip, int fl);
00407
00408
00410
00411
00418 std::vector<double> xfxa(double x, double Q, double a);
00425 std::vector<double> xfxa(int nset, double x, double Q, double a);
00426
00434 void xfxa(double x, double Q, double a, double* results);
00442 void xfxa(int nset, double x, double Q, double a, double* results);
00443
00451 double xfxa(double x, double Q, double a, int fl);
00459 double xfxa(int nset, double x, double Q, double a, int fl);
00461
00462
00466
00467
00475 std::vector<double> xfxphoton(double x, double Q);
00481 std::vector<double> xfxphoton(int nset, double x, double Q);
00482
00483
00492 void xfxphoton(double x, double Q, double* results);
00501 void xfxphoton(int nset, double x, double Q, double* results);
00502
00503
00512 double xfxphoton(double x, double Q, int fl);
00519 double xfxphoton(int nset, double x, double Q, int fl);
00521
00522
00528
00529
00531
00533
00534
00536 void initPDFSetByName(const std::string& name, SetType type);
00538 void initPDFSetByName(int nset, const std::string& name, SetType type);
00539
00541 void initPDFSetByName(const std::string& filename);
00543 void initPDFSetByName(int nset, const std::string& filename);
00544
00546 void initPDF(int memset);
00548 void initPDF(int nset, int memset);
00549
00555 void initPDFByName(const std::string& name, SetType type, int memset);
00556
00563 void initPDFByName(int nset, const std::string& name, SetType type, int memset);
00564
00569 void initPDFByName(const std::string& filename, int memset);
00575 void initPDFByName(int nset, const std::string& filename, int memset);
00577
00578
00579 }
00580
00581 #endif