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
00016
00017
00018
00019 static double m = MELECTRON;
00020 static double alpha = 1/ALPHAINV;
00021 static double Units = XcMeVtoCmsqrd;
00022
00023
00024
00025 static double Thomson = 8*PI*alpha*alpha/3/m/m*Units;
00026 double w = egamma/m;
00027
00028
00029
00030 double XC = 3*Thomson/4*
00031 ((1+w)/w/w/w*(2*w*(1+w)/(1+2*w)-log(1+2*w))
00032 +log(1+2*w)/2/w-(1+3*w)/(1+2*w)/(1+2*w));
00033
00034
00035
00036 static double Na = NAVOGADRO;
00037 static double A[2] = {A0,A1};
00038 static double Z[2] = {Z0,Z1};
00039 static double f[2];
00040 if(material == "scintillator"){
00041 f[0] = f0;
00042 f[1] = f1;
00043 }
00044 else if(material == "oil"){
00045 f[0] = f4;
00046 f[1] = f5;
00047 }
00048 else{
00049 cout << "GammaComptonRange: " << material
00050 << " is an unknown material! Assuming scintillator." << endl;
00051 f[0] = f0;
00052 f[1] = f1;
00053 }
00054
00055 static double nel[2];
00056 static bool first = 1;
00057 for(int i=0;i<2;i++){
00058 nel[i]=Na*density*f[i]*Z[i]/A[i];
00059 first = 0;
00060 }
00061
00062
00063
00064 return 1/((nel[0]+nel[1])*XC);
00065 }
00066