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

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

#include <QELFormFactors.h>

Collaboration diagram for genie::QELFormFactors:
[legend]

Public Member Functions

 QELFormFactors ()
 QELFormFactors (const QELFormFactors &form_factors)
virtual ~QELFormFactors ()
void SetModel (const QELFormFactorsModelI *model)
 Attach an algorithm.
void Calculate (const Interaction *interaction)
 Compute the form factors for the input interaction using the attached model.
double F1V (void) const
 Get the computed form factor F1V.
double xiF2V (void) const
 Get the computed form factor xi*F2V.
double FA (void) const
 Get the computed form factor FA.
double Fp (void) const
 Get the computed form factor Fp.
const QELFormFactorsModelIModel (void) const
 Get the attached model.
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 \at cern.ch> University of Liverpool
Created:\n April 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 38 of file QELFormFactors.h.

Constructor & Destructor Documentation

◆ QELFormFactors() [1/2]

QELFormFactors::QELFormFactors ( )

Definition at line 33 of file QELFormFactors.cxx.

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

References Reset().

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

◆ QELFormFactors() [2/2]

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)

References Copy(), and QELFormFactors().

◆ ~QELFormFactors()

virtual genie::QELFormFactors::~QELFormFactors ( )
inlinevirtual

Definition at line 44 of file QELFormFactors.h.

44{ }

Member Function Documentation

◆ Calculate()

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.

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}
#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
double Fp(void) const
Get the computed form factor Fp.
const QELFormFactorsModelI * fModel
double F1V(void) const
Get the computed form factor F1V.
double FA(void) const
Get the computed form factor FA.
double xiF2V(void) const
Get the computed form factor xi*F2V.

References F1V(), FA(), fF1V, fFA, fFp, fModel, Fp(), fxiF2V, LOG, pERROR, Reset(), and xiF2V().

◆ Compare()

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

Definition at line 88 of file QELFormFactors.cxx.

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)

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

Referenced by operator==().

◆ Copy()

void QELFormFactors::Copy ( const QELFormFactors & ff)

Definition at line 78 of file QELFormFactors.cxx.

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}

References fF1V, fFA, fFp, fModel, fxiF2V, and QELFormFactors().

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

◆ F1V()

double genie::QELFormFactors::F1V ( void ) const
inline

Get the computed form factor F1V.

Definition at line 53 of file QELFormFactors.h.

53{ return fF1V; }

References fF1V.

Referenced by Calculate().

◆ FA()

double genie::QELFormFactors::FA ( void ) const
inline

Get the computed form factor FA.

Definition at line 59 of file QELFormFactors.h.

59{ return fFA; }

References fFA.

Referenced by Calculate().

◆ Fp()

double genie::QELFormFactors::Fp ( void ) const
inline

Get the computed form factor Fp.

Definition at line 62 of file QELFormFactors.h.

62{ return fFp; }

References fFp.

Referenced by Calculate().

◆ Model()

const QELFormFactorsModelI * genie::QELFormFactors::Model ( void ) const
inline

Get the attached model.

Definition at line 65 of file QELFormFactors.h.

65{return fModel;}

References fModel.

◆ operator=()

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

Definition at line 112 of file QELFormFactors.cxx.

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

References Copy(), and QELFormFactors().

◆ operator==()

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

References Compare(), and QELFormFactors().

◆ Print()

void QELFormFactors::Print ( ostream & stream) const

Definition at line 98 of file QELFormFactors.cxx.

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}

References fF1V, fFA, fFp, and fxiF2V.

Referenced by operator<<.

◆ Reset()

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}

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

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

◆ SetModel()

void QELFormFactors::SetModel ( const QELFormFactorsModelI * model)

Attach an algorithm.

Definition at line 43 of file QELFormFactors.cxx.

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

References fModel, and Reset().

◆ xiF2V()

double genie::QELFormFactors::xiF2V ( void ) const
inline

Get the computed form factor xi*F2V.

Definition at line 56 of file QELFormFactors.h.

56{ return fxiF2V; }

References fxiF2V.

Referenced by Calculate().

◆ operator<<

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

References Print(), and QELFormFactors().

Member Data Documentation

◆ fF1V

double genie::QELFormFactors::fF1V
private

Definition at line 78 of file QELFormFactors.h.

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

◆ fFA

double genie::QELFormFactors::fFA
private

Definition at line 80 of file QELFormFactors.h.

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

◆ fFp

double genie::QELFormFactors::fFp
private

Definition at line 81 of file QELFormFactors.h.

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

◆ fModel

const QELFormFactorsModelI* genie::QELFormFactors::fModel
private

Definition at line 83 of file QELFormFactors.h.

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

◆ fxiF2V

double genie::QELFormFactors::fxiF2V
private

Definition at line 79 of file QELFormFactors.h.

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


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