| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

KRLInverseBeta.cc

Go to the documentation of this file.
00001 #include "KRLInverseBeta.hh"
00002 #include "stdio.h"
00003 
00004 KRLInverseBeta* gInverseBeta;
00005 
00006 KRLInverseBeta::KRLInverseBeta() {
00007   fF = 1;
00008   fG = 1.26;
00009   fF2 = 3.706;
00010   fDelta = gkMassNeutron - gkMassProton;
00011   fMassEsq = gkMassElectron*gkMassElectron;
00012   fYsq = (fDelta*fDelta - fMassEsq)/2;
00013   fF2Plus3G2 = fF*fF + 3*fG*fG;
00014   fF2MinusG2 = fF*fF - fG*fG;
00015   fSigma0 = 0.0952/(fF2Plus3G2); // *10^{-42} cm^2, eqn 9
00016   fDifferential = new TF1("fDifferential",gKRLDSigmaByDCosTheta, -1, 1, 1);
00017   fDifferential->SetParameter(0,3); // default enu = 3 MeV
00018   fHTotalCrossSection = NULL;
00019 }
00020 
00022 Double_t KRLInverseBeta::Ee1(Double_t aEnu, Double_t aCosTheta) {
00023   Double_t answer;
00024   fE0 = Ee0(aEnu);
00025   if( fE0 <= gkMassElectron ) { // below threshold
00026     fE0 = 0;
00027     fP0 = 0;
00028     answer = 0;
00029   } else {
00030     fP0 = TMath::Sqrt(fE0*fE0 - fMassEsq);
00031     fV0 = fP0/fE0;
00032     Double_t sqBracket = 1 - aEnu*(1-fV0*aCosTheta)/gkMassProton;
00033     answer = fE0*sqBracket - fYsq/gkMassProton;
00034   }
00035   return answer;
00036 }
00037 
00038 Double_t KRLInverseBeta::DSigDCosTh(Double_t aEnu, Double_t aCosTheta) {
00039   fE1 = Ee1(aEnu, aCosTheta);
00040   Double_t answer;
00041   if( fE1<gkMassElectron ) {
00042     answer = 0;
00043   } else {
00044     Double_t pe1 = TMath::Sqrt(fE1*fE1 - fMassEsq);
00045     Double_t ve1 = pe1/fE1;
00046     Double_t firstLine = (fSigma0/2) * (fF2Plus3G2 + fF2MinusG2*ve1*aCosTheta)* fE1*pe1;
00047     Double_t secondLine = fSigma0 * GammaTerm(aCosTheta) * fE0 * fP0 / (2* gkMassProton); 
00048     answer = firstLine - secondLine;
00049   }
00050   return answer;
00051 }
00052 
00053 Double_t KRLInverseBeta::GammaTerm(Double_t aCosTheta) {
00054   Double_t firstLine = (2*fE0+fDelta)*(1-fV0*aCosTheta)-fMassEsq/fE0;
00055   firstLine *= (2*(fF+fF2)*fG);
00056   Double_t secondLine = fDelta*(1+fV0*aCosTheta) +fMassEsq/fE0;
00057   secondLine *= (fF*fF+fG*fG);
00058   Double_t thirdLine = fF2Plus3G2 *( (fE0+fDelta)*(1-aCosTheta/fV0) - fDelta);
00059   Double_t fourthLine = (fF*fF - fG*fG)*fV0*aCosTheta;
00060   fourthLine *= ( (fE0+fDelta)*(1-aCosTheta/fV0) - fDelta );
00061 
00062   Double_t answer = firstLine + secondLine + thirdLine + fourthLine;
00063   return answer;
00064 
00065 }
00066 
00067 Double_t KRLInverseBeta::SigmaTot(Double_t aEnu) {
00068   //  fDifferential->SetParameter(0, aEnu);
00069   Double_t answer;
00070   if( aEnu<0 ) {
00071     Warning("SigmaTot(Double_t aEnu)","Tried to calculate cross section for -ve nu energy");
00072     return 0;
00073   }
00074   if( aEnu>10 ) {
00075     // table on precalculated to 10 MeV
00076     answer = fDifferential->Integral(-1.0, 1.0, &aEnu, 1e-9);
00077     return answer;
00078   }
00079   if( fHTotalCrossSection==NULL ) setupTotalCrossSection();
00080   int bin = fHTotalCrossSection->FindBin(aEnu);
00081   Double_t answer1 =  fHTotalCrossSection->GetBinContent(bin);
00082   Double_t e1 = fHTotalCrossSection->GetBinCenter(bin);
00083   Double_t answer2, e2;
00084   if( bin!=1000 ) {
00085     answer2 =  fHTotalCrossSection->GetBinContent(bin+1);
00086     e2 = fHTotalCrossSection->GetBinCenter(bin+1);
00087   } else {
00088     answer2 =  fHTotalCrossSection->GetBinContent(bin-1);
00089     e2 = fHTotalCrossSection->GetBinCenter(bin-1);
00090   }
00091   answer = answer1 + (answer2-answer1)*( aEnu-e1)/(e2-e1); // answer1 + slope correction
00092   return answer;
00093 }
00094 
00095 void KRLInverseBeta::setupTotalCrossSection() {
00096   fHTotalCrossSection = new TH1D("htotalCross","Total #nu (p,n) e Cross Section", 1000, 0, 10);
00097   Double_t enu;
00098   for( int i=1 ; i<=1000 ; i++ ) {
00099     enu = fHTotalCrossSection->GetBinCenter(i);
00100     fHTotalCrossSection->SetBinContent(i, fDifferential->Integral(-1.0, 1.0, &enu, 1e-9) );
00101 
00102   }
00103 }
00104 
00105 
00108 Double_t KRLInverseBeta::PromptEnergyToNeutrinoEnergy(Double_t aE_prompt) {
00109   Double_t ePos = aE_prompt - gkMassElectron; // paper uses total E so only
00110   // subtract one mass
00111   Double_t a = -1/(gkMassProton);
00112   Double_t b = 1+fDelta/gkMassProton;
00113   Double_t c = -fYsq/gkMassProton - ePos - fDelta;
00114   Double_t answer1 = ( -b + sqrt(b*b-4*a*c) )/(2*a);
00115   Double_t answer2 = ( -b - sqrt(b*b-4*a*c) )/(2*a);
00116   //  printf("%e\t%e\t%e\t%e\t%e\n", aE_prompt, ePos, answer1, answer2, ePos+fDelta);
00117   return answer1;
00118 }
00119 
00124 Double_t gKRLDSigmaByDCosTheta(Double_t* x, Double_t*a) {
00125   Double_t cosTheta = x[0];
00126   Double_t enu = a[0];
00127   if( gInverseBeta==NULL ) gInverseBeta = new KRLInverseBeta();
00128   return gInverseBeta->DSigDCosTh(enu, cosTheta);
00129 
00130 }
00131 
00132 
00133 //a global function to allow the total cross section call be put into a TF1
00134 // a redirect to KRLInverseBeta::SigmaTot()
00135 Double_t gKRLSigmaTotal(Double_t* x, Double_t*a) {
00136   // a not used
00137   // x[0] = neutrino energy (MeV)
00138   if( gInverseBeta==NULL ) gInverseBeta = new KRLInverseBeta();
00139   return gInverseBeta->SigmaTot(x[0]);
00140 }
00141 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:07:23 2011 for InverseBeta by doxygen 1.4.7