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

A class holding Deep Inelastic Scattering (DIS) Form Factors (invariant structure funstions) More...

#include <DISStructureFunc.h>

Public Member Functions

 DISStructureFunc ()
 
 DISStructureFunc (const DISStructureFunc &form_factors)
 
virtual ~DISStructureFunc ()
 
void SetModel (const DISStructureFuncModelI *model)
 Attach an algorithm. More...
 
void Calculate (const Interaction *interaction)
 Calculate the S/F's for the input interaction using the attached algorithm. More...
 
double F1 (void) const
 Get the computed structure function F1. More...
 
double F2 (void) const
 Get the computed structure function F2. More...
 
double F3 (void) const
 Get the computed structure function F3. More...
 
double F4 (void) const
 Get the computed structure function F4. More...
 
double F5 (void) const
 Get the computed structure function F5. More...
 
double F6 (void) const
 Get the computed structure function F6. More...
 
const DISStructureFuncModelIModel (void) const
 Get the attached model. More...
 
void Reset (Option_t *opt="")
 
void Copy (const DISStructureFunc &sf)
 
bool Compare (const DISStructureFunc &sf) const
 
void Print (ostream &stream) const
 
bool operator== (const DISStructureFunc &sf) const
 
DISStructureFuncoperator= (const DISStructureFunc &sf)
 

Private Attributes

double fF1
 
double fF2
 
double fF3
 
double fF4
 
double fF5
 
double fF6
 
const DISStructureFuncModelIfModel
 

Friends

ostream & operator<< (ostream &stream, const DISStructureFunc &sf)
 

Detailed Description

A class holding Deep Inelastic Scattering (DIS) Form Factors (invariant structure funstions)

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 DISStructureFuncModelI interface, that it finds attached to itself.

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

May 05, 2004

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 39 of file DISStructureFunc.h.

Constructor & Destructor Documentation

DISStructureFunc::DISStructureFunc ( )

Definition at line 33 of file DISStructureFunc.cxx.

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

Definition at line 38 of file DISStructureFunc.cxx.

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

Definition at line 44 of file DISStructureFunc.h.

44 { }

Member Function Documentation

void DISStructureFunc::Calculate ( const Interaction interaction)

Calculate the S/F's for the input interaction using the attached algorithm.

Definition at line 49 of file DISStructureFunc.cxx.

50 {
51  if(!this->fModel) {
52  LOG("DISSF",pERROR)
53  << "No DISStructureFuncModelI attached. Can not calculate SF's";
54  this->Reset("D");
55  return;
56  }
57 
58  fModel->Calculate(interaction);
59 
60  this->fF1 = fModel->F1();
61  this->fF2 = fModel->F2();
62  this->fF3 = fModel->F3();
63  this->fF4 = fModel->F4();
64  this->fF5 = fModel->F5();
65  this->fF6 = fModel->F6();
66 }
virtual double F6(void) const =0
Get the computed structure function F6.
virtual double F3(void) const =0
Get the computed structure function F3.
#define pERROR
Definition: Messenger.h:59
const DISStructureFuncModelI * fModel
virtual double F2(void) const =0
Get the computed structure function F2.
virtual double F4(void) const =0
Get the computed structure function F4.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual void Calculate(const Interaction *interaction) const =0
Calculate the structure functions F1-F6 for the input interaction.
virtual double F5(void) const =0
Get the computed structure function F5.
virtual double F1(void) const =0
Get the computed structure function F1.
void Reset(Option_t *opt="")
bool DISStructureFunc::Compare ( const DISStructureFunc sf) const

Definition at line 96 of file DISStructureFunc.cxx.

97 {
98  bool equal =
99  math::AreEqual(this->fF1, sf.fF1) &&
100  math::AreEqual(this->fF2, sf.fF2) &&
101  math::AreEqual(this->fF3, sf.fF3) &&
102  math::AreEqual(this->fF4, sf.fF4) &&
103  math::AreEqual(this->fF5, sf.fF5) &&
104  math::AreEqual(this->fF6, sf.fF6);
105  return equal;
106 }
bool AreEqual(double x1, double x2)
Definition: MathUtils.cxx:236
void DISStructureFunc::Copy ( const DISStructureFunc sf)

Definition at line 84 of file DISStructureFunc.cxx.

85 {
86  this->fF1 = sf.fF1;
87  this->fF2 = sf.fF2;
88  this->fF3 = sf.fF3;
89  this->fF4 = sf.fF4;
90  this->fF5 = sf.fF5;
91  this->fF6 = sf.fF6;
92 
93  this->fModel = sf.fModel;
94 }
const DISStructureFuncModelI * fModel
double genie::DISStructureFunc::F1 ( void  ) const
inline

Get the computed structure function F1.

Definition at line 53 of file DISStructureFunc.h.

53 { return fF1; }
double genie::DISStructureFunc::F2 ( void  ) const
inline

Get the computed structure function F2.

Definition at line 56 of file DISStructureFunc.h.

56 { return fF2; }
double genie::DISStructureFunc::F3 ( void  ) const
inline

Get the computed structure function F3.

Definition at line 59 of file DISStructureFunc.h.

59 { return fF3; }
double genie::DISStructureFunc::F4 ( void  ) const
inline

Get the computed structure function F4.

Definition at line 62 of file DISStructureFunc.h.

62 { return fF4; }
double genie::DISStructureFunc::F5 ( void  ) const
inline

Get the computed structure function F5.

Definition at line 65 of file DISStructureFunc.h.

65 { return fF5; }
double genie::DISStructureFunc::F6 ( void  ) const
inline

Get the computed structure function F6.

Definition at line 68 of file DISStructureFunc.h.

68 { return fF6; }
const DISStructureFuncModelI* genie::DISStructureFunc::Model ( void  ) const
inline

Get the attached model.

Definition at line 71 of file DISStructureFunc.h.

71 {return fModel;}
const DISStructureFuncModelI * fModel
DISStructureFunc & DISStructureFunc::operator= ( const DISStructureFunc sf)

Definition at line 129 of file DISStructureFunc.cxx.

130 {
131  this->Copy(sf);
132  return (*this);
133 }
void Copy(const DISStructureFunc &sf)
bool DISStructureFunc::operator== ( const DISStructureFunc sf) const

Definition at line 124 of file DISStructureFunc.cxx.

125 {
126  return this->Compare(sf);
127 }
bool Compare(const DISStructureFunc &sf) const
void DISStructureFunc::Print ( ostream &  stream) const

Definition at line 108 of file DISStructureFunc.cxx.

109 {
110  stream << "(F1-F6) = ("
111  << this->fF1 << ", " << this->fF2 << ", "
112  << this->fF3 << ", " << this->fF4 << ", "
113  << this->fF5 << ", " << this->fF6 << ")" << endl;
114 /*
115  stream << "F1 = " << this->fF1 << endl;
116  stream << "F2 = " << this->fF2 << endl;
117  stream << "F3 = " << this->fF3 << endl;
118  stream << "F4 = " << this->fF4 << endl;
119  stream << "F5 = " << this->fF5 << endl;
120  stream << "F6 = " << this->fF6 << endl;
121 */
122 }
QTextStream & endl(QTextStream &s)
void DISStructureFunc::Reset ( Option_t *  opt = "")

Definition at line 68 of file DISStructureFunc.cxx.

69 {
70 // Reset the DISStructureFunc object (data & attached model). If the input
71 // option = D it resets the data only and not the attached model.
72 
73  this->fF1 = 0.0;
74  this->fF2 = 0.0;
75  this->fF3 = 0.0;
76  this->fF4 = 0.0;
77  this->fF5 = 0.0;
78  this->fF6 = 0.0;
79 
80  string option(opt);
81  if(option.find("D") == string::npos) {this->fModel = 0;}
82 }
opt
Definition: train.py:196
const DISStructureFuncModelI * fModel
void DISStructureFunc::SetModel ( const DISStructureFuncModelI model)

Attach an algorithm.

Definition at line 43 of file DISStructureFunc.cxx.

44 {
45  this->Reset();
46  this->fModel = model;
47 }
const DISStructureFuncModelI * fModel
void Reset(Option_t *opt="")

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const DISStructureFunc sf 
)
friend

Definition at line 26 of file DISStructureFunc.cxx.

27  {
28  ff.Print(stream);
29  return stream;
30  }

Member Data Documentation

double genie::DISStructureFunc::fF1
private

Definition at line 84 of file DISStructureFunc.h.

double genie::DISStructureFunc::fF2
private

Definition at line 85 of file DISStructureFunc.h.

double genie::DISStructureFunc::fF3
private

Definition at line 86 of file DISStructureFunc.h.

double genie::DISStructureFunc::fF4
private

Definition at line 87 of file DISStructureFunc.h.

double genie::DISStructureFunc::fF5
private

Definition at line 88 of file DISStructureFunc.h.

double genie::DISStructureFunc::fF6
private

Definition at line 89 of file DISStructureFunc.h.

const DISStructureFuncModelI* genie::DISStructureFunc::fModel
private

Definition at line 91 of file DISStructureFunc.h.


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