Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
Generator
src
Physics
QuasiElastic
XSection
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
16
#include "
Physics/QuasiElastic/XSection/AxialFormFactor.h
"
17
#include "
Framework/Interaction/Interaction.h
"
18
#include "
Framework/Messenger/Messenger.h
"
19
#include "
Framework/Numerical/MathUtils.h
"
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
//____________________________________________________________________________
37
AxialFormFactor::AxialFormFactor
()
38
{
39
this->Reset();
40
}
41
//____________________________________________________________________________
42
AxialFormFactor::AxialFormFactor
(
const
AxialFormFactor
& ff)
43
{
44
this->Copy(ff);
45
}
46
//____________________________________________________________________________
47
void
AxialFormFactor::SetModel
(
const
AxialFormFactorModelI
*
model
)
48
{
49
this->Reset();
50
this->fModel =
model
;
51
}
52
//____________________________________________________________________________
53
void
AxialFormFactor::Calculate
(
const
Interaction
*
interaction
)
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
//____________________________________________________________________________
77
void
AxialFormFactor::Copy
(
const
AxialFormFactor
& ff)
78
{
79
this->fModel = ff.
fModel
;
80
this->fFA = ff.
fFA
;
81
}
82
//____________________________________________________________________________
83
bool
AxialFormFactor::Compare
(
const
AxialFormFactor
& ff)
const
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
//____________________________________________________________________________
94
bool
AxialFormFactor::operator ==
(
const
AxialFormFactor
& ff)
const
95
{
96
return
this->Compare(ff);
97
}
98
//___________________________________________________________________________
99
AxialFormFactor
&
AxialFormFactor::operator =
(
const
AxialFormFactor
& ff)
100
{
101
this->Copy(ff);
102
return
(*
this
);
103
}
104
//___________________________________________________________________________
genie
THE MAIN GENIE PROJECT NAMESPACE
Definition:
AlgCmp.h:25
pERROR
#define pERROR
Definition:
Messenger.h:59
string
std::string string
Definition:
nybbler.cc:12
genie::utils::math::AreEqual
bool AreEqual(double x1, double x2)
Definition:
MathUtils.cxx:236
genie::AxialFormFactorModelI
Pure abstract base class. Defines the AxialFormFactorModelI interface to be implemented by LlewellynS...
Definition:
AxialFormFactorModelI.h:33
train.opt
opt
Definition:
train.py:196
genie::AxialFormFactor::operator=
AxialFormFactor & operator=(const AxialFormFactor &ff)
Definition:
AxialFormFactor.cxx:99
genie::AxialFormFactor::fModel
const AxialFormFactorModelI * fModel
Definition:
AxialFormFactor.h:70
model
Definition:
model.py:1
genie::AxialFormFactor::Calculate
void Calculate(const Interaction *interaction)
Calculate the form factors for the input interaction using the attached algorithm.
Definition:
AxialFormFactor.cxx:53
genie::utils::operator<<
ostream & operator<<(ostream &stream, const T2KEvGenMetaData &md)
Definition:
T2KEvGenMetaData.cxx:22
genie::AxialFormFactor::SetModel
void SetModel(const AxialFormFactorModelI *model)
Attach an algorithm.
Definition:
AxialFormFactor.cxx:47
genie::AxialFormFactor
A class holding the Axial Form Factor.
Definition:
AxialFormFactor.h:38
genie::Interaction
Summary information for an interaction.
Definition:
Interaction.h:56
genie::AxialFormFactor::Print
void Print(ostream &stream) const
Definition:
AxialFormFactor.cxx:88
genie::AxialFormFactor::Compare
bool Compare(const AxialFormFactor &ff) const
Definition:
AxialFormFactor.cxx:83
Interaction.h
LOG
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition:
Messenger.h:96
AxialFormFactor.h
cvn::interaction
Definition:
InteractionType.h:60
genie::AxialFormFactor::operator==
bool operator==(const AxialFormFactor &ff) const
Definition:
AxialFormFactor.cxx:94
plot_model.model
model
Definition:
plot_model.py:61
generate_datataset.stream
stream
Definition:
generate_datataset.py:30
genie::AxialFormFactor::fFA
double fFA
Definition:
AxialFormFactor.h:68
Messenger.h
genie::AxialFormFactor::AxialFormFactor
AxialFormFactor()
Definition:
AxialFormFactor.cxx:37
MathUtils.h
genie::AxialFormFactor::Copy
void Copy(const AxialFormFactor &ff)
Definition:
AxialFormFactor.cxx:77
genie::AxialFormFactor::Reset
void Reset(Option_t *opt="")
Definition:
AxialFormFactor.cxx:66
genie::utils
Root of GENIE utility namespaces.
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11