source: trunk/source/processes/hadronic/models/chiral_inv_phase_space/calcul/G4NuElXQ2Integration.cc @ 968

Last change on this file since 968 was 968, checked in by garnier, 15 years ago

fichier ajoutes

File size: 11.7 KB
Line 
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: NuE DIS (x,Q2) approximation is integrated over x
28// .....................................................
29// Created: M.V. Kossov, CERN/ITEP(Moscow), 30-Sept-05
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
39void 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 r=0.;
65    double min=.077;             // Delta(0)
66                                double max=.47;              // Hard Pomeron
67    //double H=1.22;
68    if(Q2<=0.) G4cout<<"strucf: Q2="<<Q2<<" <= 0"<< G4endl;
69    double Q=std::sqrt(Q2);
70    //if(A==1)                   // Proton
71                  //{
72    //  r=std::sqrt(Q2/1.66);
73    //  max=.5;
74    //}
75    //else if(A<13)              // Light nuclei
76                  //{
77    //  double f=Q2/4.62;
78    //  r=f*f;
79    //  max=.3;
80    //  if(A>2) H=1.;
81    //}
82    //else if(A>0)               // Heavy nuclei
83                  //{
84    //  double f=Q2/3.4;
85    //  double ff=f*f;
86    //  r=ff*ff;
87    //  max=.5;
88    //  H=1.;
89    //}
90    //else G4cout<<"strucf: A="<<A<<" <= 0"<< G4endl;
91    //
92    N=3.+.3581*std::log(1.+Q2/.04); // a#of partons in the nonperturbative phase space
93    Del=min+(max-min)/(1.+5./Q);
94    D=0.68*std::pow(1.+.145/Q2,-1.-Del); // 0.68=1-0.34, m2=.145 GeV2
95    V=3*(1.-D)*(N-1.);
96    double c3=.75;                       // 3*0.25
97    double uu=std::exp(lGam(N-Del)-lGam(N-1.)-lGam(1.-Del))/N;
98    U2=(c3+N-3.)*uu;
99    U3=c3*uu;
100    mA  = A;
101    mQ2 = Q2;
102    mN  = N;
103    mD  = D;
104    mDel=Del;
105    mU2 =U2;
106    mU3 =U3;
107    //mUU =UU; // @@
108    mV  =V;
109  } 
110  // From here the Q2 coefficients are used
111  double x1=std::pow(1.-x,N-2.);
112  double pp=D*std::pow(x,-Del)*x1;
113  double dir=V*x*x1;
114  double per=U2*pp;
115                f2 = per + dir;
116  //double W2=MN2-MN2*x+Q2/x-Q2;
117  //if(W2<W2t)
118                //{
119  //  per=UU*pp;
120  //  xf3= per+dir;
121  //}
122  //else
123  xf3= U3*pp+dir;
124  fL = per/5.;                             // 20%
125  return;
126}
127
128void getFun(int A, double lx, double Q2, double* f)
129{
130  double f2=0., xf3=0., fL=0.;
131  if (lx>0.5) G4cerr<<"***getFun: ln(x)="<<lx<<">.5"<<G4endl;
132  double x=std::exp(lx);
133  double x2=x*x;
134  strucf(A, x, Q2, f2, xf3, fL);
135  f[0]=f2;             // direct part
136  f[1]=(-f2+xf3)/x;    // *y (neutrino) part
137  f[2]=(-f2-xf3)/x;    // *y (anti-neutrino) part
138  f[3]=(f2-fL-xf3)/x2; // *y2 (neutrino) part
139  f[4]=(f2-fL+xf3)/x2; // *y2 (anti-neutrino) part
140}
141
142int main()
143{
144  const double reps=.001;        // relative accuracy of the total Q2 integral calculation
145  const double xeps=.0001;      // relative accuracy of the total X integral calculation
146  //           =========
147  const double GF=1.16637e-5;   // Fermi constant in GeV^-2
148  const double GF2=GF*GF;       // Squared Fermi constant in GeV^-4
149  const double MW=80.425;       // Mass of W-boson in GeV
150  const double MW2=MW*MW;       // Squared mass of W-boson in GeV^2
151  const double MW4=MW2*MW2;     // Quadro mass of W-boson in GeV^4
152  const double hc2=38937932300.;// (hc)^2 in GeV^2*10^-38cm2 to convert GeV^-2 to 10^-38cm2
153  const double pif=3.14159265*4;// 4pi
154  const double sik=GF2*hc2/pif; // precalculated coefficient
155  //const double mpi=.1349766;    // pi0 meson mass in GeV
156  //const double mpi=.13957018;   // charged pi meson mass in GeV
157  //const double mpi2=mpi*mpi;    // m_pi^2 in GeV^2
158  const double me=.00051099892; // electron mass in GeV
159  const double me2=me*me;       // m_e^2 in GeV^2
160  const double hme2=me2/2;      // .5*m_e^2 in GeV^2
161  //const double mmu=.105658369;  // mu meson mass in GeV
162  //const double mmu2=mmu*mmu;    // m_mu^2 in GeV^2
163  //const double hmmu2=mmu2/2;    // .5*m_mu^2 in GeV^2
164  //const double mtau=1.777;      // tau meson mass in GeV
165  //const double mtau2=mtau*mtau; // m_tau^2 in GeV^2
166  //const double hmtau2=mtau2/2;  // .5*m_e^2 in GeV^2
167  const double mp=.93827203;    // proton mass in GeV
168  const double mn=.93956536;    // neutron mass in GeV
169  //const double md=1.87561282;   // deuteron mass in GeV
170  //const double MN=.931494043;   // Nucleon mass (inside nucleus, atomic mass unit, GeV)
171  const double MN=(mn+mp)/2;    // Nucleon mass (mean free) in GeV
172  const double MD=1.232;        // proton mass in GeV
173  //const double mp2=mp*mp;       // m_p^2 in GeV^2
174  const double MN2=MN*MN;       // M_N^2 in GeV^2
175  const double dMN=MN+MN;       // 2*M_N in GeV
176  const double dMN2=MN2+MN2;    // 2*M_N^2 in GeV^2
177  const double fMN2=dMN2+dMN2;  // 4*M_N^2 in GeV^2
178  const double EminE=me+me2/dMN;// Threshold for muon production
179  //const double EminMu=mmu+mmu2/dMN;  // Threshold for muon production
180  //const double EminTau=mmu+mmu2/dMN; // Threshold for muon production
181  //
182  //const double mc=.3;           // parameter of W>M+mc cut for Quasi-Elastic/Delta
183  const double mc=std::sqrt((MN*MN+MD*MD)/2)-MN; // Squared mean between N and \Delta
184  //const double mc=mpi;          // parameter of W>M+mc cut for Quasi-Elastic/Delta
185  const double mcV=(dMN+mc)*mc; // constant of W>M+mc cut for Quasi-Elastic
186  //std::ofstream fileNuMuX("NuMuXQ2.out", std::ios::out);
187  //fileNuMuX.setf( std::ios::scientific, std::ios::floatfield );
188  // _____ Begin of Test Area
189  //Genfun::LogGamma logGamma;
190  //double n=4.9;
191                //double g=exp(logGamma(n));
192  //G4cout<<"Gamma("<<n<<") = "<<g<<G4endl;
193  // ^^^^^ End of Test Area
194  //
195  double f[5];                    // A working array
196  int    A=12;                    // Neucleus for which calculations should be done
197  double lEnuMin=0;               // LogLog of Minimum energy of neutrino
198  double lEnuMax=std::log(1.+std::log(300./EminE)); // LogLog of MaximumEnergy of neutrino
199  int    nE=49;                   // Number of points
200  double dlE=(lEnuMax-lEnuMin)/nE;
201  lEnuMin+=dlE/10;
202  lEnuMax+=dlE/5;
203  G4cout<<"Emin="<<EminE<<",lEi="<<lEnuMin<<",lEa="<<lEnuMax<<",dlE="<<dlE<<G4endl;
204  for(double lEnu=lEnuMin; lEnu<lEnuMax; lEnu+=dlE)
205                {
206    double Enu=std::exp(std::exp(lEnu)-1.)*EminE; // Energy of neutrino/anti-neutrino
207    double dEnu=Enu+Enu;          // doubled energy of nu/anu
208    double Enu2=Enu*Enu;          // squared energy of nu/anu
209    double Ee=Enu-me;           // Free Energy of neutrino/anti-neutrino
210    double Ee2=Ee*Ee;          // squared energy of nu/anu
211    double ME=Enu*MN;             // M*E
212    double dME=ME+ME;             // 2*M*E
213    double DIStsig=1.;            // Total curent DIS cross-section to be integrated
214    double DISmsig=1.e20;         // Total remembered DIS cross-section
215    double dEMN=(dEnu+MN)*ME;
216    double MEm=ME-hme2;
217    double sqE=Enu*std::sqrt(MEm*MEm-me2*MN2);
218    double E2M=MN*Enu2-(Enu+MN)*hme2;
219    double ymax=(E2M+sqE)/dEMN;
220    double ymin=(E2M-sqE)/dEMN;
221    double rmin=1.-ymin;
222    double rhm2E=hme2/Enu2;
223    double Q2min=(Enu2+Enu2)*(rmin-rhm2E-std::sqrt(rmin*rmin-rhm2E-rhm2E));
224    double Q2max=dME*ymax;
225    int    nQ2=8;
226    //G4cout<<"*** E="<<Enu<<", Q2i="<<Q2min<<" < Q2a="<<Q2max<<", yi="<<ymin<<" < ya="
227    //      <<ymax<<G4endl;
228    while(std::fabs(DIStsig-DISmsig)/DIStsig>reps)
229    {
230      DISmsig=DIStsig;
231      DIStsig=0.;
232      nQ2*=2;
233      double dQ2=(Q2max-Q2min)/nQ2;
234      for(double Q2=Q2min+dQ2/2; Q2<Q2max; Q2+=dQ2)
235                                  {
236        double DISxint=1.;        // Curent DIS x-integral
237        double DISmint=1.e20;     // Remembered DIS x-integral
238        double Q2M=Q2+MW2;
239        double dik=MW4/Q2M/Q2M;
240        double qmc=Q2+mcV;
241        double lXQES=std::log((std::sqrt(qmc*qmc+Q2*fMN2)-qmc)/dMN2);//QuasielasticBoundary
242        //double lXQES=log(Q2/(Q2+mcV)); // Quasielastic boundary (W=MN+m_c)
243        //double xN=Q2/dME;
244        double xN=Q2/MN/(Ee+std::sqrt(Ee2+Q2));
245        //double lXmin=log(xN/ymax);
246        double lXmin=std::log(xN);
247        // ****** QE ********
248        if(lXQES>lXmin) lXmin=lXQES;   // A cut which leaves only QES >>>>>>>>>>>>>>>>
249        // *** End of QE^^^^^
250        double lXmax=0.;               // QES is in DIS
251        //double lXmax=lXQES;          // Cut off quasielastic
252        int    nX=8;
253        while(std::fabs(DISxint-DISmint)/DISxint>xeps)
254        {
255          DISmint=DISxint;
256          DISxint=0.;
257          nX*=2;
258          double dlX=(lXmax-lXmin)/nX;
259          for(double lX=lXmin+dlX/2; lX<lXmax; lX+=dlX)
260                                      {
261            getFun(A, lX, Q2, f);
262            // ***** Neutrino/Antineutrino switch ******>>>>>>>>>>>>>>>>>>>>>>>>>>>>
263            DISxint+=f[0]+f[0]+xN*(f[1]+f[1]+xN*f[3]); // neutrino
264            //DISxint+=f[0]+f[0]+xN*(f[2]+f[2]+xN*f[4]); // anti-neutrino
265            //G4cout<<f[0]<<","<<f[1]<<","<<f[2]<<","<<f[3]<<","<<f[4]<<G4endl;
266          }
267          DISxint*=dlX;
268          //G4cout<<"--- E="<<Enu<<" --- Q2="<<Q2<<" --- nX="<<nX<<", iX="<<DISxint
269          //      <<", mX="<<DISmint<<", rX="<<(DISxint-DISmint)/DISxint<<G4endl;
270        }
271        //G4cout<<"(E="<<Enu<<"), Q2="<<Q2<<", I="<<DISxint/dik/dik<<G4endl;
272        DIStsig+=DISxint*dik;
273      }
274      DIStsig*=dQ2;
275      //G4cout<<"=== E="<<Enu<<" ===> nQ="<<nQ2<<", iQ="<<DIStsig<<", mQ="<<DISmsig
276                                                //      <<", rQ="<<(DIStsig-DISmsig)/DIStsig<<G4endl;
277    }
278    //===== tot/qe choice ====
279    DIStsig*=sik/Enu;
280    //G4cout<<"***total-neutrino*** E="<<Enu<<" ,sig/E="<<DIStsig<<G4endl;
281    //G4cout<<"***total-antineutrino*** E="<<Enu<<" ,sig/E="<<DIStsig<<G4endl;
282    G4cout<<"***quasiel-nu*** E="<<Enu<<" ,sig/E="<<DIStsig*Enu<<G4endl;
283    //G4cout<<"***quasiel-antinu*** E="<<Enu<<" ,sig/E="<<DIStsig*Enu<<G4endl;
284    //...................
285    //DIStsig*=sik;
286    //G4cout<<"***qelas*** E="<<Enu<<",sig="<<DIStsig<<G4endl;
287    //===== End of the choice
288                } // End of the Enery LOOP
289  return EXIT_SUCCESS;
290}
Note: See TracBrowser for help on using the repository browser.