ThePEG::LHAPDF Class Reference

The LHAPDF class inherits from PDFBase and implements an interface to the LHAPDF library of parton density function parameterizations. More...

#include <LHAPDF.h>

Inheritance diagram for ThePEG::LHAPDF:

ThePEG::PDFBase ThePEG::HandlerBase ThePEG::HandlerBaseT< T > ThePEG::Interfaced ThePEG::InterfacedBase ThePEG::Base ThePEG::Named ThePEG::Pointer::ReferenceCounted

List of all members.

Internal helper functions.

bool indexLine (istream &is, int &set, int &mem, string &file, int &pdftyp, int &pdfgup, int &pdfsup, double &xmin, double &xmax, double &q2min, double &q2max) const
 Read a line from the index file.
void initpdfsetm () const
 Call the Fortran InitPDFSetM function.
void initpdfm () const
 Call the Fortran InitPDFSetM function.
void lastReset () const
 Reset the saved values from the last call to xfx(), etc.
void setnset () const
 Acquire a new nset number.
int getMaxMember () const
 Retrieve the number of members in the chosen PDF.
int getMaxFlav () const
 Get the maximum number of flavours available in the chosen PDF.
void checkInit () const
 Initialize the LHAPDF library for the chosen PDF set if it has not been done before.
void checkUpdate (double x, Energy2 Q2, Energy2 P2) const
 Retrieve new PDF values for the given parameters if they were changed since the last call.
void setMaxNSet (int)
 Set the maximum number of simultaneous pdfs that can be used in LHAPDF.
int getMaxNSet () const
 Get the maximum number of simultaneous pdfs that can be used in LHAPDF.
void setMinMax ()
 Deduce the min/max values of $x$ and $Q^2$ for the selected set.
void setPDFNumber (int n)
 Used by the interface to select a set and member according to a number.
int getPDFNumber () const
 Used by the interface to select a get the index number of the currently chosen set and member.
void setPDFLIBNumbers (int group, int num)
 Used by the interface to select a set and member according to the old PDFLIB numbers.
string setPDFLIBNumbers (string)
 Used by the interface to select a set and member according to the old PDFLIB numbers.
pair< int, int > getPDFLIBNumbers () const
 Used by the interface to select a get the old PDFLIB numbers of the currently chosen set and member.
void setPDFName (string name)
 Used by the interface to select a set according to a file name.
void setPDFMember (int n)
 Used by the interface to select a member in the current set.
string doTest (string input)
 Interface for simple tests.
static std::string getIndexPath ()
 Try to determine the path to where the LHAPDF index file is located.
static bool openLHAIndex (ifstream &is)
 Try to find a LHAPDF index file, open it in the given file stream.

Public Types

enum  PType { nucleonType = 1, pionType = 2, photonType = 3 }
 Enumerate the allowed particle types. More...

Public Member Functions

Standard constructors and destructors.
 LHAPDF ()
 The default constructor.
 LHAPDF (const LHAPDF &)
 The copy constructor.
Virtual functions to be overridden by sub-classes.
virtual bool canHandleParticle (tcPDPtr particle) const
 Return true if this PDF can handle the extraction of partons from the given particle.
virtual cPDVector partons (tcPDPtr particle) const
 Return the partons which this PDF may extract from the given particle.
virtual double xfx (tcPDPtr particle, tcPDPtr parton, Energy2 partonScale, double x, double eps=0.0, Energy2 particleScale=ZERO) const
 The density.
virtual double xfvl (tcPDPtr particle, tcPDPtr parton, Energy2 partonScale, double l, Energy2 particleScale=ZERO) const
 The valence density.
virtual double xfvx (tcPDPtr particle, tcPDPtr parton, Energy2 partonScale, double x, double eps=0.0, Energy2 particleScale=ZERO) const
 The valence density.
virtual double xfsx (tcPDPtr particle, tcPDPtr parton, Energy2 partonScale, double x, double eps=0.0, Energy2 particleScale=ZERO) const
 The sea density.
Simple access function.
PType ptype () const
 The particle type.
const string & PDFName () const
 The name if the PDF set to be used.
int member () const
 The chosen member of the selected PDF set.
int maxFlav () const
 The maximum number of flavours for which non-zero densities are reported.
Functions used by the persistent I/O system.
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently.
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently.

Static Public Member Functions

static void Init ()
 The standard Init function used to initialize the interfaces.

Protected Member Functions

Clone Methods.
virtual IBPtr clone () const
 Make a simple clone of this object.
virtual IBPtr fullclone () const
 Make a clone of this object, possibly modifying the cloned object to make it sane.
Standard Interfaced functions.
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk.
virtual void doinitrun ()
 Initialize this object.
virtual void dofinish ()
 Finalize this object.

Private Member Functions

LHAPDFoperator= (const LHAPDF &)
 The assignment operator is private and must never be called.

Private Attributes

PType thePType
 The particle type.
string thePDFName
 The name if the PDF set to be used.
int theMember
 The chosen member of the selected PDF set.
int thePhotonOption
 If this is a photon PDF, this describes the option for how to treat the anomalous component.
bool enablePartonicGamma
 If this PDF allows partonic photons inside a hadron, enable this.
int theVerboseLevel
 The verbosity of the output from the LHAPDF library.
int theMaxFlav
 The maximum number of flavours for which non-zero densities are reported.
int nset
 The LHAPDF nset number (minus one) to be used by this object.
Energy2 lastQ2
 Save the last $Q^2$ value used to avoid recalculation.
double lastX
 Save the last $x$ value used to avoid recalculation.
Energy2 lastP2
 Save the last $P^2$ value used for off-shell photon to avoid recalculation.
vector< double > lastXF
 Save the last function values returned from the LHAPDF library.
double xMin
 The minimum $x$-value for the current PDF set.
double xMax
 The maximum $x$-value for the current PDF set.
Energy2 Q2Min
 The minimum $Q^2$-value for the current PDF set.
Energy2 Q2Max
 The maximum $Q^2$-value for the current PDF set.

Static Private Attributes

static int MaxNSet
 The maximum number of simultaneous pdfs that can be used in LHAPDF.
static int lastNSet
 The last nset number used by an LHAPDF object.
static vector< string > lastNames
 The last names used in the initialization of a given nset number.
static vector< int > lastMem
 The last mem used in the initialization of a given nset number.
static ClassDescription< LHAPDFinitLHAPDF
 The static object used to initialize the description of this class.


Detailed Description

The LHAPDF class inherits from PDFBase and implements an interface to the LHAPDF library of parton density function parameterizations.

This class is available even if LHAPDF was not properly installed when ThePEG was installed, but will then produce an error in the initialization.

Note that the valence densities from the xfvx() and xfvl() function will only work properly for nucleons. All other particles will have zero valence densities.

See also:
The interfaces defined for LHAPDF.

Definition at line 33 of file LHAPDF.h.


Member Enumeration Documentation

Enumerate the allowed particle types.

Enumerator:
nucleonType  (Anti-) proton or neutron.

pionType  Pion.

Definition at line 38 of file LHAPDF.h.


Member Function Documentation

virtual double ThePEG::LHAPDF::xfx ( tcPDPtr  particle,
tcPDPtr  parton,
Energy2  partonScale,
double  x,
double  eps = 0.0,
Energy2  particleScale = ZERO 
) const [virtual]

The density.

Return the pdf for the given parton inside the given particle for the virtuality partonScale and momentum fraction x (with x = 1-eps). The particle is assumed to have a virtuality particleScale.

Reimplemented from ThePEG::PDFBase.

virtual double ThePEG::LHAPDF::xfvl ( tcPDPtr  particle,
tcPDPtr  parton,
Energy2  partonScale,
double  l,
Energy2  particleScale = ZERO 
) const [virtual]

The valence density.

Return the pdf for the given cvalence parton inside the given particle for the virtuality partonScale and logarithmic momentum fraction l. The particle is assumed to have a virtuality particleScale. This will only work properly for nucleons. All other particles will have zero valence densities

Reimplemented from ThePEG::PDFBase.

virtual double ThePEG::LHAPDF::xfvx ( tcPDPtr  particle,
tcPDPtr  parton,
Energy2  partonScale,
double  x,
double  eps = 0.0,
Energy2  particleScale = ZERO 
) const [virtual]

The valence density.

Return the pdf for the given cvalence parton inside the given particle for the virtuality partonScale and momentum fraction x (with x = 1-eps). The particle is assumed to have a virtuality particleScale. This will only work properly for nucleons. All other particles will have zero valence densities

Reimplemented from ThePEG::PDFBase.

virtual double ThePEG::LHAPDF::xfsx ( tcPDPtr  particle,
tcPDPtr  parton,
Energy2  partonScale,
double  x,
double  eps = 0.0,
Energy2  particleScale = ZERO 
) const [virtual]

The sea density.

Return the pdf for the given cvalence parton inside the given particle for the virtuality partonScale and momentum fraction x. The particle is assumed to have a virtuality particleScale. If not overidden by a sub class this implementation will assume that the difference between a quark and anti-quark distribution is due do valense quarks.

Reimplemented from ThePEG::PDFBase.

PType ThePEG::LHAPDF::ptype (  )  const [inline]

The particle type.

1=nucleon, 2=pion, 3=photon. No checking is done to see if the selected PDF set in LHAPDF actually can handle this type

Definition at line 129 of file LHAPDF.h.

References thePType.

const string& ThePEG::LHAPDF::PDFName (  )  const [inline]

The name if the PDF set to be used.

The full name including the .LHpdf or .LHgrid suffix.

Definition at line 135 of file LHAPDF.h.

References thePDFName.

int ThePEG::LHAPDF::maxFlav (  )  const [inline]

The maximum number of flavours for which non-zero densities are reported.

The actual number of flavours may be less depending on the chosen PDF set.

Definition at line 147 of file LHAPDF.h.

References theMaxFlav.

void ThePEG::LHAPDF::setMaxNSet ( int   )  [protected]

Set the maximum number of simultaneous pdfs that can be used in LHAPDF.

Should be set to the parameter nmxset in the parmsetup.inc in the installed LHAPDF library. (By default this is set to 3.)

void ThePEG::LHAPDF::persistentOutput ( PersistentOStream os  )  const

Function used to write out object persistently.

Parameters:
os the persistent output stream written to.

Reimplemented from ThePEG::PDFBase.

void ThePEG::LHAPDF::persistentInput ( PersistentIStream is,
int  version 
)

Function used to read in object persistently.

Parameters:
is the persistent input stream read from.
version the version number of the object when written.

Reimplemented from ThePEG::PDFBase.

static void ThePEG::LHAPDF::Init (  )  [static]

The standard Init function used to initialize the interfaces.

Called exactly once for each class by the class description system before the main function starts or when this class is dynamically loaded.

Reimplemented from ThePEG::PDFBase.

virtual IBPtr ThePEG::LHAPDF::clone (  )  const [protected, virtual]

Make a simple clone of this object.

Returns:
a pointer to the new object.

Implements ThePEG::InterfacedBase.

virtual IBPtr ThePEG::LHAPDF::fullclone (  )  const [protected, virtual]

Make a clone of this object, possibly modifying the cloned object to make it sane.

Returns:
a pointer to the new object.

Reimplemented from ThePEG::InterfacedBase.

virtual void ThePEG::LHAPDF::doinit (  )  [protected, virtual]

Initialize this object after the setup phase before saving an EventGenerator to disk.

Exceptions:
InitException if object could not be initialized properly.

Reimplemented from ThePEG::PDFBase.

virtual void ThePEG::LHAPDF::doinitrun (  )  [protected, virtual]

Initialize this object.

Called in the run phase just before a run begins.

Reimplemented from ThePEG::InterfacedBase.

virtual void ThePEG::LHAPDF::dofinish (  )  [protected, virtual]

Finalize this object.

Called in the run phase just after a run has ended. Used eg. to write out statistics.

Reimplemented from ThePEG::InterfacedBase.

LHAPDF& ThePEG::LHAPDF::operator= ( const LHAPDF  )  [private]

The assignment operator is private and must never be called.

In fact, it should not even be implemented.


Member Data Documentation

The particle type.

1=nucleon, 2=pion, 3=photon. No checking is done to see if the selected PDF set in LHAPDF actually can handle this type

Definition at line 367 of file LHAPDF.h.

Referenced by ptype().

string ThePEG::LHAPDF::thePDFName [private]

The name if the PDF set to be used.

Should be the full name including the .LHpdf or .LHgrid suffix.

Definition at line 373 of file LHAPDF.h.

Referenced by PDFName().

The maximum number of flavours for which non-zero densities are reported.

The actual number of flavours may be less depending on the chosen PDF set.

Definition at line 401 of file LHAPDF.h.

Referenced by maxFlav().

int ThePEG::LHAPDF::nset [mutable, private]

The LHAPDF nset number (minus one) to be used by this object.

If below zero, the object has not been initialized.

Definition at line 407 of file LHAPDF.h.

int ThePEG::LHAPDF::MaxNSet [static, private]

The maximum number of simultaneous pdfs that can be used in LHAPDF.

Should be set to the parameter nmxset in the parmsetup.inc in the installed LHAPDF library. (By default this is set to 3.)

Definition at line 436 of file LHAPDF.h.

The static object used to initialize the description of this class.

Indicates that this is a concrete class with persistent data.

Definition at line 479 of file LHAPDF.h.


The documentation for this class was generated from the following file:

Generated on Thu Apr 29 12:43:14 2010 for ThePEG by  doxygen 1.5.5