GENIEGenerator
Loading...
Searching...
No Matches
genie::ELFormFactors Class Reference

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

#include <ELFormFactors.h>

Collaboration diagram for genie::ELFormFactors:
[legend]

Public Member Functions

 ELFormFactors ()
 ELFormFactors (const ELFormFactors &form_factors)
virtual ~ELFormFactors ()
void SetModel (const ELFormFactorsModelI *model)
 Attach an algorithm.
void Calculate (const Interaction *interaction)
 Calculate the form factors for the input interaction using the attached algorithm.
double Gep (void) const
 Get the computed form factor Gep.
double Gmp (void) const
 Get the computed form factor Gmp.
double Gen (void) const
 Get the computed form factor Gen.
double Gmn (void) const
 Get the computed form factor Gmn.
const ELFormFactorsModelIModel (void) const
 Get the attached model.
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 \at cern.ch> University of Liverpool
Created:\n Apr 20, 2004
License:\n Copyright (c) 2003-2025, 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() [1/2]

ELFormFactors::ELFormFactors ( )

Definition at line 34 of file ELFormFactors.cxx.

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

References Reset().

Referenced by Compare(), Copy(), ELFormFactors(), operator<<, operator=(), and operator==().

◆ ELFormFactors() [2/2]

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)

References Copy(), and ELFormFactors().

◆ ~ELFormFactors()

virtual genie::ELFormFactors::~ELFormFactors ( )
inlinevirtual

Definition at line 41 of file ELFormFactors.h.

41{ }

Member Function Documentation

◆ Calculate()

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.

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
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
const ELFormFactorsModelI * fModel

References fGen, fGep, fGmn, fGmp, fModel, LOG, pERROR, and Reset().

Referenced by main().

◆ Compare()

bool ELFormFactors::Compare ( const ELFormFactors & ff) const

Definition at line 89 of file ELFormFactors.cxx.

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)

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

Referenced by operator==().

◆ Copy()

void ELFormFactors::Copy ( const ELFormFactors & ff)

Definition at line 80 of file ELFormFactors.cxx.

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}

References ELFormFactors(), fGen, fGep, fGmn, fGmp, and fModel.

Referenced by ELFormFactors(), and operator=().

◆ Gen()

double genie::ELFormFactors::Gen ( void ) const
inline

Get the computed form factor Gen.

Definition at line 56 of file ELFormFactors.h.

56{ return fGen; }

References fGen.

Referenced by main().

◆ Gep()

double genie::ELFormFactors::Gep ( void ) const
inline

Get the computed form factor Gep.

Definition at line 50 of file ELFormFactors.h.

50{ return fGep; }

References fGep.

Referenced by main().

◆ Gmn()

double genie::ELFormFactors::Gmn ( void ) const
inline

Get the computed form factor Gmn.

Definition at line 59 of file ELFormFactors.h.

59{ return fGmn; }

References fGmn.

Referenced by main().

◆ Gmp()

double genie::ELFormFactors::Gmp ( void ) const
inline

Get the computed form factor Gmp.

Definition at line 53 of file ELFormFactors.h.

53{ return fGmp; }

References fGmp.

Referenced by main().

◆ Model()

const ELFormFactorsModelI * genie::ELFormFactors::Model ( void ) const
inline

Get the attached model.

Definition at line 62 of file ELFormFactors.h.

62{return fModel;}

References fModel.

◆ operator=()

ELFormFactors & ELFormFactors::operator= ( const ELFormFactors & ff)

Definition at line 111 of file ELFormFactors.cxx.

112{
113 this->Copy(ff);
114 return (*this);
115}

References Copy(), and ELFormFactors().

◆ operator==()

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

References Compare(), and ELFormFactors().

◆ Print()

void ELFormFactors::Print ( ostream & stream) const

Definition at line 99 of file ELFormFactors.cxx.

100{
101 stream<< endl;
102 stream<< "(Gep = " << this->fGep << ", Gmp = " << this->fGmp << ")" << endl;
103 stream<< "(Gen = " << this->fGen << ", Gmn = " << this->fGmn << ")" << endl;
104}

References fGen, fGep, fGmn, and fGmp.

Referenced by operator<<.

◆ Reset()

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}

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

Referenced by Calculate(), ELFormFactors(), and SetModel().

◆ SetModel()

void ELFormFactors::SetModel ( const ELFormFactorsModelI * model)

Attach an algorithm.

Definition at line 44 of file ELFormFactors.cxx.

45{
46 this->Reset();
47 this->fModel = model;
48}

References fModel, and Reset().

Referenced by main().

◆ operator<<

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

References ELFormFactors(), and Print().

Member Data Documentation

◆ fGen

double genie::ELFormFactors::fGen
private

Definition at line 77 of file ELFormFactors.h.

Referenced by Calculate(), Compare(), Copy(), Gen(), Print(), and Reset().

◆ fGep

double genie::ELFormFactors::fGep
private

Definition at line 75 of file ELFormFactors.h.

Referenced by Calculate(), Compare(), Copy(), Gep(), Print(), and Reset().

◆ fGmn

double genie::ELFormFactors::fGmn
private

Definition at line 78 of file ELFormFactors.h.

Referenced by Calculate(), Compare(), Copy(), Gmn(), Print(), and Reset().

◆ fGmp

double genie::ELFormFactors::fGmp
private

Definition at line 76 of file ELFormFactors.h.

Referenced by Calculate(), Compare(), Copy(), Gmp(), Print(), and Reset().

◆ fModel

const ELFormFactorsModelI* genie::ELFormFactors::fModel
private

Definition at line 80 of file ELFormFactors.h.

Referenced by Calculate(), Copy(), Model(), Reset(), and SetModel().


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