1 ///////////////////////////////////////////////////////////////////////////
5 // This file is part of starlight.
7 // starlight is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // starlight is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with starlight. If not, see <http://www.gnu.org/licenses/>.
20 ///////////////////////////////////////////////////////////////////////////
22 // File and Version Information:
23 // $Rev:: 45 $: revision of last commit
24 // $Author:: bgrube $: author of last commit
25 // $Date:: 2011-02-27 20:52:35 +0100 #$: date of last commit
31 ///////////////////////////////////////////////////////////////////////////
38 #include "inputParameters.h"
39 #include "beambeamsystem.h"
41 #include "starlightconstants.h"
44 #include "incoherentPhotonNucleusLuminosity.h"
50 //______________________________________________________________________________
51 incoherentPhotonNucleusLuminosity::incoherentPhotonNucleusLuminosity(beamBeamSystem& bbsystem)
52 : photonNucleusCrossSection(bbsystem)
54 cout <<"Creating Luminosity Tables for incoherent vector meson production."<<endl;
55 incoherentPhotonNucleusDifferentialLuminosity();
56 cout <<"Luminosity Tables created."<<endl;
60 //______________________________________________________________________________
61 incoherentPhotonNucleusLuminosity::~incoherentPhotonNucleusLuminosity()
65 //______________________________________________________________________________
66 void incoherentPhotonNucleusLuminosity::incoherentPhotonNucleusDifferentialLuminosity()
68 // double Av,Wgp,cs,cvma;
71 // double t,tmin,tmax;
72 double testint,dndWdY;
77 wylumfile.precision(15);
81 dW = (_wMax - _wMin)/_nWbins;
82 dY = (_yMax-(-1.0)*_yMax)/_nYbins;
84 // Write the values of W used in the calculation to slight.txt.
85 wylumfile.open("slight.txt");
86 wylumfile << inputParametersInstance.parameterValueKey() << endl;
87 wylumfile << getbbs().beam1().Z() <<endl;
88 wylumfile << getbbs().beam1().A() <<endl;
89 wylumfile << getbbs().beam2().Z() <<endl;
90 wylumfile << getbbs().beam2().A() <<endl;
91 wylumfile << inputParametersInstance.beamLorentzGamma() <<endl;
92 wylumfile << inputParametersInstance.maxW() <<endl;
93 wylumfile << inputParametersInstance.minW() <<endl;
94 wylumfile << inputParametersInstance.nmbWBins() <<endl;
95 wylumfile << inputParametersInstance.maxRapidity() <<endl;
96 wylumfile << inputParametersInstance.nmbRapidityBins() <<endl;
97 wylumfile << inputParametersInstance.productionMode() <<endl;
98 wylumfile << inputParametersInstance.beamBreakupMode() <<endl;
99 wylumfile << inputParametersInstance.interferenceEnabled() <<endl;
100 wylumfile << inputParametersInstance.interferenceStrength() <<endl;
101 wylumfile << inputParametersInstance.coherentProduction() <<endl;
102 wylumfile << inputParametersInstance.incoherentFactor() <<endl;
103 wylumfile << inputParametersInstance.deuteronSlopePar() <<endl;
104 wylumfile << inputParametersInstance.maxPtInterference() <<endl;
105 wylumfile << inputParametersInstance.nmbPtBinsInterference() <<endl;
107 // Normalize the Breit-Wigner Distribution and write values of W to slight.txt
109 //Grabbing default value for C in the breit-wigner calculation
111 for(unsigned int i = 0; i <= _nWbins - 1; ++i) {
112 W = _wMin + double(i)*dW + 0.5*dW;
113 testint = testint + breitWigner(W,C)*dW;
114 wylumfile << W << endl;
118 // Write the values of Y used in the calculation to slight.txt.
119 for(unsigned int i = 0; i <= _nYbins - 1; ++i) {
120 Y = -1.0*_yMax + double(i)*dY + 0.5*dY;
121 wylumfile << Y << endl;
124 // Eth=0.5*(((_wMin+starlightConstants::protonMass)*(_wMin
125 // +starlightConstants::protonMass)-starlightConstants::protonMass*starlightConstants::protonMass)/
126 // (Ep + sqrt(Ep*Ep-starlightConstants::protonMass*starlightConstants::protonMass)));
128 for(unsigned int i = 0; i <= _nWbins - 1; ++i) {
130 W = _wMin + double(i)*dW + 0.5*dW;
132 double Ep = inputParametersInstance.protonEnergy();
134 Eth=0.5*(((W+starlightConstants::protonMass)*(W+starlightConstants::protonMass)-starlightConstants::protonMass*starlightConstants::protonMass)/
135 (Ep + sqrt(Ep*Ep-starlightConstants::protonMass*starlightConstants::protonMass)));
137 for(unsigned int j = 0; j <= _nYbins - 1; ++j) {
139 Y = -1.0*_yMax + double(j)*dY + 0.5*dY;
141 int A_1 = getbbs().beam1().A();
142 int A_2 = getbbs().beam2().A();
143 if( A_2 == 1 && A_1 != 1 ){
144 // pA, first beam is the nucleus
145 Egamma = 0.5*W*exp(Y);
146 } else if( A_1 ==1 && A_2 != 1){
147 // pA, second beam is the nucleus
148 Egamma = 0.5*W*exp(-Y);
150 Egamma = 0.5*W*exp(Y);
156 if(Egamma > maxPhotonEnergy())Egamma = maxPhotonEnergy();
157 double Wgp = sqrt(2.*Egamma*(Ep+sqrt(Ep*Ep-starlightConstants::protonMass*
158 starlightConstants::protonMass))+starlightConstants::protonMass*starlightConstants::protonMass);
160 double localsig = sigmagp(Wgp);
162 // double localbmin = 0;
163 if( A_1 == 1 && A_2 != 1 ){
164 // localbmin = getbbs().beam2().nuclearRadius() + 0.7;
165 // localz = getbbs().beam2().Z();
166 // dndWdY = Egamma*localz*localz*nepoint(Egamma,localbmin)*localsig*breitWigner(W,bwnorm);
167 dndWdY = Egamma*photonFlux(Egamma)*localsig*breitWigner(W,bwnorm);
168 }else if (A_2 ==1 && A_1 !=1){
169 // localbmin = getbbs().beam1().nuclearRadius() + 0.7;
170 // localz = getbbs().beam1().Z();
171 // dndWdY = Egamma*localz*localz*nepoint(Egamma,localbmin)*localsig*breitWigner(W,bwnorm);
172 dndWdY = Egamma*photonFlux(Egamma)*localsig*breitWigner(W,bwnorm);
174 double csVN = sigma_N(Wgp);
175 double csVA = sigma_A(csVN);
176 double csgA= (csVA/csVN)*sigmagp(Wgp);
177 dndWdY = Egamma*photonFlux(Egamma)*csgA*breitWigner(W,bwnorm);
181 wylumfile << dndWdY << endl;
185 wylumfile << bwnorm << endl;
186 wylumfile << inputParametersInstance.parameterValueKey() << endl;
189 // wylumfile.open("slight.txt",ios::app);
190 cout << "bwnorm: "<< bwnorm <<endl;
191 // wylumfile << bwnorm << endl;
192 // wylumfile << inputParametersInstance.parameterValueKey() << endl;
193 // wylumfile.close();
197 //______________________________________________________________________________
198 double incoherentPhotonNucleusLuminosity::nofe(double Egamma, double bimp)
200 //Function for the calculation of the "photon density".
201 //nofe=numberofgammas/(energy*area)
202 //Assume beta=1.0 and gamma>>1, i.e. neglect the (1/gamma^2)*K0(x) term
204 double X=0.,nofex=0.,factor1=0.,factor2=0.,factor3=0.;
206 X = (bimp*Egamma)/(_beamLorentzGamma*starlightConstants::hbarc);
209 cout<<"In nofe, X= "<<X<<endl;
211 factor1 = (double(getbbs().beam1().Z()*getbbs().beam1().Z())
212 *starlightConstants::alpha)/(starlightConstants::pi*starlightConstants::pi);
214 factor2 = 1./(Egamma*bimp*bimp);
215 factor3 = X*X*(bessel::dbesk1(X))*(bessel::dbesk1(X));
216 nofex = factor1*factor2*factor3;