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

A class holding Quasi Elastic (QEL) Form Factors. More...

#include <QELFormFactors.h>

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

Public Member Functions

 QELFormFactors ()
 
 QELFormFactors (const QELFormFactors &form_factors)
 
virtual ~QELFormFactors ()
 
void SetModel (const QELFormFactorsModelI *model)
 Attach an algorithm. More...
 
void Calculate (const Interaction *interaction)
 Compute the form factors for the input interaction using the attached model. More...
 
double F1V (void) const
 Get the computed form factor F1V. More...
 
double xiF2V (void) const
 Get the computed form factor xi*F2V. More...
 
double FA (void) const
 Get the computed form factor FA. More...
 
double Fp (void) const
 Get the computed form factor Fp. More...
 
const QELFormFactorsModelIModel (void) const
 Get the attached model. More...
 
void Reset (Option_t *opt="")
 
void Copy (const QELFormFactors &ff)
 
bool Compare (const QELFormFactors &ff) const
 
void Print (ostream &stream) const
 
bool operator== (const QELFormFactors &ff) const
 
QELFormFactorsoperator= (const QELFormFactors &ff)
 

Private Attributes

double fF1V
 
double fxiF2V
 
double fFA
 
double fFp
 
const QELFormFactorsModelIfModel
 

Friends

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

Detailed Description

A class holding Quasi Elastic (QEL) Form Factors.

      This class is using the \b Strategy Pattern. \n
      It can accept requests to calculate itself, for a given interaction,
      that it then delegates to the algorithmic object, implementing the
      QELFormFactorsModelI interface, that it finds attached to itself.
Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
April 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 38 of file QELFormFactors.h.

Constructor & Destructor Documentation

QELFormFactors::QELFormFactors ( )

Definition at line 33 of file QELFormFactors.cxx.

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

Definition at line 38 of file QELFormFactors.cxx.

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

Definition at line 44 of file QELFormFactors.h.

44 { }

Member Function Documentation

void QELFormFactors::Calculate ( const Interaction interaction)

Compute the form factors for the input interaction using the attached model.

Definition at line 49 of file QELFormFactors.cxx.

References LOG, and pERROR.

Referenced by genie::SmithMonizQELCCPXSec::d3sQES_dQ2dvdkF_SM(), genie::SmithMonizQELCCPXSec::dsQES_dQ2_SM(), genie::LwlynSmithQELCCPXSec::FullDifferentialXSec(), genie::LwlynSmithQELCCPXSec::XSec(), genie::PaisQELLambdaPXSec::XSec(), genie::NievesQELCCPXSec::XSec(), and genie::MKSPPPXSec2020::XSec().

50 {
51  if(!this->fModel) {
52  LOG("QELFF",pERROR)
53  << "No QELFormFactorsModelI attached. Can not calculate FF's";
54  this->Reset("D");
55  return;
56  }
57 
58  this -> fF1V = fModel -> F1V (interaction);
59  this -> fxiF2V = fModel -> xiF2V (interaction);
60  this -> fFA = fModel -> FA (interaction);
61  this -> fFp = fModel -> Fp (interaction);
62 }
const QELFormFactorsModelI * fModel
#define pERROR
Definition: Messenger.h:59
void Reset(Option_t *opt="")
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
double xiF2V(void) const
Get the computed form factor xi*F2V.
double F1V(void) const
Get the computed form factor F1V.
double Fp(void) const
Get the computed form factor Fp.
double FA(void) const
Get the computed form factor FA.
bool QELFormFactors::Compare ( const QELFormFactors ff) const

Definition at line 88 of file QELFormFactors.cxx.

References genie::utils::math::AreEqual(), fF1V, fFA, fFp, and fxiF2V.

89 {
90  bool equal =
91  math::AreEqual(this->fF1V, ff.fF1V) &&
92  math::AreEqual(this->fxiF2V, ff.fxiF2V) &&
93  math::AreEqual(this->fFA, ff.fFA) &&
94  math::AreEqual(this->fFp, ff.fFp);
95  return equal;
96 }
bool AreEqual(double x1, double x2)
Definition: MathUtils.cxx:236
void QELFormFactors::Copy ( const QELFormFactors ff)

Definition at line 78 of file QELFormFactors.cxx.

References fF1V, fFA, fFp, fModel, and fxiF2V.

79 {
80  this->fModel = ff.fModel;
81 
82  this->fF1V = ff.fF1V;
83  this->fxiF2V = ff.fxiF2V;
84  this->fFA = ff.fFA;
85  this->fFp = ff.fFp;
86 }
const QELFormFactorsModelI * fModel
double genie::QELFormFactors::F1V ( void  ) const
inline
double genie::QELFormFactors::FA ( void  ) const
inline
double genie::QELFormFactors::Fp ( void  ) const
inline
const QELFormFactorsModelI* genie::QELFormFactors::Model ( void  ) const
inline

Get the attached model.

Definition at line 65 of file QELFormFactors.h.

References fModel.

65 {return fModel;}
const QELFormFactorsModelI * fModel
QELFormFactors & QELFormFactors::operator= ( const QELFormFactors ff)

Definition at line 112 of file QELFormFactors.cxx.

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

Definition at line 107 of file QELFormFactors.cxx.

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

Definition at line 98 of file QELFormFactors.cxx.

Referenced by genie::operator<<().

99 {
100  stream << endl;
101  stream << "F1V = " << this->fF1V << endl;
102  stream << "xi*F2V = " << this->fxiF2V << endl;
103  stream << "FA = " << this->fFA << endl;
104  stream << "Fp = " << this->fFp << endl;
105 }
void QELFormFactors::Reset ( Option_t *  opt = "")

Definition at line 64 of file QELFormFactors.cxx.

65 {
66 // Reset the QELFormFactors object (data & attached model). If the input
67 // option = D it resets the data only and not the attached model.
68 
69  this->fF1V = 0;
70  this->fxiF2V = 0;
71  this->fFA = 0;
72  this->fFp = 0;
73 
74  string option(opt);
75  if(option.find("D") == string::npos) {this->fModel = 0;}
76 }
const QELFormFactorsModelI * fModel
void QELFormFactors::SetModel ( const QELFormFactorsModelI model)

Attach an algorithm.

Definition at line 43 of file QELFormFactors.cxx.

Referenced by genie::LwlynSmithQELCCPXSec::LoadConfig(), genie::PaisQELLambdaPXSec::LoadConfig(), genie::NievesQELCCPXSec::LoadConfig(), genie::SmithMonizQELCCPXSec::LoadConfig(), and genie::MKSPPPXSec2020::LoadConfig().

44 {
45  this->Reset();
46  this->fModel = model;
47 }
const QELFormFactorsModelI * fModel
void Reset(Option_t *opt="")
double genie::QELFormFactors::xiF2V ( void  ) const
inline

Friends And Related Function Documentation

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

Definition at line 26 of file QELFormFactors.cxx.

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

Member Data Documentation

double genie::QELFormFactors::fF1V
private

Definition at line 78 of file QELFormFactors.h.

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

double genie::QELFormFactors::fFA
private

Definition at line 80 of file QELFormFactors.h.

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

double genie::QELFormFactors::fFp
private

Definition at line 81 of file QELFormFactors.h.

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

const QELFormFactorsModelI* genie::QELFormFactors::fModel
private

Definition at line 83 of file QELFormFactors.h.

Referenced by Copy(), and Model().

double genie::QELFormFactors::fxiF2V
private

Definition at line 79 of file QELFormFactors.h.

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


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