AxialFormFactor.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Aaron Meyer <asmeyer2012 \at uchicago.edu>
7 
8  based off AxialFormFactor by
9  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
10  University of Liverpool & STFC Rutherford Appleton Laboratory
11 */
12 //____________________________________________________________________________
13 
14 #include <string>
15 
20 
21 using std::endl;
22 using std::string;
23 
24 using namespace genie;
25 using namespace genie::utils;
26 
27 //____________________________________________________________________________
28 namespace genie
29 {
30  ostream & operator << (ostream & stream, const AxialFormFactor & ff)
31  {
32  ff.Print(stream);
33  return stream;
34  }
35 }
36 //____________________________________________________________________________
38 {
39  this->Reset();
40 }
41 //____________________________________________________________________________
43 {
44  this->Copy(ff);
45 }
46 //____________________________________________________________________________
48 {
49  this->Reset();
50  this->fModel = model;
51 }
52 //____________________________________________________________________________
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 }
65 //____________________________________________________________________________
66 void AxialFormFactor::Reset(Option_t * opt)
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 }
76 //____________________________________________________________________________
78 {
79  this->fModel = ff.fModel;
80  this->fFA = ff.fFA;
81 }
82 //____________________________________________________________________________
84 {
85  return math::AreEqual(this->fFA, ff.fFA);
86 }
87 //____________________________________________________________________________
88 void AxialFormFactor::Print(ostream & stream) const
89 {
90  stream<< endl;
91  stream<< "(FA = " << this->fFA << ") "<< endl;
92 }
93 //____________________________________________________________________________
95 {
96  return this->Compare(ff);
97 }
98 //___________________________________________________________________________
100 {
101  this->Copy(ff);
102  return (*this);
103 }
104 //___________________________________________________________________________
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
#define pERROR
Definition: Messenger.h:59
std::string string
Definition: nybbler.cc:12
bool AreEqual(double x1, double x2)
Definition: MathUtils.cxx:236
Pure abstract base class. Defines the AxialFormFactorModelI interface to be implemented by LlewellynS...
opt
Definition: train.py:196
AxialFormFactor & operator=(const AxialFormFactor &ff)
const AxialFormFactorModelI * fModel
Definition: model.py:1
void Calculate(const Interaction *interaction)
Calculate the form factors for the input interaction using the attached algorithm.
ostream & operator<<(ostream &stream, const T2KEvGenMetaData &md)
void SetModel(const AxialFormFactorModelI *model)
Attach an algorithm.
A class holding the Axial Form Factor.
Summary information for an interaction.
Definition: Interaction.h:56
void Print(ostream &stream) const
bool Compare(const AxialFormFactor &ff) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool operator==(const AxialFormFactor &ff) const
void Copy(const AxialFormFactor &ff)
void Reset(Option_t *opt="")
Root of GENIE utility namespaces.
QTextStream & endl(QTextStream &s)