OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
EnvelopeSlice.h
Go to the documentation of this file.
1 #ifndef _ENVELOPE_SLICE_H
2 #define _ENVELOPE_SLICE_H
3 
4 #include <cmath>
5 
8  SLI_z = 0,
10  SLI_beta = 1,
12  SLI_x = 2,
14  SLI_px = 3,
16  SLI_y = 4,
18  SLI_py = 5,
20  SLI_x0 = 6,
22  SLI_px0 = 7,
24  SLI_y0 = 8,
26  SLI_py0 = 9,
29 };
30 
37 
38 public:
39 
40  EnvelopeSlice();
41 
42  virtual ~EnvelopeSlice() {}
43 
45  double p[SLNPAR];
46 
48  double p_old[SLNPAR];
49 
50  inline double computeGamma() {
51  return sqrt(1.0 / (1.0 - p[SLI_beta] * p[SLI_beta]));
52  }
53 
54  // backup the slice
55  void backup();
56 
57  // restore a slice
58  void restore();
59 
60  // check if a slice has changed
61  int check();
62 
63  inline int is_valid() { return isValid_m; }
64 
66 
67 private:
68  int isValid_m;
70 
71 };
72 
73 #endif
pX0 angular deflection centriod x
Definition: EnvelopeSlice.h:22
y beam size y (rms) [m]
Definition: EnvelopeSlice.h:16
z slice position [m]
Definition: EnvelopeSlice.h:8
beta normalized velocity (total) [-]
Definition: EnvelopeSlice.h:10
class encpasulating an envelope slice
Definition: EnvelopeSlice.h:36
pY0 angular deflection centriod y
Definition: EnvelopeSlice.h:26
py beam divergence y [rad]
Definition: EnvelopeSlice.h:18
double computeGamma()
Definition: EnvelopeSlice.h:50
bool hasSliceBeenEmitted_m
Definition: EnvelopeSlice.h:65
double p[SLNPAR]
parameters
Definition: EnvelopeSlice.h:45
X0 position centroid x [m].
Definition: EnvelopeSlice.h:20
EnvelopeSliceParameter
Definition: EnvelopeSlice.h:6
Tps< T > sqrt(const Tps< T > &x)
Square root.
Definition: TpsMath.h:91
number of slice parameters
Definition: EnvelopeSlice.h:28
Y0 position centroid y [m].
Definition: EnvelopeSlice.h:24
virtual ~EnvelopeSlice()
Definition: EnvelopeSlice.h:42
x beam size x (rms) [m]
Definition: EnvelopeSlice.h:12
px beam divergence x [rad]
Definition: EnvelopeSlice.h:14
double p_old[SLNPAR]
parameters before last integration step (backup)
Definition: EnvelopeSlice.h:48