Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions xfields/beam_elements/touschek_src/touschek.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

#include "xtrack/headers/track.h"
#include "xtrack/random/random_src/uniform_accurate.h"
#include "xfields/headers/constants.h"
#include "xfields/headers/elegant_rng.h"

#include <math.h>
Expand Down Expand Up @@ -119,8 +120,8 @@ void bunch2cm(double *p1, double *p2, double *q, double *beta, double *gamma) {
pp1 = pp1 + POW2(p1[i]);
pp2 = pp2 + POW2(p2[i]);
}
e1 = sqrt(ELECTRON_MASS_EV * ELECTRON_MASS_EV + pp1);
e2 = sqrt(ELECTRON_MASS_EV * ELECTRON_MASS_EV + pp2);
e1 = sqrt(MELECTRON_EV * MELECTRON_EV + pp1);
e2 = sqrt(MELECTRON_EV * MELECTRON_EV + pp2);
ee = e1 + e2;

betap1 = 0.0;
Expand Down Expand Up @@ -178,7 +179,7 @@ void cm2bunch(double *p1, double *p2, double *q, double *beta, double *gamma) {
pq = pq + q[i] * q[i];
}

e = sqrt(ELECTRON_MASS_EV * ELECTRON_MASS_EV + pq);
e = sqrt(MELECTRON_EV * MELECTRON_EV + pq);

betaq = 0.0;
bb = 0.0;
Expand Down Expand Up @@ -460,7 +461,7 @@ void TouschekScatter(TouschekScatteringData el,
}

if (p1[5] < delta_neg || p2[5] > delta_pos) {
beta0 = qabs / sqrt(qabs * qabs + ELECTRON_MASS_EV * ELECTRON_MASS_EV);
beta0 = qabs / sqrt(qabs * qabs + MELECTRON_EV * MELECTRON_EV);
cross = moeller(beta0, theta);
temp *= cross * beta0 / gamma / gamma;

Expand Down
2 changes: 1 addition & 1 deletion xfields/headers/beamstrahlung_spectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ double beamstrahlung_avg(LocalParticle *part, BeamBeamBiGaussian3DRecordData bea
const double gamma = initial_energy / m0; // [1]

// constants
const double r = pow(QELEM, 2.0)/(4.0* PI * EPSILON_0 * MELECTRON_KG * pow(C_LIGHT, 2.0)); // [m] electron radius
const double r = pow(QELEM, 2.0)/(4.0* PI * EPSILON_0 * MASS_ELECTRON * pow(C_LIGHT, 2.0)); // [m] electron radius
const double c1 = 2.59 * ( 5.0/ 6.0) * ( r*r) / REDUCED_COMPTON_WAVELENGTH_ELECTRON; // [m]
const double c2 = 1.2 * (25.0/36.0) * (r*r*r*r) / REDUCED_COMPTON_WAVELENGTH_ELECTRON * 137.0; // [m^3]

Expand Down
8 changes: 2 additions & 6 deletions xfields/headers/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@
#define MPROTON_GEV (0.93827208816)
#endif

#if !defined( MELECTRON_GEV )
#define MELECTRON_GEV (0.00051099895000)
#endif

#if !defined( MELECTRON_EV )
#define MELECTRON_EV (510998.95)
#endif

#if !defined( MELECTRON_KG )
#define MELECTRON_KG (9.1093837015e-31)
#if !defined( MELECTRON_GEV )
#define MELECTRON_GEV (MELECTRON_EV * 1e-9)
#endif

#if !defined( HBAR_GEVS )
Expand Down