Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::NuclearDensity Class Reference

#include <G4INCLNuclearDensity.hh>

Public Member Functions

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

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.))),
50 theProtonNuclearRadius(ParticleTable::getNuclearRadius(Proton,theA,theZ))
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'
84 << pFromR[DeltaPlusPlus]->print()
85 << '\n'
86 << "Interpolation table for delta+ local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
87 << '\n'
88 << pFromR[DeltaPlus]->print()
89 << '\n'
90 << "Interpolation table for delta0 local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
91 << '\n'
92 << pFromR[DeltaZero]->print()
93 << '\n'
94 << "Interpolation table for delta- local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
95 << '\n'
96 << pFromR[DeltaMinus]->print()
97 << '\n');
98 initializeTransmissionRadii();
99 }
G4double S(G4double temp)
#define INCL_DEBUG(x)
const G4int Z[17]
const G4double A[17]
void print(G4double elem)
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)

◆ ~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 }

◆ 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 }

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; }

◆ getMaximumRadius()

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

Definition at line 78 of file G4INCLNuclearDensity.hh.

78{ return 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 }

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

◆ 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 }

◆ getProtonNuclearRadius()

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

Definition at line 112 of file G4INCLNuclearDensity.hh.

112{ return theProtonNuclearRadius; }

Referenced by G4INCL::ClusteringModelIntercomparison::getCluster().

◆ getS()

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

Get the strange number.

Definition at line 110 of file G4INCLNuclearDensity.hh.

110{ return 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 };

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 };

◆ getZ()

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

Get the charge number.

Definition at line 107 of file G4INCLNuclearDensity.hh.

107{ return theZ; }

◆ 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)

◆ setProtonNuclearRadius()

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

Definition at line 113 of file G4INCLNuclearDensity.hh.

113{ theProtonNuclearRadius = r; }

◆ 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 }

Referenced by operator=().


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