GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BYPDF.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, 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 
18 using namespace genie;
19 
20 //____________________________________________________________________________
22 PDFModelI("genie::BYPDF")
23 {
24 
25 }
26 //____________________________________________________________________________
27 BYPDF::BYPDF(string config) :
28 PDFModelI("genie::BYPDF", config)
29 {
30 
31 }
32 //____________________________________________________________________________
34 {
35 
36 }
37 //____________________________________________________________________________
38 double BYPDF::UpValence(double x, double q2) const
39 {
40  return AllPDFs(x,q2).uval;
41 }
42 //____________________________________________________________________________
43 double BYPDF::DownValence(double x, double q2) const
44 {
45  return AllPDFs(x,q2).dval;
46 }
47 //____________________________________________________________________________
48 double BYPDF::UpSea(double x, double q2) const
49 {
50  return AllPDFs(x,q2).usea;
51 }
52 //____________________________________________________________________________
53 double BYPDF::DownSea(double x, double q2) const
54 {
55  return AllPDFs(x,q2).dsea;
56 }
57 //____________________________________________________________________________
58 double BYPDF::Strange(double x, double q2) const
59 {
60  return AllPDFs(x,q2).str;
61 }
62 //____________________________________________________________________________
63 double BYPDF::Charm(double x, double q2) const
64 {
65  return AllPDFs(x,q2).chm;
66 }
67 //____________________________________________________________________________
68 double BYPDF::Bottom(double x, double q2) const
69 {
70  return AllPDFs(x,q2).bot;
71 }
72 //____________________________________________________________________________
73 double BYPDF::Top(double x, double q2) const
74 {
75  return AllPDFs(x,q2).top;
76 }
77 //____________________________________________________________________________
78 double BYPDF::Gluon(double x, double q2) const
79 {
80  return AllPDFs(x,q2).gl;
81 }
82 //____________________________________________________________________________
83 PDF_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 //____________________________________________________________________________
145 double 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 //____________________________________________________________________________
153 void BYPDF::Configure(const Registry & config)
154 {
155  Algorithm::Configure(config);
156  this->LoadConfig();
157 }
158 //____________________________________________________________________________
159 void 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)
175  fBasePDFModel =
176  dynamic_cast<const PDFModelI *>(this->SubAlg("Uncorr-PDF-Set"));
177 }
178 //____________________________________________________________________________
static constexpr double us
Definition: Units.h:97
double Bottom(double x, double q2) const
Definition: BYPDF.cxx:68
double DownValence(double x, double q2) const
Definition: BYPDF.cxx:43
void Configure(const Registry &config)
Definition: BYPDF.cxx:153
double fX1
correction param X1
Definition: BYPDF.h:62
double DownSea(double x, double q2) const
Definition: BYPDF.cxx:53
virtual PDF_t AllPDFs(double x, double Q2) const =0
double fX0
correction param X0
Definition: BYPDF.h:61
Pure abstract base class. Defines the PDFModelI interface to be implemented by wrapper classes to exi...
Definition: PDFModelI.h:28
void LoadConfig(void)
Definition: BYPDF.cxx:165
double Charm(double x, double q2) const
Definition: BYPDF.cxx:63
double fQ2min
min. Q2 for PDF evaluation
Definition: BYPDF.h:64
PDF_t AllPDFs(double x, double q2) const
Definition: BYPDF.cxx:83
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
double Top(double x, double q2) const
Definition: BYPDF.cxx:73
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
double DeltaDU(double x) const
Definition: BYPDF.cxx:145
A struct to hold PDF set data.
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
double Gluon(double x, double q2) const
Definition: BYPDF.cxx:78
double fX2
correction param X2
Definition: BYPDF.h:63
const PDFModelI * fBasePDFModel
configuration parameters
Definition: BYPDF.h:59
double UpValence(double x, double q2) const
PDFModelI interface implementation.
Definition: BYPDF.cxx:38
virtual ~BYPDF()
Definition: BYPDF.cxx:33
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double UpSea(double x, double q2) const
Definition: BYPDF.cxx:48
double Strange(double x, double q2) const
Definition: BYPDF.cxx:58
#define pDEBUG
Definition: Messenger.h:63
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345