GENIEGenerator
Loading...
Searching...
No Matches
PDF.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, 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
13using namespace genie;
14
15using std::endl;
16
17//____________________________________________________________________________
18namespace 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//____________________________________________________________________________
32PDF::PDF(const PDF & pdf_set)
33{
34 this->Copy(pdf_set);
35}
36//____________________________________________________________________________
38{
39
40}
41//____________________________________________________________________________
42void PDF::SetModel(const PDFModelI * model)
43{
44 this->Init();
45
46 fModel = model;
47}
48//____________________________________________________________________________
49void 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//____________________________________________________________________________
64void PDF::ScaleValence(double kscale)
65{
66 fUpValence *= kscale;
67 fDownValence *= kscale;
68}
69//____________________________________________________________________________
70void 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//____________________________________________________________________________
81void PDF::ScaleUpValence(double kscale)
82{
83 fUpValence *= kscale;
84}
85//____________________________________________________________________________
86void PDF::ScaleDownValence(double kscale)
87{
88 fDownValence *= kscale;
89}
90//____________________________________________________________________________
91void PDF::ScaleUpSea(double kscale)
92{
93 fUpSea *= kscale;
94}
95//____________________________________________________________________________
96void PDF::ScaleDownSea(double kscale)
97{
98 fDownSea *= kscale;
99}
100//____________________________________________________________________________
101void PDF::ScaleStrange(double kscale)
102{
103 fStrange *= kscale;
104}
105//____________________________________________________________________________
106void PDF::ScaleCharm(double kscale)
107{
108 fCharm *= kscale;
109}
110//____________________________________________________________________________
111void 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//____________________________________________________________________________
124void 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//____________________________________________________________________________
139void 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//____________________________________________________________________________
154void 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//____________________________________________________________________________
Pure abstract base class. Defines the PDFModelI interface to be implemented by wrapper classes to exi...
Definition PDFModelI.h:28
void SetModel(const PDFModelI *model)
Definition PDF.cxx:42
void ScaleSea(double kscale)
Definition PDF.cxx:70
virtual ~PDF()
Definition PDF.cxx:37
void ScaleDownValence(double kscale)
Definition PDF.cxx:86
void Print(ostream &stream) const
Definition PDF.cxx:154
void Reset(void)
Definition PDF.cxx:111
double fUpSea
Definition PDF.h:85
double fGluon
Definition PDF.h:91
const PDFModelI * fModel
Definition PDF.h:93
void Init(void)
Definition PDF.cxx:139
void ScaleUpValence(double kscale)
Definition PDF.cxx:81
void ScaleValence(double kscale)
Definition PDF.cxx:64
double fDownSea
Definition PDF.h:86
void Calculate(double x, double q2)
Definition PDF.cxx:49
void ScaleUpSea(double kscale)
Definition PDF.cxx:91
void ScaleStrange(double kscale)
Definition PDF.cxx:101
double fStrange
Definition PDF.h:87
void ScaleCharm(double kscale)
Definition PDF.cxx:106
double fUpValence
Definition PDF.h:83
double fCharm
Definition PDF.h:88
double fBottom
Definition PDF.h:89
double fDownValence
Definition PDF.h:84
void Copy(const PDF &pdf_set)
Definition PDF.cxx:124
void ScaleDownSea(double kscale)
Definition PDF.cxx:96
double fTop
Definition PDF.h:90
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
struct genie::EPDF PDF_t
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
double str
Definition PDFt.h:29
double bot
Definition PDFt.h:31
double dsea
Definition PDFt.h:28
double uval
Definition PDFt.h:25
double top
Definition PDFt.h:32
double gl
Definition PDFt.h:33
double usea
Definition PDFt.h:27
double chm
Definition PDFt.h:30
double dval
Definition PDFt.h:26