source: trunk/source/processes/hadronic/models/neutron_hp/include/G4NeutronHPNeutronYield.hh@ 1199

Last change on this file since 1199 was 1196, checked in by garnier, 16 years ago

update CVS release candidate geant4.9.3.01

File size: 4.2 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//
26//
27// $Id: G4NeutronHPNeutronYield.hh,v 1.10 2006/06/29 20:49:05 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30#ifndef G4NeutronHPNeutronYield_h
31#define G4NeutronHPNeutronYield_h 1
32
33#include "globals.hh"
34#include "G4NeutronHPVector.hh"
35#include "G4NeutronHPPolynomExpansion.hh"
36#include "G4NeutronHPList.hh"
37
38class G4NeutronHPNeutronYield
39{
40 public:
41 G4NeutronHPNeutronYield()
42 {
43 simpleMean = true;
44 spontPrompt = true;
45 hasPromptData = false;
46 hasDelayedData = false;
47 }
48 ~G4NeutronHPNeutronYield(){}
49
50 G4double GetTargetMass() { return targetMass; }
51
52 void InitMean(std::ifstream & aDataFile)
53 {
54 G4int iflag;
55 aDataFile >> targetMass >>iflag;
56 if(iflag == 1) simpleMean=false;
57 if(simpleMean)
58 {
59 theSimpleMean.Init(aDataFile, eV);
60 }
61 else
62 {
63 theMean.Init(aDataFile);
64 }
65 }
66
67 void InitPrompt(std::ifstream & aDataFile)
68 {
69 hasPromptData = true;
70 G4int iflag;
71 aDataFile >> targetMass >>iflag;
72 if(iflag == 2) spontPrompt = false;
73 if(spontPrompt)
74 {
75 aDataFile >> theSpontPrompt;
76 }
77 else
78 {
79 thePrompt.Init(aDataFile, eV);
80 }
81 }
82
83 void InitDelayed(std::ifstream & aDataFile)
84 {
85 hasDelayedData = true;
86 G4int iflag;
87 aDataFile >> targetMass >>iflag;
88 thePrecursorDecayConstants.Init(aDataFile, 1./s); // s is the CLHEP unit second
89 if(iflag == 2) spontDelayed = false;
90 if(spontDelayed)
91 {
92 aDataFile >> theSpontDelayed;
93 }
94 else
95 {
96 theDelayed.Init(aDataFile, eV);
97 }
98 }
99
100 G4double GetMean(G4double anEnergy)
101 {
102 if(simpleMean)
103 {
104 return theSimpleMean.GetY(anEnergy);
105 }
106 return theMean.GetValue(anEnergy);
107 }
108
109 G4double GetPrompt(G4double anEnergy)
110 {
111 if(!hasPromptData) return 0;
112 if(spontPrompt)
113 {
114 return theSpontPrompt;
115 }
116 return thePrompt.GetY(anEnergy);
117 }
118
119 G4double GetDelayed(G4double anEnergy)
120 {
121 if(!hasDelayedData) return 0;
122 if(spontDelayed)
123 {
124 return theSpontDelayed;
125 }
126 return theDelayed.GetY(anEnergy);
127 }
128
129 inline G4double GetDecayConstant(G4int i)
130 {
131 return thePrecursorDecayConstants.GetValue(i);
132 }
133
134 private:
135
136 G4double targetMass;
137 // total mean
138 G4bool simpleMean;
139 G4NeutronHPPolynomExpansion theMean;
140 G4NeutronHPVector theSimpleMean;
141
142 // Prompt neutrons
143 G4bool hasPromptData;
144 G4bool spontPrompt;
145 G4NeutronHPVector thePrompt;
146 G4double theSpontPrompt;
147
148 // delayed neutrons
149 G4bool hasDelayedData;
150 G4bool spontDelayed;
151 G4NeutronHPList thePrecursorDecayConstants;
152 G4NeutronHPVector theDelayed;
153 G4double theSpontDelayed;
154
155};
156#endif
Note: See TracBrowser for help on using the repository browser.