G4NeutronHPNBodyPhaseSpace.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 G4NeutronHPNBodyPhaseSpace_h
00030 #define G4NeutronHPNBodyPhaseSpace_h 1
00031 
00032 #include <fstream>
00033 #include <CLHEP/Units/PhysicalConstants.h>
00034 
00035 #include "globals.hh"
00036 #include "G4ios.hh"
00037 #include "G4Neutron.hh"
00038 #include "G4VNeutronHPEnergyAngular.hh"
00039 #include "G4ReactionProduct.hh"
00040 
00041 class G4NeutronHPNBodyPhaseSpace : public G4VNeutronHPEnergyAngular
00042 {
00043   public:
00044   
00045   G4NeutronHPNBodyPhaseSpace(){}
00046   ~G4NeutronHPNBodyPhaseSpace(){}
00047   
00048   public:
00049   
00050   void Init(G4double aMass, G4int aCount)
00051   {
00052     theTotalMass=aMass;
00053     theTotalCount=aCount;
00054   }
00055 
00056   void Init(std::ifstream & aDataFile)
00057   {
00058     aDataFile >> theTotalMass >> theTotalCount;
00059     theTotalMass *= G4Neutron::Neutron()->GetPDGMass();
00060   }
00061    
00062   G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass);
00063     
00064   private:
00065   
00066   inline G4double Prob(G4double anEnergy, G4double eMax, G4int n)
00067   {
00068     G4double result;
00069     result = std::sqrt(anEnergy)*std::pow(eMax-anEnergy, 3.*n/2.-4.);
00070     return result;
00071   }
00072   
00073   inline G4double C(G4double anEnergy, G4double mass)
00074   {
00075     G4double result(0);
00076     if(theTotalCount==3) result = 4./CLHEP::pi/std::pow(GetEmax(anEnergy, mass),2);
00077     if(theTotalCount==4) result = 105./32./std::pow(GetEmax(anEnergy, mass), 3.5);
00078     if(theTotalCount==5) result = 256./14./CLHEP::pi/std::pow(GetEmax(anEnergy, mass), 5.);
00079     return result;
00080   }
00081   
00082   inline G4double GetEmax(G4double anEnergy, G4double mass)
00083   {
00084     G4double result;
00085     G4double tMass = GetTarget()->GetMass();
00086     G4double pMass = GetNeutron()->GetMass();
00087     G4double availableEnergy = GetQValue() + anEnergy*tMass/(pMass+tMass);
00088     result = availableEnergy*(theTotalMass-mass)/theTotalMass;
00089     return result;
00090   }
00091   
00092   G4double MeanEnergyOfThisInteraction() {return -1; }
00093   
00094   private:
00095   
00096   G4double theTotalMass; 
00097   G4int theTotalCount;
00098   
00099 };
00100 #endif

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