Two types of functional GUI's can be made

This commit is contained in:
Peter DeRosa 2022-07-13 02:44:11 -04:00
parent 4f617e27e3
commit b3c257fff2
10 changed files with 739 additions and 686 deletions

Binary file not shown.

2
.gitignore vendored
View File

@ -1 +1,3 @@
ADEX ADEX
ADT
.gitignore

View File

@ -1,4 +0,0 @@
angle,Y,Yerr
45,1.29,.10
90,1.10,.10
135,1.29,.10
1 angle Y Yerr
2 45 1.29 .10
3 90 1.10 .10
4 135 1.29 .10

1351
AD.cxx

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,7 @@ class HistoGUIad{
double A0; double A0;
double A2E; double A2E;
double A4E; double A4E;
double Ierr;
int SetFit(double a, double b, double c){ int SetFit(double a, double b, double c){
A0 = a; A0 = a;
A2E = b; A2E = b;
@ -385,7 +386,7 @@ int HistoGUIad::DrawData(double x_low_win, double y_low_win, double x_hi_win, do
for(int i=0; i < x.size() - 1; i++){ for(int i=0; i < x.size() - 1; i++){
x_wid = (x[i] + x_offset) / width_scale; x_wid = (x[i] + x_offset) / width_scale;
y_wid = (y[i] + y_offset) / height_scale; y_wid = (y[i] + y_offset) / height_scale;
y_errors_wid = (y_errors[i] / height_scale); y_errors_wid = ((y_errors[i]/A0) / height_scale);
// x_wid2 = (x[i + 1] + x_offset) / width_scale; // x_wid2 = (x[i + 1] + x_offset) / width_scale;
// y_wid2 = (y[i + 1] + y_offset) / height_scale; // y_wid2 = (y[i + 1] + y_offset) / height_scale;
//printf("(%f, %f), (%f,%f)\n", x_wid,y_wid,x_wid2,y_wid2); //printf("(%f, %f), (%f,%f)\n", x_wid,y_wid,x_wid2,y_wid2);
@ -424,14 +425,14 @@ int HistoGUIad::DrawData(double x_low_win, double y_low_win, double x_hi_win, do
for(int i=0; i < (int) width; i += w_step){ for(int i=0; i < (int) width; i += w_step){
double x_val = i * width_scale - x_offset; double x_val = i * width_scale - x_offset;
sprintf(axis_val, "%.1f", x_val); sprintf(axis_val, "%.1f", x_val);
XDrawString(disp, wind, DefaultGC(disp, screen), i, axis_y + 10, axis_val, strlen(axis_val)); XDrawString(disp, wind, DefaultGC(disp, screen), i, axis_y + 10/A0, axis_val, strlen(axis_val));
} }
int h_step = height / 10; int h_step = height / 10;
for(int i=0; i < (int) height; i += h_step){ for(int i=0; i < (int) height; i += h_step){
double y_val = i * height_scale - y_offset; double y_val = i * height_scale - y_offset;
sprintf(axis_val, "%.1f", y_val); sprintf(axis_val, "%.1f", y_val);
XDrawString(disp, wind, DefaultGC(disp, screen), axis_x + 10, i, axis_val, strlen(axis_val)); XDrawString(disp, wind, DefaultGC(disp, screen), axis_x + 10/A0, i, axis_val, strlen(axis_val));
} }
@ -447,7 +448,7 @@ int HistoGUIad::DrawData(double x_low_win, double y_low_win, double x_hi_win, do
x_wid = (x[i] + x_offset) / width_scale; x_wid = (x[i] + x_offset) / width_scale;
y_wid = (y[i] + y_offset) / height_scale; y_wid = (y[i] + y_offset) / height_scale;
y_errors_wid = (y_errors[i] / height_scale); y_errors_wid = ((y_errors[i]/A0) / height_scale);
// x_wid2 = (x[i + 1] + x_offset) / width_scale; // x_wid2 = (x[i + 1] + x_offset) / width_scale;
// y_wid2 = (y[i + 1] + y_offset) / height_scale; // y_wid2 = (y[i + 1] + y_offset) / height_scale;

Binary file not shown.

Binary file not shown.

View File

@ -210,9 +210,9 @@ double HistoGUI::legval(double theta){
double lg; double lg;
double aaa = A0; double aaa = A0/A0;
double aab = A2E*(1.5 * pow(theta,2) - .5); double aab = (A2E/A0)*(1.5 * pow(cos(theta),2) - .5);
double aac = A4E*(35./8. * pow(theta,4) - 30./8. * pow(theta,2) + 3./8. ); double aac = (A4E/A0)*(35./8. * pow(cos(theta),4) - 30./8. * pow(cos(theta),2) + 3./8. );
lg = aaa + aab + aac; lg = aaa + aab + aac;

View File

@ -5,10 +5,13 @@ int main ( int argc, char** argv){
HistoGUI gui; HistoGUI gui;
double A0E = 134.327; double A0E = 111.514;
double A2E = -11.7874; double A2E = -54.3312;
double A4E = 0.760896; double A4E = -76.4778;
//double A0E = 134.327;
//double A2E = -11.7874;
//double A4E = 0.760896;
double step = 0.0001; double step = 0.0001;
vector<double> Theta; vector<double> Theta;
@ -27,7 +30,7 @@ int main ( int argc, char** argv){
Iad = aaa + aab + aac; Iad = aaa + aab + aac;
cout << theta << "\n"; // cout << theta << "\n";
AD_I.push_back(Iad); AD_I.push_back(Iad);
Theta.push_back(theta); Theta.push_back(theta);
@ -43,16 +46,16 @@ int main ( int argc, char** argv){
dangle.push_back(1.5619); dangle.push_back(1.5619);
vector<double> dydata; vector<double> dydata;
//= {129.,110.,129.}; //= {129.,110.,129.};
dydata.push_back(129.); dydata.push_back(129./A0E);
dydata.push_back(110.); dydata.push_back(110./A0E);
dydata.push_back(129.); dydata.push_back(129./A0E);
dydata.push_back(115.); dydata.push_back(115./A0E);
vector<double> deydata; vector<double> deydata;
//= {10.,10.,10.}; //= {10.,10.,10.};
deydata.push_back(10.); deydata.push_back(5.);
deydata.push_back(10.); deydata.push_back(5.);
deydata.push_back(10.); deydata.push_back(5.);
deydata.push_back(10.); deydata.push_back(5.);

View File

@ -5,7 +5,7 @@
using namespace std; using namespace std;
//this program doesnt work and it is not used, I spent so much time transcribing it that maybe, one day some poor soul will come and try to fix it to match rose and brinks.
double RACAH(double A[6]){ double RACAH(double A[6]){