Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:28

0001 // -*- C++ -*-
0002 //
0003 // PDF.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef ThePEG_PDF_H
0010 #define ThePEG_PDF_H
0011 // This is the declaration of the PDF class.
0012 
0013 #include "ThePEG/PDF/PartonBinInstance.h"
0014 
0015 namespace ThePEG {
0016 
0017 /**
0018  * PDF is a simple wrapper class with normal copy-semantics which
0019  * holds a PDFBase object and a ParticleData object for which to
0020  * determine parton densities.
0021  */
0022 class PDF {
0023 
0024 public:
0025 
0026   /** @name Standard constructors, assignment and destructors. */
0027   //@{
0028   /**
0029    * Default constructor.
0030    */
0031   PDF() {}
0032 
0033   /**
0034    * Constructor from a given PartonBinInstance.
0035    */
0036   PDF(tcPBIPtr pb) {
0037     if ( !pb ) return;
0038     thePDF = pb->pdf();
0039     theParticle = pb->particleData();
0040   }
0041 
0042   /**
0043    * Constructor from a given PDFBase and ParticleData object.
0044    */
0045   PDF(tcPDFPtr pdf, tcPDPtr pd)
0046     : thePDF(pdf), theParticle(pd) {}
0047   //@}
0048 
0049 public:
0050 
0051   /** @name Access the parton densities. */
0052   //@{
0053   /**
0054    * Return the density for the given \a parton, for a given \a
0055    * partonScale and logarithmic momentum fraction \a l assuming the
0056    * particle has a virtuality \a particleScale.
0057    */
0058   double xfl(tcPPtr parton, Energy2 partonScale, double l,
0059          Energy2 particleScale = ZERO) const {
0060     return xfl(parton->dataPtr(), partonScale, l, particleScale);
0061   }
0062 
0063   /**
0064    * Return the density for the given \a parton, for a given \a
0065    * partonScale and momentum fraction \a x assuming the
0066    * particle has a virtuality \a particleScale.
0067    */
0068   double xfx(tcPPtr parton, Energy2 partonScale, double x,
0069          double eps = 0.0, Energy2 particleScale = ZERO) const {
0070     return xfx(parton->dataPtr(), partonScale, x, eps, particleScale);
0071   }
0072 
0073   /**
0074    * Return the valence density for the given \a parton, for a given
0075    * \a partonScale and logarithmic momentum fraction \a l assuming
0076    * the particle has a virtuality \a particleScale.
0077    */
0078   double xfvl(tcPPtr parton, Energy2 partonScale, double l,
0079           Energy2 particleScale = ZERO) const {
0080     return xfvl(parton->dataPtr(), partonScale, l, particleScale);
0081   }
0082 
0083   /**
0084    * Return the valence density for the given \a parton, for a given
0085    * \a partonScale and momentum fraction \a x assuming the particle
0086    * has a virtuality \a particleScale.
0087    */
0088   double xfvx(tcPPtr parton, Energy2 partonScale, double x,
0089           double eps = 0.0, Energy2 particleScale = ZERO) const {
0090     return xfvx(parton->dataPtr(), partonScale, x, eps, particleScale);
0091   }
0092 
0093   /**
0094    * Return the density for the given \a parton, for a given \a
0095    * partonScale and logarithmic momentum fraction \a l assuming the
0096    * particle has a virtuality \a particleScale.
0097    */
0098   double xfl(tcPDPtr parton, Energy2 partonScale, double l,
0099          Energy2 particleScale = ZERO) const {
0100     return thePDF?
0101       thePDF->xfl(theParticle, parton, partonScale, l, particleScale): 0.0;
0102   }
0103 
0104   /**
0105    * Return the density for the given \a parton, for a given \a
0106    * partonScale and momentum fraction \a x assuming the
0107    * particle has a virtuality \a particleScale.
0108    */
0109   double xfx(tcPDPtr parton, Energy2 partonScale, double x,
0110          double eps = 0.0, Energy2 particleScale = ZERO) const {
0111     return thePDF?
0112       thePDF->xfx(theParticle, parton, partonScale, x, eps, particleScale): 0.0;
0113   }
0114 
0115   /**
0116    * Return the valence density for the given \a parton, for a given
0117    * \a partonScale and logarithmic momentum fraction \a l assuming
0118    * the particle has a virtuality \a particleScale.
0119    */
0120   double xfvl(tcPDPtr parton, Energy2 partonScale, double l,
0121           Energy2 particleScale = ZERO) const {
0122     return thePDF?
0123       thePDF->xfvl(theParticle, parton, partonScale, l, particleScale): 0.0;
0124   }
0125 
0126   /**
0127    * Return the valence density for the given \a parton, for a given
0128    * \a partonScale and momentum fraction \a x assuming the particle
0129    * has a virtuality \a particleScale.
0130    */
0131   double xfvx(tcPDPtr parton, Energy2 partonScale, double x,
0132           double eps = 0.0, Energy2 particleScale = ZERO) const {
0133     return thePDF?
0134       thePDF->xfvx(theParticle, parton, partonScale, x, eps, particleScale): 0.0;
0135   }
0136   //@}
0137 
0138   
0139   /**
0140    * The parton density object.
0141    */
0142   tcPDFPtr pdf() const { return thePDF; }
0143 
0144   /**
0145    * The particle for which the parton density is used.
0146    */
0147   tcPDPtr particle() const { return theParticle; }
0148 
0149   /**
0150    * Compare for equality.
0151    */
0152   bool operator==(const PDF& x) const {
0153     return
0154       pdf() == x.pdf() &&
0155       particle() == x.particle();
0156   }
0157 
0158   /**
0159    * Compare for ordering.
0160    */
0161   bool operator<(const PDF& x) const {
0162     return
0163       pdf() == x.pdf() ?
0164       particle() < x.particle() :
0165       pdf() < x.pdf();
0166   }
0167 
0168 private:
0169 
0170   /**
0171    * The parton density object.
0172    */
0173   tcPDFPtr thePDF;
0174 
0175   /**
0176    * The particle for which the parton density is used.
0177    */
0178   tcPDPtr theParticle;
0179 
0180 };
0181 
0182 }
0183 
0184 #endif /* ThePEG_PDF_H */