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

In This Package:

Li9He8Decay.cc

Go to the documentation of this file.
00001 // This program generates Li9/He8 events.
00002 // Sep. 09,2009  qinghe@princeton.edu
00003 
00004 #include "Li9He8Decay.hh"
00005 
00006 #include "Randomize.hh"
00007 #include <CLHEP/Random/RandBreitWigner.h>
00008 
00009 
00010 Li9He8Decay::Li9He8Decay()
00011 {
00012 }
00013 
00014 void Li9He8Decay::RandomVector(G4ThreeVector& aVec)
00015 {
00016   double theta, phi;
00017   //double rn1 = G4UniformRand();
00018   double rn1 = G4UniformRand();
00019   double rn2 = G4UniformRand();
00020   
00021   theta = acos(1-2*rn1);
00022   phi = 2*pi*rn2;
00023   
00024   //aVec.SetMagThetaPhi(1.,theta,phi);
00025   aVec.setRThetaPhi(1.,theta,phi);
00026 }
00027 
00028 //Generate Li9 alpha sepectrum according data 
00029 //Nuclear Physics A450(1990) 189-208  fig.4
00030 double Li9He8Decay::GetLi9AlphaEnergy(int whichcase)
00031 {
00032   //alpha sectra 
00033   double x[181],y[181];
00034 x[0]=0.0256274;y[0]=1831.06;
00035 x[1]=0.0633363;y[1]=2024.86;x[2]=0.101034;y[2]=2211.13;x[3]=0.119957;y[3]=2507.88;
00036 x[4]=0.13888;y[4]=2844.46;x[5]=0.170319;y[5]=3145.64;x[6]=0.214286;y[6]=3434.87;
00037 x[7]=0.25815;y[7]=3348.43;x[8]=0.295687;y[8]=3064.9;x[9]=0.326944;y[9]=2770.36;
00038 x[10]=0.345638;y[10]=2441.97;x[11]=0.364344;y[11]=2179.81;x[12]=0.383038;y[12]=1921.42;
00039 x[13]=0.407922;y[13]=1550.56;x[14]=0.432897;y[14]=1384.05;x[15]=0.457838;y[15]=1189.57;
00040 x[16]=0.464199;y[16]=1315.73;x[17]=0.476544;y[17]=1061.86;x[18]=0.488968;y[18]=936.029;
00041 x[19]=0.513955;y[19]=846.107;x[20]=0.538884;y[20]=718.107;x[21]=0.551309;y[21]=633.01;
00042 x[22]=0.557487;y[22]=572.266;x[23]=0.563642;y[23]=504.472;x[24]=0.576067;y[24]=444.691;
00043 x[25]=0.607312;y[25]=396.92;x[26]=0.6258;y[26]=278.848;x[27]=0.626018;y[27]=354.308;
00044 x[28]=0.632001;y[28]=258.526;x[29]=0.656862;y[29]=203.433;x[30]=0.675785;y[30]=230.735;
00045 x[31]=0.68186;y[31]=186.222;x[32]=0.694296;y[32]=166.237;x[33]=0.706675;y[33]=139.332;
00046 x[34]=0.725415;y[34]=129.167;x[35]=0.75039;y[35]=115.296;x[36]=0.888229;y[36]=104.146;
00047 x[37]=0.93842;y[37]=108.125;x[38]=0.982421;y[38]=122.617;x[39]=1.0074;y[39]=109.449;
00048 x[40]=1.03881;y[40]=118.025;x[41]=1.17665;y[41]=106.611;x[42]=1.19554;y[42]=116.432;
00049 x[43]=1.37112;y[43]=120.785;x[44]=1.40866;y[44]=110.558;x[45]=1.43994;y[45]=102.484;
00050 x[46]=1.54651;y[46]=101.133;x[47]=1.56535;y[47]=105.018;x[48]=1.59041;y[48]=102.387;
00051 x[49]=1.59656;y[49]=90.2576;x[50]=1.61546;y[50]=99.8223;x[51]=1.63421;y[51]=93.7139;
00052 x[52]=1.65298;y[52]=89.0953;x[53]=1.69686;y[53]=89.0707;x[54]=1.71557;y[54]=79.5085;
00053 x[55]=1.74074;y[55]=87.9307;x[56]=1.75318;y[56]=78.494;x[57]=1.88492;y[57]=85.6637;
00054 x[58]=1.89738;y[58]=78.4226;x[59]=1.91607;y[59]=69.1267;x[60]=1.94116;y[60]=69.9925;
00055 x[61]=1.96634;y[61]=78.3886;x[62]=1.99144;y[62]=80.3772;x[63]=2.00387;y[63]=70.8524;
00056 x[64]=2.01002;y[64]=62.4587;x[65]=2.02249;y[65]=57.9045;x[66]=2.03513;y[66]=64.8556;
00057 x[67]=2.14164;y[67]=59.3383;x[68]=2.15406;y[68]=52.3066;x[69]=2.18549;y[69]=57.1204;
00058 x[70]=2.21056;y[70]=56.396;x[71]=2.22305;y[71]=53.6187;x[72]=2.29195;y[72]=49.6914;
00059 x[73]=2.31701;y[73]=49.0612;x[74]=2.31701;y[74]=49.0612;x[75]=2.3609;y[75]=49.0476;
00060 x[76]=2.49263;y[76]=52.8572;x[77]=2.50507;y[77]=47.1846;x[78]=2.50507;y[78]=47.1846;
00061 x[79]=2.52389;y[79]=47.7774;x[80]=2.54265;y[80]=45.4228;x[81]=2.54265;y[81]=45.4228;
00062 x[82]=2.56134;y[82]=40.0385;x[83]=2.58019;y[83]=41.5767;x[84]=2.58019;y[84]=41.5767;
00063 x[85]=2.68073;y[85]=53.4643;x[86]=2.69943;y[86]=47.7246;x[87]=2.70559;y[87]=42.0708;
00064 x[88]=2.71174;y[88]=37.0868;x[89]=2.73056;y[89]=37.5528;x[90]=2.74322;y[90]=42.5944;
00065 x[91]=2.77454;y[91]=41.5258;x[92]=2.78698;y[92]=37.0692;x[93]=2.7994;y[93]=32.6765;
00066 x[94]=2.82444;y[94]=31.0648;x[95]=2.83082;y[95]=35.2368;x[96]=2.8372;y[96]=39.969;
00067 x[97]=2.87471;y[97]=35.227;x[98]=2.89977;y[98]=34.7803;x[99]=2.93111;y[99]=34.3378;
00068 x[100]=2.9874;y[100]=29.507;x[101]=3.00005;y[101]=33.4684;x[102]=3.01259;y[102]=33.4658;
00069 x[103]=3.03149;y[103]=37.0122;x[104]=3.05658;y[104]=37.4757;x[105]=3.07529;y[105]=33.4525;
00070 x[106]=3.10033;y[106]=32.206;x[107]=3.13794;y[107]=31.7951;x[108]=3.15658;y[108]=26.6481;
00071 x[109]=3.16297;y[109]=30.2269;x[110]=3.18181;y[110]=31.3881;x[111]=3.18797;y[111]=27.6697;
00072 x[112]=3.19412;y[112]=24.3917;x[113]=3.21287;y[113]=22.8991;x[114]=3.22552;y[114]=25.648;
00073 x[115]=3.2319;y[115]=29.0925;x[116]=3.25687;y[116]=25.9683;x[117]=3.34442;y[117]=20.1704;
00074 x[118]=3.36333;y[118]=22.5908;x[119]=3.38219;y[119]=23.7563;x[120]=3.41357;y[120]=24.667;
00075 x[121]=3.45105;y[121]=21.1992;x[122]=3.46347;y[122]=18.6871;x[123]=3.47599;y[123]=18.2204;
00076 x[124]=3.495;y[124]=22.8584;x[125]=3.52628;y[125]=21.1892;x[126]=3.55766;y[126]=22.0015;
00077 x[127]=3.58894;y[127]=20.3948;x[128]=3.60778;y[128]=20.913;x[129]=3.63899;y[129]=17.9737;
00078 x[130]=3.69545;y[130]=18.6598;x[131]=3.73912;y[131]=14.6816;x[132]=3.75157;y[132]=13.4406;
00079 x[133]=3.75796;y[133]=15.2456;x[134]=3.88329;y[134]=14.3031;x[135]=3.93996;y[135]=18.6311;
00080 x[136]=3.99617;y[136]=14.6578;x[137]=4.0086;y[137]=13.0847;x[138]=4.01502;y[138]=15.414;
00081 x[139]=4.03378;y[139]=14.6543;x[140]=4.04623;y[140]=13.2476;x[141]=4.14013;y[141]=11.2386;
00082 x[142]=4.15255;y[142]=9.90679;x[143]=4.17144;y[143]=10.8194;x[144]=4.17782;y[144]=12.2724;
00083 x[145]=4.22172;y[145]=12.4246;x[146]=4.25924;y[146]=11.0895;x[147]=4.28449;y[147]=13.3955;
00084 x[148]=4.34105;y[148]=15.5775;x[149]=4.37201;y[149]=10.1457;x[150]=4.46601;y[150]=9.64108;
00085 x[151]=4.5099;y[151]=9.76068;x[152]=4.51629;y[152]=11.0715;x[153]=4.55383;y[153]=10.1341;
00086 x[154]=4.61626;y[154]=7.58054;x[155]=4.61642;y[155]=6.04361;x[156]=4.70998;y[156]=5.32303;
00087 x[157]=4.77286;y[157]=6.50995;x[158]=4.80433;y[158]=7.47671;x[159]=4.82321;y[159]=8.06317;
00088 x[160]=4.8796;y[160]=7.76119;x[161]=4.96742;y[161]=8.15803;x[162]=5.09882;y[162]=6.09977;
00089 x[163]=5.13653;y[163]=6.74537;x[164]=5.19263;y[164]=4.7377;x[165]=5.25514;y[165]=3.82235;
00090 x[166]=5.33026;y[166]=3.36807;x[167]=5.3363;y[167]=2.61743;x[168]=5.3675;y[168]=2.22137;
00091 x[169]=5.43639;y[169]=2.05867;x[170]=5.58667;y[170]=1.66001;x[171]=5.66189;y[171]=1.63843;
00092 x[172]=5.71198;y[172]=1.51861;x[173]=5.84989;y[173]=1.47951;x[174]=5.9878;y[174]=1.45971;
00093 x[175]=6.11946;y[175]=1.4585;x[176]=6.18844;y[176]=1.47636;x[177]=6.2511;y[177]=1.42101;
00094 x[178]=6.45168;y[178]=1.34943;x[179]=6.65234;y[179]=1.39967;x[180]=6.92197;y[180]=1.45114;
00095  
00096   bool accept = 0;
00097   double alphaenergy = -1;
00098   if( whichcase == 1 ){//case 1, from x[0] to x[44]
00099     while(!accept){
00100       double sampling = G4UniformRand()*x[44];
00101       //find y value of the sampling point 
00102       double yvalue = 0;
00103       for(int i=0;i<43;i++){
00104         if(sampling > x[i] && sampling < x[i+1]){
00105           yvalue = (y[i]+y[i+1])/2.;
00106           break;
00107         }
00108       }
00109 
00110       double max = 3500.0; //maximum of case 1
00111       if( yvalue > G4UniformRand()*max ){
00112         alphaenergy = sampling;
00113         accept = 1;
00114       }
00115     }
00116   }
00117   if( whichcase == 2 ){//case 2, from x[44] to x[180]
00118     while(!accept){
00119       double sampling = G4UniformRand()*(7.0-x[44])+x[44];
00120       //find y value of the sampling point 
00121       double yvalue = 0;
00122       for(int i=44;i<180;i++){
00123         if(sampling > x[i] && sampling < x[i+1]){
00124           yvalue = (y[i]+y[i+1])/2.;
00125           break;
00126         }
00127       }
00128 
00129       double max = 111.0; //maximum of case 2
00130       if( yvalue > G4UniformRand()*max ){
00131         alphaenergy = sampling;
00132         accept = 1;
00133       }
00134     }
00135   }
00136 
00137   return alphaenergy;
00138 }
00139 
00140 //Generate He8 neutron sepectrum according data 
00141 //Nuclear Physics A366(1981) 461-468  fig.4
00142 double Li9He8Decay::GetHe8NeutronEnergy()
00143 {
00144   double x[2000];
00145   double y[2000];
00146 x[0]=0.153478;y[0]=1.6369;
00147 x[1]=0.219561;y[1]=1.9881;x[2]=0.297456;y[2]=2.35119;x[3]=0.367927;y[3]=2.32143;
00148 x[4]=0.442927;y[4]=1.94643;x[5]=0.531232;y[5]=1.96429;x[6]=0.60873;y[6]=2.22619;
00149 x[7]=0.684524;y[7]=2.05357;x[8]=0.778758;y[8]=2.08333;x[9]=0.855089;y[9]=2.04762;
00150 x[10]=0.92458;y[10]=1.76786;x[11]=1.00093;y[11]=1.7381;x[12]=1.08301;y[12]=1.66667;
00151 x[13]=1.17085;y[13]=1.56548;x[14]=1.22908;y[14]=1.41667;x[15]=1.31653;y[15]=1.21429;
00152 x[16]=1.38128;y[16]=1.22619;x[17]=1.48088;y[17]=1.125;x[18]=1.55124;y[18]=1.06548;
00153 x[19]=1.63894;y[19]=0.928571;x[20]=1.7152;y[20]=0.875;x[21]=1.79743;y[21]=0.845238;
00154 x[22]=1.87967;y[22]=0.815476;x[23]=1.9497;y[23]=0.672619;x[24]=2.02633;y[24]=0.714286;
00155 x[25]=2.10212;y[25]=0.541667;x[26]=2.17264;y[26]=0.52381;x[27]=2.2489;y[27]=0.470238;
00156 x[28]=2.33665;y[28]=0.345238;x[29]=2.41349;y[29]=0.440476;x[30]=2.49542;y[30]=0.333333;
00157 x[31]=2.57782;y[31]=0.345238;x[32]=2.65437;y[32]=0.363095;x[33]=2.73049;y[33]=0.27381;
00158 x[34]=2.80717;y[34]=0.327381;x[35]=2.88336;y[35]=0.255952;x[36]=2.96555;y[36]=0.214286;
00159 x[37]=3.04797;y[37]=0.232143;x[38]=3.11811;y[38]=0.119048;x[39]=3.19484;y[39]=0.184524;
00160 x[40]=3.27659;y[40]=0.0297619;x[41]=3.34753;y[41]=0.119048;x[42]=3.43574;y[42]=0.113095;
00161 
00162   bool accept = 0;
00163   double nenergy = 0;
00164   while(!accept){
00165     double sampling = G4UniformRand()*4;
00166     //find y value of the sampling point 
00167     double yvalue = 0;
00168     for(int i=0;i<42;i++){
00169       if(sampling > x[i] && sampling < x[i+1]){
00170         yvalue = (y[i]+y[i+1])/2.;
00171         break;
00172       }
00173     }
00174     double max = 2.5; //maximum 
00175     if( yvalue > G4UniformRand()*max ){
00176       nenergy = sampling;
00177       accept = 1;
00178     }
00179   }
00180   return nenergy;
00181 }  
00182 
00183 // Chooses an intermediate energy for decays with broad levels
00184 // by thowing according to a Breit-Wigner form.  It is constrained,
00185 // however, to be >0 and less than the maximum available energy
00186 double Li9He8Decay::GetIntermediateEnergy(double peak, double width, double max)
00187 {
00188   if (width==0) return peak;
00189 
00190   double energy= -1;
00191   do {
00192         energy = RandBreitWigner::shoot(peak,width);
00193     //energy = m_breitwigner()*width+peak;
00194   } while (energy < 0 || energy > max);
00195   
00196   return energy;
00197 }
00198 
00199 //This Fermi function is copyed from Geant4
00200 double Li9He8Decay::FermiFunc(double T, double Z) {
00201   double A1, A2;
00202   double P, U, S, Y;
00203   double F2;
00204   double E = T+1.;  
00205   P=std::sqrt(E*E-1.0) ;
00206   U=Z/137.0;
00207   S=std::sqrt(1.0-U*U) - 1.;
00208   Y = 2*pi*U*E/P;
00209   A1 = U*U*E*E + P*P/4.;
00210   A2 = std::fabs(Y/(1-std::exp(-Y)));
00211   F2 = std::pow(A1,S) * A2; 
00212   return F2;
00213 }
00214 // Unnormalized beta spectrum (allowed approximation, including fermi factor)
00215 // Z is for daughter nucleus, i.e. 3 for He-8, 4 for Li-9
00216 double Li9He8Decay::BetaSpectrum(double E, double QOfDecay, double Z)
00217 {
00218   if(E>QOfDecay) return 0;
00219   else{
00220     return FermiFunc(E/electron_mass_c2, Z)*sqrt(E*E+2*electron_mass_c2*E)*(QOfDecay-E)*(QOfDecay-E)*(E+electron_mass_c2);
00221   }
00222 }
00223 
00224 //Get the spectrum max by sampling 100 events
00225 double Li9He8Decay::GetSpectrumMax(double QOfDecay, int Z)
00226 {
00227   double max = 0;
00228   int nbins = 100;
00229   double de = QOfDecay/nbins;
00230   for(int i=0; i<100; i++){
00231     double E = de*(i+1);
00232     double betaE = FermiFunc(E/electron_mass_c2, Z)*sqrt(E*E+2*electron_mass_c2*E)*(QOfDecay-E)*(QOfDecay-E)*(E+electron_mass_c2);
00233     if(betaE > max) max = betaE;
00234   }
00235 
00236   return max*1.2; //enlarge a little bit to assure it is larger than max
00237 }
00238 // Uses accept/reject method to generate electron energy according to beta spectrum
00239 // the Z is for the daughter nucleus
00240 double Li9He8Decay::GetElectronEnergy(double QOfDecay, int Z, double max)
00241 {
00242   double trialE, rn_y;
00243   do {
00244     trialE = QOfDecay*G4UniformRand();
00245     rn_y = max*G4UniformRand();
00246   } while ( rn_y > BetaSpectrum(trialE,QOfDecay,Z) );
00247   
00248   return trialE;
00249 }
00250 
00251 //This is the neutron spectrum line shape for Li9 2.43MeV state 
00252 //ref. Nuclear Physics A450(1990) 189-208 
00253 double Li9He8Decay::Li9NeutronLineShape1(double x)
00254 {
00255   double mean  = 0.2279;
00256   double width = 0.3266;
00257   double norm  = 674.1;
00258   double mean2 = 0.6661;
00259   double width2= 0.05699;
00260   double norm2 = 24.78;
00261 
00262   double sum = norm*width/((x-mean)*(x-mean)+width*width/4.);
00263   sum += norm2*width2/((x-mean2)*(x-mean2)+width2*width2/4.);  
00264   return sum;
00265 }
00266 
00267 //This is the neutron spectrum line shape for Li9 2.43MeV state 
00268 //ref. Nuclear Physics A450(1990) 189-208 
00269 double Li9He8Decay::Li9NeutronLineShape2(double x)
00270 {
00271   double mean  = 1.253;
00272   double width = 0.8205;
00273   double norm  = 219;
00274 
00275   return norm*width/((x-mean)*(x-mean)+width*width/4.);
00276 }
00277 //This is the neutron spectrum line shape for Li9 2.78MeV state 
00278 //ref. Nuclear Physics A450(1990) 189-208 
00279 double Li9He8Decay::Li9NeutronLineShape3(double x)
00280 {
00281   double mean  = 0.8;
00282   double width = 1.5;
00283   double norm  = 100;
00284 
00285   return norm*width/((x-mean)*(x-mean)+width*width/4.);
00286 }
00287 
00288 //Get Li9 neutron spectrum from the above line shapes 
00289 double Li9He8Decay::GetLi9NeutronEnergy(int whichshape, double max)
00290 {
00291   bool accept = 0;
00292   double trial_E = 0;
00293   double shapeV;
00294   while(!accept){
00295     double rand1 = G4UniformRand()*3.;//random energy
00296     double rand2 = G4UniformRand()*max;
00297     if(whichshape == 1) {
00298       shapeV = Li9NeutronLineShape1(rand1);
00299     }
00300     else if(whichshape == 2) {
00301       shapeV = Li9NeutronLineShape2(rand1);
00302     }
00303     else if(whichshape == 3) {
00304       rand1 = G4UniformRand()*10.;
00305       shapeV = Li9NeutronLineShape3(rand1);
00306     }
00307     else {
00308       cout << "Error! The first parameter must be 1, 2 or 3." << endl; 
00309       break;
00310     }
00311     if(rand2 < shapeV) {//accept
00312       trial_E = rand1;
00313       accept=1;
00314     }
00315   }    
00316 
00317   return trial_E;
00318 }
00319 
00320 // For broad states, the final energy of the daughter nucleus is thrown according 
00321 // to a Breit-Wigner form
00322 //by default, only decays with neutrons are considered.
00323 //for complete decay, use the -complete_decay option
00324 void Li9He8Decay::Li9Decay(G4ThreeVector &pElectron,G4ThreeVector &pNeutron, G4ThreeVector &pAlpha1,
00325                       G4ThreeVector &pAlpha2,double alpha_mass,bool complete_decay)
00326 {
00327   double rn;
00328   //default is to skip the decay without neutron
00329   if(complete_decay) rn= G4UniformRand();
00330   else rn = G4UniformRand()*(1.-0.492)+0.492;//start from 0.492
00331   double intermediateEnergy = 0;
00332   double betaenergy = 0;
00333   double nenergy = 0;
00334   double aenergy1 = 0;
00335   double aenergy2 = 0;
00336 
00337   double max = 0;
00338   if (rn<0.492){
00339     max = GetSpectrumMax(13.6067,4);
00340     betaenergy = GetElectronEnergy(13.6067,4,max);
00341   }
00342   else if (rn<0.789) {//case 1 for alpha spectra
00343     intermediateEnergy = GetIntermediateEnergy(2.429,0.00077,13.6067);
00344     max = GetSpectrumMax(13.6067-intermediateEnergy,4);
00345     betaenergy = GetElectronEnergy(13.6067-intermediateEnergy,4,max);
00346     nenergy = GetLi9NeutronEnergy(1,8264);
00347     aenergy1 = GetLi9AlphaEnergy(1);
00348     aenergy2 = GetLi9AlphaEnergy(1);
00349   }
00350   else if (rn < 0.947) {//case 1 for alpha spectra
00351     intermediateEnergy = GetIntermediateEnergy(2.78,1.08,13.6067);
00352     max = GetSpectrumMax(13.6067-intermediateEnergy,4);
00353     betaenergy = GetElectronEnergy(13.6067-intermediateEnergy,4,max);
00354     nenergy = GetLi9NeutronEnergy(2,1068);
00355     aenergy1 = GetLi9AlphaEnergy(1);
00356     aenergy2 = GetLi9AlphaEnergy(1);
00357   }
00358   else if (rn < 0.962) {//case 2 for alpha spectra
00359     intermediateEnergy = GetIntermediateEnergy(7.94,1.0,13.6067);
00360     max = GetSpectrumMax(13.6067-intermediateEnergy,4);
00361     betaenergy = GetElectronEnergy(13.6067-intermediateEnergy,4,max);
00362     nenergy = GetLi9NeutronEnergy(3,300);
00363     aenergy1 = GetLi9AlphaEnergy(2);
00364     aenergy2 = GetLi9AlphaEnergy(2);
00365   }
00366   else if (rn < 0.973) {//case 2 for alpha spectra
00367     intermediateEnergy = GetIntermediateEnergy(11.283,0.575,13.6067);
00368     max = GetSpectrumMax(13.6067-intermediateEnergy,4);
00369     betaenergy = GetElectronEnergy(13.6067-intermediateEnergy,4,max);
00370     nenergy = GetLi9NeutronEnergy(3,300);
00371     aenergy1 = GetLi9AlphaEnergy(2);
00372     aenergy2 = GetLi9AlphaEnergy(2);
00373   }
00374   else {//case 2 for alpha spectra
00375     intermediateEnergy = GetIntermediateEnergy(11.81,0.400,13.6067);
00376     max = GetSpectrumMax(13.6067-intermediateEnergy,4);
00377     betaenergy = GetElectronEnergy(13.6067-intermediateEnergy,4,max);
00378     nenergy = GetLi9NeutronEnergy(3,300);
00379     aenergy1 = GetLi9AlphaEnergy(2);
00380     aenergy2 = GetLi9AlphaEnergy(2);
00381   }
00382 
00383   // Electron momentum vector is isotropic
00384   double eMom = sqrt(2*betaenergy*electron_mass_c2+betaenergy*betaenergy);
00385   eMom *= MeV;
00386   RandomVector(pElectron);
00387   pElectron *= eMom;
00388 
00389   // Neutron momentum vector is isotropic
00390   if(nenergy>0){//there is neutron come out
00391     double nMom = sqrt(2*nenergy*neutron_mass_c2+nenergy*nenergy);
00392     nMom *= MeV;
00393     RandomVector(pNeutron);
00394     pNeutron *= nMom;
00395 
00396     //alpha momentum setup isotropically
00397     double aMom1 = sqrt(2*aenergy1*alpha_mass+aenergy1*aenergy1);
00398     aMom1 *= MeV;
00399     RandomVector(pAlpha1);
00400     pAlpha1 *= aMom1;
00401 
00402     //alpha2
00403     double aMom2 = sqrt(2*aenergy2*alpha_mass+aenergy2*aenergy2);
00404     aMom2 *= MeV;
00405     RandomVector(pAlpha2);
00406     pAlpha2 *= aMom2;
00407   }  
00408 }
00409 
00410 //He8 decay
00411 //by default, only decays with neutrons are considered.
00412 //for complete decay, use the -complete_decay option
00413 //ref. Nucler Physics A366 (1981) 461-468, Nuclear Physics A487 (1988) 269-278 
00414 void Li9He8Decay::He8Decay(G4ThreeVector &pElectron, G4ThreeVector &pNeutron, G4ThreeVector &pGamma,
00415               bool complete_decay)
00416 {
00417   double rn;
00418   //degault is to skip the decay without neutron
00419   if(complete_decay) rn= G4UniformRand();
00420   else rn = G4UniformRand()*(1-0.84)+0.84; //start from 0.84
00421   double intermediateEnergy = 0;
00422   double betaenergy = 0;
00423   double nenergy = 0;
00424   double gammaenergy = 0;
00425 
00426   double max = 0;
00427   if (rn<0.84){//84% to the 0.9808MeV state, no neutron
00428     max = GetSpectrumMax(10.649-0.9808,3);//(Q,Z)
00429     betaenergy = GetElectronEnergy(10.649-0.9808,3,max);
00430     gammaenergy = 0.9808;
00431   }
00432   else {//16% neutron
00433     nenergy = GetHe8NeutronEnergy();
00434     if( G4UniformRand()<0.32 ){//32% gamma 
00435       gammaenergy = 0.478;
00436     }
00437     double He8Br = G4UniformRand();
00438     if( He8Br<7.8/(7.8+2.6) ){//3.21 MeV state
00439       intermediateEnergy = GetIntermediateEnergy(3.21,1.0,10.649);
00440       max = GetSpectrumMax(10.649-intermediateEnergy,3);
00441       betaenergy = GetElectronEnergy(10.649-intermediateEnergy,3,max);
00442     }
00443     else {//5.4 MeV state
00444       intermediateEnergy = GetIntermediateEnergy(5.4,0.65,10.649);
00445       max = GetSpectrumMax(10.649-intermediateEnergy,3);
00446       betaenergy = GetElectronEnergy(10.649-intermediateEnergy,3,max);
00447     }
00448   }
00449 
00450   // Electron momentum vector is isotropic
00451   double eMom = sqrt(2*betaenergy*electron_mass_c2+betaenergy*betaenergy);
00452   eMom *= MeV;
00453   RandomVector(pElectron);
00454   pElectron *= eMom;
00455 
00456   // Neutron momentum vector is isotropic
00457   if(nenergy>0){//there is neutron come out
00458     //neutron momentum setup isotropically
00459     double nMom = sqrt(2*nenergy*neutron_mass_c2+nenergy*nenergy);
00460     nMom *= MeV;
00461     RandomVector(pNeutron);
00462     pNeutron *= nMom;
00463   }
00464 
00465   //gamma momentum setup isotropically
00466   if(gammaenergy>0){
00467     RandomVector(pGamma);
00468     pGamma *= gammaenergy*MeV;
00469   }
00470 }
00471 
00472 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:53:24 2011 for DetSim by doxygen 1.4.7