BBA07ELFormFactorsModel.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Igor Kakorin <kakorin@jinr.ru>, Joint Institute for Nuclear Research
8  adapted from fortran code provided by
9  Konstantin Kuzmin <kkuzmin@theor.jinr.ru>,
10  Joint Institute for Nuclear Research, Institute for Theoretical and Experimental Physics
11  Vladimir Lyubushkin,
12  Joint Institute for Nuclear Research
13  Vadim Naumov <vnaumov@theor.jinr.ru>,
14  Joint Institute for Nuclear Research
15  based on code of Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
16  University of Liverpool & STFC Rutherford Appleton Lab
17 
18  For the class documentation see the corresponding header file.
19 
20 */
21 //____________________________________________________________________________
22 
26 
27 using namespace genie;
28 using namespace genie::constants;
29 
30 //____________________________________________________________________________
32 ELFormFactorsModelI("genie::BBA07ELFormFactorsModel")
33 {
34 
35 }
36 //____________________________________________________________________________
38 ELFormFactorsModelI("genie::BBA07ELFormFactorsModel", config)
39 {
40 
41 }
42 //____________________________________________________________________________
44 {
45 
46 }
47 //____________________________________________________________________________
48 double BBA07ELFormFactorsModel::Gep(const Interaction * interaction) const
49 {
50  const Kinematics & kine = interaction->Kine();
51  double q2 = kine.q2();
52  double M2 = kProtonMass*kProtonMass;
53  double tp = -q2/(4*M2);
54  double xp = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tp));
55  double GEp = (1.0+fGep.a1*tp)/(1.0+tp*(fGep.b1+tp*(fGep.b2+fGep.b3*tp)));
56  double gep = AN(xp,fGep.p1,fGep.p2,fGep.p3,fGep.p4,fGep.p5,fGep.p6,fGep.p7)*GEp;
57  return gep;
58 }
59 //____________________________________________________________________________
60 double BBA07ELFormFactorsModel::Gmp(const Interaction * interaction) const
61 {
62  const Kinematics & kine = interaction->Kine();
63  double q2 = kine.q2();
64  double M2 = kProtonMass*kProtonMass;
65  double tp = -q2/(4*M2);
66  double xp = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tp));
67  double GMp = (1.0+fGmp.a1*tp)/(1.0+tp*(fGmp.b1+tp*(fGmp.b2+fGmp.b3*tp)));
68  double gmp = AN(xp,fGmp.p1,fGmp.p2,fGmp.p3,fGmp.p4,fGmp.p5,fGmp.p6,fGmp.p7)*GMp;
69  gmp *= fMuP;
70  return gmp;
71 }
72 //____________________________________________________________________________
73 double BBA07ELFormFactorsModel::Gen(const Interaction * interaction) const
74 {
75  const Kinematics & kine = interaction->Kine();
76  double q2 = kine.q2();
77  double M2 = kNeutronMass*kNeutronMass;
78  double tn = -q2/(4*M2);
79  double xn = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tn));
80  double gep = this->Gep(interaction);
81  double gen = AN(xn,fGen.p1,fGen.p2,fGen.p3,fGen.p4,fGen.p5,fGen.p6,fGen.p7)*gep*1.7*tn/(1+3.3*tn);
82  return gen;
83 }
84 //____________________________________________________________________________
85 double BBA07ELFormFactorsModel::Gmn(const Interaction * interaction) const
86 {
87  const Kinematics & kine = interaction->Kine();
88  double q2 = kine.q2();
89  double M2 = kNeutronMass*kNeutronMass;
90  double tn = -q2/(4*M2);
91  double xn = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tn));
92  double gmp = this->Gmp(interaction);
93  double gmn = AN(xn,fGmn.p1,fGmn.p2,fGmn.p3,fGmn.p4,fGmn.p5,fGmn.p6,fGmn.p7)*gmp;
94  gmn *= fMuN/fMuP;
95  return gmn;
96 }
97 //____________________________________________________________________________
99 {
100  Algorithm::Configure(config);
101  this->LoadConfig();
102 }
103 //____________________________________________________________________________
105 {
106  Algorithm::Configure(config);
107  this->LoadConfig();
108 }
109 //____________________________________________________________________________
111 {
112 
113  //-- load the BBA2007 fit coefficients
114  GetParam( "BBA07-Gep-a1", fGep.a1) ;
115  GetParam( "BBA07-Gep-b1", fGep.b1) ;
116  GetParam( "BBA07-Gep-b2", fGep.b2) ;
117  GetParam( "BBA07-Gep-b3", fGep.b3) ;
118  GetParam( "BBA07-Gmp-a1", fGmp.a1) ;
119  GetParam( "BBA07-Gmp-b1", fGmp.b1) ;
120  GetParam( "BBA07-Gmp-b2", fGmp.b2) ;
121  GetParam( "BBA07-Gmp-b3", fGmp.b3) ;
122  GetParam( "BBA07-Gep-p1", fGep.p1) ;
123  GetParam( "BBA07-Gep-p2", fGep.p2) ;
124  GetParam( "BBA07-Gep-p3", fGep.p3) ;
125  GetParam( "BBA07-Gep-p4", fGep.p4) ;
126  GetParam( "BBA07-Gep-p5", fGep.p5) ;
127  GetParam( "BBA07-Gep-p6", fGep.p6) ;
128  GetParam( "BBA07-Gep-p7", fGep.p7) ;
129  GetParam( "BBA07-Gen-p1", fGen.p1) ;
130  GetParam( "BBA07-Gen-p2", fGen.p2) ;
131  GetParam( "BBA07-Gen-p3", fGen.p3) ;
132  GetParam( "BBA07-Gen-p4", fGen.p4) ;
133  GetParam( "BBA07-Gen-p5", fGen.p5) ;
134  GetParam( "BBA07-Gen-p6", fGen.p6) ;
135  GetParam( "BBA07-Gen-p7", fGen.p7) ;
136  GetParam( "BBA07-Gmp-p1", fGmp.p1) ;
137  GetParam( "BBA07-Gmp-p2", fGmp.p2) ;
138  GetParam( "BBA07-Gmp-p3", fGmp.p3) ;
139  GetParam( "BBA07-Gmp-p4", fGmp.p4) ;
140  GetParam( "BBA07-Gmp-p5", fGmp.p5) ;
141  GetParam( "BBA07-Gmp-p6", fGmp.p6) ;
142  GetParam( "BBA07-Gmp-p7", fGmp.p7) ;
143  GetParam( "BBA07-Gmn-p1", fGmn.p1) ;
144  GetParam( "BBA07-Gmn-p2", fGmn.p2) ;
145  GetParam( "BBA07-Gmn-p3", fGmn.p3) ;
146  GetParam( "BBA07-Gmn-p4", fGmn.p4) ;
147  GetParam( "BBA07-Gmn-p5", fGmn.p5) ;
148  GetParam( "BBA07-Gmn-p6", fGmn.p6) ;
149  GetParam( "BBA07-Gmn-p7", fGmn.p7) ;
150 
151  //-- anomalous magnetic moments
152  GetParam( "AnomMagnMoment-P", fMuP ) ;
153  GetParam( "AnomMagnMoment-N", fMuN ) ;
154 }
155 //____________________________________________________________________________
156 double BBA07ELFormFactorsModel::AN (double x,double c1, double c2, double c3,double c4,double c5, double c6, double c7) const
157 {
158  const double d1 = (0.0-1.0/6)*(0.0-2.0/6)*(0.0-3.0/6)*(0.0-4.0/6)*(0.0-5.0/6)*(0.0-1.0);
159  const double d2 = (1.0/6-0.0)*(1.0/6-2.0/6)*(1.0/6-3.0/6)*(1.0/6-4.0/6)*(1.0/6-5.0/6)*(1.0/6-1.0);
160  const double d3 = (2.0/6-0.0)*(2.0/6-1.0/6)*(2.0/6-3.0/6)*(2.0/6-4.0/6)*(2.0/6-5.0/6)*(2.0/6-1.0);
161  const double d4 = (3.0/6-0.0)*(3.0/6-1.0/6)*(3.0/6-2.0/6)*(3.0/6-4.0/6)*(3.0/6-5.0/6)*(3.0/6-1.0);
162  const double d5 = (4.0/6-0.0)*(4.0/6-1.0/6)*(4.0/6-2.0/6)*(4.0/6-3.0/6)*(4.0/6-5.0/6)*(4.0/6-1.0);
163  const double d6 = (5.0/6-0.0)*(5.0/6-1.0/6)*(5.0/6-2.0/6)*(5.0/6-3.0/6)*(5.0/6-4.0/6)*(5.0/6-1.0);
164  const double d7 = (1.0-0.0)*(1.0-1.0/6)*(1.0-2.0/6)*(1.0-3.0/6)*(1.0-4.0/6)*(1.0-5.0/6);
165 
166  return c1* (x-1.0/6)*(x-2.0/6)*(x-3.0/6)*(x-4.0/6)*(x-5.0/6)*(x-1.0)/d1+
167  c2*(x-0.0)* (x-2.0/6)*(x-3.0/6)*(x-4.0/6)*(x-5.0/6)*(x-1.0)/d2+
168  c3*(x-0.0)*(x-1.0/6)* (x-3.0/6)*(x-4.0/6)*(x-5.0/6)*(x-1.0)/d3+
169  c4*(x-0.0)*(x-1.0/6)*(x-2.0/6)* (x-4.0/6)*(x-5.0/6)*(x-1.0)/d4+
170  c5*(x-0.0)*(x-1.0/6)*(x-2.0/6)*(x-3.0/6)* (x-5.0/6)*(x-1.0)/d5+
171  c6*(x-0.0)*(x-1.0/6)*(x-2.0/6)*(x-3.0/6)*(x-4.0/6)* (x-1.0)/d6+
172  c7*(x-0.0)*(x-1.0/6)*(x-2.0/6)*(x-3.0/6)*(x-4.0/6)*(x-5.0/6) /d7;
173 }
174 //____________________________________________________________________________
BBA2007Fit_t fGen
BBA2007 fit coefficients for Gen.
Basic constants.
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
void Configure(const Registry &config)
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
Definition: config.py:1
double Gmp(const Interaction *interaction) const
Compute the elastic form factor G_{mp} for the input interaction.
BBA2007Fit_t fGep
BBA2007 fit coefficients for Gep.
c2
Definition: demo5.py:33
Double_t q2[12][num]
Definition: f2_nu.C:137
Summary information for an interaction.
Definition: Interaction.h:56
double q2(bool selected=false) const
Definition: Kinematics.cxx:151
Pure abstract base class. Defines the ELFormFactorsModelI interface to be implemented by any algorith...
const Kinematics & Kine(void) const
Definition: Interaction.h:71
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
static const double kNeutronMass
Definition: Constants.h:77
BBA2007Fit_t fGmn
BBA2007 fit coefficients for Gmn.
double Gen(const Interaction *interaction) const
Compute the elastic form factor G_{en} for the input interaction.
BBA2007Fit_t fGmp
BBA2007 fit coefficients for Gmp.
double Gmn(const Interaction *interaction) const
Compute the elastic form factor G_{mn} for the input interaction.
double AN(double x, double c1, double c2, double c3, double c4, double c5, double c6, double c7) const
double fMuN
Anomalous neutron magnetic moment.
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
c1
Definition: demo5.py:24
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double Gep(const Interaction *interaction) const
Compute the elastic form factor G_{ep} for the input interaction.
double fMuP
Anomalous proton magnetic moment.
static const double kProtonMass
Definition: Constants.h:76