GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>

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

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 \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
      DISStructureFuncModelI interface, that it finds attached to itself.
Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
May 05, 2004
License:
Copyright (c) 2003-2024, 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.

References LOG, and pERROR.

Referenced by BuildStdNtuple(), VerticalSlice(), genie::QPMDISPXSec::XSec(), and genie::QPMDMDISPXSec::XSec().

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 F4(void) const =0
Get the computed structure function F4.
virtual double F2(void) const =0
Get the computed structure function F2.
virtual void Calculate(const Interaction *interaction) const =0
Calculate the structure functions F1-F6 for the input interaction.
#define pERROR
Definition: Messenger.h:59
virtual double F1(void) const =0
Get the computed structure function F1.
const DISStructureFuncModelI * fModel
virtual double F6(void) const =0
Get the computed structure function F6.
virtual double F5(void) const =0
Get the computed structure function F5.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual double F3(void) const =0
Get the computed structure function F3.
void Reset(Option_t *opt="")
bool DISStructureFunc::Compare ( const DISStructureFunc sf) const

Definition at line 96 of file DISStructureFunc.cxx.

References genie::utils::math::AreEqual(), fF1, fF2, fF3, fF4, fF5, and fF6.

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.

References fF1, fF2, fF3, fF4, fF5, fF6, and fModel.

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.

References fF1.

Referenced by BuildStdNtuple(), genie::QPMDISPXSec::XSec(), and genie::QPMDMDISPXSec::XSec().

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

Get the computed structure function F2.

Definition at line 56 of file DISStructureFunc.h.

References fF2.

Referenced by BuildStdNtuple(), genie::QPMDISPXSec::XSec(), and genie::QPMDMDISPXSec::XSec().

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

Get the computed structure function F3.

Definition at line 59 of file DISStructureFunc.h.

References fF3.

Referenced by BuildStdNtuple(), genie::QPMDISPXSec::XSec(), and genie::QPMDMDISPXSec::XSec().

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

Get the computed structure function F4.

Definition at line 62 of file DISStructureFunc.h.

References fF4.

Referenced by BuildStdNtuple(), genie::QPMDISPXSec::XSec(), and genie::QPMDMDISPXSec::XSec().

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

Get the computed structure function F5.

Definition at line 65 of file DISStructureFunc.h.

References fF5.

Referenced by BuildStdNtuple(), genie::QPMDISPXSec::XSec(), and genie::QPMDMDISPXSec::XSec().

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

Get the computed structure function F6.

Definition at line 68 of file DISStructureFunc.h.

References fF6.

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

Get the attached model.

Definition at line 71 of file DISStructureFunc.h.

References fModel.

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.

Referenced by genie::operator<<().

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 }
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 }
const DISStructureFuncModelI * fModel
void DISStructureFunc::SetModel ( const DISStructureFuncModelI model)

Attach an algorithm.

Definition at line 43 of file DISStructureFunc.cxx.

Referenced by BuildStdNtuple(), genie::QPMDISPXSec::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), and VerticalSlice().

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.

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

double genie::DISStructureFunc::fF2
private

Definition at line 85 of file DISStructureFunc.h.

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

double genie::DISStructureFunc::fF3
private

Definition at line 86 of file DISStructureFunc.h.

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

double genie::DISStructureFunc::fF4
private

Definition at line 87 of file DISStructureFunc.h.

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

double genie::DISStructureFunc::fF5
private

Definition at line 88 of file DISStructureFunc.h.

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

double genie::DISStructureFunc::fF6
private

Definition at line 89 of file DISStructureFunc.h.

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

const DISStructureFuncModelI* genie::DISStructureFunc::fModel
private

Definition at line 91 of file DISStructureFunc.h.

Referenced by Copy(), and Model().


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