Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JRadiation.hh
Go to the documentation of this file.
1 #ifndef __JPHYSICS__JRADIATION__
2 #define __JPHYSICS__JRADIATION__
3 
4 #include <cmath>
5 
6 #include <TRandom3.h>
7 
8 #include "JLang/JCC.hh"
9 #include "JPhysics/JConstants.hh"
10 #include "JPhysics/JIonization.hh"
11 
12 /**
13  * \file
14  * Muon radiative cross sections.
15  * \author P. Kooijman
16  */
17 
18 namespace JPHYSICS {}
19 namespace JPP { using namespace JPHYSICS; }
20 
21 namespace JPHYSICS {
22 
23  namespace {
24  static const double LAMBDA = 0.65; // [GeV]
25  }
26 
27  /**
28  * Auxiliary class for the calculation of the muon radiative cross sections.
29  * \author P. Kooijman
30  */
31  class JRadiation {
32  public:
33 
34  /**
35  * Virtual desctructor.
36  */
37  virtual ~JRadiation()
38  {}
39 
40 
41  /**
42  * Constructor.
43  *
44  * \param z number of protons
45  * \param a number of nucleons
46  * \param integrsteps number of integration steps
47  * \param eminBrems energy threshold Bremsstrahlung [GeV]
48  * \param eminEErad energy threshold pair production [GeV]
49  * \param eminGNrad energy threshold photo-production [GeV]
50  */
51  JRadiation(const double z,
52  const double a,
53  const int integrsteps,
54  const double eminBrems,
55  const double eminEErad,
56  const double eminGNrad
57 ) :
58 
59  Z(z),
60  A(a),
61  Dn (1.54*pow(A,0.27)),
62  DnP (pow(Dn,(1-1/Z))),
63  steps(integrsteps),
64  EminBrems(eminBrems),
65  EminEErad(eminEErad),
66  EminGNrad(eminGNrad)
67  {}
68 
69 
70  /**
71  * Pair production cross section.
72  *
73  * \param E muon energy [GeV]
74  * \param eps shower energy [GeV]
75  * \return cross section [m^2/g]
76  */
77  double SigmaEErad(const double E,
78  const double eps) const
79  {
80  //routine to calculate dsigma/de in cm^2/GeV for radiating a photon of energy eps
81 
82  if(eps<4.*MASS_ELECTRON)return 0.;
83  if(eps>E-0.75*exp(1.0)*pow(Z,1./3.)) return 0.;
84  double zeta;
85  if(E<35.*MASS_MUON)
86  {
87  zeta = 0.;
88  }
89  else
90  {
91  zeta = (0.073*log((E/MASS_MUON)/(1.+1.95e-5*pow(Z,2./3.)*E/MASS_MUON))-0.26);
92  if(zeta<0.)
93  {
94  zeta=0.;
95  }
96  else
97  {
98  zeta = zeta/(0.058*log((E/MASS_MUON)/(1.+5.3e-5*pow(Z,1./3.)*E/MASS_MUON))-0.14);
99  }
100  }
101  double integ = IntegralofG(E,eps);
102  //cout<< eps<<" integ "<< integ<<endl;
103  return integ*(4/(3.*M_PI))*(Z*(Z+zeta)/A)*AVOGADRO*pow((ALPHA_ELECTRO_MAGNETIC*r0()),2.)*(1-eps/E)/eps;
104  }
105 
106 
107  /**
108  * Pair production cross section.
109  *
110  * \param E muon energy [GeV]
111  * \return cross section [m^2/g]
112  */
113  virtual double TotalCrossSectionEErad(const double E) const
114  {
115  //cout<<" entering TotcrsecEErad"<<endl;
116  // radiation goes approx as 1/E so sample in log E
117  // calculate the total cross section as S(dsigma/de)*de
118  // start at E and go backwards for precision
119  double sum(0.);
120  double dle = log(E/EminEErad)/steps;
121  //cout << "dle "<< dle<<endl;
122  for(int i=0;i<steps+1;i++)
123  {
124  double factor = 1.0;
125  if(i==0 || i==steps)factor=0.5;
126  //cout<<"i"<<i<<endl;
127  double eps = EminEErad*exp(i*dle);sum += factor*eps*SigmaEErad( E, eps);
128  //cout<<"eps "<<eps<<" sum "<<sum<<endl;
129  }
130  return sum*dle;
131  }
132 
133 
134  /**
135  * Bremsstrahlung cross section.
136  *
137  * \param E muon energy [GeV]
138  * \return cross section [m^2/g]
139  */
140 
141  double TotalCrossSectionBrems(const double E) const
142  {
143  // double delta = (MASS_MUON*MASS_MUON*eps)/(2*E*(E-eps));
144  double delta = (MASS_MUON*MASS_MUON)/(2*E);
145  //double v = eps/E;
146  double Phin = log((B()*pow(Z,-1./3.)*(MASS_MUON+delta*(DnP*sqrt(exp(1.0))-2.)))/(DnP*(MASS_ELECTRON+delta*sqrt(exp(1.0))*B()*pow(Z,-1./3.))));
147  if(Phin<0.)Phin=0.;
148  double Phie = log((BP()*pow(Z,-2./3.)*MASS_MUON)/((1+delta*MASS_MUON/(MASS_ELECTRON*MASS_ELECTRON*sqrt(exp(1.0))))*(MASS_ELECTRON+delta*sqrt(exp(1.0))*BP()*pow(Z,-2./3.))));
149  if(Phie<0.)Phie=0.;
150  //if(eps>E/(1+MASS_MUON*MASS_MUON/(2.*MASS_ELECTRON*E)))Phie=0.;
151  double sig = (16./3.)*ALPHA_ELECTRO_MAGNETIC*AVOGADRO*pow((MASS_ELECTRON/MASS_MUON*r0()),2.0)*Z*(Z*Phin+Phie)/(A);
152  double epsint = log((E-MASS_MUON)/EminBrems)-(E-MASS_MUON-EminBrems)/E+0.375*(pow(E-MASS_MUON,2.)-pow(EminBrems,2.0))/pow(E,2.0);
153  return epsint*sig;//"cross section" in m^2/g multiplied by density and inverted gives mean free path
154  }
155 
156 
157  /**
158  * Photo-nuclear cross section.
159  *
160  * \param E muon energy [GeV]
161  * \param eps shower energy [GeV]
162  * \return cross section [m^2/g]
163  */
164  virtual double SigmaGNrad(const double E, const double eps) const
165  {
166 
167  //minimum radiated energy is 0.2 GeV, not very critical formulae become invalid for very much lower
168  //result is given in m^2/g GeV
169  if (eps<0.2) return 0.;
170  if (eps>E-MASS_PROTON) return 0.;
171  double Aeff;
172  if (A==1)
173  {Aeff = 1.;}
174  else
175  {Aeff = (0.22*A + 0.78 * pow(A,0.89));}
176  double sigmaGammaPofeps = (49.2 + 11.1 * log(eps) + 151.8/sqrt(eps))*pow(10,-34.);
177  double Psiofeps = ALPHA_ELECTRO_MAGNETIC/PI*Aeff*AVOGADRO/A*sigmaGammaPofeps/eps;
178  double Denom = 1+eps/LAMBDA*(1+LAMBDA/(2*MASS_PROTON)+eps/LAMBDA);
179  double epsoverE = eps/E;
180  double Numerator = E * E * (1 - epsoverE) / (MASS_MUON * MASS_MUON) * (1 + MASS_MUON * MASS_MUON * epsoverE * epsoverE / (LAMBDA * LAMBDA * (1 - epsoverE)));
181  double Factor = 1 - epsoverE + epsoverE * epsoverE / 2 * (1 + 2 * MASS_MUON * MASS_MUON / (LAMBDA * LAMBDA));
182  double PhiofEofeps = epsoverE - 1 + Factor * log (Numerator / Denom);
183  //cout<<"PhiofEofeps "<<PhiofEofeps<<" Psiofeps "<<Psiofeps<<endl;
184  return Psiofeps*PhiofEofeps;
185  }
186 
187 
188  /**
189  * Photo-nuclear cross section.
190  *
191  * \param E muon energy [GeV]
192  * \return cross section [m^2/g]
193  */
194  virtual double TotalCrossSectionGNrad(const double E) const
195  {
196  double epsmin = 0.2;
197  double epsmax = E-MASS_PROTON/2;
198  double sum(0.);
199  double dle = log(epsmax/epsmin)/steps;
200  for(int i=0;i<steps+1;i++)
201  {
202  float factor = 1.0;
203  if(i==0 || i==steps)factor=0.5;
204  //cout<<"i"<<i<<endl;
205  double eps = epsmin*exp(i*dle);sum += factor*eps*SigmaGNrad( E, eps);
206  //cout<<"eps "<<eps<<" sum "<<sum<<endl;
207  }
208 
209  return sum*dle;
210  }
211 
212 
213  /**
214  * Bremsstrahlung shower energy.
215  *
216  * \param E muon energy [GeV]
217  * \return shower energy [GeV]
218  */
219  double EfromBrems(const double E) const
220  {
221  //double EminBrems(0.01);
222  //generate according to 1/k from minimum energy to E
223  double Er = 0.0;
224  for (int i = 1000; i != 0; --i) {
225  Er = EminBrems*exp(gRandom->Rndm()*log(E/EminBrems));
226  //check on the extra factor (1-v+3/4v^2)
227  if(gRandom->Rndm()<(1.-Er/E+0.75*pow(Er/E,2))) break;
228  }
229  return Er;
230  }
231 
232 
233  /**
234  * Pair production shower energy.
235  *
236  * \param E muon energy [GeV]
237  * \return shower energy [GeV]
238  */
239  double EfromEErad(const double E) const
240  {
241  //generate according to 1/k from minimum energy to E
242 
243  const double eps =0.2;
244  const double IntGmax = IntegralofG(E,eps)*2.0;
245 
246  double Er = 0.0;
247  for (int i = 1000; i != 0; --i)
248  {
249  Er = EminEErad*exp(gRandom->Rndm()*log(E/EminEErad));
250  //check on the extra factor, (1-v) and IntofG
251  double factor = (1.-Er/E)*IntegralofG(E,Er)/IntGmax;
252  if(gRandom->Rndm()<factor) break;
253  }
254  return Er;
255  }
256 
257  /**
258  * Photo-nuclear shower energy.
259  *
260  * \param E muon energy [GeV]
261  * \return shower energy [GeV]
262  */
263  double EfromGNrad(const double E) const
264  {
265  //generate according to 1/k from minimum energy to E
266 
267  double cmax = sigmaGammaPparam(EminGNrad);
268  if (cmax < sigmaGammaPparam(E))
269  cmax=sigmaGammaPparam(E);
270 
271  double Pmax = PhiofEofepsparam(E,EminGNrad);
272 
273  double Er = 0.0;
274  for (int i = 1000; i != 0; --i) {
275  Er = EminGNrad*exp(gRandom->Rndm()*log(E/EminGNrad));
276  const double factor = PhiofEofepsparam(E,Er)*sigmaGammaPparam(Er)/(cmax*Pmax);
277  if (gRandom->Rndm() < factor) return Er;
278  }
279 
280  return Er;
281  }
282 
283  /**
284  * Ionization a parameter.
285  *
286  * \param Energy muon energy [GeV]
287  * \return s coefficient [GeV/m]
288  */
289  virtual double CalculateACoeff(double Energy) const
290  {
291  const double Energy2 = Energy*Energy;
292  const double beta = sqrt(Energy2 - MASS_MUON*MASS_MUON) / Energy;
293  const double beta2 = beta*beta;
294  const double gamma = Energy/MASS_MUON;
295  const double gamma2 = gamma*gamma;
296 
297  const double p2 = Energy2 - MASS_MUON*MASS_MUON;
298  const double EMaxT = 2.*MASS_ELECTRON*p2 / (MASS_ELECTRON*MASS_ELECTRON + MASS_MUON*MASS_MUON + 2.*MASS_ELECTRON*Energy);
299  const double EMaxT2 = EMaxT*EMaxT;
300  const JSter& coeff = getSterCoefficient(Z);
301  const double I2 = coeff.I*coeff.I; // in GeV^2
302  const double X = log10(beta*gamma);
303 
304  double delta = 0.0;
305 
306  if (coeff.X0 < X && X < coeff.X1) {
307  delta = 4.6052*X + coeff.a*pow(coeff.X1-X,coeff.m) + coeff.C;
308  }
309 
310  if (X > coeff.X1) {
311  delta = 4.6052*X + coeff.C;
312  }
313 
314  double acoeff = (2*PI*AVOGADRO*ALPHA_ELECTRO_MAGNETIC*ALPHA_ELECTRO_MAGNETIC*le()*le())*Z/A*(MASS_ELECTRON/beta2)*(log(2.*MASS_ELECTRON*beta2*gamma2*EMaxT/I2)-2.*beta2+0.25*(EMaxT2/Energy2)-delta);
315 
316  return acoeff;
317  }
318 
319  protected:
320  double GofZEvrho(const double E,
321  const double v,
322  const double r) const
323  {
324  const double ksi = MASS_MUON*MASS_MUON*v*v*(1-r*r)/(4*MASS_ELECTRON*MASS_ELECTRON*(1-v));//
325  const double b = v*v/(2*(1-v));//
326  const double Be = ((2+r*r)*(1+b)+ksi*(3+r*r))*log(1+1/ksi)+(1-r*r-b)/(1+ksi)-(3+r*r);
327  const double Bm = ((1+r*r)*(1+3*b/2)-(1+2*b)*(1-r*r)/ksi)*log(1+ksi)+ksi*(1-r*r-b)/(1+ksi)+(1+2*b)*(1-r*r);
328  const double Ye = (5-r*r+4*b*(1+r*r))/(2*(1+3*b)*log(3+1/ksi)-r*r-2*b*(2-r*r));
329  const double Ym = (4+r*r+3*b*(1+r*r))/((1+r*r)*(1.5+2*b)*log(3+ksi)+1-1.5*r*r);
330  const double Le = log((Astar()*pow(Z,-1./3.)*sqrt((1+ksi)*(1+Ye)))/
331  (1.+(2.*MASS_ELECTRON*sqrt(exp(1.))*Astar()*pow(Z,-1./3.)*(1+ksi)*(1+Ye))/(E*v*(1-r*r))));
332  const double Lm = log(((MASS_MUON/MASS_ELECTRON)*Astar()*pow(Z,-1./3.)*sqrt((1.+1./ksi)*(1.+Ym)))/
333  (1.+(2.*MASS_ELECTRON*sqrt(exp(1.))*Astar()*pow(Z,-1./3.)*(1+ksi)*(1+Ym))/(E*v*(1-r*r))));
334  double Phie = Be*Le; if(Phie<0.)Phie=0.;
335  double Phim = Bm*Lm; if(Phim<0.)Phim=0.;
336  return Phie+(MASS_ELECTRON*MASS_ELECTRON/(MASS_MUON*MASS_MUON))*Phim;
337  }
338 
339  virtual double IntegralofG(const double E,
340  const double eps) const
341  {
342  const double EP = E-eps;
343  const double v = eps/E;
344  const double tmin = log((4*MASS_ELECTRON/eps+12*pow(MASS_MUON,2)/(E*EP)*(1-4*MASS_ELECTRON/eps))
345  /(1+(1-6*pow(MASS_MUON,2)/(E*EP))*sqrt(1-4*MASS_ELECTRON/eps)));
346 
347  if (tmin < 0.0) {
348  const double dt = -tmin/steps;
349  double sum(0.);
350  for (int i = 0;i<steps+1;i++)
351  {
352  double fac = 1.0;if(i==0 || i==steps)fac=0.5;
353  double t = tmin+i*dt;
354  double r = 1.-exp(t);
355  sum+=fac*GofZEvrho(E,v,r)*exp(t);
356  }
357  return sum*dt;
358  } else
359  return 0.0;
360  }
361 
362  static double sigmaGammaPparam(const double eps)
363  {
364  return (49.2 + 11.1 * log(eps) + 151.8/sqrt(eps));
365  }
366 
367  static double PhiofEofepsparam(const double E,const double eps)
368  {
369  const double Denom = 1+eps/LAMBDA*(1+LAMBDA/(2*MASS_PROTON)+eps/LAMBDA);
370  const double epsoverE = eps/E;
371  const double Numerator = E * E * (1 - epsoverE) / (MASS_MUON * MASS_MUON) * (1 + MASS_MUON * MASS_MUON * epsoverE * epsoverE /
372  (LAMBDA * LAMBDA * (1 - epsoverE)));
373  const double Factor = 1 - epsoverE + epsoverE * epsoverE / 2 * (1 + 2 * MASS_MUON * MASS_MUON / (LAMBDA * LAMBDA));
374  return (epsoverE - 1 + Factor * log (Numerator / Denom));
375  }
376 
377 
378  static double le () { return 3.8616E-13;}
379  static double r0 () { return 2.817940e-15; }
380  static double Astar() { return 183.0; }
381  static double B () { return 183.0; }
382  static double BP () { return 1429.0; }
383 
384  const double Z;
385  const double A;
386  const double Dn;
387  const double DnP;
388  const int steps;
389  const double EminBrems;
390  const double EminEErad;
391  const double EminGNrad;
392  };
393 }
394 
395 #endif
396 
static double r0()
Definition: JRadiation.hh:379
double I
Ionization potentian [GeV].
Definition: JIonization.hh:22
static double le()
Definition: JRadiation.hh:378
Struct for the Sternheimer coefficients.
Definition: JIonization.hh:21
double a
Correction density parameter.
Definition: JIonization.hh:25
static double B()
Definition: JRadiation.hh:381
double m
Correction density parameter.
Definition: JIonization.hh:26
double EfromBrems(const double E) const
Bremsstrahlung shower energy.
Definition: JRadiation.hh:219
const double EminEErad
Definition: JRadiation.hh:390
static const double MASS_MUON
muon mass [GeV]
const double DnP
Definition: JRadiation.hh:387
static const double AVOGADRO
Avogadro&#39;s number [gr^-1].
double GofZEvrho(const double E, const double v, const double r) const
Definition: JRadiation.hh:320
data_type r[M+1]
Definition: JPolint.hh:742
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
double TotalCrossSectionBrems(const double E) const
Bremsstrahlung cross section.
Definition: JRadiation.hh:141
Compiler version dependent expressions, macros, etc.
Auxiliary class for the calculation of the muon radiative cross sections.
Definition: JRadiation.hh:31
Auxiliary data structure to convert (lambda) function to printable object.
Definition: JManip.hh:724
double SigmaEErad(const double E, const double eps) const
Pair production cross section.
Definition: JRadiation.hh:77
static double sigmaGammaPparam(const double eps)
Definition: JRadiation.hh:362
static double Astar()
Definition: JRadiation.hh:380
JRadiation(const double z, const double a, const int integrsteps, const double eminBrems, const double eminEErad, const double eminGNrad)
Constructor.
Definition: JRadiation.hh:51
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
then break fi done getCenter read X Y Z let X
Physics constants.
static const double PI
Mathematical constants.
virtual double SigmaGNrad(const double E, const double eps) const
Photo-nuclear cross section.
Definition: JRadiation.hh:164
const double EminGNrad
Definition: JRadiation.hh:391
static const double MASS_ELECTRON
electron mass [GeV]
double EfromGNrad(const double E) const
Photo-nuclear shower energy.
Definition: JRadiation.hh:263
const double EminBrems
Definition: JRadiation.hh:389
p2
Definition: module-Z:fit.sh:72
double X0
Correction density parameter.
Definition: JIonization.hh:23
static double BP()
Definition: JRadiation.hh:382
then JCalibrateToT a
Definition: JTuneHV.sh:116
virtual double TotalCrossSectionEErad(const double E) const
Pair production cross section.
Definition: JRadiation.hh:113
static const double MASS_PROTON
proton mass [GeV]
static const double ALPHA_ELECTRO_MAGNETIC
Electro-Magnetic coupling constant.
virtual ~JRadiation()
Virtual desctructor.
Definition: JRadiation.hh:37
static double PhiofEofepsparam(const double E, const double eps)
Definition: JRadiation.hh:367
virtual double CalculateACoeff(double Energy) const
Ionization a parameter.
Definition: JRadiation.hh:289
virtual double IntegralofG(const double E, const double eps) const
Definition: JRadiation.hh:339
double EfromEErad(const double E) const
Pair production shower energy.
Definition: JRadiation.hh:239
data_type v[N+1][M+1]
Definition: JPolint.hh:740
virtual double TotalCrossSectionGNrad(const double E) const
Photo-nuclear cross section.
Definition: JRadiation.hh:194
double C
Correction density parameter.
Definition: JIonization.hh:27
double X1
Correction density parameter.
Definition: JIonization.hh:24
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:35
static JSterCoefficient getSterCoefficient
Function object for Ster coefficients.
Definition: JIonization.hh:80