ThePEG  1.8.0
PDF.h
1 // -*- C++ -*-
2 //
3 // PDF.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_PDF_H
10 #define ThePEG_PDF_H
11 // This is the declaration of the PDF class.
12 
13 #include "ThePEG/PDF/PartonBinInstance.h"
14 
15 namespace ThePEG {
16 
22 class PDF {
23 
24 public:
25 
31  PDF() {}
32 
36  PDF(tcPBIPtr pb) {
37  if ( !pb ) return;
38  thePDF = pb->pdf();
39  theParticle = pb->particleData();
40  }
41 
46  : thePDF(pdf), theParticle(pd) {}
48 
49 public:
50 
58  double xfl(tcPPtr parton, Energy2 partonScale, double l,
59  Energy2 particleScale = ZERO) const {
60  return xfl(parton->dataPtr(), partonScale, l, particleScale);
61  }
62 
68  double xfx(tcPPtr parton, Energy2 partonScale, double x,
69  double eps = 0.0, Energy2 particleScale = ZERO) const {
70  return xfx(parton->dataPtr(), partonScale, x, eps, particleScale);
71  }
72 
78  double xfvl(tcPPtr parton, Energy2 partonScale, double l,
79  Energy2 particleScale = ZERO) const {
80  return xfvl(parton->dataPtr(), partonScale, l, particleScale);
81  }
82 
88  double xfvx(tcPPtr parton, Energy2 partonScale, double x,
89  double eps = 0.0, Energy2 particleScale = ZERO) const {
90  return xfvx(parton->dataPtr(), partonScale, x, eps, particleScale);
91  }
92 
98  double xfl(tcPDPtr parton, Energy2 partonScale, double l,
99  Energy2 particleScale = ZERO) const {
100  return thePDF?
101  thePDF->xfl(theParticle, parton, partonScale, l, particleScale): 0.0;
102  }
103 
109  double xfx(tcPDPtr parton, Energy2 partonScale, double x,
110  double eps = 0.0, Energy2 particleScale = ZERO) const {
111  return thePDF?
112  thePDF->xfx(theParticle, parton, partonScale, x, eps, particleScale): 0.0;
113  }
114 
120  double xfvl(tcPDPtr parton, Energy2 partonScale, double l,
121  Energy2 particleScale = ZERO) const {
122  return thePDF?
123  thePDF->xfvl(theParticle, parton, partonScale, l, particleScale): 0.0;
124  }
125 
131  double xfvx(tcPDPtr parton, Energy2 partonScale, double x,
132  double eps = 0.0, Energy2 particleScale = ZERO) const {
133  return thePDF?
134  thePDF->xfvx(theParticle, parton, partonScale, x, eps, particleScale): 0.0;
135  }
137 
138 
142  tcPDFPtr pdf() const { return thePDF; }
143 
147  tcPDPtr particle() const { return theParticle; }
148 
152  bool operator==(const PDF& x) const {
153  return
154  pdf() == x.pdf() &&
155  particle() == x.particle();
156  }
157 
161  bool operator<(const PDF& x) const {
162  return
163  pdf() == x.pdf() ?
164  particle() < x.particle() :
165  pdf() < x.pdf();
166  }
167 
168 private:
169 
174 
179 
180 };
181 
182 }
183 
184 #endif /* ThePEG_PDF_H */