GENIEGenerator
Loading...
Searching...
No Matches
gtestElFormFactors.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\program gtestElFormFactors
5
6\brief Program used for testing / debugging the elastic form factors
7
8\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9 University of Liverpool
10
11\created June 20, 2004
12
13\cpright Copyright (c) 2003-2025, The GENIE Collaboration
14 For the full text of the license visit http://copyright.genie-mc.org
15
16*/
17//____________________________________________________________________________
18
19#include <string>
20
21#include <TFile.h>
22#include <TNtupleD.h>
23
31
32using namespace genie;
33using std::string;
34
35//__________________________________________________________________________
36int main(int /*argc*/, char ** /*argv*/)
37{
38 TNtupleD * elffnt = new TNtupleD("elffnt","","Q2:mod:Gep:Gmp:Gen:Gmn");
39
41
42 const ELFormFactorsModelI * dipole =
43 dynamic_cast<const ELFormFactorsModelI *> (
44 algf->GetAlgorithm("genie::DipoleELFormFactorsModel", "Default"));
45 const ELFormFactorsModelI * bba2003 =
46 dynamic_cast<const ELFormFactorsModelI *> (
47 algf->GetAlgorithm("genie::BBA03ELFormFactorsModel", "Default"));
48 const ELFormFactorsModelI * bba2005 =
49 dynamic_cast<const ELFormFactorsModelI *> (
50 algf->GetAlgorithm("genie::BBA05ELFormFactorsModel", "Default"));
51
52 ELFormFactors elff;
53
54 Interaction * interaction =
56
57 for(int iq=0; iq<100; iq++) {
58
59 double Q2 = iq*0.01 + 0.01;
60 interaction->KinePtr()->SetQ2(Q2);
61
62 elff.SetModel(dipole);
63 elff.Calculate(interaction);
64 elffnt->Fill(Q2,0,elff.Gep(),elff.Gmp(),elff.Gen(),elff.Gmn());
65
66 elff.SetModel(bba2003);
67 elff.Calculate(interaction);
68 elffnt->Fill(Q2,1,elff.Gep(),elff.Gmp(),elff.Gen(),elff.Gmn());
69
70 elff.SetModel(bba2005);
71 elff.Calculate(interaction);
72 elffnt->Fill(Q2,2,elff.Gep(),elff.Gmp(),elff.Gen(),elff.Gmn());
73 }
74
75 TFile f("./elff.root","recreate");
76 elffnt->Write();
77 f.Close();
78
79 return 0;
80}
81//__________________________________________________________________________
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
int main()
The GENIE Algorithm Factory.
Definition AlgFactory.h:39
const Algorithm * GetAlgorithm(const AlgId &algid)
static AlgFactory * Instance()
Pure abstract base class. Defines the ELFormFactorsModelI interface to be implemented by any algorith...
A class holding the Elastic Form Factors Ge,Gm.
double Gmp(void) const
Get the computed form factor Gmp.
double Gep(void) const
Get the computed form factor Gep.
double Gen(void) const
Get the computed form factor Gen.
double Gmn(void) const
Get the computed form factor Gmn.
void Calculate(const Interaction *interaction)
Calculate the form factors for the input interaction using the attached algorithm.
void SetModel(const ELFormFactorsModelI *model)
Attach an algorithm.
Summary information for an interaction.
Definition Interaction.h:56
static Interaction * QELCC(int tgt, int nuc, int probe, double E=0)
Kinematics * KinePtr(void) const
Definition Interaction.h:76
void SetQ2(double Q2, bool selected=false)
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgTgtFe56
Definition PDGCodes.h:205
const int kPdgNuMu
Definition PDGCodes.h:30