Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4INCLNuclearDensity.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // INCL++ intra-nuclear cascade model
27 // Alain Boudard, CEA-Saclay, France
28 // Joseph Cugnon, University of Liege, Belgium
29 // Jean-Christophe David, CEA-Saclay, France
30 // Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland
31 // Sylvie Leray, CEA-Saclay, France
32 // Davide Mancusi, CEA-Saclay, France
33 //
34 #define INCLXX_IN_GEANT4_MODE 1
35 
36 #include "globals.hh"
37 
38 #include "G4INCLNuclearDensity.hh"
39 #include "G4INCLParticleTable.hh"
40 #include "G4INCLGlobals.hh"
41 #include <algorithm>
42 
43 namespace G4INCL {
44 
45  NuclearDensity::NuclearDensity(const G4int A, const G4int Z, InterpolationTable const * const rpCorrelationTableProton, InterpolationTable const * const rpCorrelationTableNeutron) :
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[Lambda] = rpCorrelationTableNeutron;//As for neutrons
55  rFromP[DeltaPlusPlus] = rpCorrelationTableProton;
56  rFromP[DeltaPlus] = rpCorrelationTableProton;
57  rFromP[DeltaZero] = rpCorrelationTableNeutron;
58  rFromP[DeltaMinus] = rpCorrelationTableNeutron;
59  // The interpolation table for local-energy look-ups is simply obtained by
60  // inverting the r-p correlation table.
61  std::fill(pFromR, pFromR + UnknownParticle, static_cast<InterpolationTable*>(NULL));
62  pFromR[Proton] = new InterpolationTable(rFromP[Proton]->getNodeValues(), rFromP[Proton]->getNodeAbscissae());
63  pFromR[Neutron] = new InterpolationTable(rFromP[Neutron]->getNodeValues(), rFromP[Neutron]->getNodeAbscissae());
64  pFromR[Lambda] = new InterpolationTable(rFromP[Lambda]->getNodeValues(), rFromP[Lambda]->getNodeAbscissae());//As for neutrons
65  pFromR[DeltaPlusPlus] = new InterpolationTable(rFromP[DeltaPlusPlus]->getNodeValues(), rFromP[DeltaPlusPlus]->getNodeAbscissae());
66  pFromR[DeltaPlus] = new InterpolationTable(rFromP[DeltaPlus]->getNodeValues(), rFromP[DeltaPlus]->getNodeAbscissae());
67  pFromR[DeltaZero] = new InterpolationTable(rFromP[DeltaZero]->getNodeValues(), rFromP[DeltaZero]->getNodeAbscissae());
68  pFromR[DeltaMinus] = new InterpolationTable(rFromP[DeltaMinus]->getNodeValues(), rFromP[DeltaMinus]->getNodeAbscissae());
69  INCL_DEBUG("Interpolation table for proton local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
70  << '\n'
71  << pFromR[Proton]->print()
72  << '\n'
73  << "Interpolation table for neutron local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
74  << '\n'
75  << pFromR[Neutron]->print()
76  << '\n'
77  << "Interpolation table for delta++ local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
78  << '\n'
79  << pFromR[Lambda]->print()
80  << '\n'
81  << "Interpolation table for lambda local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
82  << '\n'
84  << '\n'
85  << "Interpolation table for delta+ local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
86  << '\n'
87  << pFromR[DeltaPlus]->print()
88  << '\n'
89  << "Interpolation table for delta0 local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
90  << '\n'
91  << pFromR[DeltaZero]->print()
92  << '\n'
93  << "Interpolation table for delta- local energy (A=" << theA << ", Z=" << theZ << ") initialised:"
94  << '\n'
95  << pFromR[DeltaMinus]->print()
96  << '\n');
98  }
99 
101  // We don't delete the rFromP tables, which are cached in the
102  // NuclearDensityFactory
103  delete pFromR[Proton];
104  delete pFromR[Neutron];
105  delete pFromR[Lambda];
106  delete pFromR[DeltaPlusPlus];
107  delete pFromR[DeltaPlus];
108  delete pFromR[DeltaZero];
109  delete pFromR[DeltaMinus];
110  }
111 
113  theA(rhs.theA),
114  theZ(rhs.theZ),
115  theMaximumRadius(rhs.theMaximumRadius),
116  theProtonNuclearRadius(rhs.theProtonNuclearRadius)
117  {
118  // rFromP is owned by NuclearDensityFactory, so shallow copy is sufficient
119  std::fill(rFromP, rFromP + UnknownParticle, static_cast<InterpolationTable*>(NULL));
120  rFromP[Proton] = rhs.rFromP[Proton];
121  rFromP[Neutron] = rhs.rFromP[Neutron];
122  rFromP[Lambda] = rhs.rFromP[Neutron];//As for neutrons
127  // deep copy for pFromR
128  std::fill(pFromR, pFromR + UnknownParticle, static_cast<InterpolationTable*>(NULL));
129  pFromR[Proton] = new InterpolationTable(*(rhs.pFromR[Proton]));
131  pFromR[Lambda] = new InterpolationTable(*(rhs.pFromR[Neutron]));//As for neutrons
137  }
138 
140  NuclearDensity temporaryDensity(rhs);
141  swap(temporaryDensity);
142  return *this;
143  }
144 
146  std::swap(theA, rhs.theA);
147  std::swap(theZ, rhs.theZ);
148  std::swap(theMaximumRadius, rhs.theMaximumRadius);
151  std::swap(rFromP[Proton], rhs.rFromP[Proton]);
152  std::swap(rFromP[Neutron], rhs.rFromP[Neutron]);
153  std::swap(rFromP[Lambda], rhs.rFromP[Neutron]);//As for neutrons
154  std::swap(rFromP[DeltaPlusPlus], rhs.rFromP[DeltaPlusPlus]);
155  std::swap(rFromP[DeltaPlus], rhs.rFromP[DeltaPlus]);
156  std::swap(rFromP[DeltaZero], rhs.rFromP[DeltaZero]);
157  std::swap(rFromP[DeltaMinus], rhs.rFromP[DeltaMinus]);
158  std::swap(pFromR[Proton], rhs.pFromR[Proton]);
159  std::swap(pFromR[Neutron], rhs.pFromR[Neutron]);
160  std::swap(pFromR[DeltaPlusPlus], rhs.pFromR[DeltaPlusPlus]);
161  std::swap(pFromR[DeltaPlus], rhs.pFromR[DeltaPlus]);
162  std::swap(pFromR[DeltaZero], rhs.pFromR[DeltaZero]);
163  std::swap(pFromR[DeltaMinus], rhs.pFromR[DeltaMinus]);
164  }
165 
167  const G4double theProtonRadius = 0.88; // fm
168  const G4double theProtonTransmissionRadius = theProtonNuclearRadius + theProtonRadius;
169 
170  transmissionRadius[Proton] = theProtonTransmissionRadius;
173  transmissionRadius[DeltaPlusPlus] = theProtonTransmissionRadius;
174  transmissionRadius[DeltaPlus] = theProtonTransmissionRadius;
175  transmissionRadius[DeltaMinus] = theProtonTransmissionRadius;
177  transmissionRadius[SigmaPlus] = theProtonTransmissionRadius;
178  transmissionRadius[SigmaMinus] = theProtonTransmissionRadius;
181 
182  // transmission radii for neutral particles intentionally left uninitialised
183  }
184 
186 // assert(t==Proton || t==Neutron || t==Lambda || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
187  return (*(rFromP[t]))(p);
188  }
189 
191 // assert(t==Proton || t==Neutron || t==Lambda || t==DeltaPlusPlus || t==DeltaPlus || t==DeltaZero || t==DeltaMinus);
192  return (*(pFromR[t]))(r);
193  }
194 
195 }
void print(G4double elem)
G4double getMinPFromR(const ParticleType t, const G4double r) const
const char * p
Definition: xmltok.h:285
void initializeTransmissionRadii()
Initialize the transmission radius.
G4double getMaxRFromP(const ParticleType t, const G4double p) const
Get the maximum allowed radius for a given momentum.
#define INCL_DEBUG(x)
NuclearDensity & operator=(const NuclearDensity &rhs)
Assignment operator.
Float_t Z
void swap(NuclearDensity &rhs)
Helper method for the assignment operator.
double G4double
Definition: G4Types.hh:76
InterpolationTable const * rFromP[UnknownParticle]
double A(double temperature)
Class for interpolating the of a 1-dimensional function.
int G4int
Definition: G4Types.hh:78
G4double transmissionRadius[UnknownParticle]
NuclearDensity(const G4int A, const G4int Z, InterpolationTable const *const rpCorrelationTableProton, InterpolationTable const *const rpCorrelationTableNeutron)
InterpolationTable const * pFromR[UnknownParticle]
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
G4double theProtonNuclearRadius
Represents INCL4.5&#39;s R0 variable.