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

A class holding the Axial Form Factor. More...

#include <AxialFormFactor.h>

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

Public Member Functions

 AxialFormFactor ()
 
 AxialFormFactor (const AxialFormFactor &form_factors)
 
virtual ~AxialFormFactor ()
 
void SetModel (const AxialFormFactorModelI *model)
 Attach an algorithm. More...
 
void Calculate (const Interaction *interaction)
 Calculate the form factors for the input interaction using the attached algorithm. More...
 
double FA (void) const
 Get the computed axial form factor. More...
 
const AxialFormFactorModelIModel (void) const
 Get the attached model. More...
 
void Reset (Option_t *opt="")
 
void Copy (const AxialFormFactor &ff)
 
bool Compare (const AxialFormFactor &ff) const
 
void Print (ostream &stream) const
 
bool operator== (const AxialFormFactor &ff) const
 
AxialFormFactoroperator= (const AxialFormFactor &ff)
 

Private Attributes

double fFA
 
const AxialFormFactorModelIfModel
 

Friends

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

Detailed Description

A class holding the Axial Form Factor.

      This class is using the \b Strategy Pattern. \n
Author
Aaron Meyer <asmeyer2012 uchicago.edu>
       based off AxialFormFactor by
       Costas Andreopoulos <c.andreopoulos \at cern.ch>
       University of Liverpool
Created:
August 19, 2013
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 AxialFormFactor.h.

Constructor & Destructor Documentation

AxialFormFactor::AxialFormFactor ( )

Definition at line 37 of file AxialFormFactor.cxx.

38 {
39  this->Reset();
40 }
void Reset(Option_t *opt="")
AxialFormFactor::AxialFormFactor ( const AxialFormFactor form_factors)

Definition at line 42 of file AxialFormFactor.cxx.

43 {
44  this->Copy(ff);
45 }
void Copy(const AxialFormFactor &ff)
virtual genie::AxialFormFactor::~AxialFormFactor ( )
inlinevirtual

Definition at line 43 of file AxialFormFactor.h.

43 { }

Member Function Documentation

void AxialFormFactor::Calculate ( const Interaction interaction)

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

Definition at line 53 of file AxialFormFactor.cxx.

References LOG, and pERROR.

Referenced by CalculateFormFactor(), genie::LwlynSmithFF::FA(), and genie::LwlynSmithFF::StrangeFA().

54 {
55  if(!this->fModel)
56  {
57  LOG("AxialFormFactor", pERROR)
58  << "No AxialFormFactorModelI algorithm was defined!";
59  this->Reset("D");
60  }
61  else {
62  this->fFA = this->fModel->FA(interaction);
63  }
64 }
#define pERROR
Definition: Messenger.h:59
const AxialFormFactorModelI * fModel
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual double FA(const Interaction *interaction) const =0
Compute the axial form factor.
void Reset(Option_t *opt="")
bool AxialFormFactor::Compare ( const AxialFormFactor ff) const

Definition at line 83 of file AxialFormFactor.cxx.

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

84 {
85  return math::AreEqual(this->fFA, ff.fFA);
86 }
bool AreEqual(double x1, double x2)
Definition: MathUtils.cxx:236
void AxialFormFactor::Copy ( const AxialFormFactor ff)

Definition at line 77 of file AxialFormFactor.cxx.

References fFA, and fModel.

78 {
79  this->fModel = ff.fModel;
80  this->fFA = ff.fFA;
81 }
const AxialFormFactorModelI * fModel
double genie::AxialFormFactor::FA ( void  ) const
inline

Get the computed axial form factor.

Definition at line 52 of file AxialFormFactor.h.

References fFA.

Referenced by CalculateFormFactor(), genie::LwlynSmithFF::FA(), and genie::LwlynSmithFF::StrangeFA().

52 { return fFA; }
const AxialFormFactorModelI* genie::AxialFormFactor::Model ( void  ) const
inline

Get the attached model.

Definition at line 55 of file AxialFormFactor.h.

References fModel.

55 {return fModel;}
const AxialFormFactorModelI * fModel
AxialFormFactor & AxialFormFactor::operator= ( const AxialFormFactor ff)

Definition at line 99 of file AxialFormFactor.cxx.

100 {
101  this->Copy(ff);
102  return (*this);
103 }
void Copy(const AxialFormFactor &ff)
bool AxialFormFactor::operator== ( const AxialFormFactor ff) const

Definition at line 94 of file AxialFormFactor.cxx.

95 {
96  return this->Compare(ff);
97 }
bool Compare(const AxialFormFactor &ff) const
void AxialFormFactor::Print ( ostream &  stream) const

Definition at line 88 of file AxialFormFactor.cxx.

Referenced by genie::operator<<().

89 {
90  stream<< endl;
91  stream<< "(FA = " << this->fFA << ") "<< endl;
92 }
void AxialFormFactor::Reset ( Option_t *  opt = "")

Definition at line 66 of file AxialFormFactor.cxx.

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

Attach an algorithm.

Definition at line 47 of file AxialFormFactor.cxx.

Referenced by CalculateFormFactor(), and genie::LwlynSmithFF::LoadConfig().

48 {
49  this->Reset();
50  this->fModel = model;
51 }
const AxialFormFactorModelI * fModel
void Reset(Option_t *opt="")

Friends And Related Function Documentation

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

Definition at line 30 of file AxialFormFactor.cxx.

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

Member Data Documentation

double genie::AxialFormFactor::fFA
private

Definition at line 68 of file AxialFormFactor.h.

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

const AxialFormFactorModelI* genie::AxialFormFactor::fModel
private

Definition at line 70 of file AxialFormFactor.h.

Referenced by Copy(), and Model().


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