BBA07ELFormFactorsModel.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Igor Kakorin <kakorin@jinr.ru>
7  Joint Institute for Nuclear Research \n
8 
9  adapted from fortran code provided by:
10 
11  Konstantin Kuzmin <kkuzmin@theor.jinr.ru>, \n
12  Joint Institute for Nuclear Research
13  Institute for Theoretical and Experimental Physics \n
14 
15  Vladimir Lyubushkin, \n
16  Joint Institute for Nuclear Research \n
17 
18  Vadim Naumov <vnaumov@theor.jinr.ru>, \n
19  Joint Institute for Nuclear Research \n
20 
21  based on code of:
22 
23  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch> \n
24  University of Liverpool & STFC Rutherford Appleton Laboratory
25 */
26 //____________________________________________________________________________
27 
31 
32 using namespace genie;
33 using namespace genie::constants;
34 
35 //____________________________________________________________________________
37 ELFormFactorsModelI("genie::BBA07ELFormFactorsModel")
38 {
39 
40 }
41 //____________________________________________________________________________
43 ELFormFactorsModelI("genie::BBA07ELFormFactorsModel", config)
44 {
45 
46 }
47 //____________________________________________________________________________
49 {
50 
51 }
52 //____________________________________________________________________________
54 {
55  const Kinematics & kine = interaction->Kine();
56  double q2 = kine.q2();
57  double M2 = kProtonMass*kProtonMass;
58  double tp = -q2/(4*M2);
59  double xp = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tp));
60  double GEp = (1.0+fGep.a1*tp)/(1.0+tp*(fGep.b1+tp*(fGep.b2+fGep.b3*tp)));
61  double gep = AN(xp,fGep.p1,fGep.p2,fGep.p3,fGep.p4,fGep.p5,fGep.p6,fGep.p7)*GEp;
62  return gep;
63 }
64 //____________________________________________________________________________
66 {
67  const Kinematics & kine = interaction->Kine();
68  double q2 = kine.q2();
69  double M2 = kProtonMass*kProtonMass;
70  double tp = -q2/(4*M2);
71  double xp = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tp));
72  double GMp = (1.0+fGmp.a1*tp)/(1.0+tp*(fGmp.b1+tp*(fGmp.b2+fGmp.b3*tp)));
73  double gmp = AN(xp,fGmp.p1,fGmp.p2,fGmp.p3,fGmp.p4,fGmp.p5,fGmp.p6,fGmp.p7)*GMp;
74  gmp *= fMuP;
75  return gmp;
76 }
77 //____________________________________________________________________________
79 {
80  const Kinematics & kine = interaction->Kine();
81  double q2 = kine.q2();
82  double M2 = kNeutronMass*kNeutronMass;
83  double tn = -q2/(4*M2);
84  double xn = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tn));
85  double gep = this->Gep(interaction);
86  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);
87  return gen;
88 }
89 //____________________________________________________________________________
91 {
92  const Kinematics & kine = interaction->Kine();
93  double q2 = kine.q2();
94  double M2 = kNeutronMass*kNeutronMass;
95  double tn = -q2/(4*M2);
96  double xn = 2.0/(1.0+TMath::Sqrt(1.0+1.0/tn));
97  double gmp = this->Gmp(interaction);
98  double gmn = AN(xn,fGmn.p1,fGmn.p2,fGmn.p3,fGmn.p4,fGmn.p5,fGmn.p6,fGmn.p7)*gmp;
99  gmn *= fMuN/fMuP;
100  return gmn;
101 }
102 //____________________________________________________________________________
104 {
105  Algorithm::Configure(config);
106  this->LoadConfig();
107 }
108 //____________________________________________________________________________
110 {
111  Algorithm::Configure(config);
112  this->LoadConfig();
113 }
114 //____________________________________________________________________________
116 {
117 
118  //-- load the BBA2007 fit coefficients
119  GetParam( "BBA07-Gep-a1", fGep.a1) ;
120  GetParam( "BBA07-Gep-b1", fGep.b1) ;
121  GetParam( "BBA07-Gep-b2", fGep.b2) ;
122  GetParam( "BBA07-Gep-b3", fGep.b3) ;
123  GetParam( "BBA07-Gmp-a1", fGmp.a1) ;
124  GetParam( "BBA07-Gmp-b1", fGmp.b1) ;
125  GetParam( "BBA07-Gmp-b2", fGmp.b2) ;
126  GetParam( "BBA07-Gmp-b3", fGmp.b3) ;
127  GetParam( "BBA07-Gep-p1", fGep.p1) ;
128  GetParam( "BBA07-Gep-p2", fGep.p2) ;
129  GetParam( "BBA07-Gep-p3", fGep.p3) ;
130  GetParam( "BBA07-Gep-p4", fGep.p4) ;
131  GetParam( "BBA07-Gep-p5", fGep.p5) ;
132  GetParam( "BBA07-Gep-p6", fGep.p6) ;
133  GetParam( "BBA07-Gep-p7", fGep.p7) ;
134  GetParam( "BBA07-Gen-p1", fGen.p1) ;
135  GetParam( "BBA07-Gen-p2", fGen.p2) ;
136  GetParam( "BBA07-Gen-p3", fGen.p3) ;
137  GetParam( "BBA07-Gen-p4", fGen.p4) ;
138  GetParam( "BBA07-Gen-p5", fGen.p5) ;
139  GetParam( "BBA07-Gen-p6", fGen.p6) ;
140  GetParam( "BBA07-Gen-p7", fGen.p7) ;
141  GetParam( "BBA07-Gmp-p1", fGmp.p1) ;
142  GetParam( "BBA07-Gmp-p2", fGmp.p2) ;
143  GetParam( "BBA07-Gmp-p3", fGmp.p3) ;
144  GetParam( "BBA07-Gmp-p4", fGmp.p4) ;
145  GetParam( "BBA07-Gmp-p5", fGmp.p5) ;
146  GetParam( "BBA07-Gmp-p6", fGmp.p6) ;
147  GetParam( "BBA07-Gmp-p7", fGmp.p7) ;
148  GetParam( "BBA07-Gmn-p1", fGmn.p1) ;
149  GetParam( "BBA07-Gmn-p2", fGmn.p2) ;
150  GetParam( "BBA07-Gmn-p3", fGmn.p3) ;
151  GetParam( "BBA07-Gmn-p4", fGmn.p4) ;
152  GetParam( "BBA07-Gmn-p5", fGmn.p5) ;
153  GetParam( "BBA07-Gmn-p6", fGmn.p6) ;
154  GetParam( "BBA07-Gmn-p7", fGmn.p7) ;
155 
156  //-- anomalous magnetic moments
157  GetParam( "AnomMagnMoment-P", fMuP ) ;
158  GetParam( "AnomMagnMoment-N", fMuN ) ;
159 }
160 //____________________________________________________________________________
161 double BBA07ELFormFactorsModel::AN (double x,double c1, double c2, double c3,double c4,double c5, double c6, double c7) const
162 {
163  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);
164  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);
165  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);
166  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);
167  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);
168  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);
169  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);
170 
171  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+
172  c2*(x-0.0)* (x-2.0/6)*(x-3.0/6)*(x-4.0/6)*(x-5.0/6)*(x-1.0)/d2+
173  c3*(x-0.0)*(x-1.0/6)* (x-3.0/6)*(x-4.0/6)*(x-5.0/6)*(x-1.0)/d3+
174  c4*(x-0.0)*(x-1.0/6)*(x-2.0/6)* (x-4.0/6)*(x-5.0/6)*(x-1.0)/d4+
175  c5*(x-0.0)*(x-1.0/6)*(x-2.0/6)*(x-3.0/6)* (x-5.0/6)*(x-1.0)/d5+
176  c6*(x-0.0)*(x-1.0/6)*(x-2.0/6)*(x-3.0/6)*(x-4.0/6)* (x-1.0)/d6+
177  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;
178 }
179 //____________________________________________________________________________
BBA2007Fit_t fGen
BBA2007 fit coefficients for Gen.
Basic constants.
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
void Configure(const Registry &config)
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
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.
Summary information for an interaction.
Definition: Interaction.h:56
double q2(bool selected=false) const
Definition: Kinematics.cxx:141
Pure abstract base class. Defines the ELFormFactorsModelI interface to be implemented by any algorith...
static Config * config
Definition: config.cpp:1054
const Kinematics & Kine(void) const
Definition: Interaction.h:71
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
static const double kNeutronMass
Definition: Constants.h:76
BBA2007Fit_t fGmn
BBA2007 fit coefficients for Gmn.
gen
Definition: demo.py:24
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.
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
list x
Definition: train.py:276
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:75