GENIEGenerator
Loading...
Searching...
No Matches
INukeOset.h
Go to the documentation of this file.
1/**
2 * @brief Oset model handler (abstract class)
3 *
4 * @author Tomasz Golan
5 * @date 2015
6 * @warning Applicable for pion with Tk < 350 MeV
7 * @remarks Based on E. Oset et al., Nucl. Phys. A484 (1988) 557-592
8 *
9*/
10
11#ifndef INUKE_OSET_H
12#define INUKE_OSET_H
13
14#include <cmath>
15#include <limits>
16
20
21using namespace genie;
22using namespace genie::constants;
23
25{
26 public:
27
28 INukeOset (); //!< contructor
29
30 //! use to set up Oset class (assign pion Tk, nuclear density etc)
31 virtual void setupOset (const double &density, const double &pionTk, const int &pionPDG,
32 const double &protonFraction) = 0;
33
34 //! return total = (qel+cex+abs) cross section
35 inline double getTotalCrossSection () const
36 {
37 return fTotalCrossSection;
38 }
39
40 //! return cex cross section
41 inline double getCexCrossSection () const
42 {
43 return fCexCrossSection;
44 }
45
46 //! return absorption cross section
47 inline double getAbsorptionCrossSection () const
48 {
50 }
51
52 //! return fraction of cex events
53 inline double getCexFraction () const
54 {
56 }
57
58 //! return fraction of absorption events
59 inline double getAbsorptionFraction () const
60 {
62 }
63
64 protected:
65
66 double fNuclearDensity; //!< nuclear density in fm-3
67 double fPionKineticEnergy; //!< pion kinetic energy in MeV
68
69 //! el+cex+abs cross section (averaged over proton / neutron fraction)
71 //! cex cross section (averaged over proton / neutron fraction)
73 //! absorption cross section (averaged over proton / neutron fraction)
75
76 //! number of possible channels: pi+n, pi+p, pi0
77 /*! if (pi0) channel = 2 \n
78 * else channel = [(10 * pip + pim) == (10 * p + n)] \n \n
79 * 0 -> pi+n or pi-p, 1 -> pi+p or pi-n, 2 -> pi0
80 */
81 static const unsigned int fNChannels = 3;
82
83 //! total qel (el+cex) cross section for each channel
85 double fCexCrossSections[fNChannels]; //!< cex cross section for each channel
86
87 //! calculalte cross sections for each channel
88 virtual void setCrossSections () = 0;
89
90 //! calculate avg cross sections according to proton / neutron fraction
91 void setCrossSections (const int &pionPDG,
92 const double &protonFraction);
93};
94
95namespace osetUtils
96{
97 // workaround to get access to last instance
99 // check if double == double with defined accuracy
100 inline bool isEqual (const double &x, const double &y,
101 const double &epsilon)
102 {
103 return std::abs(x - y) < epsilon;
104 }
105 // check if double == double with best accuracy
106 inline bool isEqual (const double &x, const double &y)
107 {
108 static const double epsilon = std::numeric_limits<double>::epsilon();
109 return isEqual (x, y, epsilon);
110 }
111 // x -> variale, a->coefficients
112 inline double quadraticFunction (const double &x, const double *a)
113 {
114 return a[0] * x * x + a[1] * x + a[2];
115 }
116} // namespace osetUtils
117
118#endif // INUKE_OSET_H
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
double getAbsorptionCrossSection() const
return absorption cross section
Definition INukeOset.h:47
double fCexCrossSections[fNChannels]
cex cross section for each channel
Definition INukeOset.h:85
double getCexCrossSection() const
return cex cross section
Definition INukeOset.h:41
double fQelCrossSections[fNChannels]
total qel (el+cex) cross section for each channel
Definition INukeOset.h:84
INukeOset()
contructor
Definition INukeOset.cxx:8
double fAbsorptionCrossSection
absorption cross section (averaged over proton / neutron fraction)
Definition INukeOset.h:74
double fNuclearDensity
nuclear density in fm-3
Definition INukeOset.h:66
double fCexCrossSection
cex cross section (averaged over proton / neutron fraction)
Definition INukeOset.h:72
double getCexFraction() const
return fraction of cex events
Definition INukeOset.h:53
virtual void setCrossSections()=0
calculalte cross sections for each channel
virtual void setupOset(const double &density, const double &pionTk, const int &pionPDG, const double &protonFraction)=0
use to set up Oset class (assign pion Tk, nuclear density etc)
double fTotalCrossSection
el+cex+abs cross section (averaged over proton / neutron fraction)
Definition INukeOset.h:70
double getAbsorptionFraction() const
return fraction of absorption events
Definition INukeOset.h:59
static const unsigned int fNChannels
number of possible channels: pi+n, pi+p, pi0
Definition INukeOset.h:81
double fPionKineticEnergy
pion kinetic energy in MeV
Definition INukeOset.h:67
double getTotalCrossSection() const
return total = (qel+cex+abs) cross section
Definition INukeOset.h:35
const double epsilon
const double a
Basic constants.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
double quadraticFunction(const double &x, const double *a)
Definition INukeOset.h:112
bool isEqual(const double &x, const double &y, const double &epsilon)
Definition INukeOset.h:100
INukeOset * currentInstance
Definition INukeOset.cxx:5