Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4INCL::NuclearDensity Class Reference

#include <G4INCLNuclearDensity.hh>

Public Member Functions

 NuclearDensity (const G4int A, const G4int Z, InterpolationTable const *const rpCorrelationTableProton, InterpolationTable 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 54 of file G4INCLNuclearDensity.hh.

Constructor & Destructor Documentation

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

Definition at line 45 of file G4INCLNuclearDensity.cc.

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

Here is the call graph for this function:

G4INCL::NuclearDensity::~NuclearDensity ( )

Definition at line 94 of file G4INCLNuclearDensity.cc.

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

Copy constructor.

Definition at line 105 of file G4INCLNuclearDensity.cc.

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

Member Function Documentation

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

Get the mass number.

Definition at line 104 of file G4INCLNuclearDensity.hh.

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

Definition at line 78 of file G4INCLNuclearDensity.hh.

78 { return theMaximumRadius; };

Here is the caller graph for this function:

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 170 of file G4INCLNuclearDensity.cc.

170  {
171 // assert(t==Proton || t==Neutron || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
172  return (*(rFromP[t]))(p);
173  }
const char * p
Definition: xmltok.h:285

Here is the caller graph for this function:

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

Definition at line 175 of file G4INCLNuclearDensity.cc.

175  {
176 // assert(t==Proton || t==Neutron || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
177  return (*(pFromR[t]))(r);
178  }

Here is the caller graph for this function:

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

Definition at line 109 of file G4INCLNuclearDensity.hh.

109 { return theProtonNuclearRadius; }

Here is the caller graph for this function:

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); // 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  };
const char * p
Definition: xmltok.h:285
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)

Here is the call graph for this function:

Here is the caller graph for this function:

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  };
G4int G4INCL::NuclearDensity::getZ ( ) const
inline

Get the charge number.

Definition at line 107 of file G4INCLNuclearDensity.hh.

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

Assignment operator.

Definition at line 130 of file G4INCLNuclearDensity.cc.

130  {
131  NuclearDensity temporaryDensity(rhs);
132  swap(temporaryDensity);
133  return *this;
134  }
void swap(NuclearDensity &rhs)
Helper method for the assignment operator.
NuclearDensity(const G4int A, const G4int Z, InterpolationTable const *const rpCorrelationTableProton, InterpolationTable const *const rpCorrelationTableNeutron)

Here is the call graph for this function:

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

Definition at line 110 of file G4INCLNuclearDensity.hh.

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

Helper method for the assignment operator.

Definition at line 136 of file G4INCLNuclearDensity.cc.

136  {
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]);
144  std::swap(rFromP[DeltaPlusPlus], rhs.rFromP[DeltaPlusPlus]);
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]);
154  }

Here is the caller graph for this function:


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