Public Member Functions | Private Attributes | Friends | List of all members
genie::QELFormFactors Class Reference

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

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+3.10-2.17-e17-debug/GENIE-Generator/src/Physics/QuasiElastic/XSection/QELFormFactors.h"

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 Strategy Pattern.
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 <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

April 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 39 of file QELFormFactors.h.

Constructor & Destructor Documentation

QELFormFactors::QELFormFactors ( )

Definition at line 39 of file QELFormFactors.cxx.

References slidt::Reset().

40 {
41  this->Reset();
42 }
void Reset(Option_t *opt="")
QELFormFactors::QELFormFactors ( const QELFormFactors form_factors)

Definition at line 44 of file QELFormFactors.cxx.

45 {
46  this->Copy(form_factors);
47 }
void Copy(const QELFormFactors &ff)
virtual genie::QELFormFactors::~QELFormFactors ( )
inlinevirtual

Definition at line 45 of file QELFormFactors.h.

References Calculate(), and SetModel().

45 { }

Member Function Documentation

void QELFormFactors::Calculate ( const Interaction interaction)

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

Definition at line 55 of file QELFormFactors.cxx.

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

Referenced by genie::SmithMonizQELCCPXSec::d2sQES_dQ2dv_SM(), genie::SmithMonizQELCCPXSec::dsQES_dQ2_SM(), genie::LwlynSmithQELCCPXSec::FullDifferentialXSec(), genie::LwlynSmithQELCCPXSec::XSec(), genie::PaisQELLambdaPXSec::XSec(), genie::NievesQELCCPXSec::XSec(), and ~QELFormFactors().

56 {
57  if(!this->fModel) {
58  LOG("QELFF",pERROR)
59  << "No QELFormFactorsModelI attached. Can not calculate FF's";
60  this->Reset("D");
61  return;
62  }
63 
64  this -> fF1V = fModel -> F1V (interaction);
65  this -> fxiF2V = fModel -> xiF2V (interaction);
66  this -> fFA = fModel -> FA (interaction);
67  this -> fFp = fModel -> Fp (interaction);
68 }
const QELFormFactorsModelI * fModel
#define pERROR
Definition: Messenger.h:60
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:97
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 94 of file QELFormFactors.cxx.

References genie::utils::math::AreEqual(), gov::fnal::cd::rms::provider::equal(), fF1V, fFA, fFp, and fxiF2V.

Referenced by Model().

95 {
96  bool equal =
97  math::AreEqual(this->fF1V, ff.fF1V) &&
98  math::AreEqual(this->fxiF2V, ff.fxiF2V) &&
99  math::AreEqual(this->fFA, ff.fFA) &&
100  math::AreEqual(this->fFp, ff.fFp);
101  return equal;
102 }
bool AreEqual(double x1, double x2)
Definition: MathUtils.cxx:243
bool equal(T *first, T *second)
void QELFormFactors::Copy ( const QELFormFactors ff)

Definition at line 84 of file QELFormFactors.cxx.

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

Referenced by Model().

85 {
86  this->fModel = ff.fModel;
87 
88  this->fF1V = ff.fF1V;
89  this->fxiF2V = ff.fxiF2V;
90  this->fFA = ff.fFA;
91  this->fFp = ff.fFp;
92 }
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 66 of file QELFormFactors.h.

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

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

Definition at line 118 of file QELFormFactors.cxx.

Referenced by Model().

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

Definition at line 113 of file QELFormFactors.cxx.

References Compare().

Referenced by Model().

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

Definition at line 104 of file QELFormFactors.cxx.

References allTimeWatchdog::endl.

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

105 {
106  stream << endl;
107  stream << "F1V = " << this->fF1V << endl;
108  stream << "xi*F2V = " << this->fxiF2V << endl;
109  stream << "FA = " << this->fFA << endl;
110  stream << "Fp = " << this->fFp << endl;
111 }
void QELFormFactors::Reset ( Option_t *  opt = "")

Definition at line 70 of file QELFormFactors.cxx.

References ana::fModel.

Referenced by Model().

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

Attach an algorithm.

Definition at line 49 of file QELFormFactors.cxx.

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

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

50 {
51  this->Reset();
52  this->fModel = model;
53 }
const QELFormFactorsModelI * fModel
void Reset(Option_t *opt="")
const XML_Char XML_Content * model
Definition: expat.h:151
double genie::QELFormFactors::xiF2V ( void  ) const
inline

Friends And Related Function Documentation

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

Definition at line 32 of file QELFormFactors.cxx.

Referenced by Model().

33  {
34  ff.Print(stream);
35  return stream;
36  }
void Print(ostream &stream) const

Member Data Documentation

double genie::QELFormFactors::fF1V
private

Definition at line 79 of file QELFormFactors.h.

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

double genie::QELFormFactors::fFA
private

Definition at line 81 of file QELFormFactors.h.

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

double genie::QELFormFactors::fFp
private

Definition at line 82 of file QELFormFactors.h.

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

const QELFormFactorsModelI* genie::QELFormFactors::fModel
private

Definition at line 84 of file QELFormFactors.h.

Referenced by Copy(), and Model().

double genie::QELFormFactors::fxiF2V
private

Definition at line 80 of file QELFormFactors.h.

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


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