source: trunk/source/processes/hadronic/models/cascade/cascade/include/G4NucleiModel.hh @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 6.8 KB
Line 
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.25 2010/05/21 17:44:38 mkelsey Exp $
26// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
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
42#ifndef G4NUCLEI_MODEL_HH
43#define G4NUCLEI_MODEL_HH
44
45#include "G4InuclElementaryParticle.hh"
46#include "G4CascadParticle.hh"
47#include <algorithm>
48#include <vector>
49
50class G4InuclNuclei;
51class G4ElementaryParticleCollider;
52
53class G4NucleiModel {
54
55public:
56
57  G4NucleiModel();
58  G4NucleiModel(G4InuclNuclei* nuclei);
59
60  void generateModel(G4double a, G4double z);
61
62  void reset() {
63    neutronNumberCurrent = neutronNumber;
64    protonNumberCurrent = protonNumber;
65  }
66
67
68  void printModel() const; 
69
70
71  G4double getDensity(G4int ip, G4int izone) const {
72    return nucleon_densities[ip - 1][izone];
73  }
74
75
76  G4double getFermiMomentum(G4int ip, G4int izone) const {
77    return fermi_momenta[ip - 1][izone];
78  }
79
80  G4double getFermiKinetic(G4int ip, G4int izone) const;
81
82  G4double getPotential(G4int ip, G4int izone) const {
83    G4int ip0 = ip < 3 ? ip - 1 : 2;
84    if (ip > 10 && ip < 18) ip0 = 3;
85    if (ip > 20) ip0 = 4;
86    return izone < number_of_zones ? zone_potentials[ip0][izone] : 0.0;
87  }
88
89
90  const std::vector<G4CascadParticle>&
91  generateParticleFate(G4CascadParticle& cparticle,
92                       G4ElementaryParticleCollider* theElementaryParticleCollider); 
93
94
95  G4double getNumberOfNeutrons() const { 
96    return neutronNumberCurrent; 
97  }
98
99
100  G4double getNumberOfProtons() const { 
101    return protonNumberCurrent; 
102  }
103
104
105  G4bool empty() const { 
106    return neutronNumberCurrent < 1.0 && protonNumberCurrent < 1.0; 
107  }
108
109
110  G4bool stillInside(const G4CascadParticle& cparticle) {
111    return cparticle.getCurrentZone() < number_of_zones;
112  }
113
114
115  G4CascadParticle initializeCascad(G4InuclElementaryParticle* particle);
116
117
118  typedef std::pair<std::vector<G4CascadParticle>, std::vector<G4InuclElementaryParticle> > modelLists;
119
120  void initializeCascad(G4InuclNuclei* bullet, G4InuclNuclei* target,
121                        modelLists& output);
122
123
124  std::pair<G4int, G4int> getTypesOfNucleonsInvolved() const {
125    return std::pair<G4int, G4int>(current_nucl1, current_nucl2);
126  }
127
128
129  G4bool worthToPropagate(const G4CascadParticle& cparticle) const; 
130   
131  G4InuclElementaryParticle generateNucleon(G4int type, G4int zone) const;
132
133  G4LorentzVector generateNucleonMomentum(G4int type, G4int zone) const;
134
135  G4double absorptionCrossSection(G4double e, G4int type) const;
136  G4double totalCrossSection(G4double ke, G4int rtype) const;
137
138private:
139  G4int verboseLevel;
140
141  G4bool passFermi(const std::vector<G4InuclElementaryParticle>& particles, 
142                   G4int zone);
143
144  void boundaryTransition(G4CascadParticle& cparticle);
145
146  G4InuclElementaryParticle generateQuasiDeutron(G4int type1, 
147                                                 G4int type2,
148                                                 G4int zone) const;
149
150  typedef std::pair<G4InuclElementaryParticle, G4double> partner;
151
152  std::vector<partner> thePartners;             // Buffer for output below
153  void generateInteractionPartners(G4CascadParticle& cparticle);
154
155  // Function for std::sort() to use in organizing partners by path length
156  static G4bool sortPartners(const partner& p1, const partner& p2) {
157    return (p2.second > p1.second);
158  }
159
160  G4double volNumInt(G4double r1, G4double r2, G4double cu, 
161                     G4double d1) const; 
162
163  G4double volNumInt1(G4double r1, G4double r2, G4double cu2) const; 
164
165  G4double getRatio(G4int ip) const;
166
167  std::vector<G4CascadParticle> outgoing_cparticles;    // Return buffer
168
169  std::vector<std::vector<G4double> > nucleon_densities;
170
171  std::vector<std::vector<G4double> > zone_potentials;
172
173  std::vector<std::vector<G4double> > fermi_momenta;
174
175  std::vector<G4double> zone_radii;
176
177  std::vector<G4double> binding_energies;
178
179  G4double nuclei_radius;
180
181  G4int number_of_zones;
182
183  G4double A;
184  G4double Z;
185
186  G4double neutronNumber;
187  G4double protonNumber;
188
189  G4double neutronNumberCurrent;
190  G4double protonNumberCurrent;
191
192  G4int current_nucl1;
193  G4int current_nucl2;
194
195  // Total cross sections
196  static const G4double PPtot[30];
197  static const G4double NPtot[30];
198  static const G4double pipPtot[30];
199  static const G4double pimPtot[30];
200  static const G4double pizPtot[30];
201  static const G4double kpPtot[30];
202  static const G4double kpNtot[30];
203  static const G4double kmPtot[30];
204  static const G4double kmNtot[30];
205  static const G4double lPtot[30];
206  static const G4double spPtot[30];
207  static const G4double smPtot[30];
208  static const G4double xi0Ptot[30];
209  static const G4double ximPtot[30];
210};       
211
212#endif // G4NUCLEI_MODEL_HH
Note: See TracBrowser for help on using the repository browser.