G4NeutronHPNeutronYield.hh

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 //
00027 // $Id$
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); // s is the CLHEP unit second
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   // total mean
00139   G4bool simpleMean;
00140   G4NeutronHPPolynomExpansion theMean;
00141   G4NeutronHPVector theSimpleMean;
00142   
00143   // Prompt neutrons
00144   G4bool hasPromptData;
00145   G4bool spontPrompt;
00146   G4NeutronHPVector thePrompt;
00147   G4double theSpontPrompt;
00148   
00149   // delayed neutrons
00150   G4bool hasDelayedData;
00151   G4bool spontDelayed;
00152   G4NeutronHPList thePrecursorDecayConstants;
00153   G4NeutronHPVector theDelayed;
00154   G4double theSpontDelayed;
00155 
00156 };
00157 #endif

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