GENIEGenerator
Loading...
Searching...
No Matches
INukeOset.cxx
Go to the documentation of this file.
1#include "INukeOset.h"
2#include <cstddef>
3
4// workaround to get access to last instance
6
7//! set up initial density and enegry values; set up pointer to current instance
8INukeOset :: INukeOset () : fNuclearDensity (-1.0), fPionKineticEnergy (-1.0)
9{
11}
12
13void INukeOset :: setCrossSections (const int &pionPDG, const double &protonFraction)
14{
15 if (pionPDG == kPdgPi0)
16 {
19 }
20 else
21 {
22 // set channel for pi on proton and pi on neutron
23 const int channelIndexOnProton = (pionPDG == kPdgPiP); // 0 = pi-, 1 = pi+
24 const int channelIndexOnNeutron = (pionPDG == kPdgPiM); // 0 = pi+, 1 = pi-
25
26 // total xsec = (Z * xsec_proton + (A-Z) * xsec_neutron) / A
27 fCexCrossSection = protonFraction * fCexCrossSections[channelIndexOnProton] +
28 (1.0 - protonFraction) * fCexCrossSections[channelIndexOnNeutron];
29
30 fTotalCrossSection = protonFraction * fQelCrossSections[channelIndexOnProton] +
31 (1.0 - protonFraction) * fQelCrossSections[channelIndexOnNeutron] + fAbsorptionCrossSection;
32 }
33}
double fCexCrossSections[fNChannels]
cex cross section for each channel
Definition INukeOset.h:85
double fQelCrossSections[fNChannels]
total qel (el+cex) cross section for each channel
Definition INukeOset.h:84
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 fTotalCrossSection
el+cex+abs cross section (averaged over proton / neutron fraction)
Definition INukeOset.h:70
double fPionKineticEnergy
pion kinetic energy in MeV
Definition INukeOset.h:67
const int kPdgPiM
Definition PDGCodes.h:159
const int kPdgPi0
Definition PDGCodes.h:160
const int kPdgPiP
Definition PDGCodes.h:158
INukeOset * currentInstance
Definition INukeOset.cxx:5