34 #define INCLXX_IN_GEANT4_MODE 1
48 theMaximumRadius(std::
min((*rpCorrelationTableProton)(1.), (*rpCorrelationTableNeutron)(1.))),
51 std::fill(rFromP, rFromP +
UnknownParticle, static_cast<InterpolationTable*>(NULL));
52 rFromP[
Proton] = rpCorrelationTableProton;
53 rFromP[
Neutron] = rpCorrelationTableNeutron;
55 rFromP[
DeltaPlus] = rpCorrelationTableProton;
56 rFromP[
DeltaZero] = rpCorrelationTableNeutron;
57 rFromP[
DeltaMinus] = rpCorrelationTableNeutron;
60 std::fill(pFromR, pFromR +
UnknownParticle, static_cast<InterpolationTable*>(NULL));
67 INCL_DEBUG(
"Interpolation table for proton local energy (A=" << theA <<
", Z=" << theZ <<
") initialised:"
71 <<
"Interpolation table for neutron local energy (A=" << theA <<
", Z=" << theZ <<
") initialised:"
75 <<
"Interpolation table for delta++ local energy (A=" << theA <<
", Z=" << theZ <<
") initialised:"
79 <<
"Interpolation table for delta+ local energy (A=" << theA <<
", Z=" << theZ <<
") initialised:"
83 <<
"Interpolation table for delta0 local energy (A=" << theA <<
", Z=" << theZ <<
") initialised:"
87 <<
"Interpolation table for delta- local energy (A=" << theA <<
", Z=" << theZ <<
") initialised:"
91 initializeTransmissionRadii();
108 theMaximumRadius(rhs.theMaximumRadius),
109 theProtonNuclearRadius(rhs.theProtonNuclearRadius)
112 std::fill(rFromP, rFromP +
UnknownParticle, static_cast<InterpolationTable*>(NULL));
120 std::fill(pFromR, pFromR +
UnknownParticle, static_cast<InterpolationTable*>(NULL));
127 std::copy(rhs.transmissionRadius, rhs.transmissionRadius+
UnknownParticle, transmissionRadius);
132 swap(temporaryDensity);
137 std::swap(theA, rhs.theA);
138 std::swap(theZ, rhs.theZ);
139 std::swap(theMaximumRadius, rhs.theMaximumRadius);
140 std::swap(theProtonNuclearRadius, rhs.theProtonNuclearRadius);
141 std::swap_ranges(transmissionRadius, transmissionRadius+
UnknownParticle, rhs.transmissionRadius);
142 std::swap(rFromP[
Proton], rhs.rFromP[Proton]);
143 std::swap(rFromP[
Neutron], rhs.rFromP[Neutron]);
145 std::swap(rFromP[
DeltaPlus], rhs.rFromP[DeltaPlus]);
146 std::swap(rFromP[
DeltaZero], rhs.rFromP[DeltaZero]);
147 std::swap(rFromP[
DeltaMinus], rhs.rFromP[DeltaMinus]);
148 std::swap(pFromR[Proton], rhs.pFromR[Proton]);
149 std::swap(pFromR[Neutron], rhs.pFromR[Neutron]);
150 std::swap(pFromR[DeltaPlusPlus], rhs.pFromR[DeltaPlusPlus]);
151 std::swap(pFromR[DeltaPlus], rhs.pFromR[DeltaPlus]);
152 std::swap(pFromR[DeltaZero], rhs.pFromR[DeltaZero]);
153 std::swap(pFromR[DeltaMinus], rhs.pFromR[DeltaMinus]);
156 void NuclearDensity::initializeTransmissionRadii() {
157 const G4double theProtonRadius = 0.88;
158 const G4double theProtonTransmissionRadius = theProtonNuclearRadius + theProtonRadius;
160 transmissionRadius[
Proton] = theProtonTransmissionRadius;
161 transmissionRadius[
PiPlus] = theProtonNuclearRadius;
162 transmissionRadius[
PiMinus] = theProtonNuclearRadius;
163 transmissionRadius[
DeltaPlusPlus] = theProtonTransmissionRadius;
164 transmissionRadius[
DeltaPlus] = theProtonTransmissionRadius;
165 transmissionRadius[
DeltaMinus] = theProtonTransmissionRadius;
166 transmissionRadius[
Composite] = theProtonNuclearRadius;
172 return (*(rFromP[t]))(
p);
177 return (*(pFromR[t]))(r);
G4double getMinPFromR(const ParticleType t, const G4double r) const
NuclearDensity & operator=(const NuclearDensity &rhs)
Assignment operator.
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
double A(double temperature)
void print(G4double elem)
void swap(NuclearDensity &rhs)
Helper method for the assignment operator.
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
Class for interpolating the of a 1-dimensional function.
G4double getMaxRFromP(const ParticleType t, const G4double p) const
Get the maximum allowed radius for a given momentum.
NuclearDensity(const G4int A, const G4int Z, InterpolationTable const *const rpCorrelationTableProton, InterpolationTable const *const rpCorrelationTableNeutron)