48 using namespace starlightConstants;
54 ,_ptBinWidthInterference(inputParametersInstance.ptBinWidthInterference())
55 ,_interferenceStrength(inputParametersInstance.interferenceStrength())
56 ,_protonEnergy(inputParametersInstance.protonEnergy())
57 ,_beamLorentzGamma(inputParametersInstance.beamLorentzGamma())
58 ,_baseFileName(inputParametersInstance.baseFileName())
59 ,_maxW(inputParametersInstance.maxW())
60 ,_minW(inputParametersInstance.minW())
61 ,_nmbWBins(inputParametersInstance.nmbWBins())
62 ,_maxRapidity(inputParametersInstance.maxRapidity())
63 ,_nmbRapidityBins(inputParametersInstance.nmbRapidityBins())
64 ,_productionMode(inputParametersInstance.productionMode())
65 ,_beamBreakupMode(inputParametersInstance.beamBreakupMode())
66 ,_interferenceEnabled(inputParametersInstance.interferenceEnabled())
67 ,_maxPtInterference(inputParametersInstance.maxPtInterference())
68 ,_nmbPtBinsInterference(inputParametersInstance.nmbPtBinsInterference())
70 cout <<
"Creating Luminosity Tables."<<endl;
72 cout <<
"Luminosity Tables created."<<endl;
86 double testint,dndWdY;
91 std::string wyFileName;
95 wylumfile.precision(15);
103 wylumfile.open(wyFileName.c_str());
107 wylumfile <<
_maxW <<endl;
108 wylumfile <<
_minW <<endl;
124 for(
unsigned int i = 0; i <=
_nWbins - 1; ++i) {
125 W =
_wMin + double(i)*dW + 0.5*dW;
127 wylumfile << W << endl;
132 for(
unsigned int i = 0; i <=
_nYbins - 1; ++i) {
133 Y = -1.0*
_yMax + double(i)*dY + 0.5*
dY;
134 wylumfile << Y << endl;
145 for(
unsigned int i = 0; i <=
_nWbins - 1; ++i) {
147 W =
_wMin + double(i)*dW + 0.5*dW;
149 for(
unsigned int j = 0; j <=
_nYbins - 1; ++j) {
151 Y = -1.0*
_yMax + double(j)*dY + 0.5*
dY;
153 if( A_2 == 1 && A_1 != 1 ){
155 Egamma = 0.5*W*exp(-Y);
157 }
else if( A_1 ==1 && A_2 != 1){
159 Egamma = 0.5*W*exp(Y);
162 Egamma = 0.5*W*exp(Y);
175 wylumfile << dndWdY << endl;
182 if( !( (A_2 == 1 && A_1 != 1) || (A_1 == 1 && A_2 != 1) ) ){
184 for(
unsigned int i = 0; i <=
_nWbins - 1; ++i) {
186 W =
_wMin + double(i)*dW + 0.5*dW;
188 for(
unsigned int j = 0; j <=
_nYbins - 1; ++j) {
190 Y = -1.0*
_yMax + double(j)*dY + 0.5*
dY;
193 Egamma = 0.5*W*exp(-Y);
204 wylumfile << dndWdY << endl;
210 wylumfile << bwnorm << endl;
241 std::string wyFileName;
245 wylumfile.precision(15);
247 wylumfile.open(wyFileName.c_str(),ios::app);
249 double param1pt[500],param2pt[500];
250 double *ptparam1=param1pt;
251 double *ptparam2=param2pt;
252 double dY=0.,Yp=0.,Egamma1=0.,Egamma2=0.,Wgp=0.,cs=0.,cvma=0.,Av=0.,tmin=0.,tmax=0.,
ax=0.,bx=0.;
253 double csgA=0.,
t=0.,sig_ga_1=0.,sig_ga_2=0.,bmax=0.,bmin=0.,
db=0.,pt=0.,sum1=0.,b=0.,A1=0.,
A2=0.;
254 double sumg=0.,
theta=0.,amp_i_2=0.,sumint=0.;
257 double xg[16]={.0483076656877383162E0,.144471961582796493E0,
258 .239287362252137075E0, .331868602282127650E0,
259 .421351276130635345E0, .506899908932229390E0,
260 .587715757240762329E0, .663044266930215201E0,
261 .732182118740289680E0, .794483795967942407E0,
262 .849367613732569970E0, .896321155766052124E0,
263 .934906075937739689E0, .964762255587506430E0,
264 .985611511545268335E0, .997263861849481564E0};
265 double ag[16]={.0965400885147278006E0, .0956387200792748594E0,
266 .0938443990808045654E0, .0911738786957638847E0,
267 .0876520930044038111E0, .0833119242269467552E0,
268 .0781938957870703065E0, .0723457941088485062E0,
269 .0658222227763618468E0, .0586840934785355471E0,
270 .0509980592623761762E0, .0428358980222266807E0,
271 .0342738629130214331E0, .0253920653092620595E0,
272 .0162743947309056706E0, .00701861000947009660E0};
290 for(
int jy=1;jy<=numy;jy++){
291 Yp=-Ymax+((double(jy)-0.5)*
dY);
296 Egamma1 = 0.5*mass*exp(Yp);
297 Egamma2 = 0.5*mass*exp(-Yp);
320 tmin = ((mass*
mass)/(4.*Egamma1*gamma_em)*(mass*
mass)/(4.*Egamma1*gamma_em));
322 ax = 0.5*(tmax-tmin);
323 bx = 0.5*(tmax+tmin);
326 for(
int k=0;
k<NGAUSS;
k++){
327 t = sqrt(
ax*xg[
k]+bx);
329 t = sqrt(
ax*(-xg[
k])+bx);
333 csgA = 0.5*(tmax-tmin)*csgA;
340 Wgp=sqrt(2.*Egamma2*(Ep+sqrt(Ep*Ep-starlightConstants::protonMass*
341 starlightConstants::protonMass))+starlightConstants::protonMass*starlightConstants::protonMass);
351 tmin = (((mass*
mass)/(4.*Egamma2*gamma_em))*((mass*mass)/(4.*Egamma2*gamma_em)));
353 ax = 0.5*(tmax-tmin);
354 bx = 0.5*(tmax+tmin);
357 for(
int k=0;
k<NGAUSS;
k++){
358 t = sqrt(
ax*xg[
k]+bx);
360 t = sqrt(
ax*(-xg[
k])+bx);
364 csgA = 0.5*(tmax-tmin)*csgA;
373 ptparam1=
vmsigmapt(mass,Egamma1,ptparam1, 2);
374 ptparam2=
vmsigmapt(mass,Egamma2,ptparam2, 1);
382 if (Egamma1 >=Egamma2) {
390 db = (bmax-bmin)/
float(NBIN);
392 for(
int i=1;i<=NPT;i++){
397 for(
int j=1;j<=NBIN;j++){
399 b = bmin + (float(j)-0.5)*
db;
405 for(
int k=0;
k<NGAUSS;
k++){
411 sumg = sumg+ag[
k]*amp_i_2;
418 sum1 = sum1 + sumint;
446 double pxmax=0.,pymax=0.,
dx=0.,Epom=0.,pt=0.,px0=0.,py0=0.,sum=0.,sumy=0.;
447 double py=0.,px=0.,
pt1=0.,
pt2=0.,f1=0.,
f2=0.,q1=0.,q2=0.,norm=0.;
448 int NGAUSS =0,Nxbin=0;
449 double xg[16]={.0483076656877383162e0,.144471961582796493e0,
450 .239287362252137075e0, .331868602282127650e0,
451 .421351276130635345e0, .506899908932229390e0,
452 .587715757240762329e0, .663044266930215201e0,
453 .732182118740289680e0, .794483795967942407e0,
454 .849367613732569970e0, .896321155766052124e0,
455 .934906075937739689e0, .964762255587506430e0,
456 .985611511545268335e0, .997263861849481564e0};
457 double ag[16]={.0965400885147278006e0, .0956387200792748594e0,
458 .0938443990808045654e0, .0911738786957638847e0,
459 .0876520930044038111e0, .0833119242269467552e0,
460 .0781938957870703065e0, .0723457941088485062e0,
461 .0658222227763618468e0, .0586840934785355471e0,
462 .0509980592623761762e0, .0428358980222266807e0,
463 .0342738629130214331e0, .0253920653092620595e0,
464 .0162743947309056706e0, .00701861000947009660e0};
479 dx = 2.*pxmax/double(Nxbin);
480 Epom = W*W/(4.*Egamma);
495 for(
int i=1;i<=Nxbin;i++){
497 px = -pxmax + (double(i)-0.5)*
dx;
499 for(
int j=0;j<NGAUSS;j++){
501 py = 0.5*pymax*xg[j]+0.5*pymax;
503 pt1 = sqrt( px*px + py*py );
505 pt2 = sqrt( (px-px0)*(px-px0) + (py-py0)*(py-py0) );
523 sumy= sumy + ag[j]*f1*
f2;
526 py = 0.5*pymax*(-xg[j])+0.5*pymax;
527 pt1 = sqrt( px*px + py*py );
528 pt2 = sqrt( (px-px0)*(px-px0) + (py-py0)*(py-py0) );
545 sumy= sumy + ag[j]*f1*
f2;
549 sumy = 0.5*pymax*sumy;
551 sum = sum + 2.*sumy*
dx;
554 if(
k==1) norm=1./sum;