1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // G4 Tools program: NuEl DIS (x,Q2) approximation is integrated over x & Q2 |
---|
28 | // .....................................................[ for a <nucleon> ] |
---|
29 | // Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Oct-07 |
---|
30 | // |
---|
31 | //===================================================================== |
---|
32 | #include "globals.hh" |
---|
33 | #include <iostream> |
---|
34 | #include <fstream> |
---|
35 | #include <vector> |
---|
36 | #include "G4ios.hh" |
---|
37 | #include <CLHEP/GenericFunctions/LogGamma.hh> |
---|
38 | |
---|
39 | void strucf(int A, double x, double Q2, double& f2, double& xf3, double& fL) |
---|
40 | { |
---|
41 | //const double MN=.931494043; // Nucleon mass (inside nucleus, atomic mass unit, GeV) |
---|
42 | //const double MN2=MN*MN; // M_N^2 in GeV^2 |
---|
43 | //const double mpi=.13957018; // charged pi meson mass in GeV |
---|
44 | //const double Wt=MN+mpi; // Delta threshold |
---|
45 | //const double W2t=Wt*Wt; // Squared Delta threshold |
---|
46 | const Genfun::LogGamma lGam; |
---|
47 | static int mA=0; |
---|
48 | static double mQ2=0., mN, mD, mDel, mU2, mU3, mV; |
---|
49 | //static double mUU; |
---|
50 | double N=3., D=0., Del=0., U2=0., U3=0., V=0.; |
---|
51 | //double UU=0.; |
---|
52 | if(A==mA && Q2==mQ2) // Associative memory for acceleration |
---|
53 | { |
---|
54 | N =mN; |
---|
55 | D =mD; |
---|
56 | Del=mDel; |
---|
57 | U2 =mU2; |
---|
58 | U3 =mU3; |
---|
59 | //UU =mUU; |
---|
60 | V =mV; |
---|
61 | } |
---|
62 | else |
---|
63 | { |
---|
64 | double Q=std::sqrt(Q2); |
---|
65 | N=3.+.3581*std::log(1.+Q2/.04); // a#of partons in the nonperturbative phase space |
---|
66 | Del=.077+.393/(1.+5./Q); |
---|
67 | D=.68*std::pow(1.+.145/Q2,-1.-Del); |
---|
68 | V=3*(N-1.); |
---|
69 | double c3=.75; |
---|
70 | double uu=std::exp(lGam(N-Del)-lGam(N-1.)-lGam(1.-Del))/N; |
---|
71 | U2=(c3+N-3.)*uu; |
---|
72 | U3=c3*uu; |
---|
73 | //UU=uu+uu+uu; // @@ |
---|
74 | mA = A; |
---|
75 | mQ2 = Q2; |
---|
76 | mN = N; |
---|
77 | mD = D; |
---|
78 | mDel=Del; |
---|
79 | mU2 =U2; |
---|
80 | mU3 =U3; |
---|
81 | //mUU =UU; // @@ |
---|
82 | mV =V; |
---|
83 | } |
---|
84 | // From here the Q2 coefficients are used |
---|
85 | double x1=std::pow(1.-x,N-2.); |
---|
86 | double pp=D*std::pow(x,-Del)*x1; |
---|
87 | double dir=(1-D)*V*x*x1; |
---|
88 | double per=U2*pp; |
---|
89 | f2 = per + dir; |
---|
90 | //double W2=MN2-MN2*x+Q2/x-Q2; |
---|
91 | //if(W2<W2t) |
---|
92 | //{ |
---|
93 | // per=UU*pp; |
---|
94 | // xf3= per+dir; |
---|
95 | //} |
---|
96 | //else |
---|
97 | xf3= U3*pp+dir; |
---|
98 | fL = per/5.; |
---|
99 | return; |
---|
100 | } |
---|
101 | |
---|
102 | void getFun(int A, double lx, double Q2, double* f) |
---|
103 | { |
---|
104 | const double MN=.931494043; // Nucleon mass (inside nucleus, atomic mass unit, GeV) |
---|
105 | const double MN2=MN*MN; // Squared Nucleon mass (inside nucleus, atomic mass unit, GeV) |
---|
106 | double f2=0., xf3=0., fL=0.; |
---|
107 | if (lx>0.5) G4cerr<<"***getFun: ln(x)="<<lx<<">.5"<<G4endl; |
---|
108 | double x=std::exp(lx); |
---|
109 | double x2=x*x; |
---|
110 | double c=0.; |
---|
111 | if(Q2>.0001) c=x2*MN2/Q2; |
---|
112 | double c2=1+c+c; // Q^2/nu^2 correction |
---|
113 | strucf(A, x, Q2, f2, xf3, fL); |
---|
114 | f[0]=f2; // direct part |
---|
115 | f[1]=(-f2+xf3)/x; // *y (neutrino) part |
---|
116 | f[2]=(-f2-xf3)/x; // *y (anti-neutrino) part |
---|
117 | f[3]=(f2*c2-fL-xf3)/x2; // *y2 (neutrino) part |
---|
118 | f[4]=(f2*c2-fL+xf3)/x2; // *y2 (anti-neutrino) part |
---|
119 | } |
---|
120 | |
---|
121 | int main() |
---|
122 | { |
---|
123 | const double reps=.001; // relative accuracy of the total Q2 integral calculation |
---|
124 | const double xeps=.0001; // relative accuracy of the total X integral calculation |
---|
125 | // ========= |
---|
126 | const double GF=1.16637e-5; // Fermi constant in GeV^-2 |
---|
127 | const double GF2=GF*GF; // Squared Fermi constant in GeV^-4 |
---|
128 | const double MW=80.425; // Mass of W-boson in GeV |
---|
129 | const double MW2=MW*MW; // Squared mass of W-boson in GeV^2 |
---|
130 | const double MW4=MW2*MW2; // Quadro mass of W-boson in GeV^4 |
---|
131 | const double hc2=38937932300.;// (hc)^2 in GeV^2*10^-38cm2 to convert GeV^-2 to 10^-38cm2 |
---|
132 | const double pif=3.14159265*4;// 4pi |
---|
133 | const double sik=GF2*hc2/pif; // precalculated coefficient |
---|
134 | //const double mpi=.1349766; // pi0 meson mass in GeV |
---|
135 | //const double mpi=.13957018; // charged pi meson mass in GeV |
---|
136 | //const double mpi2=mpi*mpi; // m_pi^2 in GeV^2 |
---|
137 | const double me=.00051099892; // electron mass in GeV |
---|
138 | const double me2=me*me; // m_e^2 in GeV^2 |
---|
139 | const double hme2=me2/2; // .5*m_e^2 in GeV^2 |
---|
140 | //const double mmu=.105658369; // mu meson mass in GeV |
---|
141 | //const double mmu2=mmu*mmu; // m_mu^2 in GeV^2 |
---|
142 | //const double hmmu2=mmu2/2; // .5*m_mu^2 in GeV^2 |
---|
143 | //const double mtau=1.777; // tau meson mass in GeV |
---|
144 | //const double mtau2=mtau*mtau; // m_tau^2 in GeV^2 |
---|
145 | //const double hmtau2=mtau2/2; // .5*m_e^2 in GeV^2 |
---|
146 | //const double mp=.93827203; // proton mass in GeV |
---|
147 | //const double mn=.93956536; // neutron mass in GeV |
---|
148 | //const double md=1.87561282; // deuteron mass in GeV |
---|
149 | const double MN=.931494043; // Nucleon mass (inside nucleus, atomic mass unit, GeV) |
---|
150 | //const double MN=(mn+mp)/2; // Nucleon mass (mean free) in GeV |
---|
151 | //const double MD=1.232; // proton mass in GeV |
---|
152 | //const double mp2=mp*mp; // m_p^2 in GeV^2 |
---|
153 | const double MN2=MN*MN; // M_N^2 in GeV^2 |
---|
154 | const double dMN=MN+MN; // 2*M_N in GeV |
---|
155 | const double dMN2=MN2+MN2; // 2*M_N^2 in GeV^2 |
---|
156 | const double fMN2=dMN2+dMN2; // 4*M_N^2 in GeV^2 |
---|
157 | const double EminE=me+me2/dMN;// Threshold for muon production |
---|
158 | //const double EminMu=mmu+mmu2/dMN; // Threshold for muon production |
---|
159 | //const double EminTau=mmu+mmu2/dMN; // Threshold for muon production |
---|
160 | // |
---|
161 | const double mc=.261; // parameter of W2>(M_N^2+M_D^2)/2 cut for QuasiEl/Delta |
---|
162 | //const double mc=mpi; // parameter of W>M+mc cut for Quasi-Elastic/Delta |
---|
163 | const double mcV=(dMN+mc)*mc; // constant of W>M+mc cut for Quasi-Elastic |
---|
164 | //std::ofstream fileNuMuX("NuMuXQ2.out", std::ios::out); |
---|
165 | //fileNuMuX.setf( std::ios::scientific, std::ios::floatfield ); |
---|
166 | // _____ Begin of Test Area |
---|
167 | //Genfun::LogGamma logGamma; |
---|
168 | //double n=4.9; |
---|
169 | //double g=exp(logGamma(n)); |
---|
170 | //G4cout<<"Gamma("<<n<<") = "<<g<<G4endl; |
---|
171 | // ^^^^^ End of Test Area |
---|
172 | // |
---|
173 | double f[5]; // A working array |
---|
174 | int A=12; // Neucleus for which calculations should be done |
---|
175 | double lEnuMin=0; // LogLog of Minimum energy of neutrino |
---|
176 | double lEnuMax=std::log(1.+std::log(300./EminE)); // LogLog of MaximumEnergy of neutrino |
---|
177 | //double lEnuMax=std::log(1.+std::log(300./EminMu));// LogLog of MaximumEnergy of neutrino |
---|
178 | int nE=63; |
---|
179 | double dlE=(lEnuMax-lEnuMin)/nE; |
---|
180 | lEnuMin+=dlE/10; |
---|
181 | lEnuMax+=dlE/5; |
---|
182 | G4cout<<"Emin="<<EminE<<",lEi="<<lEnuMin<<",lEa="<<lEnuMax<<",dlE="<<dlE<<G4endl; |
---|
183 | //G4cout<<"Emin="<<EminMu<<",lEi="<<lEnuMin<<",lEa="<<lEnuMax<<",dlE="<<dlE<<G4endl; |
---|
184 | for(double lEnu=lEnuMin; lEnu<lEnuMax; lEnu+=dlE) |
---|
185 | { |
---|
186 | double Enu=std::exp(std::exp(lEnu)-1.)*EminE; // Energy of neutrino/anti-neutrino |
---|
187 | //double Enu=std::exp(std::exp(lEnu)-1.)*EminMu; // Energy of neutrino/anti-neutrino |
---|
188 | double dEnu=Enu+Enu; // doubled energy of nu/anu |
---|
189 | double Enu2=Enu*Enu; // squared energy of nu/anu |
---|
190 | double Ee=Enu-me; // Free Energy of neutrino/anti-neutrino |
---|
191 | double Ee2=Ee*Ee; // squared energy of nu/anu |
---|
192 | //double Emu=Enu-mmu; // Free Energy of neutrino/anti-neutrino |
---|
193 | //double Emu2=Emu*Emu; // squared energy of nu/anu |
---|
194 | double ME=Enu*MN; // M*E |
---|
195 | double dME=ME+ME; // 2*M*E |
---|
196 | double DIStsig=1.; // Total curent DIS cross-section to be integrated |
---|
197 | double DISmsig=1.e20; // Total remembered DIS cross-section |
---|
198 | double dEMN=(dEnu+MN)*ME; |
---|
199 | double MEm=ME-hme2; |
---|
200 | //double MEm=ME-hmmu2; |
---|
201 | double sqE=Enu*std::sqrt(MEm*MEm-me2*MN2); |
---|
202 | //double sqE=Enu*std::sqrt(MEm*MEm-mmu2*MN2); |
---|
203 | double E2M=MN*Enu2-(Enu+MN)*hme2; |
---|
204 | //double E2M=MN*Enu2-(Enu+MN)*hmmu2; |
---|
205 | double ymax=(E2M+sqE)/dEMN; |
---|
206 | double ymin=(E2M-sqE)/dEMN; |
---|
207 | double rmin=1.-ymin; |
---|
208 | double rhm2E=hme2/Enu2; |
---|
209 | //double rhm2E=hmmu2/Enu2; |
---|
210 | double Q2min=(Enu2+Enu2)*(rmin-rhm2E-std::sqrt(rmin*rmin-rhm2E-rhm2E)); |
---|
211 | double Q2max=dME*ymax; |
---|
212 | int nQ2=8; |
---|
213 | //G4cout<<"*** E="<<Enu<<", Q2i="<<Q2min<<" < Q2a="<<Q2max<<", yi="<<ymin<<" < ya=" |
---|
214 | // <<ymax<<G4endl; |
---|
215 | while(std::fabs(DIStsig-DISmsig)/DIStsig>reps) |
---|
216 | { |
---|
217 | DISmsig=DIStsig; |
---|
218 | DIStsig=0.; |
---|
219 | nQ2*=2; |
---|
220 | double dQ2=(Q2max-Q2min)/nQ2; |
---|
221 | for(double Q2=Q2min+dQ2/2; Q2<Q2max; Q2+=dQ2) |
---|
222 | { |
---|
223 | double DISxint=1.; // Curent DIS x-integral |
---|
224 | double DISmint=1.e20; // Remembered DIS x-integral |
---|
225 | double Q2M=Q2+MW2; |
---|
226 | double dik=MW4/Q2M/Q2M; |
---|
227 | double qmc=Q2+mcV; |
---|
228 | double lXQES=std::log((std::sqrt(qmc*qmc+Q2*fMN2)-qmc)/dMN2); // QuasielastBoundary |
---|
229 | //double lXQES=log(Q2/(Q2+mcV)); // Quasielastic boundary (W=MN+m_c) |
---|
230 | //double xN=Q2/dME; |
---|
231 | double xN=Q2/MN/(Ee+std::sqrt(Ee2+Q2)); |
---|
232 | //double xN=Q2/MN/(Emu+std::sqrt(Emu2+Q2)); |
---|
233 | //double lXmin=log(xN/ymax); |
---|
234 | double lXmin=std::log(xN); |
---|
235 | // ****** QE ******** tot/qe |
---|
236 | //if(lXQES>lXmin) lXmin=lXQES; // A cut which leaves only QES |
---|
237 | // *** End of QE^^^^^ |
---|
238 | double lXmax=0.; // QES is in DIS |
---|
239 | //double lXmax=lXQES; // Cut off quasielastic |
---|
240 | int nX=8; |
---|
241 | while(std::fabs(DISxint-DISmint)/DISxint>xeps) |
---|
242 | { |
---|
243 | DISmint=DISxint; |
---|
244 | DISxint=0.; |
---|
245 | nX*=2; |
---|
246 | double dlX=(lXmax-lXmin)/nX; |
---|
247 | for(double lX=lXmin+dlX/2; lX<lXmax; lX+=dlX) |
---|
248 | { |
---|
249 | getFun(A, lX, Q2, f); |
---|
250 | DISxint+=f[0]+f[0]+xN*(f[1]+f[1]+xN*f[3]); // neutrino |
---|
251 | //DISxint+=f[0]+f[0]+xN*(f[2]+f[2]+xN*f[4]); // anti-neutrino |
---|
252 | //G4cout<<f[0]<<","<<f[1]<<","<<f[2]<<","<<f[3]<<","<<f[4]<<G4endl; |
---|
253 | } |
---|
254 | DISxint*=dlX; |
---|
255 | //G4cout<<"--- E="<<Enu<<" --- Q2="<<Q2<<" --- nX="<<nX<<", iX="<<DISxint |
---|
256 | // <<", mX="<<DISmint<<", rX="<<(DISxint-DISmint)/DISxint<<G4endl; |
---|
257 | } |
---|
258 | //G4cout<<"(E="<<Enu<<"), Q2="<<Q2<<", I="<<DISxint/dik/dik<<G4endl; |
---|
259 | DIStsig+=DISxint*dik; |
---|
260 | } |
---|
261 | DIStsig*=dQ2; |
---|
262 | //G4cout<<"=== E="<<Enu<<" ===> nQ="<<nQ2<<", iQ="<<DIStsig<<", mQ="<<DISmsig |
---|
263 | // <<", rQ="<<(DIStsig-DISmsig)/DIStsig<<G4endl; |
---|
264 | } |
---|
265 | //===== tot/qe choice ==== |
---|
266 | DIStsig*=sik/Enu; |
---|
267 | G4cout<<"***total*** E="<<Enu<<",sig/E= "<<DIStsig<<G4endl; |
---|
268 | //................... |
---|
269 | //DIStsig*=sik; |
---|
270 | //G4cout<<"***qelas*** E="<<Enu<<",sig= "<<DIStsig<<G4endl; |
---|
271 | //===== End of the choice |
---|
272 | } // End of the Enery LOOP |
---|
273 | // int np=0; |
---|
274 | //for(int m=0; m<2; m++) |
---|
275 | //{ |
---|
276 | // //fileNuMuX<<" static const G4double SH"<<n<<"[nH]={"<<G4endl<<" "; |
---|
277 | // //G4cout<<"**** A_high="<<m<<G4endl; |
---|
278 | // np=0; |
---|
279 | // int nC=14; |
---|
280 | // for(G4int en=0; en<nC; en++) |
---|
281 | // { |
---|
282 | // //G4double sig=1.; |
---|
283 | // np++; |
---|
284 | // //if(np==7) // Write by 7 number in brackets |
---|
285 | // //{ |
---|
286 | // // if(en==nC-1) fileNuMuX<<sig<<"};"<<G4endl; |
---|
287 | // // else fileNuMuX<<sig<<","<<G4endl<<" "; |
---|
288 | // //} |
---|
289 | // //else fileNuMuX<<sig<<","; |
---|
290 | // //if(np==7) np=0; |
---|
291 | // } // End of the point LOOP |
---|
292 | //} // End of the isotop LOOP |
---|
293 | return EXIT_SUCCESS; |
---|
294 | } |
---|