Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4INCL::NuclearDensity Class Reference

#include <G4INCLNuclearDensity.hh>

Public Member Functions

G4int getA () const
 Get the mass number. More...
 
G4double getMaximumRadius () const
 
G4double getMaxRFromP (const ParticleType t, const G4double p) const
 Get the maximum allowed radius for a given momentum. More...
 
G4double getMinPFromR (const ParticleType t, const G4double r) const
 
G4double getProtonNuclearRadius () const
 
G4int getS () const
 Get the strange number. More...
 
G4double getTransmissionRadius (Particle const *const p) const
 The radius used for calculating the transmission coefficient. More...
 
G4double getTransmissionRadius (ParticleType type) const
 The radius used for calculating the transmission coefficient. More...
 
G4int getZ () const
 Get the charge number. More...
 
 NuclearDensity (const G4int A, const G4int Z, const G4int S, InterpolationTable const *const rpCorrelationTableProton, InterpolationTable const *const rpCorrelationTableNeutron, InterpolationTable const *const rpCorrelationTableLambda)
 
 NuclearDensity (const NuclearDensity &rhs)
 Copy constructor. More...
 
NuclearDensityoperator= (const NuclearDensity &rhs)
 Assignment operator. More...
 
void setProtonNuclearRadius (const G4double r)
 
void swap (NuclearDensity &rhs)
 Helper method for the assignment operator. More...
 
 ~NuclearDensity ()
 

Private Member Functions

void initializeTransmissionRadii ()
 Initialize the transmission radius. More...
 

Private Attributes

InterpolationTable const * pFromR [UnknownParticle]
 
InterpolationTable const * rFromP [UnknownParticle]
 
G4int theA
 
G4double theMaximumRadius
 
G4double theProtonNuclearRadius
 Represents INCL4.5's R0 variable. More...
 
G4int theS
 
G4int theZ
 
G4double transmissionRadius [UnknownParticle]
 

Detailed Description

Definition at line 54 of file G4INCLNuclearDensity.hh.

Constructor & Destructor Documentation

◆ NuclearDensity() [1/2]

G4INCL::NuclearDensity::NuclearDensity ( const G4int  A,
const G4int  Z,
const G4int  S,
InterpolationTable const *const  rpCorrelationTableProton,
InterpolationTable const *const  rpCorrelationTableNeutron,
InterpolationTable const *const  rpCorrelationTableLambda 
)

Definition at line 45 of file G4INCLNuclearDensity.cc.

45 :
46 theA(A),
47 theZ(Z),
48 theS(S),
49 theMaximumRadius(std::min((*rpCorrelationTableProton)(1.), (*rpCorrelationTableNeutron)(1.))),
51 {
52 std::fill(rFromP, rFromP + UnknownParticle, static_cast<InterpolationTable*>(NULL));
53 rFromP[Proton] = rpCorrelationTableProton;
54 rFromP[Neutron] = rpCorrelationTableNeutron;
55 rFromP[Lambda] = rpCorrelationTableLambda;
56 rFromP[DeltaPlusPlus] = rpCorrelationTableProton;
57 rFromP[DeltaPlus] = rpCorrelationTableProton;
58 rFromP[DeltaZero] = rpCorrelationTableNeutron;
59 rFromP[DeltaMinus] = rpCorrelationTableNeutron;
60 // The interpolation table for local-energy look-ups is simply obtained by
61 // inverting the r-p correlation table.
62 std::fill(pFromR, pFromR + UnknownParticle, static_cast<InterpolationTable*>(NULL));
63 pFromR[Proton] = new InterpolationTable(rFromP[Proton]->getNodeValues(), rFromP[Proton]->getNodeAbscissae());
64 pFromR[Neutron] = new InterpolationTable(rFromP[Neutron]->getNodeValues(), rFromP[Neutron]->getNodeAbscissae());
65 pFromR[Lambda] = new InterpolationTable(rFromP[Lambda]->getNodeValues(), rFromP[Lambda]->getNodeAbscissae());
66 pFromR[DeltaPlusPlus] = new InterpolationTable(rFromP[DeltaPlusPlus]->getNodeValues(), rFromP[DeltaPlusPlus]->getNodeAbscissae());
67 pFromR[DeltaPlus] = new InterpolationTable(rFromP[DeltaPlus]->getNodeValues(), rFromP[DeltaPlus]->getNodeAbscissae());
68 pFromR[DeltaZero] = new InterpolationTable(rFromP[DeltaZero]->getNodeValues(), rFromP[DeltaZero]->getNodeAbscissae());
69 pFromR[DeltaMinus] = new InterpolationTable(rFromP[DeltaMinus]->getNodeValues(), rFromP[DeltaMinus]->getNodeAbscissae());
70 INCL_DEBUG("Interpolation table for proton local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
71 << '\n'
72 << pFromR[Proton]->print()
73 << '\n'
74 << "Interpolation table for neutron local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
75 << '\n'
76 << pFromR[Neutron]->print()
77 << '\n'
78 << "Interpolation table for lambda local energy (A=" << theA << ", Z=" << theZ << ", S=" << theS << ") initialised:"
79 << '\n'
80 << pFromR[Lambda]->print()
81 << '\n'
82 << "Interpolation table for delta++ local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
83 << '\n'
85 << '\n'
86 << "Interpolation table for delta+ local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
87 << '\n'
89 << '\n'
90 << "Interpolation table for delta0 local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
91 << '\n'
93 << '\n'
94 << "Interpolation table for delta- local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
95 << '\n'
97 << '\n');
99 }
G4double S(G4double temp)
#define INCL_DEBUG(x)
const G4int Z[17]
const G4double A[17]
void print(G4double elem)
InterpolationTable const * rFromP[UnknownParticle]
InterpolationTable const * pFromR[UnknownParticle]
G4double theProtonNuclearRadius
Represents INCL4.5's R0 variable.
void initializeTransmissionRadii()
Initialize the transmission radius.
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)

References G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, INCL_DEBUG, initializeTransmissionRadii(), G4INCL::Lambda, G4INCL::Neutron, pFromR, print(), G4INCL::Proton, rFromP, theA, theS, theZ, and G4INCL::UnknownParticle.

◆ ~NuclearDensity()

G4INCL::NuclearDensity::~NuclearDensity ( )

Definition at line 101 of file G4INCLNuclearDensity.cc.

101 {
102 // We don't delete the rFromP tables, which are cached in the
103 // NuclearDensityFactory
104 delete pFromR[Proton];
105 delete pFromR[Neutron];
106 delete pFromR[Lambda];
107 delete pFromR[DeltaPlusPlus];
108 delete pFromR[DeltaPlus];
109 delete pFromR[DeltaZero];
110 delete pFromR[DeltaMinus];
111 }

References G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, G4INCL::Lambda, G4INCL::Neutron, pFromR, and G4INCL::Proton.

◆ NuclearDensity() [2/2]

G4INCL::NuclearDensity::NuclearDensity ( const NuclearDensity rhs)

Copy constructor.

Definition at line 113 of file G4INCLNuclearDensity.cc.

113 :
114 theA(rhs.theA),
115 theZ(rhs.theZ),
116 theS(rhs.theS),
117 theMaximumRadius(rhs.theMaximumRadius),
118 theProtonNuclearRadius(rhs.theProtonNuclearRadius)
119 {
120 // rFromP is owned by NuclearDensityFactory, so shallow copy is sufficient
121 std::fill(rFromP, rFromP + UnknownParticle, static_cast<InterpolationTable*>(NULL));
122 rFromP[Proton] = rhs.rFromP[Proton];
123 rFromP[Neutron] = rhs.rFromP[Neutron];
124 rFromP[Lambda] = rhs.rFromP[Lambda];
125 rFromP[DeltaPlusPlus] = rhs.rFromP[DeltaPlusPlus];
126 rFromP[DeltaPlus] = rhs.rFromP[DeltaPlus];
127 rFromP[DeltaZero] = rhs.rFromP[DeltaZero];
128 rFromP[DeltaMinus] = rhs.rFromP[DeltaMinus];
129 // deep copy for pFromR
130 std::fill(pFromR, pFromR + UnknownParticle, static_cast<InterpolationTable*>(NULL));
131 pFromR[Proton] = new InterpolationTable(*(rhs.pFromR[Proton]));
132 pFromR[Neutron] = new InterpolationTable(*(rhs.pFromR[Neutron]));
133 pFromR[Lambda] = new InterpolationTable(*(rhs.pFromR[Lambda]));
134 pFromR[DeltaPlusPlus] = new InterpolationTable(*(rhs.pFromR[DeltaPlusPlus]));
135 pFromR[DeltaPlus] = new InterpolationTable(*(rhs.pFromR[DeltaPlus]));
136 pFromR[DeltaZero] = new InterpolationTable(*(rhs.pFromR[DeltaZero]));
137 pFromR[DeltaMinus] = new InterpolationTable(*(rhs.pFromR[DeltaMinus]));
138 std::copy(rhs.transmissionRadius, rhs.transmissionRadius+UnknownParticle, transmissionRadius);
139 }
G4double transmissionRadius[UnknownParticle]
void copy(G4double dst[], const G4double src[], size_t size=G4FieldTrack::ncompSVEC)
Definition: G4FieldUtils.cc:98

References field_utils::copy(), G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, G4INCL::Lambda, G4INCL::Neutron, pFromR, G4INCL::Proton, rFromP, transmissionRadius, and G4INCL::UnknownParticle.

Member Function Documentation

◆ getA()

G4int G4INCL::NuclearDensity::getA ( ) const
inline

Get the mass number.

Definition at line 104 of file G4INCLNuclearDensity.hh.

104{ return theA; }

References theA.

◆ getMaximumRadius()

G4double G4INCL::NuclearDensity::getMaximumRadius ( ) const
inline

Definition at line 78 of file G4INCLNuclearDensity.hh.

78{ return theMaximumRadius; };

References theMaximumRadius.

Referenced by G4INCL::Nucleus::Nucleus().

◆ getMaxRFromP()

G4double G4INCL::NuclearDensity::getMaxRFromP ( const ParticleType  t,
const G4double  p 
) const

Get the maximum allowed radius for a given momentum.

Parameters
ttype of the particle
pabsolute value of the particle momentum, divided by the relevant Fermi momentum.
Returns
maximum allowed radius.

Definition at line 188 of file G4INCLNuclearDensity.cc.

188 {
189// assert(t==Proton || t==Neutron || t==Lambda || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
190 return (*(rFromP[t]))(p);
191 }

References rFromP.

Referenced by G4INCL::Nucleus::getSurfaceRadius(), G4INCL::ParticleSampler::sampleOneParticleWithFuzzyRPCorrelation(), and G4INCL::ParticleSampler::sampleOneParticleWithRPCorrelation().

◆ getMinPFromR()

G4double G4INCL::NuclearDensity::getMinPFromR ( const ParticleType  t,
const G4double  r 
) const

Definition at line 193 of file G4INCLNuclearDensity.cc.

193 {
194// assert(t==Proton || t==Neutron || t==Lambda || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
195 return (*(pFromR[t]))(r);
196 }

References pFromR.

◆ getProtonNuclearRadius()

G4double G4INCL::NuclearDensity::getProtonNuclearRadius ( ) const
inline

◆ getS()

G4int G4INCL::NuclearDensity::getS ( ) const
inline

Get the strange number.

Definition at line 110 of file G4INCLNuclearDensity.hh.

110{ return theS; }

References theS.

◆ getTransmissionRadius() [1/2]

G4double G4INCL::NuclearDensity::getTransmissionRadius ( Particle const *const  p) const
inline

The radius used for calculating the transmission coefficient.

Returns
the radius

Definition at line 84 of file G4INCLNuclearDensity.hh.

84 {
85 const ParticleType t = p->getType();
86// assert(t!=Neutron && t!=PiZero && t!=DeltaZero && t!=Eta && t!=Omega && t!=EtaPrime && t!=Photon && t!= Lambda && t!=SigmaZero && t!=KZero && t!=KZeroBar && t!=KShort && t!=KLong); // no neutral particles here
87 if(t==Composite) {
88 return transmissionRadius[t] +
89 ParticleTable::getNuclearRadius(t, p->getA(), p->getZ());
90 } else
91 return transmissionRadius[t];
92 };

References G4INCL::Composite, G4INCL::Particle::getA(), G4INCL::ParticleTable::getNuclearRadius(), G4INCL::Particle::getType(), G4INCL::Particle::getZ(), and transmissionRadius.

Referenced by G4INCL::CoulombNonRelativistic::distortOut(), and G4INCL::Nucleus::getTransmissionBarrier().

◆ getTransmissionRadius() [2/2]

G4double G4INCL::NuclearDensity::getTransmissionRadius ( ParticleType  type) const
inline

The radius used for calculating the transmission coefficient.

Returns
the radius

Definition at line 98 of file G4INCLNuclearDensity.hh.

98 {
99// assert(type!=Composite);
100 return transmissionRadius[type];
101 };

References transmissionRadius.

◆ getZ()

G4int G4INCL::NuclearDensity::getZ ( ) const
inline

Get the charge number.

Definition at line 107 of file G4INCLNuclearDensity.hh.

107{ return theZ; }

References theZ.

◆ initializeTransmissionRadii()

void G4INCL::NuclearDensity::initializeTransmissionRadii ( )
private

Initialize the transmission radius.

Definition at line 169 of file G4INCLNuclearDensity.cc.

169 {
170 const G4double theProtonRadius = 0.88; // fm
171 const G4double theProtonTransmissionRadius = theProtonNuclearRadius + theProtonRadius;
172
173 transmissionRadius[Proton] = theProtonTransmissionRadius;
176 transmissionRadius[DeltaPlusPlus] = theProtonTransmissionRadius;
177 transmissionRadius[DeltaPlus] = theProtonTransmissionRadius;
178 transmissionRadius[DeltaMinus] = theProtonTransmissionRadius;
180 transmissionRadius[SigmaPlus] = theProtonTransmissionRadius;
181 transmissionRadius[SigmaMinus] = theProtonTransmissionRadius;
184
185 // transmission radii for neutral particles intentionally left uninitialised
186 }
double G4double
Definition: G4Types.hh:83

References G4INCL::Composite, G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::KMinus, G4INCL::KPlus, G4INCL::PiMinus, G4INCL::PiPlus, G4INCL::Proton, G4INCL::SigmaMinus, G4INCL::SigmaPlus, theProtonNuclearRadius, and transmissionRadius.

Referenced by NuclearDensity().

◆ operator=()

NuclearDensity & G4INCL::NuclearDensity::operator= ( const NuclearDensity rhs)

Assignment operator.

Definition at line 141 of file G4INCLNuclearDensity.cc.

141 {
142 NuclearDensity temporaryDensity(rhs);
143 swap(temporaryDensity);
144 return *this;
145 }
void swap(NuclearDensity &rhs)
Helper method for the assignment operator.
NuclearDensity(const G4int A, const G4int Z, const G4int S, InterpolationTable const *const rpCorrelationTableProton, InterpolationTable const *const rpCorrelationTableNeutron, InterpolationTable const *const rpCorrelationTableLambda)

References swap().

◆ setProtonNuclearRadius()

void G4INCL::NuclearDensity::setProtonNuclearRadius ( const G4double  r)
inline

Definition at line 113 of file G4INCLNuclearDensity.hh.

References theProtonNuclearRadius.

◆ swap()

void G4INCL::NuclearDensity::swap ( NuclearDensity rhs)

Helper method for the assignment operator.

Definition at line 147 of file G4INCLNuclearDensity.cc.

147 {
148 std::swap(theA, rhs.theA);
149 std::swap(theZ, rhs.theZ);
150 std::swap(theS, rhs.theS);
151 std::swap(theMaximumRadius, rhs.theMaximumRadius);
152 std::swap(theProtonNuclearRadius, rhs.theProtonNuclearRadius);
153 std::swap_ranges(transmissionRadius, transmissionRadius+UnknownParticle, rhs.transmissionRadius);
154 std::swap(rFromP[Proton], rhs.rFromP[Proton]);
155 std::swap(rFromP[Neutron], rhs.rFromP[Neutron]);
156 std::swap(rFromP[Lambda], rhs.rFromP[Lambda]);
157 std::swap(rFromP[DeltaPlusPlus], rhs.rFromP[DeltaPlusPlus]);
158 std::swap(rFromP[DeltaPlus], rhs.rFromP[DeltaPlus]);
159 std::swap(rFromP[DeltaZero], rhs.rFromP[DeltaZero]);
160 std::swap(rFromP[DeltaMinus], rhs.rFromP[DeltaMinus]);
161 std::swap(pFromR[Proton], rhs.pFromR[Proton]);
162 std::swap(pFromR[Neutron], rhs.pFromR[Neutron]);
163 std::swap(pFromR[DeltaPlusPlus], rhs.pFromR[DeltaPlusPlus]);
164 std::swap(pFromR[DeltaPlus], rhs.pFromR[DeltaPlus]);
165 std::swap(pFromR[DeltaZero], rhs.pFromR[DeltaZero]);
166 std::swap(pFromR[DeltaMinus], rhs.pFromR[DeltaMinus]);
167 }

References G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, G4INCL::Lambda, G4INCL::Neutron, pFromR, G4INCL::Proton, rFromP, theA, theMaximumRadius, theProtonNuclearRadius, theS, theZ, transmissionRadius, and G4INCL::UnknownParticle.

Referenced by operator=().

Field Documentation

◆ pFromR

InterpolationTable const* G4INCL::NuclearDensity::pFromR[UnknownParticle]
private

Definition at line 129 of file G4INCLNuclearDensity.hh.

Referenced by getMinPFromR(), NuclearDensity(), swap(), and ~NuclearDensity().

◆ rFromP

InterpolationTable const* G4INCL::NuclearDensity::rFromP[UnknownParticle]
private

Definition at line 128 of file G4INCLNuclearDensity.hh.

Referenced by getMaxRFromP(), NuclearDensity(), and swap().

◆ theA

G4int G4INCL::NuclearDensity::theA
private

Definition at line 120 of file G4INCLNuclearDensity.hh.

Referenced by getA(), NuclearDensity(), and swap().

◆ theMaximumRadius

G4double G4INCL::NuclearDensity::theMaximumRadius
private

Definition at line 121 of file G4INCLNuclearDensity.hh.

Referenced by getMaximumRadius(), and swap().

◆ theProtonNuclearRadius

G4double G4INCL::NuclearDensity::theProtonNuclearRadius
private

Represents INCL4.5's R0 variable.

Definition at line 123 of file G4INCLNuclearDensity.hh.

Referenced by getProtonNuclearRadius(), initializeTransmissionRadii(), setProtonNuclearRadius(), and swap().

◆ theS

G4int G4INCL::NuclearDensity::theS
private

Definition at line 120 of file G4INCLNuclearDensity.hh.

Referenced by getS(), NuclearDensity(), and swap().

◆ theZ

G4int G4INCL::NuclearDensity::theZ
private

Definition at line 120 of file G4INCLNuclearDensity.hh.

Referenced by getZ(), NuclearDensity(), and swap().

◆ transmissionRadius

G4double G4INCL::NuclearDensity::transmissionRadius[UnknownParticle]
private

The documentation for this class was generated from the following files: