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
00030 #include "G4NeutronHPFissionBaseFS.hh"
00031 #include "G4SystemOfUnits.hh"
00032 #include "G4ReactionProduct.hh"
00033 #include "G4Nucleus.hh"
00034 #include "G4Proton.hh"
00035 #include "G4Deuteron.hh"
00036 #include "G4Triton.hh"
00037 #include "G4Alpha.hh"
00038 #include "G4ThreeVector.hh"
00039 #include "G4LorentzVector.hh"
00040 #include "G4NeutronHPDataUsed.hh"
00041
00042 void G4NeutronHPFissionBaseFS::Init (G4double A, G4double Z, G4int M, G4String & dirName, G4String & bit)
00043 {
00044 G4String tString = dirName;
00045 G4bool dbool;
00046 G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, bit, dbool);
00047 G4String filename = aFile.GetName();
00048 SetAZMs( A, Z, M, aFile );
00049
00050
00051
00052 if ( !dbool || ( Z<2.5 && ( std::abs(theNDLDataZ - Z)>0.0001 || std::abs(theNDLDataA - A)>0.0001)) )
00053 {
00054 hasAnyData = false;
00055 hasFSData = false;
00056 hasXsec = false;
00057 return;
00058 }
00059
00060 std::ifstream theData(filename, std::ios::in);
00061 G4int dummy;
00062 if(!(theData))
00063 {
00064 theData.close();
00065 hasFSData = false;
00066 hasXsec = false;
00067 hasAnyData = false;
00068 return;
00069 }
00070 theData >> dummy>>dummy;
00071 G4int total;
00072 theData >> total;
00073 theXsection->Init(theData, total, eV);
00074 if (!(theData >> dummy))
00075 {
00076 hasFSData = false;
00077 theData.close();
00078 return;
00079 }
00080 theData >> dummy;
00081
00082 theAngularDistribution.Init(theData);
00083
00084 theData >> dummy >> dummy;
00085
00086 theEnergyDistribution.Init(theData);
00087 theData.close();
00088
00089 }
00090
00091 G4DynamicParticleVector * G4NeutronHPFissionBaseFS::ApplyYourself(G4int nPrompt)
00092 {
00093
00094 if(!HasFSData()) { return 0; }
00095
00096 G4int i;
00097 G4DynamicParticleVector * aResult = new G4DynamicParticleVector;
00098 G4ReactionProduct boosted;
00099 boosted.Lorentz(theNeutron, theTarget);
00100 G4double eKinetic = boosted.GetKineticEnergy();
00101
00102
00103 G4ReactionProduct * theNeutrons = new G4ReactionProduct[nPrompt];
00104 for(i=0; i<nPrompt; i++)
00105 {
00106 theNeutrons[i].SetDefinition(G4Neutron::Neutron());
00107 }
00108
00109
00110 G4int dummy;
00111 for(i=0; i<nPrompt; i++)
00112 {
00113
00114 theNeutrons[i].SetKineticEnergy(theEnergyDistribution.Sample(eKinetic, dummy));
00115 }
00116
00117
00118 for(i=0; i<nPrompt; i++)
00119 {
00120 theAngularDistribution.SampleAndUpdate(theNeutrons[i]);
00121 }
00122
00123
00124 for(i=0; i<nPrompt; i++)
00125 {
00126 G4DynamicParticle * it = new G4DynamicParticle;
00127 it->SetDefinition(theNeutrons[i].GetDefinition());
00128 it->SetMomentum(theNeutrons[i].GetMomentum());
00129 aResult->push_back(it);
00130 }
00131 delete [] theNeutrons;
00132
00133
00134 return aResult;
00135 }