GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BYStrucFunc.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 <TMath.h>
12 
18 
19 using namespace genie;
20 using namespace genie::constants;
21 
22 //____________________________________________________________________________
24 QPMDISStrucFuncBase("genie::BYStrucFunc")
25 {
26  this->Init();
27 }
28 //____________________________________________________________________________
29 BYStrucFunc::BYStrucFunc(string config):
30 QPMDISStrucFuncBase("genie::BYStrucFunc", config)
31 {
32  this->Init();
33 }
34 //____________________________________________________________________________
36 {
37 
38 }
39 //____________________________________________________________________________
40 void BYStrucFunc::Configure(const Registry & config)
41 {
42 // Overload Algorithm::Configure() to read the config. registry and set
43 // private data members.
44 // QPMDISStrucFuncBase::Configure() creates the owned PDF object that gets
45 // configured with the specified PDFModelI
46 // For the ReadBYParams() method see below
47 
49  this->ReadBYParams();
50 }
51 //____________________________________________________________________________
52 void BYStrucFunc::Configure(string param_set)
53 {
55  this->ReadBYParams();
56 }
57 //____________________________________________________________________________
59 {
60 // Get the Bodek-Yang model parameters A,B,Csea,Cv1,Cv2 from the config.
61 // registry and set some private data members so as not to accessing the
62 // registry at every calculation.
63 //
64  GetParam( "BY-A", fA ) ;
65  GetParam( "BY-B", fB ) ;
66  GetParam( "BY-CsU", fCsU ) ;
67  GetParam( "BY-CsD", fCsD ) ;
68  GetParam( "BY-Cv1U", fCv1U ) ;
69  GetParam( "BY-Cv2U", fCv2U ) ;
70  GetParam( "BY-Cv1D", fCv1D ) ;
71  GetParam( "BY-Cv2D", fCv2D ) ;
72 
73 }
74 //____________________________________________________________________________
76 {
77  fA = 0;
78  fB = 0;
79  fCsU = 0;
80  fCsD = 0;
81  fCv1U = 0;
82  fCv2U = 0;
83  fCv1D = 0;
84  fCv2D = 0;
85 }
86 //____________________________________________________________________________
87 double BYStrucFunc::ScalingVar(const Interaction * interaction) const
88 {
89 // Overrides QPMDISStrucFuncBase::ScalingVar() to compute the BY scaling var
90 
91  const Kinematics & kine = interaction->Kine();
92  double x = kine.x();
93  double myQ2 = this->Q2(interaction);
94  //myQ2 = TMath::Max(Q2,fQ2min);
95  LOG("BodekYang", pDEBUG) << "Q2 at scaling var calculation = " << myQ2;
96 
97  double a = TMath::Power( 2*kProtonMass*x, 2 ) / myQ2;
98  double xw = 2*x*(myQ2+fB) / (myQ2*(1.+TMath::Sqrt(1+a)) + 2*fA*x);
99  return xw;
100 }
101 //____________________________________________________________________________
102 void BYStrucFunc::KFactors(const Interaction * interaction,
103  double & kuv, double & kdv, double & kus, double & kds) const
104 {
105 // Overrides QPMDISStrucFuncBase::KFactors() to compute the BY K factors for
106 // u(valence), d(valence), u(sea), d(sea);
107 
108  double myQ2 = this->Q2(interaction);
109  double GD = 1. / TMath::Power(1.+myQ2/0.71, 2); // p elastic form factor
110  double GD2 = TMath::Power(GD,2);
111 
112  kuv = (1.-GD2)*(myQ2+fCv2U)/(myQ2+fCv1U); // K - u(valence)
113  kdv = (1.-GD2)*(myQ2+fCv2D)/(myQ2+fCv1D); // K - d(valence)
114  kus = myQ2/(myQ2+fCsU); // K - u(sea)
115  kds = myQ2/(myQ2+fCsD); // K - d(sea)
116 }
117 //____________________________________________________________________________
void KFactors(const Interaction *i, double &kuv, double &kdv, double &kus, double &kds) const
double fCv1U
U-val K factor parameter.
Definition: BYStrucFunc.h:58
void Configure(const Registry &config)
Definition: BYStrucFunc.cxx:40
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
virtual ~BYStrucFunc()
Definition: BYStrucFunc.cxx:35
double x(bool selected=false) const
Definition: Kinematics.cxx:99
double ScalingVar(const Interaction *i) const
Definition: BYStrucFunc.cxx:87
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:96
virtual double Q2(const Interaction *i) const
double fCv2D
D-val K factor parameter.
Definition: BYStrucFunc.h:61
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:59
void ReadBYParams(void)
Definition: BYStrucFunc.cxx:58
double fCv1D
D-val K factor parameter.
Definition: BYStrucFunc.h:60
double fB
better scaling var parameter B
Definition: BYStrucFunc.h:55
void Configure(const Registry &config)
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
double fCsU
U-sea K factor parameter.
Definition: BYStrucFunc.h:56
double fA
better scaling var parameter A
Definition: BYStrucFunc.h:54
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fCsD
D-sea K factor parameter.
Definition: BYStrucFunc.h:57
#define pDEBUG
Definition: Messenger.h:63