Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4INCL::NuclearDensity Class Reference

#include <G4INCLNuclearDensity.hh>

Public Member Functions

 NuclearDensity (const G4int A, const G4int Z, InverseInterpolationTable const *const rpCorrelationTableProton, InverseInterpolationTable const *const rpCorrelationTableNeutron)
 
 ~NuclearDensity ()
 
 NuclearDensity (const NuclearDensity &rhs)
 Copy constructor. More...
 
NuclearDensityoperator= (const NuclearDensity &rhs)
 Assignment operator. More...
 
void swap (NuclearDensity &rhs)
 Helper method for the assignment operator. More...
 
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 getMaximumRadius () const
 
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 getA () const
 Get the mass number. More...
 
G4int getZ () const
 Get the charge number. More...
 
G4double getProtonNuclearRadius () const
 
void setProtonNuclearRadius (const G4double r)
 

Detailed Description

Definition at line 53 of file G4INCLNuclearDensity.hh.

Constructor & Destructor Documentation

G4INCL::NuclearDensity::NuclearDensity ( const G4int  A,
const G4int  Z,
InverseInterpolationTable const *const  rpCorrelationTableProton,
InverseInterpolationTable const *const  rpCorrelationTableNeutron 
)

Definition at line 44 of file G4INCLNuclearDensity.cc.

References G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, INCL_DEBUG, G4INCL::Neutron, print(), G4INCL::Proton, and G4INCL::UnknownParticle.

44  :
45  theA(A),
46  theZ(Z),
47  theMaximumRadius(std::min((*rpCorrelationTableProton)(1.), (*rpCorrelationTableNeutron)(1.))),
48  theProtonNuclearRadius(ParticleTable::getNuclearRadius(Proton,theA,theZ))
49  {
50  std::fill(rFromP, rFromP + UnknownParticle, static_cast<InverseInterpolationTable*>(NULL));
51  rFromP[Proton] = rpCorrelationTableProton;
52  rFromP[Neutron] = rpCorrelationTableNeutron;
53  rFromP[DeltaPlusPlus] = rpCorrelationTableProton;
54  rFromP[DeltaPlus] = rpCorrelationTableProton;
55  rFromP[DeltaZero] = rpCorrelationTableNeutron;
56  rFromP[DeltaMinus] = rpCorrelationTableNeutron;
57  // The interpolation table for local-energy look-ups is simply obtained by
58  // inverting the r-p correlation table.
59  std::fill(pFromR, pFromR + UnknownParticle, static_cast<InverseInterpolationTable*>(NULL));
60  pFromR[Proton] = new InverseInterpolationTable(rFromP[Proton]->getNodeValues(), rFromP[Proton]->getNodeAbscissae());
61  pFromR[Neutron] = new InverseInterpolationTable(rFromP[Neutron]->getNodeValues(), rFromP[Neutron]->getNodeAbscissae());
62  pFromR[DeltaPlusPlus] = new InverseInterpolationTable(rFromP[DeltaPlusPlus]->getNodeValues(), rFromP[DeltaPlusPlus]->getNodeAbscissae());
63  pFromR[DeltaPlus] = new InverseInterpolationTable(rFromP[DeltaPlus]->getNodeValues(), rFromP[DeltaPlus]->getNodeAbscissae());
64  pFromR[DeltaZero] = new InverseInterpolationTable(rFromP[DeltaZero]->getNodeValues(), rFromP[DeltaZero]->getNodeAbscissae());
65  pFromR[DeltaMinus] = new InverseInterpolationTable(rFromP[DeltaMinus]->getNodeValues(), rFromP[DeltaMinus]->getNodeAbscissae());
66  INCL_DEBUG("Interpolation table for proton local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
67  << std::endl
68  << pFromR[Proton]->print()
69  << std::endl
70  << "Interpolation table for neutron local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
71  << std::endl
72  << pFromR[Neutron]->print()
73  << std::endl
74  << "Interpolation table for delta++ local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
75  << std::endl
76  << pFromR[DeltaPlusPlus]->print()
77  << std::endl
78  << "Interpolation table for delta+ local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
79  << std::endl
80  << pFromR[DeltaPlus]->print()
81  << std::endl
82  << "Interpolation table for delta0 local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
83  << std::endl
84  << pFromR[DeltaZero]->print()
85  << std::endl
86  << "Interpolation table for delta- local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
87  << std::endl
88  << pFromR[DeltaMinus]->print()
89  << std::endl);
90  initializeTransmissionRadii();
91  }
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void print(const std::vector< T > &data)
Definition: DicomRun.hh:111
#define INCL_DEBUG(x)
G4INCL::NuclearDensity::~NuclearDensity ( )

Definition at line 93 of file G4INCLNuclearDensity.cc.

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

93  {
94  // We don't delete the rFromP tables, which are cached in the
95  // NuclearDensityFactory
96  delete pFromR[Proton];
97  delete pFromR[Neutron];
98  delete pFromR[DeltaPlusPlus];
99  delete pFromR[DeltaPlus];
100  delete pFromR[DeltaZero];
101  delete pFromR[DeltaMinus];
102  }
G4INCL::NuclearDensity::NuclearDensity ( const NuclearDensity rhs)

Copy constructor.

Definition at line 104 of file G4INCLNuclearDensity.cc.

References copy(), G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, G4INCL::Neutron, G4INCL::Proton, and G4INCL::UnknownParticle.

104  :
105  theA(rhs.theA),
106  theZ(rhs.theZ),
107  theMaximumRadius(rhs.theMaximumRadius),
108  theProtonNuclearRadius(rhs.theProtonNuclearRadius)
109  {
110  // rFromP is owned by NuclearDensityFactory, so shallow copy is sufficient
111  std::fill(rFromP, rFromP + UnknownParticle, static_cast<InverseInterpolationTable*>(NULL));
112  rFromP[Proton] = rhs.rFromP[Proton];
113  rFromP[Neutron] = rhs.rFromP[Neutron];
114  rFromP[DeltaPlusPlus] = rhs.rFromP[DeltaPlusPlus];
115  rFromP[DeltaPlus] = rhs.rFromP[DeltaPlus];
116  rFromP[DeltaZero] = rhs.rFromP[DeltaZero];
117  rFromP[DeltaMinus] = rhs.rFromP[DeltaMinus];
118  // deep copy for pFromR
119  std::fill(pFromR, pFromR + UnknownParticle, static_cast<InverseInterpolationTable*>(NULL));
120  pFromR[Proton] = new InverseInterpolationTable(*(rhs.pFromR[Proton]));
121  pFromR[Neutron] = new InverseInterpolationTable(*(rhs.pFromR[Neutron]));
122  pFromR[DeltaPlusPlus] = new InverseInterpolationTable(*(rhs.pFromR[DeltaPlusPlus]));
123  pFromR[DeltaPlus] = new InverseInterpolationTable(*(rhs.pFromR[DeltaPlus]));
124  pFromR[DeltaZero] = new InverseInterpolationTable(*(rhs.pFromR[DeltaZero]));
125  pFromR[DeltaMinus] = new InverseInterpolationTable(*(rhs.pFromR[DeltaMinus]));
126  std::copy(rhs.transmissionRadius, rhs.transmissionRadius+UnknownParticle, transmissionRadius);
127  }
void copy(std::vector< T > &main, const std::vector< T > &data)
Definition: DicomRun.hh:91

Member Function Documentation

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

Get the mass number.

Definition at line 103 of file G4INCLNuclearDensity.hh.

103 { return theA; }
G4double G4INCL::NuclearDensity::getMaximumRadius ( ) const
inline

Definition at line 77 of file G4INCLNuclearDensity.hh.

Referenced by G4INCL::KinematicsUtils::getLocalEnergy().

77 { return theMaximumRadius; };
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 169 of file G4INCLNuclearDensity.cc.

Referenced by G4INCL::KinematicsUtils::getLocalEnergy(), and G4INCL::Nucleus::getSurfaceRadius().

169  {
170 // assert(t==Proton || t==Neutron || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
171  return (*(rFromP[t]))(p);
172  }
const char * p
Definition: xmltok.h:285
G4double G4INCL::NuclearDensity::getMinPFromR ( const ParticleType  t,
const G4double  r 
) const

Definition at line 174 of file G4INCLNuclearDensity.cc.

Referenced by G4INCL::KinematicsUtils::getLocalEnergy().

174  {
175 // assert(t==Proton || t==Neutron || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
176  return (*(pFromR[t]))(r);
177  }
G4double G4INCL::NuclearDensity::getProtonNuclearRadius ( ) const
inline

Definition at line 108 of file G4INCLNuclearDensity.hh.

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

108 { return theProtonNuclearRadius; }
G4double G4INCL::NuclearDensity::getTransmissionRadius ( Particle const *const  p) const
inline

The radius used for calculating the transmission coefficient.

Returns
the radius

Definition at line 83 of file G4INCLNuclearDensity.hh.

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

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

83  {
84  const ParticleType t = p->getType();
85 // assert(t!=Neutron && t!=PiZero && t!=DeltaZero); // no neutral particles here
86  if(t==Composite) {
87  return transmissionRadius[t] +
88  ParticleTable::getNuclearRadius(t, p->getA(), p->getZ());
89  } else
90  return transmissionRadius[t];
91  };
const char * p
Definition: xmltok.h:285
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
G4double G4INCL::NuclearDensity::getTransmissionRadius ( ParticleType  type) const
inline

The radius used for calculating the transmission coefficient.

Returns
the radius

Definition at line 97 of file G4INCLNuclearDensity.hh.

97  {
98 // assert(type!=Composite);
99  return transmissionRadius[type];
100  };
G4int G4INCL::NuclearDensity::getZ ( ) const
inline

Get the charge number.

Definition at line 106 of file G4INCLNuclearDensity.hh.

106 { return theZ; }
NuclearDensity & G4INCL::NuclearDensity::operator= ( const NuclearDensity rhs)

Assignment operator.

Definition at line 129 of file G4INCLNuclearDensity.cc.

References swap().

129  {
130  NuclearDensity temporaryDensity(rhs);
131  swap(temporaryDensity);
132  return *this;
133  }
NuclearDensity(const G4int A, const G4int Z, InverseInterpolationTable const *const rpCorrelationTableProton, InverseInterpolationTable const *const rpCorrelationTableNeutron)
void swap(NuclearDensity &rhs)
Helper method for the assignment operator.
void G4INCL::NuclearDensity::setProtonNuclearRadius ( const G4double  r)
inline

Definition at line 109 of file G4INCLNuclearDensity.hh.

109 { theProtonNuclearRadius = r; }
void G4INCL::NuclearDensity::swap ( NuclearDensity rhs)

Helper method for the assignment operator.

Definition at line 135 of file G4INCLNuclearDensity.cc.

References G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, G4INCL::Neutron, G4INCL::Proton, CLHEP::swap(), and G4INCL::UnknownParticle.

Referenced by operator=().

135  {
136  std::swap(theA, rhs.theA);
137  std::swap(theZ, rhs.theZ);
138  std::swap(theMaximumRadius, rhs.theMaximumRadius);
139  std::swap(theProtonNuclearRadius, rhs.theProtonNuclearRadius);
140  std::swap_ranges(transmissionRadius, transmissionRadius+UnknownParticle, rhs.transmissionRadius);
141  std::swap(rFromP[Proton], rhs.rFromP[Proton]);
142  std::swap(rFromP[Neutron], rhs.rFromP[Neutron]);
143  std::swap(rFromP[DeltaPlusPlus], rhs.rFromP[DeltaPlusPlus]);
144  std::swap(rFromP[DeltaPlus], rhs.rFromP[DeltaPlus]);
145  std::swap(rFromP[DeltaZero], rhs.rFromP[DeltaZero]);
146  std::swap(rFromP[DeltaMinus], rhs.rFromP[DeltaMinus]);
147  std::swap(pFromR[Proton], rhs.pFromR[Proton]);
148  std::swap(pFromR[Neutron], rhs.pFromR[Neutron]);
149  std::swap(pFromR[DeltaPlusPlus], rhs.pFromR[DeltaPlusPlus]);
150  std::swap(pFromR[DeltaPlus], rhs.pFromR[DeltaPlus]);
151  std::swap(pFromR[DeltaZero], rhs.pFromR[DeltaZero]);
152  std::swap(pFromR[DeltaMinus], rhs.pFromR[DeltaMinus]);
153  }
void swap(shared_ptr< P > &, shared_ptr< P > &)
Definition: memory.h:1247

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