Added constants.h: declaring global variables there and passign to parameters, particles. Included Elastic Scattering
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// constants.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 08.10.18.
|
||||
// Copyright © 2018 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef constants_h
|
||||
#define constants_h
|
||||
|
||||
class Constants
|
||||
{
|
||||
public:
|
||||
virtual ~Constants(){};
|
||||
Constants() {};
|
||||
|
||||
protected:
|
||||
const double pi = 3.1415;
|
||||
const double c_nat = 1.;
|
||||
const double c_ms = 299792458;
|
||||
const double me_eV = 0.511e6;
|
||||
const double qe_e = 1;
|
||||
const double re_m = 2.817940322719e-15;
|
||||
const double e_C = 1.602176462e-19;
|
||||
const double ZT2 = 2.;
|
||||
const double mT2_eV = 5.61886404234e9;
|
||||
|
||||
// Conversion Functions
|
||||
double v_ms(double Ekin_eV) {
|
||||
double gamma = 1. + Ekin_eV/me_eV;
|
||||
double beta = sqrt(1 - pow(gamma,-2));
|
||||
return(beta * c_ms);
|
||||
|
||||
}
|
||||
double Ekin_eV(double speedAbs_ms) {
|
||||
double beta = speedAbs_ms/c_ms;
|
||||
double gamma = pow(1 - pow(beta,2),-0.5);
|
||||
return ( (gamma-1) * me_eV * pow(c_nat,2) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user