GENIEGenerator
Loading...
Searching...
No Matches
genie::LHAPDF5 Class Reference

LHAPDF5 library interface. Concrete implementation of the PDFModelI interface. More...

#include <LHAPDF5.h>

Inheritance diagram for genie::LHAPDF5:
[legend]
Collaboration diagram for genie::LHAPDF5:
[legend]

Public Member Functions

 LHAPDF5 ()
 LHAPDF5 (string config)
virtual ~LHAPDF5 ()
double UpValence (double x, double Q2) const
double DownValence (double x, double Q2) const
double UpSea (double x, double Q2) const
double DownSea (double x, double Q2) const
double Strange (double x, double Q2) const
double Charm (double x, double Q2) const
double Bottom (double x, double Q2) const
double Top (double x, double Q2) const
double Gluon (double x, double Q2) const
PDF_t AllPDFs (double x, double Q2) const
void Configure (const Registry &config)
void Configure (string config)
Public Member Functions inherited from genie::PDFModelI
virtual ~PDFModelI ()
Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
virtual void FindConfig (void)
virtual const RegistryGetConfig (void) const
RegistryGetOwnedConfig (void)
virtual const AlgIdId (void) const
 Get algorithm ID.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
virtual void SetId (string name, string config)
const AlgorithmSubAlg (const RgKey &registry_key) const
void AdoptConfig (void)
void AdoptSubstructure (void)
virtual void Print (ostream &stream) const
 Print algorithm info.

Private Member Functions

void Initialize (void) const
void SetPDFSetFromConfig (void) const

Additional Inherited Members

Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
static string BuildParamVectSizeKey (const std::string &comm_name)
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
static string BuildParamMatRowSizeKey (const std::string &comm_name)
static string BuildParamMatColSizeKey (const std::string &comm_name)
Protected Member Functions inherited from genie::PDFModelI
 PDFModelI ()
 PDFModelI (string name)
 PDFModelI (string name, string config)
Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 Algorithm (string name)
 Algorithm (string name, string config)
void Initialize (void)
void DeleteConfig (void)
void DeleteSubstructure (void)
RegistryExtractLocalConfig (const Registry &in) const
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key.
template<class T>
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
template<class T>
bool GetParamDef (const RgKey &name, T &p, const T &def) const
template<class T>
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters.
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
template<class T>
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters.
template<class T>
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

Detailed Description

LHAPDF5 library interface. Concrete implementation of the PDFModelI interface.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n June 06, 2004
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 28 of file LHAPDF5.h.

Constructor & Destructor Documentation

◆ LHAPDF5() [1/2]

LHAPDF5::LHAPDF5 ( )

Definition at line 27 of file LHAPDF5.cxx.

27 :
28PDFModelI("genie::LHAPDF5")
29{
30 this->Initialize();
31}
void Initialize(void) const
Definition LHAPDF5.cxx:46

References Initialize(), and genie::PDFModelI::PDFModelI().

◆ LHAPDF5() [2/2]

LHAPDF5::LHAPDF5 ( string config)

Definition at line 33 of file LHAPDF5.cxx.

33 :
34PDFModelI("genie::LHAPDF5", config)
35{
36 LOG("LHAPDF5", pDEBUG) << "LHAPDF5 configuration:\n " << this->GetConfig();
37
38 this->Initialize();
39}
#define pDEBUG
Definition Messenger.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
virtual const Registry & GetConfig(void) const

References genie::Algorithm::GetConfig(), Initialize(), LOG, pDEBUG, and genie::PDFModelI::PDFModelI().

◆ ~LHAPDF5()

LHAPDF5::~LHAPDF5 ( )
virtual

Definition at line 41 of file LHAPDF5.cxx.

42{
43
44}

Member Function Documentation

◆ AllPDFs()

PDF_t LHAPDF5::AllPDFs ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 136 of file LHAPDF5.cxx.

143{
144 PDF_t pdf;
145
146#ifdef __GENIE_LHAPDF5_ENABLED__
147 // QCD scale
148 double Q = TMath::Sqrt( TMath::Abs(Q2) );
149
150 vector<double> pdfs = LHAPDF::xfx(x, Q);
151 pdf.uval = pdfs[8] - pdfs[4];
152 pdf.dval = pdfs[7] - pdfs[5];
153 pdf.usea = pdfs[4];
154 pdf.dsea = pdfs[5];
155 pdf.str = pdfs[9];
156 pdf.chm = pdfs[10];
157 pdf.bot = pdfs[11];
158 pdf.top = pdfs[12];
159 pdf.gl = pdfs[6];;
160#endif
161
162 return pdf;
163}
struct genie::EPDF PDF_t

References genie::EPDF::bot, genie::EPDF::chm, genie::EPDF::dsea, genie::EPDF::dval, genie::EPDF::gl, genie::EPDF::str, genie::EPDF::top, genie::EPDF::usea, and genie::EPDF::uval.

Referenced by Bottom(), Charm(), DownSea(), DownValence(), Gluon(), Strange(), Top(), UpSea(), and UpValence().

◆ Bottom()

double LHAPDF5::Bottom ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 121 of file LHAPDF5.cxx.

122{
123 return AllPDFs(x,Q2).bot;
124}
PDF_t AllPDFs(double x, double Q2) const
Definition LHAPDF5.cxx:136
double bot
Definition PDFt.h:31

References AllPDFs(), and genie::EPDF::bot.

◆ Charm()

double LHAPDF5::Charm ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 116 of file LHAPDF5.cxx.

117{
118 return AllPDFs(x,Q2).chm;
119}
double chm
Definition PDFt.h:30

References AllPDFs(), and genie::EPDF::chm.

◆ Configure() [1/2]

void LHAPDF5::Configure ( const Registry & config)
virtual

Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority

Reimplemented from genie::Algorithm.

Definition at line 165 of file LHAPDF5.cxx.

166{
167 Algorithm::Configure(config);
168
169 this->Initialize();
170 this->SetPDFSetFromConfig();
171
172 fAllowReconfig=false;
173}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
void SetPDFSetFromConfig(void) const
Definition LHAPDF5.cxx:70

References genie::Algorithm::Configure(), genie::Algorithm::fAllowReconfig, Initialize(), and SetPDFSetFromConfig().

◆ Configure() [2/2]

void LHAPDF5::Configure ( string config)
virtual

Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration

Reimplemented from genie::Algorithm.

Definition at line 175 of file LHAPDF5.cxx.

176{
177 Algorithm::Configure(config);
178
179 this->Initialize();
180 this->SetPDFSetFromConfig();
181
182 fAllowReconfig=false;
183}

References genie::Algorithm::Configure(), genie::Algorithm::fAllowReconfig, Initialize(), and SetPDFSetFromConfig().

◆ DownSea()

double LHAPDF5::DownSea ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 106 of file LHAPDF5.cxx.

107{
108 return AllPDFs(x,Q2).dsea;
109}
double dsea
Definition PDFt.h:28

References AllPDFs(), and genie::EPDF::dsea.

◆ DownValence()

double LHAPDF5::DownValence ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 96 of file LHAPDF5.cxx.

97{
98 return AllPDFs(x,Q2).dval;
99}
double dval
Definition PDFt.h:26

References AllPDFs(), and genie::EPDF::dval.

◆ Gluon()

double LHAPDF5::Gluon ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 131 of file LHAPDF5.cxx.

132{
133 return AllPDFs(x,Q2).gl;
134}
double gl
Definition PDFt.h:33

References AllPDFs(), and genie::EPDF::gl.

◆ Initialize()

void LHAPDF5::Initialize ( void ) const
private

Definition at line 46 of file LHAPDF5.cxx.

47{
48#ifdef __GENIE_LHAPDF5_ENABLED__
49 bool lhapath_ok = true;
50 const char * lhapath = gSystem->Getenv("LHAPATH");
51 if(!lhapath) lhapath_ok = false;
52 else {
53 void *dirp = gSystem->OpenDirectory(lhapath);
54 if (dirp) gSystem->FreeDirectory(dirp);
55 else lhapath_ok = false;
56 }
57 if(!lhapath_ok) {
58 LOG("LHAPDF5", pFATAL)
59 << "\n"
60 << "** LHAPDF won't be able to read-in the PDF data. \n"
61 << "** The LHAPATH env. variable is not properly (or at all) defined. \n"
62 << "** Please, set LHAPATH to <lhapdf_top_dir>/PDFsets/ \n"
63 << "** See http://projects.hepforge.org/lhapdf/ for more details. \n\n";
64 gAbortingInErr = true;
65 exit(1);
66 }
67#endif
68}
#define pFATAL
Definition Messenger.h:56
bool gAbortingInErr
Definition Messenger.cxx:34

References genie::gAbortingInErr, LOG, and pFATAL.

Referenced by Configure(), Configure(), LHAPDF5(), and LHAPDF5().

◆ SetPDFSetFromConfig()

void LHAPDF5::SetPDFSetFromConfig ( void ) const
private

Definition at line 70 of file LHAPDF5.cxx.

71{
72// Get PDF spec (particle type, pdf group/set) from configuration registry.
73// For definitions, have a look at PDFLIB and LHAPDF manuals
74
75#ifdef __GENIE_LHAPDF5_ENABLED__
76 string name = "";
77 int type = 0;
78 int memset = 0;
79
80 this->GetParam("name_lhapdf", name);
81 this->GetParam("type_lhapdf", type);
82 this->GetParam("memset_lhapdf", memset);
83
84 LHAPDF::SetType stype = (type==0) ? LHAPDF::LHPDF : LHAPDF::LHGRID;
85
86 LHAPDF::initPDFByName(name, stype, memset);
87 LHAPDF::extrapolate(false);
88#endif
89}
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const

References genie::Algorithm::GetParam().

Referenced by Configure(), and Configure().

◆ Strange()

double LHAPDF5::Strange ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 111 of file LHAPDF5.cxx.

112{
113 return AllPDFs(x,Q2).str;
114}
double str
Definition PDFt.h:29

References AllPDFs(), and genie::EPDF::str.

◆ Top()

double LHAPDF5::Top ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 126 of file LHAPDF5.cxx.

127{
128 return AllPDFs(x,Q2).top;
129}
double top
Definition PDFt.h:32

References AllPDFs(), and genie::EPDF::top.

◆ UpSea()

double LHAPDF5::UpSea ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 101 of file LHAPDF5.cxx.

102{
103 return AllPDFs(x,Q2).usea;
104}
double usea
Definition PDFt.h:27

References AllPDFs(), and genie::EPDF::usea.

◆ UpValence()

double LHAPDF5::UpValence ( double x,
double Q2 ) const
virtual

Implements genie::PDFModelI.

Definition at line 91 of file LHAPDF5.cxx.

92{
93 return AllPDFs(x,Q2).uval;
94}
double uval
Definition PDFt.h:25

References AllPDFs(), and genie::EPDF::uval.


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