00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef G4NeutronHPNeutronYield_h
00030 #define G4NeutronHPNeutronYield_h 1
00031
00032 #include <CLHEP/Units/SystemOfUnits.h>
00033
00034 #include "globals.hh"
00035 #include "G4NeutronHPVector.hh"
00036 #include "G4NeutronHPPolynomExpansion.hh"
00037 #include "G4NeutronHPList.hh"
00038
00039 class G4NeutronHPNeutronYield
00040 {
00041 public:
00042 G4NeutronHPNeutronYield()
00043 {
00044 simpleMean = true;
00045 spontPrompt = true;
00046 hasPromptData = false;
00047 hasDelayedData = false;
00048 }
00049 ~G4NeutronHPNeutronYield(){}
00050
00051 G4double GetTargetMass() { return targetMass; }
00052
00053 void InitMean(std::ifstream & aDataFile)
00054 {
00055 G4int iflag;
00056 aDataFile >> targetMass >>iflag;
00057 if(iflag == 1) simpleMean=false;
00058 if(simpleMean)
00059 {
00060 theSimpleMean.Init(aDataFile, CLHEP::eV);
00061 }
00062 else
00063 {
00064 theMean.Init(aDataFile);
00065 }
00066 }
00067
00068 void InitPrompt(std::ifstream & aDataFile)
00069 {
00070 hasPromptData = true;
00071 G4int iflag;
00072 aDataFile >> targetMass >>iflag;
00073 if(iflag == 2) spontPrompt = false;
00074 if(spontPrompt)
00075 {
00076 aDataFile >> theSpontPrompt;
00077 }
00078 else
00079 {
00080 thePrompt.Init(aDataFile, CLHEP::eV);
00081 }
00082 }
00083
00084 void InitDelayed(std::ifstream & aDataFile)
00085 {
00086 hasDelayedData = true;
00087 G4int iflag;
00088 aDataFile >> targetMass >>iflag;
00089 thePrecursorDecayConstants.Init(aDataFile, 1./CLHEP::s);
00090 if(iflag == 2) spontDelayed = false;
00091 if(spontDelayed)
00092 {
00093 aDataFile >> theSpontDelayed;
00094 }
00095 else
00096 {
00097 theDelayed.Init(aDataFile, CLHEP::eV);
00098 }
00099 }
00100
00101 G4double GetMean(G4double anEnergy)
00102 {
00103 if(simpleMean)
00104 {
00105 return theSimpleMean.GetY(anEnergy);
00106 }
00107 return theMean.GetValue(anEnergy);
00108 }
00109
00110 G4double GetPrompt(G4double anEnergy)
00111 {
00112 if(!hasPromptData) return 0;
00113 if(spontPrompt)
00114 {
00115 return theSpontPrompt;
00116 }
00117 return thePrompt.GetY(anEnergy);
00118 }
00119
00120 G4double GetDelayed(G4double anEnergy)
00121 {
00122 if(!hasDelayedData) return 0;
00123 if(spontDelayed)
00124 {
00125 return theSpontDelayed;
00126 }
00127 return theDelayed.GetY(anEnergy);
00128 }
00129
00130 inline G4double GetDecayConstant(G4int i)
00131 {
00132 return thePrecursorDecayConstants.GetValue(i);
00133 }
00134
00135 private:
00136
00137 G4double targetMass;
00138
00139 G4bool simpleMean;
00140 G4NeutronHPPolynomExpansion theMean;
00141 G4NeutronHPVector theSimpleMean;
00142
00143
00144 G4bool hasPromptData;
00145 G4bool spontPrompt;
00146 G4NeutronHPVector thePrompt;
00147 G4double theSpontPrompt;
00148
00149
00150 G4bool hasDelayedData;
00151 G4bool spontDelayed;
00152 G4NeutronHPList thePrecursorDecayConstants;
00153 G4NeutronHPVector theDelayed;
00154 G4double theSpontDelayed;
00155
00156 };
00157 #endif