Beam orbit generation


Detailed Description


Files

file  bpm_orbit.h
 libbpm orbit generation routines
file  get_bpmhit.c
file  vm.c

Data Structures

struct  v3
struct  m33

Functions

EXTERN double get_rbend (double e, double B, double l, double p)
EXTERN double get_sbend (double e, double B, double l, double p)
EXTERN int get_bpmhit (bunchconf_t *bunch, bpmconf_t *bpm)
EXTERN int get_bpmhits (beamconf_t *beam, bpmconf_t *bpm)
void v_copy (struct v3 *v1, struct v3 *v2)
double v_mag (struct v3 *v1)
void v_scale (struct v3 *v1, double dscale)
void v_norm (struct v3 *v1)
void v_matmult (struct m33 *m1, struct v3 *v1)
void v_add (struct v3 *v1, struct v3 *v2)
void v_sub (struct v3 *v1, struct v3 *v2)
double v_dot (struct v3 *v1, struct v3 *v2)
void v_cross (struct v3 *v1, struct v3 *v2)
void v_print (struct v3 *v1)
void m_rotmat (struct m33 *m1, double alpha, double beta, double gamma)
void m_matmult (struct m33 *m, struct m33 *m1, struct m33 *m2)
void m_matadd (struct m33 *m1, struct m33 *m2)
void m_print (struct m33 *m1)


Function Documentation

EXTERN double get_rbend ( double  e,
double  B,
double  l,
double  p 
)

Get the bending angle through a rectangular bending magnet

Parameters:
e the particle's charge in units of e, take sign into account !
B the magnetic field in Tesla
l the length of the magnet in meter
p the momentum of the particle in GeV
Returns:
the bending angle
get_rbend.c

Definition at line 12 of file get_bend.c.

EXTERN double get_sbend ( double  e,
double  B,
double  l,
double  p 
)

Get the bending angle through a sector bending magnet

Parameters:
e the particle's charge in units of e, take sign into account !
B the magnetic field in Tesla
l the sector length of the magnet in meter
p the momentum of the particle in GeV
Returns:
the bending angle

Definition at line 17 of file get_bend.c.

EXTERN int get_bpmhit ( bunchconf_t bunch,
bpmconf_t bpm 
)

Get the bunch hit in the local BPM coordinate frame

Parameters:
bunch the bunch structure
bpm the bpm config

Definition at line 34 of file get_bpmhit.c.

References bpm_error(), bunchconf::bpmposition, bunchconf::bpmslope, bunchconf::bpmtilt, bpmconf::geom_pos, bpmconf::geom_tilt, m_rotmat(), bunchconf::position, bunchconf::slope, v_add(), v_copy(), v_cross(), v_dot(), v_matmult(), v_scale(), v_sub(), v3::x, v3::y, and v3::z.

Referenced by get_bpmhits().

EXTERN int get_bpmhits ( beamconf_t beam,
bpmconf_t bpm 
)

Calls get_bpmhit for every bunch in the beam...

Parameters:
beam the beam structure
bpm the bpm config

Definition at line 9 of file get_bpmhit.c.

References bpm_error(), beamconf::bunch, get_bpmhit(), and beamconf::nbunches.

void v_copy ( struct v3 v1,
struct v3 v2 
)

Copy 3-vector v2 into 3-vector v1

Definition at line 11 of file vm.c.

References v3::x, v3::y, and v3::z.

Referenced by get_bpmhit().

double v_mag ( struct v3 v1  ) 

Return the magnitude of 3-vector v1

Definition at line 18 of file vm.c.

References v_dot().

Referenced by v_norm().

void v_scale ( struct v3 v1,
double  dscale 
)

Scale 3-vector v1 with factor dscale

Definition at line 22 of file vm.c.

References v3::x, v3::y, and v3::z.

Referenced by get_bpmhit(), and v_norm().

void v_norm ( struct v3 v1  ) 

Normalise 3-vector v1 to unit vector

Definition at line 28 of file vm.c.

References v_mag(), and v_scale().

void v_matmult ( struct m33 m1,
struct v3 v1 
)

Multiply matrix m1 with 3-vector v1 : m1.v1, result is in v1

Definition at line 32 of file vm.c.

References m33::e, v3::x, v3::y, and v3::z.

Referenced by get_bpmhit().

void v_add ( struct v3 v1,
struct v3 v2 
)

Add two 3-vectors v1 and v2, result is in v1

Definition at line 44 of file vm.c.

References v3::x, v3::y, and v3::z.

Referenced by get_bpmhit().

void v_sub ( struct v3 v1,
struct v3 v2 
)

Subtract 3-vectors v1 - v2, result is in v1

Definition at line 50 of file vm.c.

References v3::x, v3::y, and v3::z.

Referenced by get_bpmhit().

double v_dot ( struct v3 v1,
struct v3 v2 
)

Return Scalar product of 3-vectors v1 and v2

Definition at line 56 of file vm.c.

References v3::x, v3::y, and v3::z.

Referenced by get_bpmhit(), and v_mag().

void v_cross ( struct v3 v1,
struct v3 v2 
)

Return the vector product of 3 vectors v1 x v2, result is in v1

Definition at line 60 of file vm.c.

References v3::x, v3::y, and v3::z.

Referenced by get_bpmhit().

void v_print ( struct v3 v1  ) 

Print the 3-vector to stdout

Definition at line 74 of file vm.c.

References v3::x, v3::y, and v3::z.

void m_rotmat ( struct m33 m1,
double  alpha,
double  beta,
double  gamma 
)

Create rotation 3x3 matrix with the 3 euler angles alpha, beta and gamma, result in m1

Definition at line 78 of file vm.c.

References m33::e, and m_matmult().

Referenced by get_bpmhit().

void m_matmult ( struct m33 m,
struct m33 m1,
struct m33 m2 
)

3x3 Matrix multiplication m1.m2, result in m

Definition at line 126 of file vm.c.

References m33::e.

Referenced by m_rotmat().

void m_matadd ( struct m33 m1,
struct m33 m2 
)

3x3 Matrix addition m1+m2, result in m1

Definition at line 140 of file vm.c.

References m33::e.

void m_print ( struct m33 m1  ) 

Print 3x3 matrix m1 to stdout

Definition at line 151 of file vm.c.

References m33::e.


Generated on Wed Jun 25 17:32:49 2008 for libbpm by  doxygen 1.5.6