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 | // neutron_hp -- source file |
---|
27 | // J.P. Wellisch, Nov-1996 |
---|
28 | // A prototype of the low energy neutron transport model. |
---|
29 | // |
---|
30 | #include "G4NeutronHPFissionBaseFS.hh" |
---|
31 | #include "G4ReactionProduct.hh" |
---|
32 | #include "G4Nucleus.hh" |
---|
33 | #include "G4Proton.hh" |
---|
34 | #include "G4Deuteron.hh" |
---|
35 | #include "G4Triton.hh" |
---|
36 | #include "G4Alpha.hh" |
---|
37 | #include "G4ThreeVector.hh" |
---|
38 | #include "G4LorentzVector.hh" |
---|
39 | #include "G4NeutronHPDataUsed.hh" |
---|
40 | |
---|
41 | void G4NeutronHPFissionBaseFS::Init (G4double A, G4double Z, G4String & dirName, G4String & bit) |
---|
42 | { |
---|
43 | G4String tString = dirName; |
---|
44 | G4bool dbool; |
---|
45 | G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), tString, bit, dbool); |
---|
46 | G4String filename = aFile.GetName(); |
---|
47 | theBaseA = aFile.GetA(); |
---|
48 | theBaseZ = aFile.GetZ(); |
---|
49 | if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001) ) ) |
---|
50 | { |
---|
51 | hasAnyData = false; |
---|
52 | hasFSData = false; |
---|
53 | hasXsec = false; |
---|
54 | return; // no data for exactly this isotope. |
---|
55 | } |
---|
56 | std::ifstream theData(filename, std::ios::in); |
---|
57 | G4int dummy; |
---|
58 | if(!(theData)) |
---|
59 | { |
---|
60 | theData.close(); |
---|
61 | hasFSData = false; |
---|
62 | hasXsec = false; |
---|
63 | hasAnyData = false; |
---|
64 | return; // no data for this FS for this isotope |
---|
65 | } |
---|
66 | theData >> dummy>>dummy; |
---|
67 | G4int total; |
---|
68 | theData >> total; |
---|
69 | theXsection->Init(theData, total, eV); |
---|
70 | if (!(theData >> dummy)) |
---|
71 | { |
---|
72 | hasFSData = false; |
---|
73 | theData.close(); |
---|
74 | return; |
---|
75 | } |
---|
76 | theData >> dummy; |
---|
77 | |
---|
78 | theAngularDistribution.Init(theData); |
---|
79 | |
---|
80 | theData >> dummy >> dummy; |
---|
81 | |
---|
82 | theEnergyDistribution.Init(theData); |
---|
83 | theData.close(); |
---|
84 | |
---|
85 | } |
---|
86 | |
---|
87 | G4DynamicParticleVector * G4NeutronHPFissionBaseFS::ApplyYourself(G4int nPrompt) |
---|
88 | { |
---|
89 | // if therere were no data for this isotope, break out. |
---|
90 | if(!HasFSData()) { return 0; } |
---|
91 | |
---|
92 | G4int i; |
---|
93 | G4DynamicParticleVector * aResult = new G4DynamicParticleVector; |
---|
94 | G4ReactionProduct boosted; |
---|
95 | boosted.Lorentz(theNeutron, theTarget); |
---|
96 | G4double eKinetic = boosted.GetKineticEnergy(); |
---|
97 | |
---|
98 | // Build neutrons |
---|
99 | G4ReactionProduct * theNeutrons = new G4ReactionProduct[nPrompt]; |
---|
100 | for(i=0; i<nPrompt; i++) |
---|
101 | { |
---|
102 | theNeutrons[i].SetDefinition(G4Neutron::Neutron()); |
---|
103 | } |
---|
104 | |
---|
105 | // sample energies |
---|
106 | G4int dummy; |
---|
107 | for(i=0; i<nPrompt; i++) |
---|
108 | { |
---|
109 | // always in the lab system (if file-5) |
---|
110 | theNeutrons[i].SetKineticEnergy(theEnergyDistribution.Sample(eKinetic, dummy)); |
---|
111 | } |
---|
112 | |
---|
113 | // sample neutron angular distribution |
---|
114 | for(i=0; i<nPrompt; i++) |
---|
115 | { |
---|
116 | theAngularDistribution.SampleAndUpdate(theNeutrons[i]); |
---|
117 | } |
---|
118 | |
---|
119 | // already in lab. Add neutrons to dynamic particle vector |
---|
120 | for(i=0; i<nPrompt; i++) |
---|
121 | { |
---|
122 | G4DynamicParticle * it = new G4DynamicParticle; |
---|
123 | it->SetDefinition(theNeutrons[i].GetDefinition()); |
---|
124 | it->SetMomentum(theNeutrons[i].GetMomentum()); |
---|
125 | aResult->push_back(it); |
---|
126 | } |
---|
127 | delete [] theNeutrons; |
---|
128 | |
---|
129 | // return the result |
---|
130 | return aResult; |
---|
131 | } |
---|