GENIEGenerator
Loading...
Searching...
No Matches
gtestElFormFactors.cxx File Reference
Include dependency graph for gtestElFormFactors.cxx:

Go to the source code of this file.

Functions

int main (int, char **)

Function Documentation

◆ main()

int main ( int ,
char **  )

Definition at line 36 of file gtestElFormFactors.cxx.

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}
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)
double Q2(const Interaction *const i)
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgTgtFe56
Definition PDGCodes.h:205
const int kPdgNuMu
Definition PDGCodes.h:30

References genie::ELFormFactors::Calculate(), genie::ELFormFactors::Gen(), genie::ELFormFactors::Gep(), genie::AlgFactory::GetAlgorithm(), genie::ELFormFactors::Gmn(), genie::ELFormFactors::Gmp(), genie::AlgFactory::Instance(), genie::Interaction::KinePtr(), genie::kPdgNuMu, genie::kPdgProton, genie::kPdgTgtFe56, genie::Interaction::QELCC(), genie::ELFormFactors::SetModel(), and genie::Kinematics::SetQ2().