Skip to content

Commit

Permalink
works up until gain
Browse files Browse the repository at this point in the history
  • Loading branch information
cbetanco committed Oct 1, 2018
1 parent 0c158f1 commit 32f3e0f
Show file tree
Hide file tree
Showing 71 changed files with 8,457 additions and 602 deletions.
449 changes: 252 additions & 197 deletions Ana_tests.C

Large diffs are not rendered by default.

759 changes: 759 additions & 0 deletions Ana_tests.C~

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions Ana_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,31 @@ class 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();
void Check_Gain();
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 histogram(int start, int bins, int data[], int size, int ch);
void set_calib_fifo();
bool set_calib_fifo();
//vector<int> m_hist[128];
int m_hmin;
int m_bins;
float m_avg_adc[128];
float m_std_dev[128];
float m_gain[128];
float m_offset[128];
float m_gain_chip;
float m_offset_chip;
float m_noise;
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;
Expand Down
66 changes: 66 additions & 0 deletions Ana_tests.h~
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#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 histogram(int start, int bins, int data[], int size, int ch);
void set_calib_fifo();
//vector<int> m_hist[128];
int m_hmin;
int m_bins;
float m_avg_adc[128];
float m_std_dev[128];
float m_gain[128];
float m_offset[128];
float m_gain_chip;
float m_offset_chip;
float m_noise;
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_;

};
130 changes: 130 additions & 0 deletions Baseline_value.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
AVG = 123.164
STD_DEV = 19.4124
48
154
143
118
172
111
127
114
149
125
160
117
92
102
144
116
112
114
144
111
141
106
101
137
156
116
103
140
114
117
90
98
123
121
120
112
149
103
114
128
131
122
87
128
128
53
128
107
154
117
91
107
157
131
112
118
123
120
130
123
125
106
116
107
128
128
124
132
113
129
141
119
120
107
91
132
128
144
126
103
135
115
149
136
127
115
134
122
110
113
130
139
115
133
128
105
142
119
122
147
144
142
94
132
142
112
148
120
133
135
108
117
119
116
107
126
164
91
130
142
159
120
112
163
118
148
116
123
130 changes: 130 additions & 0 deletions Calib_Calib.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
length_avg = 2
runs = 10, Average = 0.00625, std_dev = 0.00681078
0
0
0
0
0
0
0
0.1
0
0
0
0
0
0
0
0.1
0
0
0.2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.1
0.1
0
0
0.1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.1
0
0
0
0
0
0
0
0
0
0
0
0.1
0
0
0
0
0.3
0
0
0.1
0.1
0
0.2
0
0.1
0
0
0.1
0
0
0
0
0
0
0
0
0
0
0
0
0
0.1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.1
0
0
0
0
0
0.1
0
0.2
0
0
0
0
0
0
0
0.1
Loading

0 comments on commit 32f3e0f

Please sign in to comment.