File indexing completed on 2024-09-27 07:03:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #include <iostream>
0035 #include <fstream>
0036 #include <cmath>
0037
0038 #include "inputParameters.h"
0039 #include "beambeamsystem.h"
0040 #include "beam.h"
0041 #include "starlightconstants.h"
0042 #include "nucleus.h"
0043 #include "bessel.h"
0044 #include "gammaaluminosity.h"
0045
0046
0047 using namespace std;
0048 using namespace starlightConstants;
0049
0050
0051
0052 photonNucleusLuminosity::photonNucleusLuminosity(const inputParameters& inputParametersInstance, beamBeamSystem& bbsystem)
0053 : photonNucleusCrossSection(inputParametersInstance, bbsystem)
0054 ,_ptBinWidthInterference(inputParametersInstance.ptBinWidthInterference())
0055 ,_interferenceStrength(inputParametersInstance.interferenceStrength())
0056 ,_protonEnergy(inputParametersInstance.protonEnergy())
0057 ,_beamLorentzGamma(inputParametersInstance.beamLorentzGamma())
0058 ,_baseFileName(inputParametersInstance.baseFileName())
0059 ,_maxW(inputParametersInstance.maxW())
0060 ,_minW(inputParametersInstance.minW())
0061 ,_nmbWBins(inputParametersInstance.nmbWBins())
0062 ,_maxRapidity(inputParametersInstance.maxRapidity())
0063 ,_nmbRapidityBins(inputParametersInstance.nmbRapidityBins())
0064 ,_productionMode(inputParametersInstance.productionMode())
0065 ,_beamBreakupMode(inputParametersInstance.beamBreakupMode())
0066 ,_interferenceEnabled(inputParametersInstance.interferenceEnabled())
0067 ,_maxPtInterference(inputParametersInstance.maxPtInterference())
0068 ,_nmbPtBinsInterference(inputParametersInstance.nmbPtBinsInterference())
0069 {
0070 cout <<"Creating Luminosity Tables."<<endl;
0071 photonNucleusDifferentialLuminosity();
0072 cout <<"Luminosity Tables created."<<endl;
0073 }
0074
0075
0076
0077 photonNucleusLuminosity::~photonNucleusLuminosity()
0078 { }
0079
0080
0081
0082 void photonNucleusLuminosity::photonNucleusDifferentialLuminosity()
0083 {
0084 double W,dW,dY;
0085 double Egamma,Y;
0086 double testint,dndWdY;
0087 double csgA;
0088 double C;
0089 int beam;
0090
0091 std::string wyFileName;
0092 wyFileName = _baseFileName +".txt";
0093
0094 ofstream wylumfile;
0095 wylumfile.precision(15);
0096
0097 double bwnorm,Eth;
0098
0099 dW = (_wMax-_wMin)/_nWbins;
0100 dY = (_yMax-(-1.0)*_yMax)/_nYbins;
0101
0102
0103 wylumfile.open(wyFileName.c_str());
0104 wylumfile << getbbs().targetBeam().Z() <<endl;
0105 wylumfile << getbbs().targetBeam().A() <<endl;
0106 wylumfile << _beamLorentzGamma <<endl;
0107 wylumfile << _maxW <<endl;
0108 wylumfile << _minW <<endl;
0109 wylumfile << _nmbWBins <<endl;
0110 wylumfile << _maxRapidity <<endl;
0111 wylumfile << _nmbRapidityBins <<endl;
0112 wylumfile << _productionMode <<endl;
0113 wylumfile << _beamBreakupMode <<endl;
0114 wylumfile << _interferenceEnabled <<endl;
0115 wylumfile << _interferenceStrength <<endl;
0116 wylumfile << starlightConstants::deuteronSlopePar <<endl;
0117 wylumfile << _maxPtInterference <<endl;
0118 wylumfile << _nmbPtBinsInterference <<endl;
0119
0120
0121 testint=0.0;
0122
0123 C=getDefaultC();
0124 for(unsigned int i = 0; i <= _nWbins - 1; ++i) {
0125 W = _wMin + double(i)*dW + 0.5*dW;
0126 testint = testint + breitWigner(W,C)*dW;
0127 wylumfile << W << endl;
0128 }
0129 bwnorm = 1./testint;
0130
0131
0132 for(unsigned int i = 0; i <= _nYbins - 1; ++i) {
0133 Y = -1.0*_yMax + double(i)*dY + 0.5*dY;
0134 wylumfile << Y << endl;
0135 }
0136
0137 Eth=0.5*(((_wMin+starlightConstants::protonMass)*(_wMin +starlightConstants::protonMass)-starlightConstants::protonMass*starlightConstants::protonMass)/(_protonEnergy+sqrt(_protonEnergy*_protonEnergy-starlightConstants::protonMass*starlightConstants::protonMass)));
0138
0139 int A_1 = 0;
0140 int A_2 = getbbs().targetBeam().A();
0141
0142
0143
0144
0145 for(unsigned int i = 0; i <= _nWbins - 1; ++i) {
0146
0147 W = _wMin + double(i)*dW + 0.5*dW;
0148
0149 for(unsigned int j = 0; j <= _nYbins - 1; ++j) {
0150
0151 Y = -1.0*_yMax + double(j)*dY + 0.5*dY;
0152
0153 if( A_2 == 1 && A_1 != 1 ){
0154
0155 Egamma = 0.5*W*exp(-Y);
0156 beam = 1;
0157 } else if( A_1 ==1 && A_2 != 1){
0158
0159 Egamma = 0.5*W*exp(Y);
0160 beam = 2;
0161 } else {
0162 Egamma = 0.5*W*exp(Y);
0163 beam = 2;
0164 }
0165
0166 dndWdY = 0.;
0167
0168 if( Egamma > Eth && Egamma < maxPhotonEnergy() ){
0169
0170 csgA=getcsgA(Egamma,W,beam);
0171 dndWdY = Egamma*photonFlux(Egamma,beam)*csgA*breitWigner(W,bwnorm);
0172
0173 }
0174
0175 wylumfile << dndWdY << endl;
0176
0177 }
0178 }
0179
0180
0181
0182 if( !( (A_2 == 1 && A_1 != 1) || (A_1 == 1 && A_2 != 1) ) ){
0183
0184 for(unsigned int i = 0; i <= _nWbins - 1; ++i) {
0185
0186 W = _wMin + double(i)*dW + 0.5*dW;
0187
0188 for(unsigned int j = 0; j <= _nYbins - 1; ++j) {
0189
0190 Y = -1.0*_yMax + double(j)*dY + 0.5*dY;
0191
0192 beam = 1;
0193 Egamma = 0.5*W*exp(-Y);
0194
0195 dndWdY = 0.;
0196
0197 if( Egamma > Eth && Egamma < maxPhotonEnergy() ){
0198
0199 csgA=getcsgA(Egamma,W,beam);
0200 dndWdY = Egamma*photonFlux(Egamma,beam)*csgA*breitWigner(W,bwnorm);
0201
0202 }
0203
0204 wylumfile << dndWdY << endl;
0205
0206 }
0207 }
0208 }
0209
0210 wylumfile << bwnorm << endl;
0211 wylumfile.close();
0212
0213 if(_interferenceEnabled==1)
0214 pttablegen();
0215
0216 }
0217
0218
0219
0220 void photonNucleusLuminosity::pttablegen()
0221 {
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241 std::string wyFileName;
0242 wyFileName = _baseFileName +".txt";
0243
0244 ofstream wylumfile;
0245 wylumfile.precision(15);
0246
0247 wylumfile.open(wyFileName.c_str(),ios::app);
0248
0249 double param1pt[500],param2pt[500];
0250 double *ptparam1=param1pt;
0251 double *ptparam2=param2pt;
0252 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.;
0253 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.;
0254 double sumg=0.,theta=0.,amp_i_2=0.,sumint=0.;
0255 int NGAUSS=0,NBIN=0;
0256
0257 double xg[16]={.0483076656877383162E0,.144471961582796493E0,
0258 .239287362252137075E0, .331868602282127650E0,
0259 .421351276130635345E0, .506899908932229390E0,
0260 .587715757240762329E0, .663044266930215201E0,
0261 .732182118740289680E0, .794483795967942407E0,
0262 .849367613732569970E0, .896321155766052124E0,
0263 .934906075937739689E0, .964762255587506430E0,
0264 .985611511545268335E0, .997263861849481564E0};
0265 double ag[16]={.0965400885147278006E0, .0956387200792748594E0,
0266 .0938443990808045654E0, .0911738786957638847E0,
0267 .0876520930044038111E0, .0833119242269467552E0,
0268 .0781938957870703065E0, .0723457941088485062E0,
0269 .0658222227763618468E0, .0586840934785355471E0,
0270 .0509980592623761762E0, .0428358980222266807E0,
0271 .0342738629130214331E0, .0253920653092620595E0,
0272 .0162743947309056706E0, .00701861000947009660E0};
0273
0274 NGAUSS=16;
0275
0276
0277 double Ymax=_yMax;
0278 int numy = _nYbins;
0279 double Ep = _protonEnergy;
0280 int ibreakup = _beamBreakupMode;
0281 double NPT = _nmbPtBinsInterference;
0282 double gamma_em = _beamLorentzGamma;
0283 double mass = getChannelMass();
0284 int beam;
0285
0286
0287
0288
0289 dY=(2.*Ymax)/numy;
0290 for(int jy=1;jy<=numy;jy++){
0291 Yp=-Ymax+((double(jy)-0.5)*dY);
0292
0293
0294
0295
0296 Egamma1 = 0.5*mass*exp(Yp);
0297 Egamma2 = 0.5*mass*exp(-Yp);
0298
0299
0300
0301
0302 beam=2;
0303
0304 Wgp=sqrt(2.*Egamma1*(Ep+sqrt(Ep*Ep-starlightConstants::protonMass*
0305 starlightConstants::protonMass))+starlightConstants::protonMass*starlightConstants::protonMass);
0306
0307
0308
0309 cs=sqrt(16.*starlightConstants::pi*vmPhotonCoupling()*slopeParameter()*
0310 starlightConstants::hbarc*starlightConstants::hbarc*sigmagp(Wgp)
0311 /starlightConstants::alpha);
0312
0313 cvma=sigma_A(cs,beam);
0314
0315
0316
0317 Av=(starlightConstants::alpha*cvma*cvma)/(16.*starlightConstants::pi
0318 *vmPhotonCoupling()*starlightConstants::hbarc*starlightConstants::hbarc);
0319
0320 tmin = ((mass*mass)/(4.*Egamma1*gamma_em)*(mass*mass)/(4.*Egamma1*gamma_em));
0321 tmax = tmin + 0.25;
0322 ax = 0.5*(tmax-tmin);
0323 bx = 0.5*(tmax+tmin);
0324 csgA = 0.;
0325
0326 for(int k=0;k<NGAUSS;k++){
0327 t = sqrt(ax*xg[k]+bx);
0328 csgA = csgA + ag[k]*getbbs().targetBeam().formFactor(t)*getbbs().targetBeam().formFactor(t);
0329 t = sqrt(ax*(-xg[k])+bx);
0330 csgA = csgA + ag[k]*getbbs().targetBeam().formFactor(t)*getbbs().targetBeam().formFactor(t);
0331 }
0332
0333 csgA = 0.5*(tmax-tmin)*csgA;
0334 csgA = Av*csgA;
0335 sig_ga_1 = csgA;
0336
0337
0338 beam=1;
0339
0340 Wgp=sqrt(2.*Egamma2*(Ep+sqrt(Ep*Ep-starlightConstants::protonMass*
0341 starlightConstants::protonMass))+starlightConstants::protonMass*starlightConstants::protonMass);
0342
0343 cs=sqrt(16.*starlightConstants::pi*vmPhotonCoupling()*slopeParameter()*
0344 starlightConstants::hbarc*starlightConstants::hbarc*sigmagp(Wgp)/starlightConstants::alpha);
0345
0346 cvma=sigma_A(cs,beam);
0347
0348 Av=(starlightConstants::alpha*cvma*cvma)/(16.*starlightConstants::pi
0349 *vmPhotonCoupling()*starlightConstants::hbarc*starlightConstants::hbarc);
0350
0351 tmin = (((mass*mass)/(4.*Egamma2*gamma_em))*((mass*mass)/(4.*Egamma2*gamma_em)));
0352 tmax = tmin + 0.25;
0353 ax = 0.5*(tmax-tmin);
0354 bx = 0.5*(tmax+tmin);
0355 csgA = 0.;
0356
0357 for(int k=0;k<NGAUSS;k++){
0358 t = sqrt(ax*xg[k]+bx);
0359 csgA = csgA + ag[k]*getbbs().electronBeam().formFactor(t)*getbbs().electronBeam().formFactor(t);
0360 t = sqrt(ax*(-xg[k])+bx);
0361 csgA = csgA + ag[k]*getbbs().electronBeam().formFactor(t)*getbbs().electronBeam().formFactor(t);
0362 }
0363
0364 csgA = 0.5*(tmax-tmin)*csgA;
0365 csgA = Av*csgA;
0366 sig_ga_2 = csgA;
0367
0368
0369
0370
0371
0372
0373 ptparam1=vmsigmapt(mass,Egamma1,ptparam1, 2);
0374 ptparam2=vmsigmapt(mass,Egamma2,ptparam2, 1);
0375
0376 bmin = getbbs().electronBeam().nuclearRadius()+getbbs().targetBeam().nuclearRadius();
0377
0378 if (ibreakup != 1)
0379 bmin=0.95*bmin;
0380
0381
0382 if (Egamma1 >=Egamma2) {
0383 bmax=bmin+6.*starlightConstants::hbarc*gamma_em/Egamma2;
0384 }
0385 else {
0386 bmax=bmin+6.*starlightConstants::hbarc*gamma_em/Egamma1;
0387 }
0388
0389 NBIN = 2000;
0390 db = (bmax-bmin)/float(NBIN);
0391
0392 for(int i=1;i<=NPT;i++){
0393
0394 pt = (float(i)-0.5)*_ptBinWidthInterference;
0395 sum1=0.0;
0396
0397 for(int j=1;j<=NBIN;j++){
0398
0399 b = bmin + (float(j)-0.5)*db;
0400 A1 = Egamma1*getbbs().electronBeam().photonDensity(Egamma1,b)*sig_ga_1*ptparam1[i];
0401 A2 = Egamma2*getbbs().targetBeam().photonDensity(Egamma2,b)*sig_ga_2*ptparam2[i];
0402 sumg=0.0;
0403
0404
0405 for(int k=0;k<NGAUSS;k++){
0406
0407 theta=xg[k]*starlightConstants::pi;
0408
0409 amp_i_2 = A1 + A2 - 2.*_interferenceStrength
0410 *sqrt(A1*A2)*cos(pt*b*cos(theta)/starlightConstants::hbarc);
0411 sumg = sumg+ag[k]*amp_i_2;
0412 }
0413
0414
0415 sumint=2.*sumg*b*db;
0416 if (ibreakup > 1)
0417 sumint=sumint*getbbs().probabilityOfBreakup(b);
0418 sum1 = sum1 + sumint;
0419
0420 }
0421
0422
0423
0424
0425 wylumfile << sum1*pt*_ptBinWidthInterference <<endl;
0426
0427 }
0428
0429 }
0430 wylumfile.close();
0431 }
0432
0433
0434
0435 double *photonNucleusLuminosity::vmsigmapt(double W, double Egamma, double *SIGMAPT, int beam)
0436 {
0437
0438
0439
0440
0441
0442
0443
0444
0445
0446 double pxmax=0.,pymax=0.,dx=0.,Epom=0.,pt=0.,px0=0.,py0=0.,sum=0.,sumy=0.;
0447 double py=0.,px=0.,pt1=0.,pt2=0.,f1=0.,f2=0.,q1=0.,q2=0.,norm=0.;
0448 int NGAUSS =0,Nxbin=0;
0449 double xg[16]={.0483076656877383162e0,.144471961582796493e0,
0450 .239287362252137075e0, .331868602282127650e0,
0451 .421351276130635345e0, .506899908932229390e0,
0452 .587715757240762329e0, .663044266930215201e0,
0453 .732182118740289680e0, .794483795967942407e0,
0454 .849367613732569970e0, .896321155766052124e0,
0455 .934906075937739689e0, .964762255587506430e0,
0456 .985611511545268335e0, .997263861849481564e0};
0457 double ag[16]={.0965400885147278006e0, .0956387200792748594e0,
0458 .0938443990808045654e0, .0911738786957638847e0,
0459 .0876520930044038111e0, .0833119242269467552e0,
0460 .0781938957870703065e0, .0723457941088485062e0,
0461 .0658222227763618468e0, .0586840934785355471e0,
0462 .0509980592623761762e0, .0428358980222266807e0,
0463 .0342738629130214331e0, .0253920653092620595e0,
0464 .0162743947309056706e0, .00701861000947009660e0};
0465 NGAUSS=16;
0466
0467
0468 if (beam == 1) {
0469 pxmax = 10.*(starlightConstants::hbarc/getbbs().targetBeam().nuclearRadius());
0470 pymax = 10.*(starlightConstants::hbarc/getbbs().targetBeam().nuclearRadius());
0471 }
0472 else {
0473 pxmax = 10.*(starlightConstants::hbarc/getbbs().electronBeam().nuclearRadius());
0474 pymax = 10.*(starlightConstants::hbarc/getbbs().electronBeam().nuclearRadius());
0475 }
0476
0477 Nxbin = 500;
0478
0479 dx = 2.*pxmax/double(Nxbin);
0480 Epom = W*W/(4.*Egamma);
0481
0482
0483
0484 for(int k=1;k<=_nmbPtBinsInterference;k++){
0485
0486 pt=_ptBinWidthInterference*(double(k)-0.5);
0487
0488 px0 = pt;
0489 py0 = 0.0;
0490
0491
0492
0493
0494 sum=0.;
0495 for(int i=1;i<=Nxbin;i++){
0496
0497 px = -pxmax + (double(i)-0.5)*dx;
0498 sumy=0.0;
0499 for(int j=0;j<NGAUSS;j++){
0500
0501 py = 0.5*pymax*xg[j]+0.5*pymax;
0502
0503 pt1 = sqrt( px*px + py*py );
0504
0505 pt2 = sqrt( (px-px0)*(px-px0) + (py-py0)*(py-py0) );
0506 q1 = sqrt( ((Egamma/_beamLorentzGamma)*(Egamma/_beamLorentzGamma)) + pt1*pt1 );
0507 q2 = sqrt( ((Epom/_beamLorentzGamma)*(Epom/_beamLorentzGamma)) + pt2*pt2 );
0508
0509
0510
0511 if (beam ==2) {
0512 f1 = (getbbs().electronBeam().formFactor(q1*q1)*getbbs().electronBeam().formFactor(q1*q1)*pt1*pt1)/(q1*q1*q1*q1);
0513
0514
0515 f2 = getbbs().targetBeam().formFactor(q2*q2)*getbbs().targetBeam().formFactor(q2*q2);
0516 }
0517 else {
0518 f1 = (getbbs().targetBeam().formFactor(q1*q1)*getbbs().targetBeam().formFactor(q1*q1)*pt1*pt1)/(q1*q1*q1*q1);
0519
0520
0521 f2 = getbbs().electronBeam().formFactor(q2*q2)*getbbs().electronBeam().formFactor(q2*q2);
0522 }
0523 sumy= sumy + ag[j]*f1*f2;
0524
0525
0526 py = 0.5*pymax*(-xg[j])+0.5*pymax;
0527 pt1 = sqrt( px*px + py*py );
0528 pt2 = sqrt( (px-px0)*(px-px0) + (py-py0)*(py-py0) );
0529 q1 = sqrt( ((Egamma/_beamLorentzGamma)*Egamma/_beamLorentzGamma) + pt1*pt1 );
0530 q2 = sqrt( ((Epom/_beamLorentzGamma)*(Epom/_beamLorentzGamma)) + pt2*pt2 );
0531
0532 if (beam ==2) {
0533 f1 = (getbbs().electronBeam().formFactor(q1*q1)*getbbs().electronBeam().formFactor(q1*q1)*pt1*pt1)/(q1*q1*q1*q1);
0534
0535
0536 f2 = getbbs().targetBeam().formFactor(q2*q2)*getbbs().targetBeam().formFactor(q2*q2);
0537 }
0538 else {
0539 f1 = (getbbs().targetBeam().formFactor(q1*q1)*getbbs().targetBeam().formFactor(q1*q1)*pt1*pt1)/(q1*q1*q1*q1);
0540
0541
0542 f2 = getbbs().electronBeam().formFactor(q2*q2)*getbbs().electronBeam().formFactor(q2*q2);
0543 }
0544
0545 sumy= sumy + ag[j]*f1*f2;
0546
0547 }
0548
0549 sumy = 0.5*pymax*sumy;
0550
0551 sum = sum + 2.*sumy*dx;
0552 }
0553
0554 if(k==1) norm=1./sum;
0555 SIGMAPT[k]=sum*norm;
0556 }
0557 return (SIGMAPT);
0558 }
0559