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