-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ana_tests.h
83 lines (75 loc) · 2.03 KB
/
Ana_tests.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <stddef.h>
#include <stdio.h>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <sstream>
#include "Salt.h"
#include "Fpga.h"
#include "fastComm.h"
#include <fstream>
//#include <vector>
using namespace std;
class Ana_tests {
public:
Ana_tests(){};
Ana_tests(Fpga*, Salt*, FastComm*);
~Ana_tests(){};
void Get_run(string option, int runs, string outText);
void output_file(int runs, float avg_ADC[], float avg_chip[], float avg_noise, float length_avg, string outText, string option);
void Trim_dac_scan();
bool Check_Gain();
bool Get_noise(int runs, string data_type, string option);
bool Check_NZS();
bool Baseline_corr();
float calculateSD(float data[], int runs);
float calculateSD(int data[], int runs);
void adc_output(int min, int bins);
void xtalk_output();
void xtalk_outFile();
void histogram(int start, int bins, int data[], int size, int ch);
bool set_calib_fifo();
void gain_output();
bool uniformity_test();
bool xtalk_test();
void enable_ch(int ch);
void disable_ch(int ch);
void baseline_output();
void noise_outFile();
void baseline_outFile();
void gain_outFile();
//vector<int> m_hist[128];
int m_hmin;
int m_bins;
float xtalkl[128];
float xtalkr[128];
float m_xtalk[128];
float m_avg_adc[128];
float m_std_dev[128];
float m_gain[128];
float m_gain_pts[3][8];
float m_offset[128];
float m_gain_chip;
float m_offset_chip;
float m_noise;
int m_baseline[128];
float m_noise_rms;
int m_mcm_ch;
int m_mcm_v;
float m_a;
float m_b;
float m_c;
// int m_hist[128];
int adc_hist[128][64];
// vector<int> hist;
bool Check_PedS();
bool Check_MCMS();
bool Check_MCMS(float ADC[128], int mcm1, int mcm2, int mcm_ch, int mcm_v);
bool Check_linear(float x[], float y[], int size, float thresh);
bool Get_Quad_Coef(float x[], float y[], int PointsNum, float &a, float &b, float &c);
void Get_quadTerms(float x[], float y[], int npoints, float &a, float &b, float &c);
private:
Fpga* fpga_;
Salt* salt_;
FastComm* fastComm_;
};