-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspect_jitter.cc
49 lines (38 loc) · 1.33 KB
/
spect_jitter.cc
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
#include "lib/csv_reader.h"
#include <TH2D.h>
#include <TCanvas.h>
#include <TStyle.h>
int main (){
TString PATH = "/Users/osahin/Projects/";
// TString fileName = "DifferentFly640_FE640_160Mhz_spectrum.log";
TString fileName = "CommonFly640_FE640_160Mhz_spectrum.log";
// TString filnemane2 = "1st-measures-eLink-clk.csv second file
TString fileName2 = "1st-measures-eLink-clk.csv";
jitter_handler jhandler(160.0);
/* set minimum offset freq */
double minF = 0.999;
double maxF = 1.01e6;
jhandler.set_min_freq(minF);
jhandler.set_max_freq(maxF);
plot_jitter graph, graph2;
/* file reader */
csv_reader csv;
/* jitter info container */
source_jitter jitter, jitter2;
//for the first file
try{
csv.read(TString(PATH+fileName).Data(), jitter, TString("Single"));
}catch(const int dummy){return 0;} //const int dummy is used to cath the throw only
std::cout << jhandler.rms_jitter(jitter) << std::endl;
//for the second file
try{
csv.read(TString(PATH+fileName2).Data(), jitter2, TString("Double"));
}catch(const int b){return 0;}
std::cout << " second file -rms_jitter --> " << jhandler.rms_jitter(jitter2) << std::endl;
/* returns jitter value */
graph.add_plot(jitter,minF,maxF);
graph.add_plot(jitter2,minF,maxF);
graph.print_plot("");
graph.print_plot("same");
return 0;
}