BYStrucFunc.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 BYStrucFunc from BYStructureFuncModel
15 
16 */
17 //____________________________________________________________________________
18 
19 #include <TMath.h>
20 
26 
27 using namespace genie;
28 using namespace genie::constants;
29 
30 //____________________________________________________________________________
32 QPMDISStrucFuncBase("genie::BYStrucFunc")
33 {
34  this->Init();
35 }
36 //____________________________________________________________________________
38 QPMDISStrucFuncBase("genie::BYStrucFunc", config)
39 {
40  this->Init();
41 }
42 //____________________________________________________________________________
44 {
45 
46 }
47 //____________________________________________________________________________
49 {
50 // Overload Algorithm::Configure() to read the config. registry and set
51 // private data members.
52 // QPMDISStrucFuncBase::Configure() creates the owned PDF object that gets
53 // configured with the specified PDFModelI
54 // For the ReadBYParams() method see below
55 
57  this->ReadBYParams();
58 }
59 //____________________________________________________________________________
60 void BYStrucFunc::Configure(string param_set)
61 {
63  this->ReadBYParams();
64 }
65 //____________________________________________________________________________
67 {
68 // Get the Bodek-Yang model parameters A,B,Csea,Cv1,Cv2 from the config.
69 // registry and set some private data members so as not to accessing the
70 // registry at every calculation.
71 //
72  GetParam( "BY-A", fA ) ;
73  GetParam( "BY-B", fB ) ;
74  GetParam( "BY-CsU", fCsU ) ;
75  GetParam( "BY-CsD", fCsD ) ;
76  GetParam( "BY-Cv1U", fCv1U ) ;
77  GetParam( "BY-Cv2U", fCv2U ) ;
78  GetParam( "BY-Cv1D", fCv1D ) ;
79  GetParam( "BY-Cv2D", fCv2D ) ;
80 
81 }
82 //____________________________________________________________________________
84 {
85  fA = 0;
86  fB = 0;
87  fCsU = 0;
88  fCsD = 0;
89  fCv1U = 0;
90  fCv2U = 0;
91  fCv1D = 0;
92  fCv2D = 0;
93 }
94 //____________________________________________________________________________
95 double BYStrucFunc::ScalingVar(const Interaction * interaction) const
96 {
97 // Overrides QPMDISStrucFuncBase::ScalingVar() to compute the BY scaling var
98 
99  const Kinematics & kine = interaction->Kine();
100  double x = kine.x();
101  double myQ2 = this->Q2(interaction);
102  //myQ2 = TMath::Max(Q2,fQ2min);
103  LOG("BodekYang", pDEBUG) << "Q2 at scaling var calculation = " << myQ2;
104 
105  double a = TMath::Power( 2*kProtonMass*x, 2 ) / myQ2;
106  double xw = 2*x*(myQ2+fB) / (myQ2*(1.+TMath::Sqrt(1+a)) + 2*fA*x);
107  return xw;
108 }
109 //____________________________________________________________________________
110 void BYStrucFunc::KFactors(const Interaction * interaction,
111  double & kuv, double & kdv, double & kus, double & kds) const
112 {
113 // Overrides QPMDISStrucFuncBase::KFactors() to compute the BY K factors for
114 // u(valence), d(valence), u(sea), d(sea);
115 
116  double myQ2 = this->Q2(interaction);
117  double GD = 1. / TMath::Power(1.+myQ2/0.71, 2); // p elastic form factor
118  double GD2 = TMath::Power(GD,2);
119 
120  kuv = (1.-GD2)*(myQ2+fCv2U)/(myQ2+fCv1U); // K - u(valence)
121  kdv = (1.-GD2)*(myQ2+fCv2D)/(myQ2+fCv1D); // K - d(valence)
122  kus = myQ2/(myQ2+fCsU); // K - u(sea)
123  kds = myQ2/(myQ2+fCsD); // K - d(sea)
124 }
125 //____________________________________________________________________________
void KFactors(const Interaction *i, double &kuv, double &kdv, double &kus, double &kds) const
double fCv1U
U-val K factor parameter.
Definition: BYStrucFunc.h:56
Basic constants.
void Configure(const Registry &config)
Definition: BYStrucFunc.cxx:48
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
virtual ~BYStrucFunc()
Definition: BYStrucFunc.cxx:43
double x(bool selected=false) const
Definition: Kinematics.cxx:109
Definition: config.py:1
double ScalingVar(const Interaction *i) const
Definition: BYStrucFunc.cxx:95
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
virtual double Q2(const Interaction *i) const
double fCv2D
D-val K factor parameter.
Definition: BYStrucFunc.h:59
Abstract base class. Provides common implementation for concrete objects implementing the DISStructur...
const double a
const Kinematics & Kine(void) const
Definition: Interaction.h:71
double fCv2U
U-val K factor parameter.
Definition: BYStrucFunc.h:57
void ReadBYParams(void)
Definition: BYStrucFunc.cxx:66
double fCv1D
D-val K factor parameter.
Definition: BYStrucFunc.h:58
double fB
better scaling var parameter B
Definition: BYStrucFunc.h:53
void Configure(const Registry &config)
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
double fCsU
U-sea K factor parameter.
Definition: BYStrucFunc.h:54
double fA
better scaling var parameter A
Definition: BYStrucFunc.h:52
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fCsD
D-sea K factor parameter.
Definition: BYStrucFunc.h:55
static const double kProtonMass
Definition: Constants.h:76
#define pDEBUG
Definition: Messenger.h:64