22 using namespace genie;
112 <<
"GRV98LO algorithm was not initialized succesfully";
126 <<
"Inputs x = " << x <<
", Q2 = " <<
Q2;
130 if(Q2 <= 0.8) Q2 = 0.80001;
135 double logx = std::log(x);
136 double logQ2 = std::log(Q2);
138 double xv = std::sqrt(x);
140 double x1p3 = x1*x1*
x1;
141 double x1p4 = x1*x1p3;
142 double x1p5 = x1*x1p4;
143 double x1p7 = x1p3*x1p4;
145 double uv =
fXUVF->
Eval(logx,logQ2) * x1p3 * xv;
146 double dv =
fXDVF->
Eval(logx,logQ2) * x1p4 * xv;
147 double de =
fXDEF->
Eval(logx,logQ2) * x1p7 * xv;
148 double ud =
fXUDF->
Eval(logx,logQ2) * x1p7 * xs;
149 double us = 0.5 * (ud - de);
150 double ds = 0.5 * (ud + de);
151 double ss =
fXSF->
Eval(logx,logQ2) * x1p7 * xs;
152 double gl =
fXGF->
Eval(logx,logQ2) * x1p5 * xs;
183 const char *
genie_dir = gSystem->Getenv(
"GENIE");
184 if(!genie_dir)
return;
186 string grid_file_name =
187 string(gSystem->Getenv(
"GENIE")) +
string(
"/data/evgen/pdfs/GRV98lo_patched.LHgrid");
190 <<
"Reading grid file from:\n " << grid_file_name;
193 grid_file.open (grid_file_name.c_str());
197 const int nskip = 21;
198 for(
int i=0; i<nskip; i++) {
199 grid_file.getline(rubbish,1000);
200 LOG(
"GRV98LO",
pDEBUG) <<
"Skipping: " << rubbish;
206 LOG(
"GRV98LO",
pDEBUG) <<
"Reading x_bj grid values";
207 for(
int j=0; j <
kNXbj; j++) {
215 ostringstream grid_values;
217 for(
int j=0; j <
kNXbj; j++) {
219 if(j == kNXbj - 1) { grid_values <<
")"; }
220 else { grid_values <<
", "; }
223 <<
"x_bj grid values: " << grid_values.str();
228 LOG(
"GRV98LO",
pDEBUG) <<
"Reading Q^2 grid values.";
229 for(
int i=0; i <
kNQ2; i++) {
239 for(
int i=0; i <
kNQ2; i++) {
241 if(i == kNQ2 - 1) { grid_values <<
")"; }
242 else { grid_values <<
", "; }
245 <<
"Q^2 grid values: " << grid_values.str() <<
"GeV^2";
248 grid_file.getline(rubbish,1000);
249 LOG(
"GRV98LO",
pDEBUG) <<
"Skipping: " << rubbish;
250 grid_file.getline(rubbish,1000);
251 LOG(
"GRV98LO",
pDEBUG) <<
"Skipping: " << rubbish;
256 LOG(
"GRV98LO",
pDEBUG) <<
"Reading PDF values on grid points";
259 for(
int j=0; j < kNXbj-1; j++) {
260 for(
int i=0; i <
kNQ2; i++) {
267 grid_file >> p0 >> p1 >> p2 >> p3 >> p4 >> p5;
269 <<
"Row: " << k <<
", grid point: (" << i <<
", " << j <<
") ->" 291 vector<double> gridLogQ2 (kNQ2);
292 vector<double> gridLogXbj(kNXbj);
293 vector<double> knotsXUVF(kNQ2*kNXbj);
294 vector<double> knotsXDVF(kNQ2*kNXbj);
295 vector<double> knotsXDEF(kNQ2*kNXbj);
296 vector<double> knotsXUDF(kNQ2*kNXbj);
297 vector<double> knotsXSF (kNQ2*kNXbj);
298 vector<double> knotsXGF (kNQ2*kNXbj);
301 for(
int i=0; i <
kNQ2; i++) {
302 double logQ2 = std::log(
fGridQ2[i]);
303 gridLogQ2[i] = logQ2;
304 for(
int j=0; j < kNXbj - 1; j++) {
305 double logx = std::log(
fGridXbj[j]);
306 gridLogXbj[j] = logx;
307 double xb0v = std::sqrt(
fGridXbj[j]);
314 knotsXUVF[
k] =
fParton[0][i][j] / (xb1p3 * xb0v);
315 knotsXDVF[
k] =
fParton[1][i][j] / (xb1p4 * xb0v);
316 knotsXDEF[
k] =
fParton[2][i][j] / (xb1p7 * xb0v);
317 knotsXUDF[
k] =
fParton[3][i][j] / (xb1p7 * xb0s);
318 knotsXSF [
k] =
fParton[4][i][j] / (xb1p7 * xb0s);
319 knotsXGF [
k] =
fParton[5][i][j] / (xb1p5 * xb0s);
322 double logxmax = TMath::Log(
fGridXbj[kNXbj-1]);
323 gridLogXbj[kNXbj-1] = logxmax;
333 fXUVF =
new Interpolator2D(gridLogXbj.size(),&gridLogXbj[0],gridLogQ2.size(),&gridLogQ2[0],&knotsXUVF[0]);
334 fXDVF =
new Interpolator2D(gridLogXbj.size(),&gridLogXbj[0],gridLogQ2.size(),&gridLogQ2[0],&knotsXDVF[0]);
335 fXDEF =
new Interpolator2D(gridLogXbj.size(),&gridLogXbj[0],gridLogQ2.size(),&gridLogQ2[0],&knotsXDEF[0]);
336 fXUDF =
new Interpolator2D(gridLogXbj.size(),&gridLogXbj[0],gridLogQ2.size(),&gridLogQ2[0],&knotsXUDF[0]);
337 fXSF =
new Interpolator2D(gridLogXbj.size(),&gridLogXbj[0],gridLogQ2.size(),&gridLogQ2[0],&knotsXSF [0]);
338 fXGF =
new Interpolator2D(gridLogXbj.size(),&gridLogXbj[0],gridLogQ2.size(),&gridLogQ2[0],&knotsXGF [0]);
double Top(double x, double Q2) const
double Charm(double x, double Q2) const
PDF_t AllPDFs(double x, double Q2) const
static constexpr double us
double Bottom(double x, double Q2) const
THE MAIN GENIE PROJECT NAMESPACE
double Q2(const Interaction *const i)
double Eval(const double &x, const double &y) const
double DownSea(double x, double Q2) const
double fGridLogXbj[kNXbj]
Pure abstract base class. Defines the PDFModelI interface to be implemented by wrapper classes to exi...
virtual const Registry & GetConfig(void) const
void Configure(const Registry &config)
double DownValence(double x, double Q2) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
double Strange(double x, double Q2) const
virtual void Configure(const Registry &config)
static int max(int a, int b)
double UpValence(double x, double Q2) const
A struct to hold PDF set data.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
A registry. Provides the container for algorithm configuration parameters.
A 2D interpolator using the GSL spline type If GSL version is not sufficient, does an inefficient ver...
string genie_dir(std::getenv("GENIE"))
double fParton[kNParton][kNQ2][kNXbj-1]
double UpSea(double x, double Q2) const
double Gluon(double x, double Q2) const