GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DMBYStrucFunc.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 
7  Costas Andreopoulos <c.andreopoulos \at cern.ch>
8  University of Liverpool
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 DMBYStrucFunc from DMBYStructureFuncModel
15 
16 */
17 //____________________________________________________________________________
18 
19 #include <TMath.h>
20 
26 
27 using namespace genie;
28 using namespace genie::constants;
29 
30 //____________________________________________________________________________
32 QPMDMDISStrucFuncBase("genie::DMBYStrucFunc")
33 {
34  this->Init();
35 }
36 //____________________________________________________________________________
38 QPMDMDISStrucFuncBase("genie::DMBYStrucFunc", config)
39 {
40  this->Init();
41 }
42 //____________________________________________________________________________
44 {
45 
46 }
47 //____________________________________________________________________________
48 void DMBYStrucFunc::Configure(const Registry & config)
49 {
50 // Overload Algorithm::Configure() to read the config. registry and set
51 // private data members.
52 // QPMDMDISStrucFuncBase::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 DMBYStrucFunc::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 DMBYStrucFunc::ScalingVar(const Interaction * interaction) const
96 {
97 // Overrides QPMDMDISStrucFuncBase::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 DMBYStrucFunc::KFactors(const Interaction * interaction,
111  double & kuv, double & kdv, double & kus, double & kds) const
112 {
113 // Overrides QPMDMDISStrucFuncBase::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 //____________________________________________________________________________
double fB
better scaling var parameter B
Definition: DMBYStrucFunc.h:53
double fCv2D
D-val K factor parameter.
Definition: DMBYStrucFunc.h:59
double fCv1D
D-val K factor parameter.
Definition: DMBYStrucFunc.h:58
Abstract base class. Provides common implementation for concrete objects implementing the DISStructur...
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
double x(bool selected=false) const
Definition: Kinematics.cxx:99
double ScalingVar(const Interaction *i) const
double fCv2U
U-val K factor parameter.
Definition: DMBYStrucFunc.h:57
void Configure(const Registry &config)
Summary information for an interaction.
Definition: Interaction.h:56
void Configure(const Registry &config)
double fCsU
U-sea K factor parameter.
Definition: DMBYStrucFunc.h:54
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual double Q2(const Interaction *i) const
const double a
const Kinematics & Kine(void) const
Definition: Interaction.h:71
double fA
better scaling var parameter A
Definition: DMBYStrucFunc.h:52
void KFactors(const Interaction *i, double &kuv, double &kdv, double &kus, double &kds) const
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fCsD
D-sea K factor parameter.
Definition: DMBYStrucFunc.h:55
double fCv1U
U-val K factor parameter.
Definition: DMBYStrucFunc.h:56
#define pDEBUG
Definition: Messenger.h:63