Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4NeutronHPNeutronYield.hh
Go to the documentation of this file.
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$
28 //
29 #ifndef G4NeutronHPNeutronYield_h
30 #define G4NeutronHPNeutronYield_h 1
31 
33 
34 #include "globals.hh"
35 #include "G4NeutronHPVector.hh"
37 #include "G4NeutronHPList.hh"
38 
40 {
41  public:
43  {
44  simpleMean = true;
45  spontPrompt = true;
46  hasPromptData = false;
47  hasDelayedData = false;
48  }
50 
51  G4double GetTargetMass() { return targetMass; }
52 
53  void InitMean(std::ifstream & aDataFile)
54  {
55  G4int iflag;
56  aDataFile >> targetMass >>iflag;
57  if(iflag == 1) simpleMean=false;
58  if(simpleMean)
59  {
60  theSimpleMean.Init(aDataFile, CLHEP::eV);
61  }
62  else
63  {
64  theMean.Init(aDataFile);
65  }
66  }
67 
68  void InitPrompt(std::ifstream & aDataFile)
69  {
70  hasPromptData = true;
71  G4int iflag;
72  aDataFile >> targetMass >>iflag;
73  if(iflag == 2) spontPrompt = false;
74  if(spontPrompt)
75  {
76  aDataFile >> theSpontPrompt;
77  }
78  else
79  {
80  thePrompt.Init(aDataFile, CLHEP::eV);
81  }
82  }
83 
84  void InitDelayed(std::ifstream & aDataFile)
85  {
86  hasDelayedData = true;
87  G4int iflag;
88  aDataFile >> targetMass >>iflag;
89  thePrecursorDecayConstants.Init(aDataFile, 1./CLHEP::s); // s is the CLHEP unit second
90  if(iflag == 2) spontDelayed = false;
91  if(spontDelayed)
92  {
93  aDataFile >> theSpontDelayed;
94  }
95  else
96  {
97  theDelayed.Init(aDataFile, CLHEP::eV);
98  }
99  }
100 
102  {
103  if(simpleMean)
104  {
105  return theSimpleMean.GetY(anEnergy);
106  }
107  return theMean.GetValue(anEnergy);
108  }
109 
111  {
112  if(!hasPromptData) return 0;
113  if(spontPrompt)
114  {
115  return theSpontPrompt;
116  }
117  return thePrompt.GetY(anEnergy);
118  }
119 
121  {
122  if(!hasDelayedData) return 0;
123  if(spontDelayed)
124  {
125  return theSpontDelayed;
126  }
127  return theDelayed.GetY(anEnergy);
128  }
129 
131  {
132  return thePrecursorDecayConstants.GetValue(i);
133  }
134 
135  private:
136 
137  G4double targetMass;
138  // total mean
139  G4bool simpleMean;
141  G4NeutronHPVector theSimpleMean;
142 
143  // Prompt neutrons
144  G4bool hasPromptData;
145  G4bool spontPrompt;
146  G4NeutronHPVector thePrompt;
147  G4double theSpontPrompt;
148 
149  // delayed neutrons
150  G4bool hasDelayedData;
151  G4bool spontDelayed;
152  G4NeutronHPList thePrecursorDecayConstants;
153  G4NeutronHPVector theDelayed;
154  G4double theSpontDelayed;
155 
156 };
157 #endif