GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MKFFEM.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  or see $GENIE/LICENSE
6 
7  Author: Igor Kakorin <kakorin@jinr.ru>, Joint Institute for Nuclear Research
8  based on code of Costas Andreopoulos <c.andreopoulos \at cern.ch>
9  University of Liverpool
10 
11  For the class documentation see the corresponding header file.
12 
13 
14 */
15 //____________________________________________________________________________
16 
17 #include <TMath.h>
18 
28 
29 using namespace genie;
30 using namespace genie::constants;
31 
32 //____________________________________________________________________________
34 QELFormFactorsModelI("genie::MKFFEM")
35 {
36 
37 }
38 //____________________________________________________________________________
39 MKFFEM::MKFFEM(string config) :
40 QELFormFactorsModelI("genie::MKFFEM", config)
41 {
42 
43 }
44 //____________________________________________________________________________
46 {
47 
48 }
49 //____________________________________________________________________________
50 double MKFFEM::F1P(const Interaction * interaction) const
51 {
52  fELFF.Calculate(interaction);
53  double t = this->tau(interaction);
54  double T = 1 / (1 - t);
55  return T * (fELFF.Gep() - t * fELFF.Gmp());
56 }
57 //____________________________________________________________________________
58 double MKFFEM::F2P(const Interaction * interaction) const
59 {
60  fELFF.Calculate(interaction);
61  double t = this->tau(interaction);
62  double T = 1 / (1 - t);
63  return T * (fELFF.Gmp() - fELFF.Gep());
64 }
65 //____________________________________________________________________________
66 double MKFFEM::F1N(const Interaction * interaction) const
67 {
68  fELFF.Calculate(interaction);
69  double t = this->tau(interaction);
70  double T = 1 / (1 - t);
71  return T * (fELFF.Gen() - t * fELFF.Gmn());
72 }
73 //____________________________________________________________________________
74 double MKFFEM::F2N(const Interaction * interaction) const
75 {
76  fELFF.Calculate(interaction);
77  double t = this->tau(interaction);
78  double T = 1 / (1 - t);
79  return T * (fELFF.Gmn() - fELFF.Gen());
80 }
81 //____________________________________________________________________________
82 double MKFFEM::F1V(const Interaction * interaction) const
83 {
84  double F1p = this->F1P(interaction);
85  double F1n = this->F1N(interaction);
86 
87  double _F1V = F1p + F1n;
88  return _F1V;
89 }
90 //____________________________________________________________________________
91 double MKFFEM::xiF2V(const Interaction * interaction) const
92 {
93  double F2p = this->F2P(interaction);
94  double F2n = this->F2N(interaction);
95 
96  double _xiF2V = F2p + F2n;
97  return _xiF2V;
98 }
99 //____________________________________________________________________________
100 double MKFFEM::FA(const Interaction * /*interaction*/ ) const
101 {
102  return 0.;
103 }
104 //____________________________________________________________________________
105 double MKFFEM::Fp(const Interaction * /*interaction*/ ) const
106 {
107  return 0.;
108 }
109 //____________________________________________________________________________
110 void MKFFEM::Configure(const Registry & config)
111 {
112  Algorithm::Configure(config);
113  this->LoadConfig();
114 }
115 //____________________________________________________________________________
116 void MKFFEM::Configure(string config)
117 {
118  Algorithm::Configure(config);
119  this->LoadConfig();
120 }
121 //____________________________________________________________________________
123 {
124 // Load configuration data from its configuration Registry (or global defaults)
125 // to private data members
126  fElFFModel =
127  dynamic_cast<const ELFormFactorsModelI *> (this->SubAlg("ElasticFormFactorsModel"));
128  assert(fElFFModel);
130 
131 
132 }
133 //____________________________________________________________________________
134 double MKFFEM::tau(const Interaction * interaction) const
135 {
136 // computes q^2 / (4 * MNucl^2)
137 
138  //-- get kinematics & initial state parameters
139  const Kinematics & kinematics = interaction->Kine();
140  // const InitialState & init_state = interaction->InitState();
141  double q2 = kinematics.q2();
142 
143  PDGLibrary * pdglib = PDGLibrary::Instance();
144  double M = (pdglib->Find(kPdgProton)->Mass() + pdglib->Find(kPdgNeutron)->Mass())/2;
145 
146  //-- calculate q^2 / (4*Mnuc^2)
147  return q2/(4*M*M);
148 }
149 //____________________________________________________________________________
double F2P(const Interaction *interaction) const
Definition: MKFFEM.cxx:58
double xiF2V(const Interaction *interaction) const
Compute the form factor xi*F2V for the input interaction.
Definition: MKFFEM.cxx:91
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
const ELFormFactorsModelI * fElFFModel
Definition: MKFFEM.h:60
double Gen(void) const
Get the computed form factor Gen.
Definition: ELFormFactors.h:56
void Configure(const Registry &config)
Definition: MKFFEM.cxx:110
Summary information for an interaction.
Definition: Interaction.h:56
double q2(bool selected=false) const
Definition: Kinematics.cxx:141
double F2N(const Interaction *interaction) const
Definition: MKFFEM.cxx:74
double Fp(const Interaction *interaction) const
Compute the form factor Fp for the input interaction.
Definition: MKFFEM.cxx:105
Pure abstract base class. Defines the QELFormFactorsModelI interface to be implemented by any algorit...
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:62
double FA(const Interaction *interaction) const
Compute the form factor FA for the input interaction.
Definition: MKFFEM.cxx:100
ELFormFactors fELFF
Definition: MKFFEM.h:62
void Calculate(const Interaction *interaction)
Calculate the form factors for the input interaction using the attached algorithm.
void LoadConfig(void)
Definition: MKFFEM.cxx:122
double Gmn(void) const
Get the computed form factor Gmn.
Definition: ELFormFactors.h:59
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:68
double tau(const Interaction *interaction) const
Definition: MKFFEM.cxx:134
double F1V(const Interaction *interaction) const
Compute the form factor F1V for the input interaction.
Definition: MKFFEM.cxx:82
Singleton class to load &amp; serve a TDatabasePDG.
Definition: PDGLibrary.h:35
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
double Gmp(void) const
Get the computed form factor Gmp.
Definition: ELFormFactors.h:53
double Gep(void) const
Get the computed form factor Gep.
Definition: ELFormFactors.h:50
const int kPdgProton
Definition: PDGCodes.h:81
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:86
void SetModel(const ELFormFactorsModelI *model)
Attach an algorithm.
double F1P(const Interaction *interaction) const
Definition: MKFFEM.cxx:50
double F1N(const Interaction *interaction) const
Definition: MKFFEM.cxx:66
const int kPdgNeutron
Definition: PDGCodes.h:83
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345