GENIEGenerator
Loading...
Searching...
No Matches
BYPDF.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
11#include <TMath.h>
12
14#include "Framework/Conventions/GBuild.h"
17
18using namespace genie;
19
20//____________________________________________________________________________
22PDFModelI("genie::BYPDF")
23{
24
25}
26//____________________________________________________________________________
27BYPDF::BYPDF(string config) :
28PDFModelI("genie::BYPDF", config)
29{
30
31}
32//____________________________________________________________________________
34{
35
36}
37//____________________________________________________________________________
38double BYPDF::UpValence(double x, double q2) const
39{
40 return AllPDFs(x,q2).uval;
41}
42//____________________________________________________________________________
43double BYPDF::DownValence(double x, double q2) const
44{
45 return AllPDFs(x,q2).dval;
46}
47//____________________________________________________________________________
48double BYPDF::UpSea(double x, double q2) const
49{
50 return AllPDFs(x,q2).usea;
51}
52//____________________________________________________________________________
53double BYPDF::DownSea(double x, double q2) const
54{
55 return AllPDFs(x,q2).dsea;
56}
57//____________________________________________________________________________
58double BYPDF::Strange(double x, double q2) const
59{
60 return AllPDFs(x,q2).str;
61}
62//____________________________________________________________________________
63double BYPDF::Charm(double x, double q2) const
64{
65 return AllPDFs(x,q2).chm;
66}
67//____________________________________________________________________________
68double BYPDF::Bottom(double x, double q2) const
69{
70 return AllPDFs(x,q2).bot;
71}
72//____________________________________________________________________________
73double BYPDF::Top(double x, double q2) const
74{
75 return AllPDFs(x,q2).top;
76}
77//____________________________________________________________________________
78double BYPDF::Gluon(double x, double q2) const
79{
80 return AllPDFs(x,q2).gl;
81}
82//____________________________________________________________________________
83PDF_t BYPDF::AllPDFs(double x, double q2) const
84{
85#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
86 LOG("BodekYang", pDEBUG)
87 << "Inputs: x = " << x << ", |q2| = " << TMath::Abs(q2);
88#endif
89 if(TMath::Abs(q2) < fQ2min) q2=fQ2min;
90
91 // get the uncorrected PDFs
92 PDF_t uncorrected_pdfs = fBasePDFModel->AllPDFs(x, q2);
93 double uv = uncorrected_pdfs.uval;
94 double us = uncorrected_pdfs.usea;
95 double dv = uncorrected_pdfs.dval;
96 double ds = uncorrected_pdfs.dsea;
97
98 // compute correction factor delta(d/u)
99 double delta = this->DeltaDU(x);
100#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
101 LOG("BodekYang", pDEBUG) << "delta(d/u) = " << delta;
102#endif
103
104 // compute u/(u+d) ratios for both valence & sea quarks
105 double val = uv+dv;
106 double sea = us+ds;
107 double rv = (val==0) ? 0. : uv/val;
108 double rs = (sea==0) ? 0. : us/sea;
109
110#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
111 LOG("BodekYang", pDEBUG)
112 << "valence[u/(u+d)] = " << rv << ", sea[u/(u+d)] = " << rs;
113#endif
114
115 // compute the corrected valence and sea quark PDFs:
116 double uv_c = uv / ( 1 + delta*rv);
117 double dv_c = (dv + uv*delta) / ( 1 + delta*rv);
118 double us_c = us / ( 1 + delta*rs);
119 double ds_c = (ds + us*delta) / ( 1 + delta*rs);
120
121#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
122 LOG("BodekYang", pDEBUG) << "Bodek-Yang PDF correction:";
123 LOG("BodekYang", pDEBUG) << "uv: " << uv << " --> " << uv_c;
124 LOG("BodekYang", pDEBUG) << "dv: " << dv << " --> " << dv_c;
125 LOG("BodekYang", pDEBUG) << "us: " << us << " --> " << us_c;
126 LOG("BodekYang", pDEBUG) << "ds: " << ds << " --> " << ds_c;
127#endif
128
129 // fill in and return the corrected PDFs:
130 PDF_t corrected_pdfs;
131
132 corrected_pdfs.uval = uv_c;
133 corrected_pdfs.dval = dv_c;
134 corrected_pdfs.usea = us_c;
135 corrected_pdfs.dsea = ds_c;
136 corrected_pdfs.str = uncorrected_pdfs.str;
137 corrected_pdfs.chm = uncorrected_pdfs.chm;
138 corrected_pdfs.bot = uncorrected_pdfs.bot;
139 corrected_pdfs.top = uncorrected_pdfs.top;
140 corrected_pdfs.gl = uncorrected_pdfs.gl;
141
142 return corrected_pdfs;
143}
144//____________________________________________________________________________
145double BYPDF::DeltaDU(double x) const
146{
147// Computes the BY correction factor delta(d/u)
148
149 double d = fX0 + fX1 * x + fX2 * TMath::Power(x,2);
150 return d;
151}
152//____________________________________________________________________________
153void BYPDF::Configure(const Registry & config)
154{
155 Algorithm::Configure(config);
156 this->LoadConfig();
157}
158//____________________________________________________________________________
159void BYPDF::Configure(string config)
160{
161 Algorithm::Configure(config);
162 this->LoadConfig();
163}
164//____________________________________________________________________________
166{
167
168 GetParam( "BY-X0", fX0 ) ;
169 GetParam( "BY-X1", fX1 ) ;
170 GetParam( "BY-X2", fX2 ) ;
171
172 GetParam( "PDF-Q2min", fQ2min ) ;
173
174 // get the base PDF model (typically GRV9* LO)
176 dynamic_cast<const PDFModelI *>(this->SubAlg("Uncorr-PDF-Set"));
177}
178//____________________________________________________________________________
#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
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
const Algorithm * SubAlg(const RgKey &registry_key) const
double fX0
correction param X0
Definition BYPDF.h:61
double DeltaDU(double x) const
Definition BYPDF.cxx:145
double fX2
correction param X2
Definition BYPDF.h:63
double UpSea(double x, double q2) const
Definition BYPDF.cxx:48
double fX1
correction param X1
Definition BYPDF.h:62
const PDFModelI * fBasePDFModel
configuration parameters
Definition BYPDF.h:59
double Gluon(double x, double q2) const
Definition BYPDF.cxx:78
PDF_t AllPDFs(double x, double q2) const
Definition BYPDF.cxx:83
double Bottom(double x, double q2) const
Definition BYPDF.cxx:68
double fQ2min
min. Q2 for PDF evaluation
Definition BYPDF.h:64
virtual ~BYPDF()
Definition BYPDF.cxx:33
double Strange(double x, double q2) const
Definition BYPDF.cxx:58
void Configure(const Registry &config)
Definition BYPDF.cxx:153
double DownValence(double x, double q2) const
Definition BYPDF.cxx:43
double UpValence(double x, double q2) const
PDFModelI interface implementation.
Definition BYPDF.cxx:38
double Top(double x, double q2) const
Definition BYPDF.cxx:73
double DownSea(double x, double q2) const
Definition BYPDF.cxx:53
double Charm(double x, double q2) const
Definition BYPDF.cxx:63
void LoadConfig(void)
Definition BYPDF.cxx:165
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
struct genie::EPDF PDF_t
double str
Definition PDFt.h:29
double bot
Definition PDFt.h:31
double dsea
Definition PDFt.h:28
double uval
Definition PDFt.h:25
double top
Definition PDFt.h:32
double gl
Definition PDFt.h:33
double usea
Definition PDFt.h:27
double chm
Definition PDFt.h:30
double dval
Definition PDFt.h:26