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 "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Physics/QuasiElastic/XSection/ELFormFactors.h"

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 Strategy Pattern.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

Apr 20, 2004

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 37 of file ELFormFactors.h.

Constructor & Destructor Documentation

ELFormFactors::ELFormFactors ( )

Definition at line 42 of file ELFormFactors.cxx.

References slidt::Reset().

43 {
44  this->Reset();
45 }
void Reset(Option_t *opt="")
ELFormFactors::ELFormFactors ( const ELFormFactors form_factors)

Definition at line 47 of file ELFormFactors.cxx.

48 {
49  this->Copy(ff);
50 }
void Copy(const ELFormFactors &ff)
TFile ff[ntarg]
Definition: Style.C:26
virtual genie::ELFormFactors::~ELFormFactors ( )
inlinevirtual

Definition at line 42 of file ELFormFactors.h.

References Calculate(), and SetModel().

42 { }

Member Function Documentation

void ELFormFactors::Calculate ( const Interaction interaction)

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

Definition at line 58 of file ELFormFactors.cxx.

References ana::fModel, LOG, pERROR, and slidt::Reset().

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

59 {
60  if(!this->fModel)
61  {
62  LOG("ELFormFactors", pERROR)
63  << "No ELFormFactorModelI algorithm was defined!";
64  this->Reset("D");
65  }
66  else {
67  this->fGep = this->fModel->Gep(interaction);
68  this->fGmp = this->fModel->Gmp(interaction);
69  this->fGen = this->fModel->Gen(interaction);
70  this->fGmn = this->fModel->Gmn(interaction);
71  }
72 }
#define pERROR
Definition: Messenger.h:60
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
virtual double Gep(const Interaction *interaction) const =0
Compute the elastic form factor G_{ep} for the input interaction.
virtual double Gen(const Interaction *interaction) const =0
Compute the elastic form factor G_{en} for the input interaction.
void Reset(Option_t *opt="")
virtual double Gmn(const Interaction *interaction) const =0
Compute the elastic form factor G_{mn} for the input interaction.
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:81
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 97 of file ELFormFactors.cxx.

References genie::utils::math::AreEqual(), gov::fnal::cd::rms::provider::equal(), fGen, fGep, fGmn, and fGmp.

Referenced by Model().

98 {
99  bool equal =
100  math::AreEqual(this->fGep, ff.fGep) &&
101  math::AreEqual(this->fGmp, ff.fGmp) &&
102  math::AreEqual(this->fGen, ff.fGen) &&
103  math::AreEqual(this->fGmn, ff.fGmn);
104  return equal;
105 }
bool AreEqual(double x1, double x2)
Definition: MathUtils.cxx:243
bool equal(T *first, T *second)
void ELFormFactors::Copy ( const ELFormFactors ff)

Definition at line 88 of file ELFormFactors.cxx.

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

Referenced by Model().

89 {
90  this->fModel = ff.fModel;
91  this->fGep = ff.fGep;
92  this->fGmp = ff.fGmp;
93  this->fGen = ff.fGen;
94  this->fGmn = ff.fGmn;
95 }
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:81
double genie::ELFormFactors::Gen ( void  ) const
inline

Get the computed form factor Gen.

Definition at line 57 of file ELFormFactors.h.

References fGen.

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

57 { 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 60 of file ELFormFactors.h.

References fGmn.

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

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

Get the attached model.

Definition at line 63 of file ELFormFactors.h.

References Compare(), Copy(), ff, fModel, operator<<, operator=(), operator==(), MECModelEnuComparisons::opt, Print(), Reset(), and runNovaSAM::stream.

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

Definition at line 119 of file ELFormFactors.cxx.

Referenced by Model().

120 {
121  this->Copy(ff);
122  return (*this);
123 }
void Copy(const ELFormFactors &ff)
bool ELFormFactors::operator== ( const ELFormFactors ff) const

Definition at line 114 of file ELFormFactors.cxx.

References Compare().

Referenced by Model().

115 {
116  return this->Compare(ff);
117 }
bool Compare(const ELFormFactors &ff) const
void ELFormFactors::Print ( ostream &  stream) const

Definition at line 107 of file ELFormFactors.cxx.

References allTimeWatchdog::endl.

Referenced by Model(), and genie::operator<<().

108 {
109  stream<< endl;
110  stream<< "(Gep = " << this->fGep << ", Gmp = " << this->fGmp << ")" << endl;
111  stream<< "(Gen = " << this->fGen << ", Gmn = " << this->fGmn << ")" << endl;
112 }
void ELFormFactors::Reset ( Option_t *  opt = "")

Definition at line 74 of file ELFormFactors.cxx.

References ana::fModel.

Referenced by Model().

75 {
76 // Reset the ELFormFactors object (data & attached model). If the input
77 // option = D it resets the data only and not the attached model.
78 
79  this->fGep = 0.;
80  this->fGmp = 0.;
81  this->fGen = 0.;
82  this->fGmn = 0.;
83 
84  string option(opt);
85  if(option.find("D") == string::npos) {this->fModel = 0;}
86 }
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:81
void ELFormFactors::SetModel ( const ELFormFactorsModelI model)

Attach an algorithm.

Definition at line 52 of file ELFormFactors.cxx.

References ana::fModel, and slidt::Reset().

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

53 {
54  this->Reset();
55  this->fModel = model;
56 }
void Reset(Option_t *opt="")
const ELFormFactorsModelI * fModel
Definition: ELFormFactors.h:81
const XML_Char XML_Content * model
Definition: expat.h:151

Friends And Related Function Documentation

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

Definition at line 35 of file ELFormFactors.cxx.

Referenced by Model().

36  {
37  ff.Print(stream);
38  return stream;
39  }
void Print(ostream &stream) const

Member Data Documentation

double genie::ELFormFactors::fGen
private

Definition at line 78 of file ELFormFactors.h.

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

double genie::ELFormFactors::fGep
private

Definition at line 76 of file ELFormFactors.h.

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

double genie::ELFormFactors::fGmn
private

Definition at line 79 of file ELFormFactors.h.

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

double genie::ELFormFactors::fGmp
private

Definition at line 77 of file ELFormFactors.h.

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

const ELFormFactorsModelI* genie::ELFormFactors::fModel
private

Definition at line 81 of file ELFormFactors.h.

Referenced by Copy(), and Model().


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