43 using namespace starlightConstants;
84 double dEgamma, minEgamma;
88 int iEgamma, nEgamma,
beam;
96 cout<<
" Using Narrow Resonance ..."<<endl;
104 if( A_2 == 0 && A_1 >= 1 ){
107 }
else if( A_1 ==0 && A_2 >= 1){
123 for(iEgamma = 0 ; iEgamma < nEgamma; ++iEgamma){
125 ega[0] = exp(minEgamma + iEgamma*dEgamma );
126 ega[1] = exp(minEgamma + (iEgamma+1)*dEgamma );
127 ega[2] = 0.5*(ega[0]+ega[1]);
130 double dndE[3] = {0};
131 double full_int[3] = {0};
133 for(
int iEgaInt = 0 ; iEgaInt < 3; ++iEgaInt){
157 double lnQ2ratio = std::log(Q2_max/Q2_min)/nQ2;
158 double lnQ2_min = std::log(Q2_min);
161 for(
int iQ2 = 0 ; iQ2 < nQ2; ++iQ2){
163 double q2_1 = exp( lnQ2_min + iQ2*lnQ2ratio);
164 double q2_2 = exp( lnQ2_min + (iQ2+1)*lnQ2ratio);
165 double q2_12 = (q2_2+q2_1)/2.;
171 full_int[iEgaInt] += (q2_2-q2_1)*(
g(ega[iEgaInt],q2_1)*
getcsgA(ega[iEgaInt],q2_1,beam)
172 +
g(ega[iEgaInt],q2_2)*
getcsgA(ega[iEgaInt],q2_2,beam)
173 + 4.*
g(ega[iEgaInt],q2_12)*
getcsgA(ega[iEgaInt],q2_12,beam) );
177 dndE[iEgaInt] = dndE[iEgaInt]/6.;
178 full_int[iEgaInt] = full_int[iEgaInt]/6.;
183 dR += 4.*full_int[2];
184 dR = dR*(ega[1]-ega[0])/6.;
190 dR2 = dR2*(ega[1]-ega[0])/6.;
193 int_r2 = int_r2 + dR2;
201 cout<<
"The total cross section for backward production"<<endl;
202 cout<<
"should only be trusted for the omega. The exact omega"<<endl;
203 cout<<
"behavior is implemented for the rho. Other mesons use"<<endl;
204 cout<<
"the forward cross section dependence"<<endl;}
212 #ifdef _makeGammaPQ2_
231 int const nQ2bins = 38;
232 double const q2Edge[nQ2bins+1] = { 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09,
233 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
234 1, 2, 3, 4, 5, 6, 7, 8, 9,
235 10, 20, 30, 40, 50, 60, 70, 80, 90,
238 double full_x_section[nQ2bins] = {0};
239 double effective_flux[nQ2bins] = {0};
241 ofstream gamma_flux,total_xsec;
243 gamma_flux.open(
"estarlight_gamma_flux.csv");
244 total_xsec.open(
"estarlight_total_xsec.csv");
246 double dEgamma, minEgamma;
250 int iEgamma, nEgamma,
beam;
265 if( A_2 == 0 && A_1 >= 1 ){
268 }
else if( A_1 ==0 && A_2 >= 1){
280 for(
int iQ2Bin = 0 ; iQ2Bin < nQ2bins; ++iQ2Bin){
281 for(iEgamma = 0 ; iEgamma < nEgamma; ++iEgamma){
283 ega[0] = exp(minEgamma + iEgamma*dEgamma );
284 ega[1] = exp(minEgamma + (iEgamma+1)*dEgamma );
285 ega[2] = 0.5*(ega[0]+ega[1]);
289 double dndE[3] = {0};
290 double full_int[3] = {0};
292 for(
int iEgaInt = 0 ; iEgaInt < 3; ++iEgaInt){
294 double Q2_min = q2Edge[iQ2Bin];
295 double Q2_max = q2Edge[iQ2Bin+1];
296 double lnQ2ratio = std::log(Q2_max/Q2_min)/nQ2;
297 double lnQ2_min = std::log(Q2_min);
298 for(
int iQ2 = 0 ; iQ2 < nQ2; ++iQ2){
300 double q2_1 = exp( lnQ2_min + iQ2*lnQ2ratio);
301 double q2_2 = exp( lnQ2_min + (iQ2+1)*lnQ2ratio);
302 double q2_12 = (q2_2+q2_1)/2.;
304 dndE[iEgaInt] +=(q2_2-q2_1)*(
photonFlux(ega[iEgaInt],q2_1)
308 full_int[iEgaInt] += (q2_2-q2_1)*(
g(ega[iEgaInt],q2_1)*
getcsgA(ega[iEgaInt],q2_1,beam)
309 +
g(ega[iEgaInt],q2_2)*
getcsgA(ega[iEgaInt],q2_2,beam)
310 + 4.*
g(ega[iEgaInt],q2_12)*
getcsgA(ega[iEgaInt],q2_12,beam) );
313 dndE[iEgaInt] = dndE[iEgaInt]/6.;
314 full_int[iEgaInt] = full_int[iEgaInt]/6.;
319 dR += 4.*full_int[2];
320 dR = dR*(ega[1]-ega[0])/6.;
326 dR2 = dR2*(ega[1]-ega[0])/6.;
328 full_x_section[iQ2Bin] += dR;
329 effective_flux[iQ2Bin] += dR2;
332 gamma_flux<<q2Edge[iQ2Bin]<<
","<<q2Edge[iQ2Bin+1]<<
","<<effective_flux[iQ2Bin]<<endl;
333 total_xsec<<q2Edge[iQ2Bin]<<
","<<q2Edge[iQ2Bin+1]<<
","<<full_x_section[iQ2Bin]<<endl;
343 if (0.01*x_section > 1.){
344 cout<< name.c_str() <<0.01*x_section<<
" barn."<<endl;
345 }
else if (10.*x_section > 1.){
346 cout<< name.c_str() <<10.*x_section<<
" mb."<<endl;
347 }
else if (10000.*x_section > 1.){
348 cout<< name.c_str() <<10000.*x_section<<
" microb."<<endl;
349 }
else if (10000000.*x_section > 1.){
350 cout<< name.c_str() <<10000000.*x_section<<
" nanob."<<endl;
351 }
else if (1.E10*x_section > 1.){
352 cout<< name.c_str() <<1.E10*x_section<<
" picob."<<endl;
354 cout<< name.c_str() <<1.E13*x_section<<
" femtob."<<endl;