forked from radiasoft/rshellweg
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBeam.h
More file actions
72 lines (58 loc) · 2.26 KB
/
Beam.h
File metadata and controls
72 lines (58 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//---------------------------------------------------------------------------
#ifndef BeamH
#define BeamH
#include "Spectrum.h"
const int Ncoef=4;
//---------------------------------------------------------------------------
class TBeam
{
private:
int Np,Nliv,Nbars;
double Kernel;
void CountLiving();
void TwoRandomGauss(double& x1,double& x2);
void SetParameters(double *X,TBeamParameter Par);
TSpectrumBar *GetSpectrum(bool Smooth,double *X,double& Xav,double& dX,bool width=false);
int CountCSTParticles(char *F);
FILE *logFile;
double BesselSum(TIntParameters& Par,TIntegration *I,TTrig Trig);
public:
__fastcall TBeam(int N);
__fastcall ~TBeam();
TParticle *Particle;
double lmb,h,Cmag;
double Ib,I0;
bool Reverse;
void SetKernel(double Ker);
void SetBarsNumber(int N);
bool ReadCSTEmittance(TBeamType bType);
int CountCSTParticles(TBeamType bType);
void MakeGaussEmittance(double alpha, double betta, double eps);
void MakeGaussDistribution(double Xav,double sX,TBeamParameter Par);
void MakeEquiprobableDistribution(double Xav, double dX,TBeamParameter Par);
//GET OUTPUT PARAMETERS
void GetCourantSneider(double& alpha,double& betta, double& epsilon);
void GetEllipticParameters(double& x0,double& y0, double& a,double& b,double& phi, double& Rx, double& Ry);
TSpectrumBar *GetEnergySpectrum(bool Smooth,double& Wav,double& dW);
TSpectrumBar *GetPhaseSpectrum(bool Smooth,double& Fav,double& dF);
void GetParameters(double *X,TBeamParameter Par);
double GetBeamRadius();
double GetPhaseLength();
double GetAveragePhase();
double GetAverageEnergy();
double GetMaxEnergy();
double iGetAverageEnergy(TIntParameters& Par,TIntegration *I);
double iGetBeamLength(TIntParameters& Par,TIntegration *I);
double iGetBeamRadius(TIntParameters& Par,TIntegration *I);
double iGetAveragePhase(TIntParameters& Par,TIntegration *I);
double SinSum(TIntParameters& Par,TIntegration *I);
double CosSum(TIntParameters& Par,TIntegration *I);
int GetLivingNumber();
double FindEmittanceAngle(double& a,double& b);
void Integrate(TIntParameters& Par,TIntegration **I,int Si);
void Next(TBeam *nBeam,TIntParameters& Par,TIntegration **I);
void Next(TBeam *nBeam);
void Solve();
};
//---------------------------------------------------------------------------
#endif