calc_lum_h

/* Include file for the calculation of the luminosity overlap integral */

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ssdef.h>
#include "cnsparam.h"
#include "physlib.h"

/* Structure containing the lattice parameters at z = 0 longitudinally */

typedef struct LATT_PARAMS
{
  float betax;	          /* horizontal beta (meters) at z = 0 */
  float alphax;           /* alphax at z = 0 */
  float betay;   	  /* vertical beta (meters) at z = 0 */
  float alphay;           /* alphay at z = 0 */
  float dispx;            /* horizontal dispersion (meters) at z = 0 */
  float dispy;   	  /* vertical dispersion (meters) at z = 0 */
  float dispx_slope;      /* slope of horizontal dispersion at z = 0 */
  float dispy_slope;      /* slope of vertical dispersion at z = 0 */
} __attribute__((packed)) /* Added by the PACKINATOR(tm) */ LATT_PARAMS;


/* Structure containing the bunch information -- Note that the x and y
   notation indicate the horizontal and vertical planes, respectively.
   The labels of 1 and 2 indicate bunch 1 and bunch 2, respectively. */

typedef struct PARTICLE_PARAMS
{
  float emit1_x;    /* normalized emittance (mm-mrads) ( xPI ) */
  float emit2_x;    /* all emittances will be multiplied by PI */ 
  float emit1_y;   
  float emit2_y;   
  float d0_x;       /* center to center bunch separation (microns) */
  float d0_y;      
  float angle_x;    /* full crossing angle (uradians) */
  float angle_y;   
  float tot_energy; /* total energy of synchronous particle (GeV) */
  float ct_0;       /* longitudinal collision point offset (cm from z=0) */
  float sigma1_z;   /* longitudinal bunch length (cm) */
  float sigma2_z;  
  float gammat;     /* transition gamma */
  float int_1;      /* particles per bunch x 10e10 */
  float int_2;
  float rf1;        /* peak accelerating voltage (MV) per turn */
  float rf2;    
  float acc_radius; /* accelerator radius (km) */
  float harm_num;   /* harmonic number */
} __attribute__((packed)) /* Added by the PACKINATOR(tm) */ PARTICLE_PARAMS;

extern "C" {
float calc_lum(LATT_PARAMS *latt, PARTICLE_PARAMS *part,
	       float integral_lower_bnd, float integral_upper_bnd);

float calc_sigma(float z, float beta_min, float disp_min, float mom_spread,
		 float rel_gamma, float rel_beta, float norm_emit,
		 float disp_slope, float alpha_latt);
}