00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #define INCLXX_IN_GEANT4_MODE 1
00034
00035 #include "globals.hh"
00036
00037 #include "G4INCLNuclearDensity.hh"
00038 #include "G4INCLParticleTable.hh"
00039 #include "G4INCLGlobals.hh"
00040 #include <algorithm>
00041
00042 namespace G4INCL {
00043
00044 NuclearDensity::NuclearDensity(G4int A, G4int Z, InverseInterpolationTable *rpCorrelationTable) :
00045 theA(A),
00046 theZ(Z),
00047 theMaximumRadius((*rpCorrelationTable)(1.)),
00048 theNuclearRadius(ParticleTable::getNuclearRadius(theA,theZ)),
00049 rFromP(rpCorrelationTable),
00050
00051
00052 tFromR(new InverseInterpolationTable(rFromP->getNodeValues(), rFromP->getNodeAbscissae()))
00053 {
00054 DEBUG("Interpolation table for local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
00055 << std::endl
00056 << tFromR->print()
00057 << std::endl);
00058 initializeTransmissionRadii();
00059 }
00060
00061 NuclearDensity::~NuclearDensity() {
00062
00063
00064 delete tFromR;
00065 }
00066
00067 NuclearDensity::NuclearDensity(const NuclearDensity &rhs) :
00068 theA(rhs.theA),
00069 theZ(rhs.theZ),
00070 theMaximumRadius(rhs.theMaximumRadius),
00071 theNuclearRadius(rhs.theNuclearRadius),
00072
00073 rFromP(rhs.rFromP),
00074
00075 tFromR(new InverseInterpolationTable(*(rhs.tFromR)))
00076 {
00077 std::copy(rhs.transmissionRadius, rhs.transmissionRadius+UnknownParticle, transmissionRadius);
00078 }
00079
00080 NuclearDensity &NuclearDensity::operator=(const NuclearDensity &rhs) {
00081 NuclearDensity temporaryDensity(rhs);
00082 swap(temporaryDensity);
00083 return *this;
00084 }
00085
00086 void NuclearDensity::swap(NuclearDensity &rhs) {
00087 std::swap(theA, rhs.theA);
00088 std::swap(theZ, rhs.theZ);
00089 std::swap(theMaximumRadius, rhs.theMaximumRadius);
00090 std::swap(theNuclearRadius, rhs.theNuclearRadius);
00091 std::swap_ranges(transmissionRadius, transmissionRadius+UnknownParticle, rhs.transmissionRadius);
00092 std::swap(rFromP, rhs.rFromP);
00093 std::swap(tFromR, rhs.tFromR);
00094 }
00095
00096 void NuclearDensity::initializeTransmissionRadii() {
00097 const G4double theProtonRadius = 0.88;
00098 const G4double theProtonTransmissionRadius = theNuclearRadius + theProtonRadius;
00099
00100 transmissionRadius[Proton] = theProtonTransmissionRadius;
00101 transmissionRadius[PiPlus] = theNuclearRadius;
00102 transmissionRadius[PiMinus] = theNuclearRadius;
00103 transmissionRadius[DeltaPlusPlus] = theProtonTransmissionRadius;
00104 transmissionRadius[DeltaPlus] = theProtonTransmissionRadius;
00105 transmissionRadius[DeltaMinus] = theProtonTransmissionRadius;
00106 transmissionRadius[Composite] = theNuclearRadius;
00107
00108 }
00109
00110 G4double NuclearDensity::getMaxRFromP(G4double p) const {
00111 return (*rFromP)(p);
00112 }
00113
00114 G4double NuclearDensity::getMaxTFromR(G4double r) const {
00115 return (*tFromR)(r);
00116 }
00117
00118 }