GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
gtestElFormFactors.cxx File Reference
#include <string>
#include <TFile.h>
#include <TNtupleD.h>
#include "Framework/Algorithm/Algorithm.h"
#include "Framework/Algorithm/AlgFactory.h"
#include "Physics/QuasiElastic/XSection/ELFormFactors.h"
#include "Physics/QuasiElastic/XSection/ELFormFactorsModelI.h"
#include "Framework/Interaction/Interaction.h"
#include "Framework/Messenger/Messenger.h"
#include "Framework/ParticleData/PDGCodes.h"
Include dependency graph for gtestElFormFactors.cxx:

Go to the source code of this file.

Functions

int main (int, char **)
 

Function Documentation

int main ( int  ,
char **   
)

Definition at line 36 of file gtestElFormFactors.cxx.

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::utils::kinematics::Q2(), genie::Interaction::QELCC(), genie::ELFormFactors::SetModel(), and genie::Kinematics::SetQ2().

37 {
38  TNtupleD * elffnt = new TNtupleD("elffnt","","Q2:mod:Gep:Gmp:Gen:Gmn");
39 
40  AlgFactory * algf = AlgFactory::Instance();
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 =
55  Interaction::QELCC(kPdgTgtFe56,kPdgProton,kPdgNuMu,10);
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 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
void SetQ2(double Q2, bool selected=false)
Definition: Kinematics.cxx:255
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
const int kPdgNuMu
Definition: PDGCodes.h:30
double Gen(void) const
Get the computed form factor Gen.
Definition: ELFormFactors.h:56
Summary information for an interaction.
Definition: Interaction.h:56
Pure abstract base class. Defines the ELFormFactorsModelI interface to be implemented by any algorith...
const Algorithm * GetAlgorithm(const AlgId &algid)
Definition: AlgFactory.cxx:75
void Calculate(const Interaction *interaction)
Calculate the form factors for the input interaction using the attached algorithm.
A class holding the Elastic Form Factors Ge,Gm.
Definition: ELFormFactors.h:36
double Gmn(void) const
Get the computed form factor Gmn.
Definition: ELFormFactors.h:59
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 kPdgTgtFe56
Definition: PDGCodes.h:205
const int kPdgProton
Definition: PDGCodes.h:81
The GENIE Algorithm Factory.
Definition: AlgFactory.h:39
void SetModel(const ELFormFactorsModelI *model)
Attach an algorithm.