eb2esig.c - eb2esig.c generate formatted events or signal...

This preview shows page 1 - 3 out of 4 pages.

/*** eb2esig.c: generate formatted events or signal decomposition from event- built digitizer data */ #include <stdlib.h> #include <stdio.h> #include <assert.h> #include <strings.h> #include "eb.h" #include "lh.h" #include "wrap.h" #define AVG_TR_LEN 108 #define AVG_TR_STRIDE 110 int avg_tr[40][SPN_LEN]; #define MAX_AVG_TR(m, n) (avg_tr[(m)][(n) * AVG_TR_STRIDE + AVG_TR_LEN - 1]) #define TR_SCALE 10000.0f int main(int argc, char **argv) { int e0, e1; Event_Signal event; int x, v; FILE *fin, *fou, *fnet2, *f_ener_sp, *f_tr_gain; uint2 *rbuf; int *cur_tr; pair *detmap; int len, tr_len, num, num_complete = 0, num_read = 0, num_inpeak = 0, num_net1 = 0; int ener_cc; float cal_ener_cc; float cc_avg; int *a, i, j, k, t0; float gain[TOT_SEGS - 1], fact; float tr_gain[37]; uint2 *b; int num_net, net_seg, segs[36]; int net1_cnt = 0; lh *numnet_h, *t0_h, *x_h, *hitp_h, *tr_cc_h, *cfdcc_h; lh *cctr_h, *net1_h; int num_align_cfd = 0, num_aligned = 0; float *delay0, *delay1; static char *filename_in = "dig_sigs.eb"; static char *filename_out = "input_signals.dat"; float *a0, *a1; int net2[36][36]; struct filter *fltr; int m, avg_i; float avg = 0.0; int *ener_sp, ie; /* corrected ener of seg, cc after gate applied */ for (i = 0; i < 36; i++) { for (j = 0; j <36; j++) { net2[i][j] = 0; } } assert(argc == 1); fin = fopen(filename_in, "r"); if (fin == 0) { printf("%s: cannot open file %s\n", argv[0], filename_in); exit(1); } fou = fopen(filename_out, "w"); assert(fou != 0);
a0 = Calloc(TOT_SEGS, sizeof(float));

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture