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 | // $Id: G4NucleiModel.hh,v 1.30 2010/09/14 17:51:36 mkelsey Exp $ |
---|
26 | // GEANT4 tag: $Name: geant4-09-03-ref-09 $ |
---|
27 | // |
---|
28 | // 20100319 M. Kelsey -- Remove "using" directory and unnecessary #includes, |
---|
29 | // move ctor to .cc file |
---|
30 | // 20100407 M. Kelsey -- Create "partners thePartners" data member to act |
---|
31 | // as buffer between ::generateInteractionPartners() and |
---|
32 | // ::generateParticleFate(), and make "outgoing_cparticles" a |
---|
33 | // data member returned from the latter by const-ref. Replace |
---|
34 | // return-by-value of initializeCascad() with an input buffer. |
---|
35 | // 20100409 M. Kelsey -- Add function to sort list of partnerts by pathlen, |
---|
36 | // move non-inlinable code to .cc. |
---|
37 | // 20100421 M. Kelsey -- Move getFermiKinetic() to .cc, no hardwired masses. |
---|
38 | // 20100517 M. Kelsey -- Change cross-section tables to static arrays. Move |
---|
39 | // absorptionCrossSection() from SpecialFunc. |
---|
40 | // 20100520 M. Kelsey -- Add function to separate momentum from nucleon |
---|
41 | // 20100617 M. Kelsey -- Add setVerboseLevel() function, add generateModel() |
---|
42 | // with particle input, and ctor with A/Z input. |
---|
43 | // 20100715 M. Kelsey -- Add G4InuclNuclei object for use with balance checks |
---|
44 | // 20100723 M. Kelsey -- Move G4CollisionOutput buffer, along with all |
---|
45 | // std::vector<> buffers, here for reuse |
---|
46 | // 20100914 M. Kelsey -- Migrate to integer A and Z |
---|
47 | |
---|
48 | #ifndef G4NUCLEI_MODEL_HH |
---|
49 | #define G4NUCLEI_MODEL_HH |
---|
50 | |
---|
51 | #include "G4InuclElementaryParticle.hh" |
---|
52 | #include "G4CascadParticle.hh" |
---|
53 | #include "G4CollisionOutput.hh" |
---|
54 | #include <algorithm> |
---|
55 | #include <vector> |
---|
56 | |
---|
57 | class G4InuclNuclei; |
---|
58 | class G4ElementaryParticleCollider; |
---|
59 | |
---|
60 | class G4NucleiModel { |
---|
61 | public: |
---|
62 | G4NucleiModel(); |
---|
63 | G4NucleiModel(G4int a, G4int z); |
---|
64 | explicit G4NucleiModel(G4InuclNuclei* nuclei); |
---|
65 | |
---|
66 | ~G4NucleiModel() {} |
---|
67 | |
---|
68 | void setVerboseLevel(G4int verbose) { verboseLevel = verbose; } |
---|
69 | |
---|
70 | void generateModel(G4InuclNuclei* nuclei); |
---|
71 | void generateModel(G4int a, G4int z); |
---|
72 | |
---|
73 | void reset() { |
---|
74 | neutronNumberCurrent = neutronNumber; |
---|
75 | protonNumberCurrent = protonNumber; |
---|
76 | } |
---|
77 | |
---|
78 | void printModel() const; |
---|
79 | |
---|
80 | G4double getDensity(G4int ip, G4int izone) const { |
---|
81 | return nucleon_densities[ip - 1][izone]; |
---|
82 | } |
---|
83 | |
---|
84 | |
---|
85 | G4double getFermiMomentum(G4int ip, G4int izone) const { |
---|
86 | return fermi_momenta[ip - 1][izone]; |
---|
87 | } |
---|
88 | |
---|
89 | G4double getFermiKinetic(G4int ip, G4int izone) const; |
---|
90 | |
---|
91 | G4double getPotential(G4int ip, G4int izone) const { |
---|
92 | G4int ip0 = ip < 3 ? ip - 1 : 2; |
---|
93 | if (ip > 10 && ip < 18) ip0 = 3; |
---|
94 | if (ip > 20) ip0 = 4; |
---|
95 | return izone < number_of_zones ? zone_potentials[ip0][izone] : 0.0; |
---|
96 | } |
---|
97 | |
---|
98 | |
---|
99 | const std::vector<G4CascadParticle>& |
---|
100 | generateParticleFate(G4CascadParticle& cparticle, |
---|
101 | G4ElementaryParticleCollider* theElementaryParticleCollider); |
---|
102 | |
---|
103 | |
---|
104 | G4int getNumberOfNeutrons() const { |
---|
105 | return neutronNumberCurrent; |
---|
106 | } |
---|
107 | |
---|
108 | |
---|
109 | G4int getNumberOfProtons() const { |
---|
110 | return protonNumberCurrent; |
---|
111 | } |
---|
112 | |
---|
113 | |
---|
114 | G4bool empty() const { |
---|
115 | return neutronNumberCurrent < 1.0 && protonNumberCurrent < 1.0; |
---|
116 | } |
---|
117 | |
---|
118 | |
---|
119 | G4bool stillInside(const G4CascadParticle& cparticle) { |
---|
120 | return cparticle.getCurrentZone() < number_of_zones; |
---|
121 | } |
---|
122 | |
---|
123 | |
---|
124 | G4CascadParticle initializeCascad(G4InuclElementaryParticle* particle); |
---|
125 | |
---|
126 | |
---|
127 | typedef std::pair<std::vector<G4CascadParticle>, std::vector<G4InuclElementaryParticle> > modelLists; |
---|
128 | |
---|
129 | void initializeCascad(G4InuclNuclei* bullet, G4InuclNuclei* target, |
---|
130 | modelLists& output); |
---|
131 | |
---|
132 | |
---|
133 | std::pair<G4int, G4int> getTypesOfNucleonsInvolved() const { |
---|
134 | return std::pair<G4int, G4int>(current_nucl1, current_nucl2); |
---|
135 | } |
---|
136 | |
---|
137 | |
---|
138 | G4bool worthToPropagate(const G4CascadParticle& cparticle) const; |
---|
139 | |
---|
140 | G4InuclElementaryParticle generateNucleon(G4int type, G4int zone) const; |
---|
141 | |
---|
142 | G4LorentzVector generateNucleonMomentum(G4int type, G4int zone) const; |
---|
143 | |
---|
144 | G4double absorptionCrossSection(G4double e, G4int type) const; |
---|
145 | G4double totalCrossSection(G4double ke, G4int rtype) const; |
---|
146 | |
---|
147 | private: |
---|
148 | G4int verboseLevel; |
---|
149 | |
---|
150 | G4bool passFermi(const std::vector<G4InuclElementaryParticle>& particles, |
---|
151 | G4int zone); |
---|
152 | |
---|
153 | void boundaryTransition(G4CascadParticle& cparticle); |
---|
154 | |
---|
155 | G4InuclElementaryParticle generateQuasiDeutron(G4int type1, |
---|
156 | G4int type2, |
---|
157 | G4int zone) const; |
---|
158 | |
---|
159 | typedef std::pair<G4InuclElementaryParticle, G4double> partner; |
---|
160 | |
---|
161 | std::vector<partner> thePartners; // Buffer for output below |
---|
162 | void generateInteractionPartners(G4CascadParticle& cparticle); |
---|
163 | |
---|
164 | // Function for std::sort() to use in organizing partners by path length |
---|
165 | static G4bool sortPartners(const partner& p1, const partner& p2) { |
---|
166 | return (p2.second > p1.second); |
---|
167 | } |
---|
168 | |
---|
169 | G4double volNumInt(G4double r1, G4double r2, G4double cu, |
---|
170 | G4double d1) const; |
---|
171 | |
---|
172 | G4double volNumInt1(G4double r1, G4double r2, G4double cu2) const; |
---|
173 | |
---|
174 | G4double getRatio(G4int ip) const; |
---|
175 | |
---|
176 | // Buffers for processing interactions on each cycle |
---|
177 | std::vector<G4CascadParticle> outgoing_cparticles; // Return buffer |
---|
178 | G4CollisionOutput EPCoutput; // For N-body inelastic collisions |
---|
179 | |
---|
180 | std::vector<G4InuclElementaryParticle> qdeutrons; // For h+(NN) trials |
---|
181 | std::vector<G4double> acsecs; |
---|
182 | |
---|
183 | std::vector<G4ThreeVector> coordinates; // for initializeCascad() |
---|
184 | std::vector<G4LorentzVector> momentums; |
---|
185 | std::vector<G4InuclElementaryParticle> raw_particles; |
---|
186 | |
---|
187 | std::vector<std::vector<G4double> > nucleon_densities; |
---|
188 | std::vector<std::vector<G4double> > zone_potentials; |
---|
189 | std::vector<std::vector<G4double> > fermi_momenta; |
---|
190 | std::vector<G4double> zone_radii; |
---|
191 | std::vector<G4double> binding_energies; |
---|
192 | G4double nuclei_radius; |
---|
193 | G4int number_of_zones; |
---|
194 | |
---|
195 | G4int A; |
---|
196 | G4int Z; |
---|
197 | G4InuclNuclei* theNucleus; |
---|
198 | |
---|
199 | G4int neutronNumber; |
---|
200 | G4int protonNumber; |
---|
201 | |
---|
202 | G4int neutronNumberCurrent; |
---|
203 | G4int protonNumberCurrent; |
---|
204 | |
---|
205 | G4int current_nucl1; |
---|
206 | G4int current_nucl2; |
---|
207 | |
---|
208 | // Total cross sections |
---|
209 | static const G4double PPtot[30]; |
---|
210 | static const G4double NPtot[30]; |
---|
211 | static const G4double pipPtot[30]; |
---|
212 | static const G4double pimPtot[30]; |
---|
213 | static const G4double pizPtot[30]; |
---|
214 | static const G4double kpPtot[30]; |
---|
215 | static const G4double kpNtot[30]; |
---|
216 | static const G4double kmPtot[30]; |
---|
217 | static const G4double kmNtot[30]; |
---|
218 | static const G4double lPtot[30]; |
---|
219 | static const G4double spPtot[30]; |
---|
220 | static const G4double smPtot[30]; |
---|
221 | static const G4double xi0Ptot[30]; |
---|
222 | static const G4double ximPtot[30]; |
---|
223 | }; |
---|
224 | |
---|
225 | #endif // G4NUCLEI_MODEL_HH |
---|