Analysis routines


Files

file  ana_compute_residual.c
file  ana_def_cutfn.c
file  ana_get_svd_coeffs.c
file  ana_set_cutfn.c
file  bpm_analysis.h
 libbpm analysis routines

Defines

#define BPM_GOOD_EVENT
#define BPM_BAD_EVENT
#define ANA_SVD_TILT
#define ANA_SVD_NOTILT

Functions

EXTERN int ana_set_cutfn (int(*cutfn)(bpmproc_t *proc))
EXTERN int ana_get_svd_coeffs (bpmproc_t **proc, int num_bpms, int num_svd, int total_num_evts, double *coeffs, int mode)
EXTERN int ana_compute_residual (bpmproc_t **proc, int num_bpms, int num_evts, double *coeffs, int mode, double *mean, double *rms)
EXTERN int ana_def_cutfn (bpmproc_t *proc)

Variables

EXTERN int(*) ana_cutfn (bpmproc_t *proc)


Define Documentation

#define BPM_GOOD_EVENT

A good event

Definition at line 28 of file bpm_analysis.h.

Referenced by ana_compute_residual(), ana_def_cutfn(), ana_get_svd_coeffs(), and ana_set_cutfn().

#define BPM_BAD_EVENT

A bad event

Definition at line 29 of file bpm_analysis.h.

#define ANA_SVD_TILT

Include tilts in the SVD

Definition at line 31 of file bpm_analysis.h.

Referenced by ana_compute_residual(), and ana_get_svd_coeffs().

#define ANA_SVD_NOTILT

Don't include tilts in the SVD

Definition at line 32 of file bpm_analysis.h.


Function Documentation

EXTERN int ana_set_cutfn ( int(*)(bpmproc_t *proc)  cutfn  ) 

Set the cut function

Parameters:
cutfn a pointer to the cut function with a bpmproc_t as argument
Returns:
BPM_SUCCESS upon success, BPM_FAILURE upon failure

Definition at line 8 of file ana_set_cutfn.c.

References ana_cutfn, bpm_error(), and BPM_GOOD_EVENT.

EXTERN int ana_get_svd_coeffs ( bpmproc_t **  proc,
int  num_bpms,
int  num_svd,
int  total_num_evts,
double *  coeffs,
int  mode 
)

Perform the SVD on the given data and return the coefficients. The index 0 bpmconf is the bpm to be regressed against and the remainder are put into the regression. The coeffs array must be valid up to the number of arguments approapriate to mode.

Parameters:
proc pointer to the the processed bpm databuffer
num_bpms the number of bpms in the array
num_svd number of svd constants
total_num_evts total number of events in the buffer
coeffs the array of correlation coefficients that is returned
mode mode option: take tilts into account in the SVD ?
Returns:
BPM_SUCCESS upon success, BPM_FAILURE upon failure

Definition at line 9 of file ana_get_svd_coeffs.c.

References ana_cutfn, ANA_SVD_TILT, BPM_GOOD_EVENT, gsl_linalg_SV_decomp(), gsl_linalg_SV_solve(), gsl_matrix_calloc(), gsl_matrix_set(), gsl_vector_calloc(), gsl_vector_get(), and gsl_vector_set().

EXTERN int ana_compute_residual ( bpmproc_t **  proc,
int  num_bpms,
int  num_evts,
double *  coeffs,
int  mode,
double *  mean,
double *  rms 
)

Calculate the mean and rms of the residual fomr the given events. Note that the mode and svd coefficients must 'match' as with ana_get_svd_coeffs()

Parameters:
proc pointer to the the processed bpm databuffer
num_bpms the number of bpms in the array
num_evts total number of events in the buffer
coeffs the array of correlation coefficients
mode mode option: take tilts into account in the SVD ?
mean the returned mean
rms the returned rms

Definition at line 8 of file ana_compute_residual.c.

References ana_cutfn, ANA_SVD_TILT, BPM_GOOD_EVENT, and bpmproc::ddc_pos.

EXTERN int ana_def_cutfn ( bpmproc_t proc  ) 

The default cut function if people cut be bothered to do their own :)

Parameters:
proc the event to decide
Returns:
BPM_GOOD_EVENT if the event is good, BPM_BAD_EVENT if it isn't

Definition at line 10 of file ana_def_cutfn.c.

References BPM_GOOD_EVENT.


Variable Documentation

EXTERN int(*) ana_cutfn(bpmproc_t *proc)

A user cut function to allow cuts to be applied while selecting events for SVD, etc.

Definition at line 100 of file bpm_analysis.h.


Generated on Thu Jan 10 10:18:34 2008 for libbpm by  doxygen 1.5.1