00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef THEPEG_LHAPDF_H
00010 #define THEPEG_LHAPDF_H
00011
00012
00013
00014
00015 #include "ThePEG/PDF/PDFBase.h"
00016
00017 namespace ThePEG {
00018
00033 class LHAPDF: public PDFBase {
00034
00035 public:
00036
00038 enum PType { nucleonType = 1,
00039 pionType = 2,
00040 photonType = 3
00041 };
00042
00043 public:
00044
00050 LHAPDF();
00051
00055 LHAPDF(const LHAPDF &);
00057
00058 public:
00059
00066 virtual bool canHandleParticle(tcPDPtr particle) const;
00067
00072 virtual cPDVector partons(tcPDPtr particle) const;
00073
00080 virtual double xfx(tcPDPtr particle, tcPDPtr parton, Energy2 partonScale,
00081 double x, double eps = 0.0,
00082 Energy2 particleScale = ZERO) const;
00083
00092 virtual double xfvl(tcPDPtr particle, tcPDPtr parton, Energy2 partonScale,
00093 double l, Energy2 particleScale = ZERO) const;
00094
00103 virtual double xfvx(tcPDPtr particle, tcPDPtr parton, Energy2 partonScale,
00104 double x, double eps = 0.0,
00105 Energy2 particleScale = ZERO) const;
00106
00116 virtual double xfsx(tcPDPtr particle, tcPDPtr parton, Energy2 partonScale,
00117 double x, double eps = 0.0,
00118 Energy2 particleScale = ZERO) const;
00120
00121
00129 PType ptype() const { return thePType; }
00130
00135 const string & PDFName() const { return thePDFName; }
00136
00140 int member() const { return theMember; }
00141
00147 int maxFlav() const { return theMaxFlav; }
00149
00150 protected:
00151
00157 bool indexLine(istream & is, int & set, int & mem, string & file,
00158 int & pdftyp, int & pdfgup, int & pdfsup,
00159 double & xmin, double & xmax,
00160 double & q2min, double & q2max) const;
00161
00165 void initpdfsetm() const;
00166
00170 void initpdfm() const;
00171
00175 void lastReset() const;
00176
00180 void setnset() const;
00181
00185 int getMaxMember() const;
00186
00190 int getMaxFlav() const;
00191
00196 void checkInit() const;
00197
00202 void checkUpdate(double x, Energy2 Q2, Energy2 P2) const;
00203
00210 void setMaxNSet(int);
00211
00216 int getMaxNSet() const;
00217
00222 void setMinMax();
00223
00227 void setPDFNumber(int n);
00228
00233 int getPDFNumber() const;
00234
00239 void setPDFLIBNumbers(int group, int num);
00240
00245 string setPDFLIBNumbers(string);
00246
00251 pair<int,int> getPDFLIBNumbers() const;
00252
00256 void setPDFName(string name);
00257
00261 void setPDFMember(int n);
00262
00266 static std::string getIndexPath();
00267
00271 static bool openLHAIndex(ifstream & is);
00272
00276 string doTest(string input);
00278
00279 public:
00280
00287 void persistentOutput(PersistentOStream & os) const;
00288
00294 void persistentInput(PersistentIStream & is, int version);
00296
00303 static void Init();
00304
00305 protected:
00306
00313 virtual IBPtr clone() const;
00314
00319 virtual IBPtr fullclone() const;
00321
00322 public:
00323
00326 class NotInstalled: public Exception {};
00327
00329 static void throwNotInstalled();
00330
00333
00334
00335
00336 protected:
00337
00345 virtual void doinit();
00346
00351 virtual void doinitrun();
00352
00357 virtual void dofinish();
00359
00360 private:
00361
00367 PType thePType;
00368
00373 string thePDFName;
00374
00378 int theMember;
00379
00384 int thePhotonOption;
00385
00389 bool enablePartonicGamma;
00390
00394 int theVerboseLevel;
00395
00401 int theMaxFlav;
00402
00407 mutable int nset;
00408
00412 mutable Energy2 lastQ2;
00413
00417 mutable double lastX;
00418
00423 mutable Energy2 lastP2;
00424
00428 mutable vector<double> lastXF;
00429
00436 static int MaxNSet;
00437
00441 static int lastNSet;
00442
00446 static vector<string> lastNames;
00447
00451 static vector<int> lastMem;
00452
00456 double xMin;
00457
00461 double xMax;
00462
00466 Energy2 Q2Min;
00467
00471 Energy2 Q2Max;
00472
00473 private:
00474
00479 static ClassDescription<LHAPDF> initLHAPDF;
00480
00485 LHAPDF & operator=(const LHAPDF &);
00486
00487 };
00488
00489 }
00490
00491 #include "ThePEG/Utilities/ClassTraits.h"
00492
00493 namespace ThePEG {
00494
00499 template <>
00500 struct BaseClassTrait<LHAPDF,1> {
00502 typedef PDFBase NthBase;
00503 };
00504
00507 template <>
00508 struct ClassTraits<LHAPDF>
00509 : public ClassTraitsBase<LHAPDF> {
00511 static string className() { return "ThePEG::LHAPDF"; }
00512 };
00513
00516 }
00517
00518 #endif