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
8 INukeOset :: INukeOset () : fNuclearDensity (-1.0), fPionKineticEnergy (-1.0)
9 {
10  osetUtils::currentInstance = this;
11 }
12 
13 void 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 }
INukeOset * currentInstance
Definition: INukeOset.cxx:5
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 fCexCrossSections[fNChannels]
cex cross section for each channel
Definition: INukeOset.h:85
double fAbsorptionCrossSection
absorption cross section (averaged over proton / neutron fraction)
Definition: INukeOset.h:74
double fQelCrossSections[fNChannels]
total qel (el+cex) cross section for each channel
Definition: INukeOset.h:84
const int kPdgPiP
Definition: PDGCodes.h:135
const int kPdgPi0
Definition: PDGCodes.h:137
virtual void setCrossSections()=0
calculalte cross sections for each channel
const int kPdgPiM
Definition: PDGCodes.h:136
INukeOset()
contructor
Definition: INukeOset.cxx:8