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 // Compatibility preprocessing of deprecated "M" function names 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 void initLHAPDF(); 00118 00120 void setVerbosity(Verbosity noiselevel); 00121 00123 void extrapolate(bool extrapolate=true); 00124 00126 void setPDFPath(const std::string& path); 00127 00129 void setParameter(const std::string& parm); 00131 00132 00134 00135 00137 class PDFSetInfo { 00138 public: 00139 std::string file; 00140 std::string description; 00141 int id; 00142 int pdflibNType, pdflibNGroup, pdflibNSet; 00143 int memberId; 00144 double lowx, highx; 00145 double lowQ2, highQ2; 00146 00148 std::string toString() const { 00149 std::ostringstream os; 00150 os << "PDF set #" << id 00151 << " {" 00152 << " file='" << file << "'," 00153 << " description='" << description << "'," 00154 << " x = [" << lowx << ", " << highx << "]," 00155 << " Q2 = [" << lowQ2 << ", " << highQ2 << "]" 00156 << " }"; 00157 return os.str(); 00158 } 00159 }; 00160 00161 00162 inline std::ostream& operator<<(std::ostream& os, const PDFSetInfo& info) { 00163 os << info.toString(); 00164 return os; 00165 } 00166 00168 PDFSetInfo getPDFSetInfo(const std::string& filename, int memid); 00169 00171 PDFSetInfo getPDFSetInfo(int id); 00172 00174 std::vector<PDFSetInfo> getAllPDFSetInfo(); 00176 00177 00179 00180 00182 std::string prefixPath(); 00183 00185 std::string pdfsetsPath(); 00186 00188 std::string pdfsetsIndexPath(); 00189 00191 00192 00197 00198 00200 void initPDFSet(int setid, int member); 00202 void initPDFSet(int nset, int setid, int member); // can't have a default 3rd arg 00203 00205 void initPDFSet(const std::string& name, SetType type, int member=0); 00207 void initPDFSet(int nset, const std::string& name, SetType type, int member=0); 00208 00212 void initPDFSet(const std::string& filename, int member=0); 00216 void initPDFSet(int nset, const std::string& filename, int member=0); 00217 00220 void usePDFMember(int member); 00223 void usePDFMember(int nset, int member); 00225 00226 00228 00229 00231 void getDescription(); 00233 void getDescription(int nset); 00234 00236 bool hasPhoton(); 00237 00239 int numberPDF(); 00241 int numberPDF(int nset); 00242 00244 double alphasPDF(double Q); 00246 double alphasPDF(int nset, double Q); 00247 00249 int getOrderPDF(); 00251 int getOrderPDF(int nset); 00252 00254 int getOrderAlphaS(); 00256 int getOrderAlphaS(int nset); 00257 00259 double getQMass(int f); 00261 double getQMass(int nset, int f); 00262 00264 double getThreshold(int f); 00266 double getThreshold(int nset, int f); 00267 00269 int getNf(); 00271 int getNf(int nset); 00272 00274 double getLam4(int m); 00276 double getLam4(int nset, int m); 00277 00279 double getLam5(int m); 00281 double getLam5(int nset, int m); 00282 00284 double getXmin(int m); 00286 double getXmin(int nset, int m); 00287 00289 double getXmax(int m); 00291 double getXmax(int nset, int m); 00292 00294 double getQ2min(int m); 00296 double getQ2min(int nset, int m); 00297 00299 double getQ2max(int m); 00301 double getQ2max(int nset, int m); 00303 00304 00308 00309 00314 std::vector<double> xfx(double x, double Q); 00319 std::vector<double> xfx(int nset, double x, double Q); 00320 00326 void xfx(double x, double Q, double* results); 00332 void xfx(int nset, double x, double Q, double* results); 00333 00334 00340 double xfx(double x, double Q, int fl); 00346 double xfx(int nset, double x, double Q, int fl); 00348 00349 00351 00352 00359 std::vector<double> xfxp(double x, double Q, double P2, int ip); 00366 std::vector<double> xfxp(int nset, double x, double Q, double P2, int ip); 00367 00375 void xfxp(double x, double Q, double P2, int ip, double* results); 00383 void xfxp(int nset, double x, double Q, double P2, int ip, double* results); 00384 00385 00393 double xfxp(double x, double Q, double P2, int ip, int fl); 00401 double xfxp(int nset, double x, double Q, double P2, int ip, int fl); 00403 00404 00406 00407 00414 std::vector<double> xfxa(double x, double Q, double a); 00421 std::vector<double> xfxa(int nset, double x, double Q, double a); 00422 00430 void xfxa(double x, double Q, double a, double* results); 00438 void xfxa(int nset, double x, double Q, double a, double* results); 00439 00447 double xfxa(double x, double Q, double a, int fl); 00455 double xfxa(int nset, double x, double Q, double a, int fl); 00457 00458 00462 00463 00471 std::vector<double> xfxphoton(double x, double Q); 00477 std::vector<double> xfxphoton(int nset, double x, double Q); 00478 00479 00488 void xfxphoton(double x, double Q, double* results); 00497 void xfxphoton(int nset, double x, double Q, double* results); 00498 00499 00508 double xfxphoton(double x, double Q, int fl); 00515 double xfxphoton(int nset, double x, double Q, int fl); 00517 00518 00524 00525 00527 //void initPDFSet(const std::string& path); 00529 //void initPDFSet(int nset, const std::string& path); 00530 00532 void initPDFSetByName(const std::string& name, SetType type); 00534 void initPDFSetByName(int nset, const std::string& name, SetType type); 00535 00537 void initPDFSetByName(const std::string& filename); 00539 void initPDFSetByName(int nset, const std::string& filename); 00540 00542 void initPDF(int memset); 00544 void initPDF(int nset, int memset); 00545 00551 void initPDFByName(const std::string& name, SetType type, int memset); 00552 00559 void initPDFByName(int nset, const std::string& name, SetType type, int memset); 00560 00565 void initPDFByName(const std::string& filename, int memset); 00571 void initPDFByName(int nset, const std::string& filename, int memset); 00573 00574 00575 } 00576 00577 #endif