00001
00013 #ifndef BPMORBIT_H__
00014 #define BPMORBIT_H__
00015
00016
00017
00018
00019 #include <math.h>
00020 #include <bpm/bpm_defs.h>
00021 #include <bpm/bpm_units.h>
00022 #include <bpm/bpm_interface.h>
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00039 struct v3 {
00040 double x;
00041 double y;
00042 double z;
00043 };
00044
00045
00050 struct m33 {
00051 double e[3][3];
00052 };
00053
00054
00055
00056
00057
00058
00059
00068 EXTERN double get_rbend( double e, double B, double l, double p );
00069
00078 EXTERN double get_sbend( double e, double B, double l, double p );
00079
00080
00081 EXTERN int get_bpmhit( beamconf_t* beam, bpmconf_t* bpm );
00082
00098 EXTERN int generate_bpm_orbit( beamconf_t* beam, bpmconf_t* bpm );
00099
00100
00101
00114 EXTERN int generate_corr_scan( bpmconf_t* bpm, beamconf_t* beam, int num_evts,
00115 int num_steps, double angle_range, double angle,
00116 double z_pos );
00117
00118
00131 EXTERN int generate_mover_scan( beamconf_t* beam, int num_evts, int num_steps,
00132 double mover_range, double angle );
00133
00134
00135
00137 void v_copy(struct v3 *v1, struct v3 *v2);
00138
00140 double v_mag(struct v3 *v1);
00141
00143 void v_scale(struct v3 *v1, double dscale);
00144
00146 void v_norm(struct v3 *v1);
00147
00149 void v_matmult(struct m33 *m1, struct v3 *v1);
00150
00152 void v_add(struct v3 *v1, struct v3 *v2);
00153
00155 void v_sub(struct v3 *v1, struct v3 *v2);
00156
00158 double v_dot(struct v3 *v1, struct v3 *v2);
00159
00161 void v_cross(struct v3 *v1, struct v3 *v2);
00162
00164 void v_print(struct v3 *v1);
00165
00167 void m_rotmat(struct m33 *m1, double alpha, double beta, double gamma);
00168
00170 void m_matmult(struct m33 *m, struct m33 *m1, struct m33 *m2);
00171
00173 void m_matadd(struct m33 *m1, struct m33 *m2);
00174
00176 void m_print(struct m33 *m1);
00177
00178 #ifdef __cplusplus
00179 }
00180 #endif
00181
00182 #endif
00183
00184