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>

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

Author
Aaron Meyer <asmeyer2012 uchicago.edu>
       based off AxialFormFactor by
       Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
       University of Liverpool & STFC Rutherford Appleton Laboratory

August 19, 2013

Copyright (c) 2003-2020, 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.

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
virtual double FA(const Interaction *interaction) const =0
Compute the axial form factor.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
void Reset(Option_t *opt="")
bool AxialFormFactor::Compare ( const AxialFormFactor ff) const

Definition at line 83 of file AxialFormFactor.cxx.

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.

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.

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

Get the attached model.

Definition at line 55 of file AxialFormFactor.h.

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.

89 {
90  stream<< endl;
91  stream<< "(FA = " << this->fFA << ") "<< endl;
92 }
QTextStream & endl(QTextStream &s)
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 }
opt
Definition: train.py:196
const AxialFormFactorModelI * fModel
void AxialFormFactor::SetModel ( const AxialFormFactorModelI model)

Attach an algorithm.

Definition at line 47 of file AxialFormFactor.cxx.

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.

const AxialFormFactorModelI* genie::AxialFormFactor::fModel
private

Definition at line 70 of file AxialFormFactor.h.


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