Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | List of all members
JPHYSICS::JRadiationFunction Class Reference

Fast implementation of class JRadiation. More...

#include <JRadiationSource.hh>

Inheritance diagram for JPHYSICS::JRadiationFunction:
JPHYSICS::JRadiation

Public Member Functions

 JRadiationFunction (const JRadiation &radiation, const unsigned int number_of_bins, const double Emin, const double Emax)
 Constructor. More...
 
virtual double TotalCrossSectionEErad (const double E) const
 Pair production cross section. More...
 
virtual double TotalCrossSectionGNrad (const double E) const
 Photo-nuclear cross section. More...
 
double SigmaEErad (const double E, const double eps) const
 Pair production cross section. More...
 
double TotalCrossSectionBrems (const double E) const
 Bremsstrahlung cross section. More...
 
virtual double SigmaGNrad (const double E, const double eps) const
 Photo-nuclear cross section. More...
 
double EfromBrems (const double E) const
 Bremsstrahlung shower energy. More...
 
double EfromEErad (const double E) const
 Pair production shower energy. More...
 
double EfromGNrad (const double E) const
 Photo-nuclear shower energy. More...
 

Protected Member Functions

virtual double IntegralofG (const double E, const double eps) const
 
double GofZEvrho (const double E, const double v, const double r) const
 

Static Protected Member Functions

static double sigmaGammaPparam (const double eps)
 
static double PhiofEofepsparam (const double E, const double eps)
 
static double r0 ()
 
static double Astar ()
 
static double B ()
 
static double BP ()
 

Protected Attributes

JFunction1D_t sigmaEE
 
JFunction1D_t sigmaGN
 
JFunction2D_t integral
 
const double Z
 
const double A
 
const double Dn
 
const double DnP
 
const int steps
 
const double EminBrems
 
const double EminEErad
 
const double EminGNrad
 

Private Types

typedef
JTOOLS::JGridPolint1Function1D_t 
JFunction1D_t
 
typedef JTOOLS::JMultiFunction
< JFunction1D_t,
JTOOLS::JMapList
< JTOOLS::JPolint1FunctionalGridMap > > 
JFunction2D_t
 

Detailed Description

Fast implementation of class JRadiation.

In this, the methods

JRadiation::TotalCrossSectionEErad(...), JRadiation::TotalCrossSectionGNrad(...) and JRadiation::IntegralofG(...)

are replaced by lookup tables.

Definition at line 35 of file JRadiationSource.hh.

Member Typedef Documentation

Definition at line 39 of file JRadiationSource.hh.

Definition at line 41 of file JRadiationSource.hh.

Constructor & Destructor Documentation

JPHYSICS::JRadiationFunction::JRadiationFunction ( const JRadiation radiation,
const unsigned int  number_of_bins,
const double  Emin,
const double  Emax 
)
inlineexplicit

Constructor.

Parameters
radiationJRadiation object
number_of_binsnumber of bins
Eminminimal muon energy [GeV]
Emaxmaximal muon energy [GeV]

Definition at line 52 of file JRadiationSource.hh.

55  :
56  JRadiation(radiation)
57  {
58  using namespace JTOOLS;
59 
60  const double xmin = log(Emin);
61  const double xmax = log(Emax);
62 
63 
64  integral.configure(make_grid(number_of_bins, xmin, xmax));
65 
66  for (JFunction2D_t::iterator i = integral.begin(); i != integral.end(); ++i) {
67 
68  const double x = i->getX();
69  const double E = exp(x);
70 
71  const double ymin = log(EminEErad/E);
72  const double ymax = 0.0;
73 
74  if (ymax > ymin) {
75 
76  i->getY().configure(make_grid(number_of_bins, ymin, ymax));
77 
78  for (JFunction1D_t::iterator j = i->getY().begin(); j != i->getY().end(); ++j) {
79 
80  const double y = j->getX();
81  const double eps = exp(y) * E;
82  const double z = JRadiation::IntegralofG(E, eps);
83 
84  j->getY() = z;
85  }
86  }
87  }
88 
89  integral.compile();
90  integral.setExceptionHandler(new JFunction1D_t::JDefaultResult(0.0));
91 
92 
93  sigmaEE.configure(make_grid(number_of_bins, xmin, xmax));
94 
95  for (JFunction1D_t::iterator i = sigmaEE.begin(); i != sigmaEE.end(); ++i) {
96 
97  const double E = exp(i->getX());
98  const double y = JRadiation::TotalCrossSectionEErad(E);
99 
100  i->getY() = y;
101  }
102 
103  sigmaEE.compile();
104 
105 
106  sigmaGN.configure(make_grid(number_of_bins, xmin, xmax));
107 
108  for (JFunction1D_t::iterator i = sigmaGN.begin(); i != sigmaGN.end(); ++i) {
109 
110  const double E = exp(i->getX());
111  const double y = JRadiation::TotalCrossSectionGNrad(E);
112 
113  i->getY() = y;
114  }
115 
116  sigmaGN.compile();
117  }
void compile()
Compilation.
const double EminEErad
Definition: JRadiation.hh:357
void setExceptionHandler(const supervisor_type &supervisor)
Set the supervisor for handling of exceptions.
JRadiation(const double z, const double a, const int integrsteps, const double eminBrems, const double eminEErad, const double eminGNrad)
Constructor.
Definition: JRadiation.hh:59
virtual double TotalCrossSectionEErad(const double E) const
Pair production cross section.
Definition: JRadiation.hh:118
virtual double IntegralofG(const double E, const double eps) const
Definition: JRadiation.hh:307
virtual double TotalCrossSectionGNrad(const double E) const
Photo-nuclear cross section.
Definition: JRadiation.hh:197
JGrid< JAbscissa_t > make_grid(const int nx, const JAbscissa_t Xmin, const JAbscissa_t Xmax)
Helper method for JGrid.
Definition: JGrid.hh:177

Member Function Documentation

virtual double JPHYSICS::JRadiationFunction::TotalCrossSectionEErad ( const double  E) const
inlinevirtual

Pair production cross section.

Parameters
Emuon energy [GeV]
Returns
cross section [m^2/g]

Reimplemented from JPHYSICS::JRadiation.

Definition at line 126 of file JRadiationSource.hh.

127  {
128  const double x = log(E);
129 
130  if (x >= sigmaEE. begin()->getX() &&
131  x <= sigmaEE.rbegin()->getX()) {
132 
133  try {
134  return sigmaEE(x);
135  }
136  catch(std::exception& error) {
137  std::cerr << "JRadiation::TotalCrossSectionEErad() " << E << ' ' << error.what() << std::endl;
138  }
139  }
140 
142  }
virtual double TotalCrossSectionEErad(const double E) const
Pair production cross section.
Definition: JRadiation.hh:118
virtual double JPHYSICS::JRadiationFunction::TotalCrossSectionGNrad ( const double  E) const
inlinevirtual

Photo-nuclear cross section.

Parameters
Emuon energy [GeV]
Returns
cross section [m^2/g]

Reimplemented from JPHYSICS::JRadiation.

Definition at line 151 of file JRadiationSource.hh.

152  {
153  const double x = log(E);
154 
155  if (x >= sigmaGN. begin()->getX() &&
156  x <= sigmaGN.rbegin()->getX()) {
157 
158  try {
159  return sigmaGN(x);
160  }
161  catch(std::exception& error) {
162  std::cerr << "JRadiation::TotalCrossSectionGNrad() " << E << ' ' << error.what() << std::endl;
163  }
164  }
165 
167  }
virtual double TotalCrossSectionGNrad(const double E) const
Photo-nuclear cross section.
Definition: JRadiation.hh:197
virtual double JPHYSICS::JRadiationFunction::IntegralofG ( const double  E,
const double  eps 
) const
inlineprotectedvirtual

Reimplemented from JPHYSICS::JRadiation.

Definition at line 170 of file JRadiationSource.hh.

172  {
173  try {
174 
175  const double x = log(E);
176  const double y = log(eps/E);
177  const double z = integral(x, y);
178 
179  return z;
180  }
181  catch(std::exception& error) {
182  std::cerr << "JRadiation::IntegralofG() " << E << ' ' << eps << ' ' << error.what() << std::endl;
183  }
184 
185  return JRadiation::IntegralofG(E, eps);
186  }
virtual double IntegralofG(const double E, const double eps) const
Definition: JRadiation.hh:307
double JPHYSICS::JRadiation::SigmaEErad ( const double  E,
const double  eps 
) const
inlineinherited

Pair production cross section.

Parameters
Emuon energy [GeV]
epsshower energy [GeV]
Returns
cross section [m^2/g]

Definition at line 83 of file JRadiation.hh.

85  {
86  //routine to calculate dsigma/de in cm^2/GeV for radiating a photon of energy eps
87  if(eps<4.*MASS_ELECTRON)return 0.;
88  if(eps>E-0.75*exp(1.0)*pow(Z,1./3.)) return 0.;
89  double zeta;
90  if(E<35.*MASS_MUON)
91  {
92  zeta = 0.;
93  }
94  else
95  {
96  zeta = (0.073*log((E/MASS_MUON)/(1.+1.95e-5*pow(Z,2./3.)*E/MASS_MUON))-0.26);
97  if(zeta<0.)
98  {
99  zeta=0.;
100  }
101  else
102  {
103  zeta = zeta/(0.058*log((E/MASS_MUON)/(1.+5.3e-5*pow(Z,1./3.)*E/MASS_MUON))-0.14);
104  }
105  }
106  double integ = IntegralofG(E,eps);
107  //cout<< eps<<" integ "<< integ<<endl;
108  return integ*(4/(3.*M_PI))*(Z*(Z+zeta)/A)*AVOGADRO*pow((ALPHA_ELECTRO_MAGNETIC*r0()),2.)*(1-eps/E)/eps;
109  }
static double r0()
Definition: JRadiation.hh:346
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
static const double ALPHA_ELECTRO_MAGNETIC
Electro-Magnetic coupling constant.
Definition: JConstants.hh:28
static const double AVOGADRO
Avogadro&#39;s number [gr^-1].
Definition: JConstants.hh:24
virtual double IntegralofG(const double E, const double eps) const
Definition: JRadiation.hh:307
static const double MASS_ELECTRON
electron mass [GeV]
Definition: JConstants.hh:58
double JPHYSICS::JRadiation::TotalCrossSectionBrems ( const double  E) const
inlineinherited

Bremsstrahlung cross section.

Parameters
Emuon energy [GeV]
Returns
cross section [m^2/g]

Definition at line 145 of file JRadiation.hh.

146  {
147  // double delta = (MASS_MUON*MASS_MUON*eps)/(2*E*(E-eps));
148  double delta = (MASS_MUON*MASS_MUON)/(2*E);
149  //double v = eps/E;
150  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.))));
151  if(Phin<0.)Phin=0.;
152  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.))));
153  if(Phie<0.)Phie=0.;
154  //if(eps>E/(1+MASS_MUON*MASS_MUON/(2.*MASS_ELECTRON*E)))Phie=0.;
155  double sig = (16./3.)*ALPHA_ELECTRO_MAGNETIC*AVOGADRO*pow((MASS_ELECTRON/MASS_MUON*r0()),2.0)*Z*(Z*Phin+Phie)/(A);
156  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);
157  return epsint*sig;//"cross section" in m^2/g multiplied by density and inverted gives mean free path
158  }
static double r0()
Definition: JRadiation.hh:346
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
static double B()
Definition: JRadiation.hh:348
const double DnP
Definition: JRadiation.hh:354
static const double ALPHA_ELECTRO_MAGNETIC
Electro-Magnetic coupling constant.
Definition: JConstants.hh:28
const double EminBrems
Definition: JRadiation.hh:356
static double BP()
Definition: JRadiation.hh:349
static const double AVOGADRO
Avogadro&#39;s number [gr^-1].
Definition: JConstants.hh:24
static const double MASS_ELECTRON
electron mass [GeV]
Definition: JConstants.hh:58
virtual double JPHYSICS::JRadiation::SigmaGNrad ( const double  E,
const double  eps 
) const
inlinevirtualinherited

Photo-nuclear cross section.

Parameters
Emuon energy [GeV]
epsshower energy [GeV]
Returns
cross section [m^2/g]

Definition at line 168 of file JRadiation.hh.

169  {
170  //minimum radiated energy is 0.2 GeV, not very critical formulae become invalid for very much lower
171  //result is given in m^2/g GeV
172  if (eps<0.2) return 0.;
173  if (eps>E-MASS_PROTON) return 0.;
174  double Aeff;
175  if (A==1)
176  {Aeff = 1.;}
177  else
178  {Aeff = (0.22*A + 0.78 * pow(A,0.89));}
179  double sigmaGammaPofeps = (49.2 + 11.1 * log(eps) + 151.8/sqrt(eps))*pow(10,-34.);
180  double Psiofeps = ALPHA_ELECTRO_MAGNETIC/PI*Aeff*AVOGADRO/A*sigmaGammaPofeps/eps;
181  double Denom = 1+eps/LAMBDA*(1+LAMBDA/(2*MASS_PROTON)+eps/LAMBDA);
182  double epsoverE = eps/E;
183  double Numerator = E * E * (1 - epsoverE) / (MASS_MUON * MASS_MUON) * (1 + MASS_MUON * MASS_MUON * epsoverE * epsoverE / (LAMBDA * LAMBDA * (1 - epsoverE)));
184  double Factor = 1 - epsoverE + epsoverE * epsoverE / 2 * (1 + 2 * MASS_MUON * MASS_MUON / (LAMBDA * LAMBDA));
185  double PhiofEofeps = epsoverE - 1 + Factor * log (Numerator / Denom);
186  //cout<<"PhiofEofeps "<<PhiofEofeps<<" Psiofeps "<<Psiofeps<<endl;
187  return Psiofeps*PhiofEofeps;
188  }
static const double MASS_PROTON
proton mass [GeV]
Definition: JConstants.hh:67
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
static const double PI
Constants.
Definition: JConstants.hh:20
static const double ALPHA_ELECTRO_MAGNETIC
Electro-Magnetic coupling constant.
Definition: JConstants.hh:28
static const double AVOGADRO
Avogadro&#39;s number [gr^-1].
Definition: JConstants.hh:24
double JPHYSICS::JRadiation::EfromBrems ( const double  E) const
inlineinherited

Bremsstrahlung shower energy.

Parameters
Emuon energy [GeV]
Returns
shower energy [GeV]

Definition at line 222 of file JRadiation.hh.

223  {
224  //double EminBrems(0.01);
225  //generate according to 1/k from minimum energy to E
226  double Er = 0.0;
227  for (int i = 1000; i != 0; --i) {
228  Er = EminBrems*exp(gRandom->Rndm()*log(E/EminBrems));
229  //check on the extra factor (1-v+3/4v^2)
230  if(gRandom->Rndm()<(1.-Er/E+0.75*pow(Er/E,2))) break;
231  }
232  return Er;
233  }
const double EminBrems
Definition: JRadiation.hh:356
double JPHYSICS::JRadiation::EfromEErad ( const double  E) const
inlineinherited

Pair production shower energy.

Parameters
Emuon energy [GeV]
Returns
shower energy [GeV]

Definition at line 242 of file JRadiation.hh.

243  {
244  //generate according to 1/k from minimum energy to E
245 
246  const double eps =0.2;
247  const double IntGmax = IntegralofG(E,eps)*2.0;
248 
249  double Er = 0.0;
250  for (int i = 1000; i != 0; --i)
251  {
252  Er = EminEErad*exp(gRandom->Rndm()*log(E/EminEErad));
253  //check on the extra factor, (1-v) and IntofG
254  double factor = (1.-Er/E)*IntegralofG(E,Er)/IntGmax;
255  if(gRandom->Rndm()<factor) break;
256  }
257  return Er;
258  }
const double EminEErad
Definition: JRadiation.hh:357
virtual double IntegralofG(const double E, const double eps) const
Definition: JRadiation.hh:307
double JPHYSICS::JRadiation::EfromGNrad ( const double  E) const
inlineinherited

Photo-nuclear shower energy.

Parameters
Emuon energy [GeV]
Returns
shower energy [GeV]

Definition at line 266 of file JRadiation.hh.

267  {
268  //generate according to 1/k from minimum energy to E
269 
270  double cmax = sigmaGammaPparam(EminGNrad);
271  if (cmax < sigmaGammaPparam(E))
272  cmax=sigmaGammaPparam(E);
273 
274  double Pmax = PhiofEofepsparam(E,EminGNrad);
275 
276  double Er = 0.0;
277  for (int i = 1000; i != 0; --i) {
278  Er = EminGNrad*exp(gRandom->Rndm()*log(E/EminGNrad));
279  const double factor = PhiofEofepsparam(E,Er)*sigmaGammaPparam(Er)/(cmax*Pmax);
280  if (gRandom->Rndm() < factor) return Er;
281  }
282 
283  return Er;
284  }
static double sigmaGammaPparam(const double eps)
Definition: JRadiation.hh:330
const double EminGNrad
Definition: JRadiation.hh:358
static double PhiofEofepsparam(const double E, const double eps)
Definition: JRadiation.hh:335
double JPHYSICS::JRadiation::GofZEvrho ( const double  E,
const double  v,
const double  r 
) const
inlineprotectedinherited

Definition at line 288 of file JRadiation.hh.

291  {
292  const double ksi = MASS_MUON*MASS_MUON*v*v*(1-r*r)/(4*MASS_ELECTRON*MASS_ELECTRON*(1-v));//
293  const double b = v*v/(2*(1-v));//
294  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);
295  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);
296  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));
297  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);
298  const double Le = log((Astar()*pow(Z,-1./3.)*sqrt((1+ksi)*(1+Ye)))/
299  (1.+(2.*MASS_ELECTRON*sqrt(exp(1.))*Astar()*pow(Z,-1./3.)*(1+ksi)*(1+Ye))/(E*v*(1-r*r))));
300  const double Lm = log(((MASS_MUON/MASS_ELECTRON)*Astar()*pow(Z,-1./3.)*sqrt((1.+1./ksi)*(1.+Ym)))/
301  (1.+(2.*MASS_ELECTRON*sqrt(exp(1.))*Astar()*pow(Z,-1./3.)*(1+ksi)*(1+Ym))/(E*v*(1-r*r))));
302  double Phie = Be*Le; if(Phie<0.)Phie=0.;
303  double Phim = Bm*Lm; if(Phim<0.)Phim=0.;
304  return Phie+(MASS_ELECTRON*MASS_ELECTRON/(MASS_MUON*MASS_MUON))*Phim;
305  }
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
static double Astar()
Definition: JRadiation.hh:347
static const double MASS_ELECTRON
electron mass [GeV]
Definition: JConstants.hh:58
static double JPHYSICS::JRadiation::sigmaGammaPparam ( const double  eps)
inlinestaticprotectedinherited

Definition at line 330 of file JRadiation.hh.

331  {
332  return (49.2 + 11.1 * log(eps) + 151.8/sqrt(eps));
333  }
static double JPHYSICS::JRadiation::PhiofEofepsparam ( const double  E,
const double  eps 
)
inlinestaticprotectedinherited

Definition at line 335 of file JRadiation.hh.

336  {
337  const double Denom = 1+eps/LAMBDA*(1+LAMBDA/(2*MASS_PROTON)+eps/LAMBDA);
338  const double epsoverE = eps/E;
339  const double Numerator = E * E * (1 - epsoverE) / (MASS_MUON * MASS_MUON) * (1 + MASS_MUON * MASS_MUON * epsoverE * epsoverE /
340  (LAMBDA * LAMBDA * (1 - epsoverE)));
341  const double Factor = 1 - epsoverE + epsoverE * epsoverE / 2 * (1 + 2 * MASS_MUON * MASS_MUON / (LAMBDA * LAMBDA));
342  return (epsoverE - 1 + Factor * log (Numerator / Denom));
343  }
static const double MASS_PROTON
proton mass [GeV]
Definition: JConstants.hh:67
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
static double JPHYSICS::JRadiation::r0 ( )
inlinestaticprotectedinherited

Definition at line 346 of file JRadiation.hh.

346 { return 2.817940e-15; }
static double JPHYSICS::JRadiation::Astar ( )
inlinestaticprotectedinherited

Definition at line 347 of file JRadiation.hh.

347 { return 183.0; }
static double JPHYSICS::JRadiation::B ( )
inlinestaticprotectedinherited

Definition at line 348 of file JRadiation.hh.

348 { return 183.0; }
static double JPHYSICS::JRadiation::BP ( )
inlinestaticprotectedinherited

Definition at line 349 of file JRadiation.hh.

349 { return 1429.0; }

Member Data Documentation

JFunction1D_t JPHYSICS::JRadiationFunction::sigmaEE
protected

Definition at line 188 of file JRadiationSource.hh.

JFunction1D_t JPHYSICS::JRadiationFunction::sigmaGN
protected

Definition at line 189 of file JRadiationSource.hh.

JFunction2D_t JPHYSICS::JRadiationFunction::integral
protected

Definition at line 190 of file JRadiationSource.hh.

const double JPHYSICS::JRadiation::Z
protectedinherited

Definition at line 351 of file JRadiation.hh.

const double JPHYSICS::JRadiation::A
protectedinherited

Definition at line 352 of file JRadiation.hh.

const double JPHYSICS::JRadiation::Dn
protectedinherited

Definition at line 353 of file JRadiation.hh.

const double JPHYSICS::JRadiation::DnP
protectedinherited

Definition at line 354 of file JRadiation.hh.

const int JPHYSICS::JRadiation::steps
protectedinherited

Definition at line 355 of file JRadiation.hh.

const double JPHYSICS::JRadiation::EminBrems
protectedinherited

Definition at line 356 of file JRadiation.hh.

const double JPHYSICS::JRadiation::EminEErad
protectedinherited

Definition at line 357 of file JRadiation.hh.

const double JPHYSICS::JRadiation::EminGNrad
protectedinherited

Definition at line 358 of file JRadiation.hh.


The documentation for this class was generated from the following file: