GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | Friends | List of all members
genie::ELFormFactors Class Reference

A class holding the Elastic Form Factors Ge,Gm. More...

#include <ELFormFactors.h>

Collaboration diagram for genie::ELFormFactors:
Collaboration graph
[legend]

Public Member Functions

 ELFormFactors ()
 
 ELFormFactors (const ELFormFactors &form_factors)
 
virtual ~ELFormFactors ()
 
void SetModel (const ELFormFactorsModelI *model)
 Attach an algorithm. More...
 
void Calculate (const Interaction *interaction)
 Calculate the form factors for the input interaction using the attached algorithm. More...
 
double Gep (void) const
 Get the computed form factor Gep. More...
 
double Gmp (void) const
 Get the computed form factor Gmp. More...
 
double Gen (void) const
 Get the computed form factor Gen. More...
 
double Gmn (void) const
 Get the computed form factor Gmn. More...
 
const ELFormFactorsModelIModel (void) const
 Get the attached model. More...
 
void Reset (Option_t *opt="")
 
void Copy (const ELFormFactors &ff)
 
bool Compare (const ELFormFactors &ff) const
 
void Print (ostream &stream) const
 
bool operator== (const ELFormFactors &ff) const
 
ELFormFactorsoperator= (const ELFormFactors &ff)
 

Private Attributes

double fGep
 
double fGmp
 
double fGen
 
double fGmn
 
const ELFormFactorsModelIfModel
 

Friends

ostream & operator<< (ostream &stream, const ELFormFactors &ff)
 

Detailed Description

A class holding the Elastic Form Factors Ge,Gm.

      This class is using the \b Strategy Pattern. \n
Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
Apr 20, 2004
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 36 of file ELFormFactors.h.

Constructor & Destructor Documentation

ELFormFactors::ELFormFactors ( )

Definition at line 34 of file ELFormFactors.cxx.

35 {
36  this->Reset();
37 }
void Reset(Option_t *opt="")
ELFormFactors::ELFormFactors ( const ELFormFactors form_factors)

Definition at line 39 of file ELFormFactors.cxx.

40 {
41  this->Copy(ff);
42 }
void Copy(const ELFormFactors &ff)
virtual genie::ELFormFactors::~ELFormFactors ( )
inlinevirtual

Definition at line 41 of file ELFormFactors.h.

41 { }

Member Function Documentation

void ELFormFactors::Calculate ( const Interaction interaction)

Calculate the form factors for the input interaction using the attached algorithm.

Definition at line 50 of file ELFormFactors.cxx.

References LOG, and pERROR.

Referenced by genie::MKFFEM::F1N(), genie::LwlynSmithFF::F1N(), genie::MKFFEM::F1P(), genie::LwlynSmithFF::F1P(), genie::LwlynSmithFFNC::F1V(), genie::MKFFEM::F2N(), genie::LwlynSmithFF::F2N(), genie::MKFFEM::F2P(), genie::LwlynSmithFF::F2P(), genie::LwlynSmithFF::GVE(), genie::LwlynSmithFF::GVM(), main(), genie::LwlynSmithFFNC::xiF2V(), and genie::RosenbluthPXSec::XSec().

51 {
52  if(!this->fModel)
53  {
54  LOG("ELFormFactors", pERROR)
55  << "No ELFormFactorModelI algorithm was defined!";
56  this->Reset("D");
57  }
58  else {
59  this->fGep = this->fModel->Gep(interaction);
60  this->fGmp = this->fModel->Gmp(interaction);
61  this->fGen = this->fModel->Gen(interaction);
62  this->fGmn = this->fModel->Gmn(interaction);
63  }
64 }
#define pERROR
Definition: Messenger.h:59
virtual double Gmn(const Interaction *interaction) const =0
Compute the elastic form factor G_{mn} for the input interaction.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual double Gen(const Interaction *interaction) const =0
Compute the elastic form factor G_{en} for the input interaction.
void Reset(Option_t *opt="")
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:80
virtual double Gep(const Interaction *interaction) const =0
Compute the elastic form factor G_{ep} for the input interaction.
virtual double Gmp(const Interaction *interaction) const =0
Compute the elastic form factor G_{mp} for the input interaction.
bool ELFormFactors::Compare ( const ELFormFactors ff) const

Definition at line 89 of file ELFormFactors.cxx.

References genie::utils::math::AreEqual(), fGen, fGep, fGmn, and fGmp.

90 {
91  bool equal =
92  math::AreEqual(this->fGep, ff.fGep) &&
93  math::AreEqual(this->fGmp, ff.fGmp) &&
94  math::AreEqual(this->fGen, ff.fGen) &&
95  math::AreEqual(this->fGmn, ff.fGmn);
96  return equal;
97 }
bool AreEqual(double x1, double x2)
Definition: MathUtils.cxx:236
void ELFormFactors::Copy ( const ELFormFactors ff)

Definition at line 80 of file ELFormFactors.cxx.

References fGen, fGep, fGmn, fGmp, and fModel.

81 {
82  this->fModel = ff.fModel;
83  this->fGep = ff.fGep;
84  this->fGmp = ff.fGmp;
85  this->fGen = ff.fGen;
86  this->fGmn = ff.fGmn;
87 }
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:80
double genie::ELFormFactors::Gen ( void  ) const
inline

Get the computed form factor Gen.

Definition at line 56 of file ELFormFactors.h.

References fGen.

Referenced by genie::MKFFEM::F1N(), genie::LwlynSmithFF::F1N(), genie::MKFFEM::F2N(), genie::LwlynSmithFF::F2N(), genie::LwlynSmithFF::GVE(), main(), and genie::RosenbluthPXSec::XSec().

56 { return fGen; }
double genie::ELFormFactors::Gep ( void  ) const
inline
double genie::ELFormFactors::Gmn ( void  ) const
inline

Get the computed form factor Gmn.

Definition at line 59 of file ELFormFactors.h.

References fGmn.

Referenced by genie::MKFFEM::F1N(), genie::LwlynSmithFF::F1N(), genie::MKFFEM::F2N(), genie::LwlynSmithFF::F2N(), genie::LwlynSmithFF::GVM(), main(), and genie::RosenbluthPXSec::XSec().

59 { return fGmn; }
double genie::ELFormFactors::Gmp ( void  ) const
inline
const ELFormFactorsModelI* genie::ELFormFactors::Model ( void  ) const
inline

Get the attached model.

Definition at line 62 of file ELFormFactors.h.

References fModel.

62 {return fModel;}
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:80
ELFormFactors & ELFormFactors::operator= ( const ELFormFactors ff)

Definition at line 111 of file ELFormFactors.cxx.

112 {
113  this->Copy(ff);
114  return (*this);
115 }
void Copy(const ELFormFactors &ff)
bool ELFormFactors::operator== ( const ELFormFactors ff) const

Definition at line 106 of file ELFormFactors.cxx.

107 {
108  return this->Compare(ff);
109 }
bool Compare(const ELFormFactors &ff) const
void ELFormFactors::Print ( ostream &  stream) const

Definition at line 99 of file ELFormFactors.cxx.

Referenced by genie::operator<<().

100 {
101  stream<< endl;
102  stream<< "(Gep = " << this->fGep << ", Gmp = " << this->fGmp << ")" << endl;
103  stream<< "(Gen = " << this->fGen << ", Gmn = " << this->fGmn << ")" << endl;
104 }
void ELFormFactors::Reset ( Option_t *  opt = "")

Definition at line 66 of file ELFormFactors.cxx.

67 {
68 // Reset the ELFormFactors object (data & attached model). If the input
69 // option = D it resets the data only and not the attached model.
70 
71  this->fGep = 0.;
72  this->fGmp = 0.;
73  this->fGen = 0.;
74  this->fGmn = 0.;
75 
76  string option(opt);
77  if(option.find("D") == string::npos) {this->fModel = 0;}
78 }
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:80
void ELFormFactors::SetModel ( const ELFormFactorsModelI model)

Attach an algorithm.

Definition at line 44 of file ELFormFactors.cxx.

Referenced by genie::MKFFEM::LoadConfig(), genie::RosenbluthPXSec::LoadConfig(), genie::LwlynSmithFF::LoadConfig(), and main().

45 {
46  this->Reset();
47  this->fModel = model;
48 }
void Reset(Option_t *opt="")
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:80

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const ELFormFactors ff 
)
friend

Definition at line 27 of file ELFormFactors.cxx.

28  {
29  ff.Print(stream);
30  return stream;
31  }
void Print(ostream &stream) const

Member Data Documentation

double genie::ELFormFactors::fGen
private

Definition at line 77 of file ELFormFactors.h.

Referenced by Compare(), Copy(), and Gen().

double genie::ELFormFactors::fGep
private

Definition at line 75 of file ELFormFactors.h.

Referenced by Compare(), Copy(), and Gep().

double genie::ELFormFactors::fGmn
private

Definition at line 78 of file ELFormFactors.h.

Referenced by Compare(), Copy(), and Gmn().

double genie::ELFormFactors::fGmp
private

Definition at line 76 of file ELFormFactors.h.

Referenced by Compare(), Copy(), and Gmp().

const ELFormFactorsModelI* genie::ELFormFactors::fModel
private

Definition at line 80 of file ELFormFactors.h.

Referenced by Copy(), and Model().


The documentation for this class was generated from the following files: