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 | // |
---|
27 | // $Id: G4NeutronHPProduct.hh,v 1.12 2007/06/06 12:45:13 ahoward Exp $ |
---|
28 | // GEANT4 tag $Name: $ |
---|
29 | // |
---|
30 | #ifndef G4NeutronHPProduct_h |
---|
31 | #define G4NeutronHPProduct_h 1 |
---|
32 | |
---|
33 | #include "G4HadronicException.hh" |
---|
34 | #include "globals.hh" |
---|
35 | #include "G4NeutronHPVector.hh" |
---|
36 | #include "Randomize.hh" |
---|
37 | #include "G4ios.hh" |
---|
38 | #include <fstream> |
---|
39 | #include "globals.hh" |
---|
40 | #include "G4VNeutronHPEnergyAngular.hh" |
---|
41 | #include "G4ReactionProductVector.hh" |
---|
42 | |
---|
43 | #include "G4NeutronHPContEnergyAngular.hh" |
---|
44 | #include "G4NeutronHPDiscreteTwoBody.hh" |
---|
45 | #include "G4NeutronHPIsotropic.hh" |
---|
46 | #include "G4NeutronHPNBodyPhaseSpace.hh" |
---|
47 | #include "G4NeutronHPLabAngularEnergy.hh" |
---|
48 | |
---|
49 | class G4NeutronHPProduct |
---|
50 | { |
---|
51 | public: |
---|
52 | G4NeutronHPProduct() |
---|
53 | { |
---|
54 | theDist = 0; |
---|
55 | } |
---|
56 | ~G4NeutronHPProduct() |
---|
57 | { |
---|
58 | if(theDist != 0) delete theDist; |
---|
59 | } |
---|
60 | |
---|
61 | inline void Init(std::ifstream & aDataFile) |
---|
62 | { |
---|
63 | aDataFile >> theMassCode>>theMass>>theIsomerFlag>>theDistLaw |
---|
64 | >> theGroundStateQValue>>theActualStateQValue; |
---|
65 | theGroundStateQValue*= eV; |
---|
66 | theActualStateQValue*= eV; |
---|
67 | theYield.Init(aDataFile, eV); |
---|
68 | if(theDistLaw==0) |
---|
69 | { |
---|
70 | // distribution not known, use E-independent, isotropic angular distribution |
---|
71 | theDist = new G4NeutronHPIsotropic; |
---|
72 | } |
---|
73 | else if(theDistLaw == 1) |
---|
74 | { |
---|
75 | // Continuum energy-angular distribution |
---|
76 | theDist = new G4NeutronHPContEnergyAngular; |
---|
77 | } |
---|
78 | else if(theDistLaw == 2) |
---|
79 | { |
---|
80 | // Discrete 2-body scattering |
---|
81 | theDist = new G4NeutronHPDiscreteTwoBody; |
---|
82 | } |
---|
83 | else if(theDistLaw == 3) |
---|
84 | { |
---|
85 | // Isotropic emission |
---|
86 | theDist = new G4NeutronHPIsotropic; |
---|
87 | } |
---|
88 | else if(theDistLaw == 4) |
---|
89 | { |
---|
90 | // Discrete 2-body recoil modification |
---|
91 | // not used for now. @@@@ |
---|
92 | theDist = new G4NeutronHPDiscreteTwoBody; |
---|
93 | // the above is only temporary; |
---|
94 | // recoils need to be addressed |
---|
95 | // properly |
---|
96 | delete theDist; |
---|
97 | theDist = 0; |
---|
98 | } |
---|
99 | else if(theDistLaw == 5) |
---|
100 | { |
---|
101 | // charged particles only, to be used in a later stage. @@@@ |
---|
102 | } |
---|
103 | else if(theDistLaw == 6) |
---|
104 | { |
---|
105 | // N-Body phase space |
---|
106 | theDist = new G4NeutronHPNBodyPhaseSpace; |
---|
107 | } |
---|
108 | else if(theDistLaw == 7) |
---|
109 | { |
---|
110 | // Laboratory angular energy paraetrisation |
---|
111 | theDist = new G4NeutronHPLabAngularEnergy; |
---|
112 | } |
---|
113 | else |
---|
114 | { |
---|
115 | throw G4HadronicException(__FILE__, __LINE__, "distribution law unknown to G4NeutronHPProduct"); |
---|
116 | } |
---|
117 | if(theDist!=0) |
---|
118 | { |
---|
119 | theDist->SetQValue(theActualStateQValue); |
---|
120 | theDist->Init(aDataFile); |
---|
121 | } |
---|
122 | } |
---|
123 | |
---|
124 | G4ReactionProductVector * Sample(G4double anEnergy); |
---|
125 | |
---|
126 | G4double GetMeanYield(G4double anEnergy) |
---|
127 | { |
---|
128 | return theYield.GetY(anEnergy); |
---|
129 | } |
---|
130 | |
---|
131 | void SetNeutron(G4ReactionProduct * aNeutron) |
---|
132 | { |
---|
133 | theNeutron = aNeutron; |
---|
134 | } |
---|
135 | |
---|
136 | void SetTarget(G4ReactionProduct * aTarget) |
---|
137 | { |
---|
138 | theTarget = aTarget; |
---|
139 | } |
---|
140 | |
---|
141 | inline G4ReactionProduct * GetTarget() { return theTarget; } |
---|
142 | |
---|
143 | inline G4ReactionProduct * GetNeutron() { return theNeutron; } |
---|
144 | |
---|
145 | inline G4double MeanEnergyOfThisInteraction() |
---|
146 | { |
---|
147 | G4double result; |
---|
148 | if(theDist == 0) |
---|
149 | { |
---|
150 | result = 0; |
---|
151 | } |
---|
152 | else |
---|
153 | { |
---|
154 | result=theDist->MeanEnergyOfThisInteraction(); |
---|
155 | result *= theCurrentMultiplicity; |
---|
156 | } |
---|
157 | return result; |
---|
158 | } |
---|
159 | |
---|
160 | inline G4double GetQValue() { return theActualStateQValue; } |
---|
161 | private: |
---|
162 | |
---|
163 | // data members |
---|
164 | |
---|
165 | G4double theMassCode; |
---|
166 | G4double theMass; |
---|
167 | G4int theIsomerFlag; |
---|
168 | G4double theGroundStateQValue; |
---|
169 | G4double theActualStateQValue; |
---|
170 | G4int theDistLaw; // redundant |
---|
171 | G4NeutronHPVector theYield; |
---|
172 | G4VNeutronHPEnergyAngular * theDist; |
---|
173 | |
---|
174 | // Utility quantities |
---|
175 | |
---|
176 | G4ReactionProduct * theTarget; |
---|
177 | G4ReactionProduct * theNeutron; |
---|
178 | |
---|
179 | // cashed values |
---|
180 | |
---|
181 | G4int theCurrentMultiplicity; |
---|
182 | |
---|
183 | }; |
---|
184 | |
---|
185 | #endif |
---|