G4NeutronHPFissionBaseFS.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // neutron_hp -- source file
00027 // J.P. Wellisch, Nov-1996
00028 // A prototype of the low energy neutron transport model.
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     //theBaseA = aFile.GetA();
00050     //theBaseZ = aFile.GetZ();
00051     //if(!dbool  || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001) ) )
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; // no data for exactly this isotope.
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; // no data for this FS for this isotope
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 // if therere were no data for this isotope, break out.    
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 // Build neutrons
00103     G4ReactionProduct * theNeutrons = new G4ReactionProduct[nPrompt];
00104     for(i=0; i<nPrompt; i++)
00105     {
00106       theNeutrons[i].SetDefinition(G4Neutron::Neutron());
00107     }
00108     
00109 // sample energies
00110    G4int dummy;
00111    for(i=0; i<nPrompt; i++)
00112    {
00113      // always in the lab system (if file-5)
00114      theNeutrons[i].SetKineticEnergy(theEnergyDistribution.Sample(eKinetic, dummy));
00115    }
00116 
00117 // sample neutron angular distribution
00118    for(i=0; i<nPrompt; i++)
00119    {
00120      theAngularDistribution.SampleAndUpdate(theNeutrons[i]);
00121    }
00122    
00123 // already in lab. Add neutrons to dynamic particle vector
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 // return the result
00134     return aResult;
00135   }

Generated on Mon May 27 17:49:01 2013 for Geant4 by  doxygen 1.4.7