Main Page   Compound List   File List   Compound Members   File Members  

GammaComptonRange.cpp

Go to the documentation of this file.
00001 
00008 #include <math.h>
00009 #include <iostream.h>
00010 #include <string>
00011 #include "ReactorConstants.hh"
00012 
00013 double GammaComptonRange(std::string material,double egamma){
00014 
00015   //cout << "gamma propogating through " << material << endl;
00016   //
00017   // Compute the mean free path for Compton scattering.
00018   //
00019   static ReactorConstants k;
00020   static double pi = k.pi;
00021   static double m = k.Melectron;
00022   static double alpha = 1/k.alphainv;
00023   static double Units = k.XcMeVtoCmsqrd;
00024   //
00025   // Overall cross section scale
00026   //
00027   static double Thomson = 8*pi*alpha*alpha/3/m/m*Units;
00028   double w = egamma/m;
00029   //
00030   // Klein-Nishina cross section
00031   //
00032   double XC = 3*Thomson/4*
00033     ((1+w)/w/w/w*(2*w*(1+w)/(1+2*w)-log(1+2*w))
00034      +log(1+2*w)/2/w-(1+3*w)/(1+2*w)/(1+2*w));
00035   //
00036   // Need electron density to get mfp. Get H and C contributions.
00037   //
00038   static double density = k.density;
00039   static double Na = k.Navogadro;
00040   static double A[2] = {k.A0,k.A1};
00041   static double Z[2] = {k.Z0,k.Z1};
00042   static double f[2];
00043   if(material == "scintillator"){
00044     f[0] = k.f0;
00045     f[1] = k.f1;
00046   }
00047   else if(material == "oil"){
00048     f[0] = k.f4;
00049     f[1] = k.f5;
00050   }
00051   else{
00052     cout << "GammaComptonRange: " << material 
00053          << " is an unknown material!  Assuming scintillator." << endl;
00054     f[0] = k.f0;
00055     f[1] = k.f1;
00056   }    
00057   //for(int i=0;i<2;i++) cout << "f["<<i<<"] " << f[i] << endl;
00058   static double nel[2];
00059   static bool first = 1;
00060   for(int i=0;i<2;i++){
00061     nel[i]=Na*density*f[i]*Z[i]/A[i];
00062     first = 0;
00063   }
00064   //
00065   //  Compute mean free path.
00066   //  
00067   return 1/((nel[0]+nel[1])*XC);
00068 }
00069                           

Generated on Thu Jul 29 14:27:03 2004 for ReactorFsim by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002