#ifndef NewTypes_H #define NewTypes_H #include "includes.h" //New types typedef vector < double > Vector; //Vector typedef vector < Vector > Matrix; //Matrix enum Distribution {Gaussian, Parabolic, DoubleGaussian}; //Initial distribution of the particles in a bunch enum Axis {x_axis, y_axis}; //Axis for the plot enum Parameter {initial_distribution, final_distribution, mean, rms}; enum BeamPosition {upper, lower}; //To see where is the beam at the interaction point, it is a convention //Define PI for Windows extern double M_PI; // = 3.14159265 //Global variables for the simulation extern double QS; // = 0. extern double QMOD; // = 0.005 extern double BX; //The x-beta function = 1.0 extern double BY; //The y-beta function = 1.0 //Create a generator of random numbers extern TRandom3 random_number; // = 0 //Matrix multiplication Vector MV(const Matrix & matrix, const Vector & vector); //Generate two random numbers with a Normal distribution void rand_normal(double & r1, double & r2); //Generate two random numbers with a parabolic distribution 3/4*(-x^2 + 1) void rand_parabolic(double & r1, double & r2); //Generate two random numbers with a double Gaussian distribution void rand_double_gauss(double & r1, double & r2, double average = 0., double sigma = 1., double distance = 4.); //distance is the distance between the peaks, average is the position of the hole and sigma the sigma of the two Gaussians //Compute and plot a FFT from an array of real numbers TGraph* ComputeFFT(TCanvas *c1, int color_plot, int size_results, double *input_array, double tune); //Find the two peaks of a FFT with their error void FFT_find_peaks(TCanvas *c1, TGraph *graph_fft, double first_hypothesis, double second_hypothesis, double & x_1, double & FWHM_1, double & x_2, double & FWHM_2); #endif