BYPDF.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2019, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
8  University of Liverpool & STFC Rutherford Appleton Lab
9 
10  For the class documentation see the corresponding header file.
11 
12  Important revisions after version 2.0.0 :
13  @ Oct 09, 2009 - CA
14  Renamed to BYPDF from BYPDFModel
15 */
16 //____________________________________________________________________________
17 
18 #include <TMath.h>
19 
24 
25 using namespace genie;
26 
27 //____________________________________________________________________________
29 PDFModelI("genie::BYPDF")
30 {
31 
32 }
33 //____________________________________________________________________________
35 PDFModelI("genie::BYPDF", config)
36 {
37 
38 }
39 //____________________________________________________________________________
41 {
42 
43 }
44 //____________________________________________________________________________
45 double BYPDF::UpValence(double x, double q2) const
46 {
47  return AllPDFs(x,q2).uval;
48 }
49 //____________________________________________________________________________
50 double BYPDF::DownValence(double x, double q2) const
51 {
52  return AllPDFs(x,q2).dval;
53 }
54 //____________________________________________________________________________
55 double BYPDF::UpSea(double x, double q2) const
56 {
57  return AllPDFs(x,q2).usea;
58 }
59 //____________________________________________________________________________
60 double BYPDF::DownSea(double x, double q2) const
61 {
62  return AllPDFs(x,q2).dsea;
63 }
64 //____________________________________________________________________________
65 double BYPDF::Strange(double x, double q2) const
66 {
67  return AllPDFs(x,q2).str;
68 }
69 //____________________________________________________________________________
70 double BYPDF::Charm(double x, double q2) const
71 {
72  return AllPDFs(x,q2).chm;
73 }
74 //____________________________________________________________________________
75 double BYPDF::Bottom(double x, double q2) const
76 {
77  return AllPDFs(x,q2).bot;
78 }
79 //____________________________________________________________________________
80 double BYPDF::Top(double x, double q2) const
81 {
82  return AllPDFs(x,q2).top;
83 }
84 //____________________________________________________________________________
85 double BYPDF::Gluon(double x, double q2) const
86 {
87  return AllPDFs(x,q2).gl;
88 }
89 //____________________________________________________________________________
90 PDF_t BYPDF::AllPDFs(double x, double q2) const
91 {
92 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
93  LOG("BodekYang", pDEBUG)
94  << "Inputs: x = " << x << ", |q2| = " << TMath::Abs(q2);
95 #endif
96  if(TMath::Abs(q2) < fQ2min) q2=fQ2min;
97 
98  // get the uncorrected PDFs
99  PDF_t uncorrected_pdfs = fBasePDFModel->AllPDFs(x, q2);
100  double uv = uncorrected_pdfs.uval;
101  double us = uncorrected_pdfs.usea;
102  double dv = uncorrected_pdfs.dval;
103  double ds = uncorrected_pdfs.dsea;
104 
105  // compute correction factor delta(d/u)
106  double delta = this->DeltaDU(x);
107 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
108  LOG("BodekYang", pDEBUG) << "delta(d/u) = " << delta;
109 #endif
110 
111  // compute u/(u+d) ratios for both valence & sea quarks
112  double val = uv+dv;
113  double sea = us+ds;
114  double rv = (val==0) ? 0. : uv/val;
115  double rs = (sea==0) ? 0. : us/sea;
116 
117 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
118  LOG("BodekYang", pDEBUG)
119  << "valence[u/(u+d)] = " << rv << ", sea[u/(u+d)] = " << rs;
120 #endif
121 
122  // compute the corrected valence and sea quark PDFs:
123  double uv_c = uv / ( 1 + delta*rv);
124  double dv_c = (dv + uv*delta) / ( 1 + delta*rv);
125  double us_c = us / ( 1 + delta*rs);
126  double ds_c = (ds + us*delta) / ( 1 + delta*rs);
127 
128 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
129  LOG("BodekYang", pDEBUG) << "Bodek-Yang PDF correction:";
130  LOG("BodekYang", pDEBUG) << "uv: " << uv << " --> " << uv_c;
131  LOG("BodekYang", pDEBUG) << "dv: " << dv << " --> " << dv_c;
132  LOG("BodekYang", pDEBUG) << "us: " << us << " --> " << us_c;
133  LOG("BodekYang", pDEBUG) << "ds: " << ds << " --> " << ds_c;
134 #endif
135 
136  // fill in and return the corrected PDFs:
137  PDF_t corrected_pdfs;
138 
139  corrected_pdfs.uval = uv_c;
140  corrected_pdfs.dval = dv_c;
141  corrected_pdfs.usea = us_c;
142  corrected_pdfs.dsea = ds_c;
143  corrected_pdfs.str = uncorrected_pdfs.str;
144  corrected_pdfs.chm = uncorrected_pdfs.chm;
145  corrected_pdfs.bot = uncorrected_pdfs.bot;
146  corrected_pdfs.top = uncorrected_pdfs.top;
147  corrected_pdfs.gl = uncorrected_pdfs.gl;
148 
149  return corrected_pdfs;
150 }
151 //____________________________________________________________________________
152 double BYPDF::DeltaDU(double x) const
153 {
154 // Computes the BY correction factor delta(d/u)
155 
156  double d = fX0 + fX1 * x + fX2 * TMath::Power(x,2);
157  return d;
158 }
159 //____________________________________________________________________________
161 {
162  Algorithm::Configure(config);
163  this->LoadConfig();
164 }
165 //____________________________________________________________________________
167 {
168  Algorithm::Configure(config);
169  this->LoadConfig();
170 }
171 //____________________________________________________________________________
173 {
174 
175  GetParam( "BY-X0", fX0 ) ;
176  GetParam( "BY-X1", fX1 ) ;
177  GetParam( "BY-X2", fX2 ) ;
178 
179  GetParam( "PDF-Q2min", fQ2min ) ;
180 
181  // get the base PDF model (typically GRV9* LO)
182  fBasePDFModel =
183  dynamic_cast<const PDFModelI *>(this->SubAlg("Uncorr-PDF-Set"));
184 }
185 //____________________________________________________________________________
186 
187 
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
virtual PDF_t AllPDFs(double x, double Q2) const =0
double Bottom(double x, double q2) const
Definition: BYPDF.cxx:75
double delta
Definition: runWimpSim.h:98
double DownValence(double x, double q2) const
Definition: BYPDF.cxx:50
void Configure(const Registry &config)
Definition: BYPDF.cxx:160
double fX1
correction param X1
Definition: BYPDF.h:60
double DownSea(double x, double q2) const
Definition: BYPDF.cxx:60
Definition: config.py:1
double fX0
correction param X0
Definition: BYPDF.h:59
Pure abstract base class. Defines the PDFModelI interface to be implemented by wrapper classes to exi...
Definition: PDFModelI.h:29
void LoadConfig(void)
Definition: BYPDF.cxx:172
double Charm(double x, double q2) const
Definition: BYPDF.cxx:70
double fQ2min
min. Q2 for PDF evaluation
Definition: BYPDF.h:62
Double_t q2[12][num]
Definition: f2_nu.C:137
PDF_t AllPDFs(double x, double q2) const
Definition: BYPDF.cxx:90
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
double Top(double x, double q2) const
Definition: BYPDF.cxx:80
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
double DeltaDU(double x) const
Definition: BYPDF.cxx:152
Float_t d
Definition: plot.C:236
A very simple service to remember what detector we&#39;re working in.
static constexpr double us
A struct to hold PDF set data.
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
double Gluon(double x, double q2) const
Definition: BYPDF.cxx:85
double fX2
correction param X2
Definition: BYPDF.h:61
const PDFModelI * fBasePDFModel
configuration parameters
Definition: BYPDF.h:57
double UpValence(double x, double q2) const
PDFModelI interface implementation.
Definition: BYPDF.cxx:45
virtual ~BYPDF()
Definition: BYPDF.cxx:40
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double UpSea(double x, double q2) const
Definition: BYPDF.cxx:55
double Strange(double x, double q2) const
Definition: BYPDF.cxx:65
#define pDEBUG
Definition: Messenger.h:64
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:353