GENIEGenerator
Loading...
Searching...
No Matches
AxialFormFactor.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, 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 <c.andreopoulos \at cern.ch>
10 University of Liverpool
11*/
12//____________________________________________________________________________
13
14#include <string>
15
20
21using std::endl;
22using std::string;
23
24using namespace genie;
25using namespace genie::utils;
26
27//____________________________________________________________________________
28namespace genie
29{
30 ostream & operator << (ostream & stream, const AxialFormFactor & ff)
31 {
32 ff.Print(stream);
33 return stream;
34 }
35}
36//____________________________________________________________________________
41//____________________________________________________________________________
43{
44 this->Copy(ff);
45}
46//____________________________________________________________________________
48{
49 this->Reset();
50 this->fModel = model;
51}
52//____________________________________________________________________________
53void 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//____________________________________________________________________________
66void 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//____________________________________________________________________________
88void 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//___________________________________________________________________________
#define pERROR
Definition Messenger.h:59
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
Pure abstract base class. Defines the AxialFormFactorModelI interface to be implemented by LlewellynS...
bool operator==(const AxialFormFactor &ff) const
const AxialFormFactorModelI * fModel
void Reset(Option_t *opt="")
void SetModel(const AxialFormFactorModelI *model)
Attach an algorithm.
bool Compare(const AxialFormFactor &ff) const
void Print(ostream &stream) const
void Copy(const AxialFormFactor &ff)
void Calculate(const Interaction *interaction)
Calculate the form factors for the input interaction using the attached algorithm.
AxialFormFactor & operator=(const AxialFormFactor &ff)
Summary information for an interaction.
Definition Interaction.h:56
bool AreEqual(double x1, double x2)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)