GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PDF.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 "PDF.h"
12 
13 using namespace genie;
14 
15 using std::endl;
16 
17 //____________________________________________________________________________
18 namespace genie
19 {
20  ostream & operator << (ostream & stream, const PDF & pdf_set)
21  {
22  pdf_set.Print(stream);
23  return stream;
24  }
25 }
26 //____________________________________________________________________________
28 {
29  this->Init();
30 }
31 //____________________________________________________________________________
32 PDF::PDF(const PDF & pdf_set)
33 {
34  this->Copy(pdf_set);
35 }
36 //____________________________________________________________________________
38 {
39 
40 }
41 //____________________________________________________________________________
42 void PDF::SetModel(const PDFModelI * model)
43 {
44  this->Init();
45 
46  fModel = model;
47 }
48 //____________________________________________________________________________
49 void PDF::Calculate(double x, double q2)
50 {
51  PDF_t pdfs = fModel->AllPDFs(x, q2);
52 
53  fUpValence = pdfs.uval;
54  fDownValence = pdfs.dval;
55  fUpSea = pdfs.usea;
56  fDownSea = pdfs.dsea;
57  fStrange = pdfs.str;
58  fCharm = pdfs.chm;
59  fBottom = pdfs.bot;
60  fTop = pdfs.top;
61  fGluon = pdfs.gl;
62 }
63 //____________________________________________________________________________
64 void PDF::ScaleValence(double kscale)
65 {
66  fUpValence *= kscale;
67  fDownValence *= kscale;
68 }
69 //____________________________________________________________________________
70 void PDF::ScaleSea(double kscale)
71 {
72  fUpSea *= kscale;
73  fDownSea *= kscale;
74  fStrange *= kscale;
75  fCharm *= kscale;
76  fBottom *= kscale;
77  fTop *= kscale;
78  fGluon *= kscale;
79 }
80 //____________________________________________________________________________
81 void PDF::ScaleUpValence(double kscale)
82 {
83  fUpValence *= kscale;
84 }
85 //____________________________________________________________________________
86 void PDF::ScaleDownValence(double kscale)
87 {
88  fDownValence *= kscale;
89 }
90 //____________________________________________________________________________
91 void PDF::ScaleUpSea(double kscale)
92 {
93  fUpSea *= kscale;
94 }
95 //____________________________________________________________________________
96 void PDF::ScaleDownSea(double kscale)
97 {
98  fDownSea *= kscale;
99 }
100 //____________________________________________________________________________
101 void PDF::ScaleStrange(double kscale)
102 {
103  fStrange *= kscale;
104 }
105 //____________________________________________________________________________
106 void PDF::ScaleCharm(double kscale)
107 {
108  fCharm *= kscale;
109 }
110 //____________________________________________________________________________
111 void PDF::Reset(void)
112 {
113  fUpValence = 0.0;
114  fDownValence = 0.0;
115  fUpSea = 0.0;
116  fDownSea = 0.0;
117  fStrange = 0.0;
118  fCharm = 0.0;
119  fBottom = 0.0;
120  fTop = 0.0;
121  fGluon = 0.0;
122 }
123 //____________________________________________________________________________
124 void PDF::Copy(const PDF & pdf_set)
125 {
126  fModel = pdf_set.fModel;
127 
128  fUpValence = pdf_set.fUpValence;
129  fDownValence = pdf_set.fDownValence;
130  fUpSea = pdf_set.fUpSea;
131  fDownSea = pdf_set.fDownSea;
132  fStrange = pdf_set.fStrange;
133  fCharm = pdf_set.fCharm;
134  fBottom = pdf_set.fBottom;
135  fTop = pdf_set.fTop;
136  fGluon = pdf_set.fGluon;
137 }
138 //____________________________________________________________________________
139 void PDF::Init(void)
140 {
141  fModel = 0;
142 
143  fUpValence = 0.0;
144  fDownValence = 0.0;
145  fUpSea = 0.0;
146  fDownSea = 0.0;
147  fStrange = 0.0;
148  fCharm = 0.0;
149  fBottom = 0.0;
150  fTop = 0.0;
151  fGluon = 0.0;
152 }
153 //____________________________________________________________________________
154 void PDF::Print(ostream & stream) const
155 {
156  stream << endl;
157  stream << "UP-VAL....... " << fUpValence << endl;
158  stream << "DOWN-VAL..... " << fDownValence << endl;
159  stream << "UP-SEA....... " << fUpSea << endl;
160  stream << "DOWN-SEA..... " << fDownSea << endl;
161  stream << "STRANGE...... " << fStrange << endl;
162  stream << "CHARM........ " << fCharm << endl;
163  stream << "BOTTOM....... " << fBottom << endl;
164  stream << "TOP.......... " << fTop << endl;
165  stream << "GLUON........ " << fGluon << endl;
166 }
167 //____________________________________________________________________________
double fDownValence
Definition: PDF.h:84
double fDownSea
Definition: PDF.h:86
void Init(void)
Definition: PDF.cxx:139
A class to store PDFs.
Definition: PDF.h:37
virtual PDF_t AllPDFs(double x, double Q2) const =0
void Copy(const PDF &pdf_set)
Definition: PDF.cxx:124
Pure abstract base class. Defines the PDFModelI interface to be implemented by wrapper classes to exi...
Definition: PDFModelI.h:28
void Reset(void)
Definition: PDF.cxx:111
double fStrange
Definition: PDF.h:87
void ScaleDownValence(double kscale)
Definition: PDF.cxx:86
double fTop
Definition: PDF.h:90
double fUpValence
Definition: PDF.h:83
void SetModel(const PDFModelI *model)
Definition: PDF.cxx:42
void ScaleSea(double kscale)
Definition: PDF.cxx:70
void ScaleValence(double kscale)
Definition: PDF.cxx:64
void Calculate(double x, double q2)
Definition: PDF.cxx:49
virtual ~PDF()
Definition: PDF.cxx:37
double fBottom
Definition: PDF.h:89
void ScaleUpValence(double kscale)
Definition: PDF.cxx:81
A struct to hold PDF set data.
double fUpSea
Definition: PDF.h:85
PDF()
Definition: PDF.cxx:27
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
double fGluon
Definition: PDF.h:91
const PDFModelI * fModel
Definition: PDF.h:93
double fCharm
Definition: PDF.h:88
void ScaleUpSea(double kscale)
Definition: PDF.cxx:91
void ScaleCharm(double kscale)
Definition: PDF.cxx:106
void ScaleDownSea(double kscale)
Definition: PDF.cxx:96
void Print(ostream &stream) const
Definition: PDF.cxx:154
void ScaleStrange(double kscale)
Definition: PDF.cxx:101