General documentation update

This commit is contained in:
Peter DeRosa 2022-08-22 12:05:21 -04:00
parent 65567640dd
commit d2bf32953f
11 changed files with 134 additions and 66 deletions

Binary file not shown.

15
326.csv Normal file
View File

@ -0,0 +1,15 @@
x, y, y_err
50.24390, 1.01725,0.04
58.536584, 1.01478,0.04
69.26829, 1.07394,0.04
79.02439, 1.15528,0.04
80.48780, 1.08380,0.04
89.75609, 1.11584,0.04
98.53658, 1.02957,0.04
100.48788, 1.05176,0.04
110.2439, 1.04436,0.04
121.46345, 1.01725,0.04
129.7560, 1.00985,0.04
141.9512, 0.8693,0.04
147.3170, 0.90633,0.04
161.9512, 0.78309,0.04
1 x y y_err
2 50.24390 1.01725 0.04
3 58.536584 1.01478 0.04
4 69.26829 1.07394 0.04
5 79.02439 1.15528 0.04
6 80.48780 1.08380 0.04
7 89.75609 1.11584 0.04
8 98.53658 1.02957 0.04
9 100.48788 1.05176 0.04
10 110.2439 1.04436 0.04
11 121.46345 1.01725 0.04
12 129.7560 1.00985 0.04
13 141.9512 0.8693 0.04
14 147.3170 0.90633 0.04
15 161.9512 0.78309 0.04

14
426.csv Normal file
View File

@ -0,0 +1,14 @@
x, y, y_err
50.73177, 1.06408,0.04
58.536554, 0.99757,0.04
70.2439, 0.896478,0.04
79.51211, 0.84471,0.04
80.48788, 0.81267,0.04
89.7560, 0.891549,0.04
100.48778, 0.93839,0.04
98.53655, 0.86197,0.04
109.7566, 0.90387,0.04
121.46335, 0.97046,0.04
141.9511, 1.11338,0.04
147.8045, 1.15774,0.04
161.9511, 1.25880,0.04
1 x y y_err
2 50.73177 1.06408 0.04
3 58.536554 0.99757 0.04
4 70.2439 0.896478 0.04
5 79.51211 0.84471 0.04
6 80.48788 0.81267 0.04
7 89.7560 0.891549 0.04
8 100.48778 0.93839 0.04
9 98.53655 0.86197 0.04
10 109.7566 0.90387 0.04
11 121.46335 0.97046 0.04
12 141.9511 1.11338 0.04
13 147.8045 1.15774 0.04
14 161.9511 1.25880 0.04

59
AD.cxx
View File

@ -1,3 +1,26 @@
//#################################################################
// This program is the main functional of an Angular Ditribution
// calculation to fit and determine accepted values of delta.
//
// Input file need is two .csv, one is a table of racah values,
// the second is the experimental data file. The program can handle
// any amount of angles of detectors.
//
// The inputs needed are j1 and j2 values, the gamma-ray ,the radius,
// distance and depth of the detectors, and the sigma of magnetic
// substate distribution following the reaction of interest.
//
// The program generates 2 graphs - 1 Visible Angular distribution
// plot and fit normalized by A0. - 2 The log(Chi-squared) vs
// arctan(delta) graph.
//
// The program also outputs a ad.txt which has QDK coeff. and other
// detector parameters.
//
//To compile : g++ AD.cxx -o {Input Executable Name} -lX11
//For more information about angular distributions, read Rose and Brinks, and Frank Moore (1988).
//#################################################################
#include "global.h" #include "global.h"
#include "GUI_AD.h" #include "GUI_AD.h"
@ -7,9 +30,6 @@
#include "Cleb.h" #include "Cleb.h"
//To compile : g++ AD.cxx -o {Input Executable Name} -lX11
//For more information about angular distributions, read Rose and Brinks, and Frank Moore (1988).
using namespace std; using namespace std;
#ifndef __CINT__ #ifndef __CINT__
@ -38,12 +58,12 @@ int main(int argc,char **argv){
targetdistance = 4.; targetdistance = 4.;
detthickness = 5.; detthickness = 5.;
Energy = 1147.; Energy = 426.;
Sigma = .5; Sigma = 1.0;
j1 = 5.5; j1 = 7.5;
j2 = 3.5; j2 = 5.5;
//-------------------------------- //--------------------------------
//TEST MODE? y : 1 || n = 0 //TEST MODE? y : 1 || n = 0
@ -204,30 +224,16 @@ int main(int argc,char **argv){
double aa = dangle[i]; double aa = dangle[i];
dangler.push_back(aa*3.14159/180.); dangler.push_back(aa*3.14159/180.);
printf("dangle = %lf\n",dangler[i]); printf("Angle %d = %lf\n",i,dangler[i]);
} }
// if you need to scale the y data by sin(theta)
/*
for(int i=0; i<content.size(); i++){
for(int j=0; j<content[i].size(); j++){
cout<< content[i][j]<<" ";
}
cout<<"\n";
}
*/
//legendre fitting //legendre fitting
// F[xi] = A0(1) + A2(P2(cos(xi))) + A4(P4(cos(xi))) // F[xi] = A0(1) + A2(P2(cos(xi))) + A4(P4(cos(xi)))
//xi data is angle data in radians. //xi data is angle data in radians.
//yi data is y-intensity data. //yi data is y-intensity data.
//to change the number of angles, just mess with the indexing of the read in and arrays.
//12 constants. this will build our matrix for gaussian elinmination. //12 constants. this will build our matrix for gaussian elinmination.
//[a1 a2 a3] [A0] = [a4] //[a1 a2 a3] [A0] = [a4]
//[a5 a6 a7] [A2] = [a8] //[a5 a6 a7] [A2] = [a8]
@ -323,8 +329,8 @@ int main(int argc,char **argv){
cout<<"A0 = "<<residual[0]<<"\n"; cout<<"A0 = "<<residual[0]<<"\n";
cout<<"A2 = "<<residual[1]<<"\n"; cout<<"a2 = "<<residual[1]/residual[0]<<"\n";
cout<<"A4 = "<<residual[2]<<"\n"; cout<<"a4 = "<<residual[2]/residual[0]<<"\n";
@ -779,7 +785,7 @@ int main(int argc,char **argv){
for(int i = 0; i < dydata.size(); i++){ for(int i = 0; i < dydata.size(); i++){
double bbb = dydata[i]; double bbb = dydata[i];
dydatas.push_back(bbb/A0E); dydatas.push_back(bbb/A0E);
// printf("Normalized y-intensity %i = %lf\n",i+1,dydatas[i]); // printf("Normalized y-intensity %i = %lf\n",i+1,dydatas[i]);
} }
@ -845,7 +851,8 @@ int main(int argc,char **argv){
}else if(optnum == 2 and param == 1){ }else if(optnum == 2 and param == 1){
optnum = -1; optnum = -1;
gui_ad.SetData(dangler,dydatas); // gui_ad.SetData(dangler,dydata); //dydata means you are using already normalizing data.
gui_ad.SetData(dangler,dydatas); //dydatas means you are using non-A0 normalized data to start with.
gui_ad.SetErrors(deydata); gui_ad.SetErrors(deydata);
gui_ad.SetFit(residual[0],residual[1],residual[2]); gui_ad.SetFit(residual[0],residual[1],residual[2]);

10
Cleb.h
View File

@ -1,7 +1,13 @@
//#############################################################
#include "global.h"
//To compile : g++ AD.cxx -o {Input Executable Name} -lX11 //To compile : g++ AD.cxx -o {Input Executable Name} -lX11
//#include "Coeff.h" //#include "Coeff.h"
//
//This file contains member functions of Clebsh-Gordan functions
//and other methods to caluculate 3J and 6J symbols if needed
//for direct Racah calculations.
//
//#############################################################
#include "global.h"
using namespace std; using namespace std;

View File

@ -1,6 +1,9 @@
//################################################################
// This file contains the menu outputs and also misc conversion
// functions used throughout the program.
//
//################################################################
#include "global.h" #include "global.h"
//To compile : g++ AD.cxx -o {Input Executable Name} -lX11
using namespace std; using namespace std;
@ -20,22 +23,27 @@ void menu(){
void Readme(){ void Readme(){
std::cout<< " \n"; std::cout<< " \n";
std::cout<< " The program calculates Chi-Squared values \n"; std::cout<< " The program calculates Chi-Squared values \n";
std::cout<< " from experimental angular distributions as \n"; std::cout<< " from experimental angular distributions as \n";
std::cout<< " a function of multipole ratios using the \n"; std::cout<< " a function of multipole ratios using the \n";
std::cout<< " theoretical angular distribution formulae \n"; std::cout<< " theoretical angular distribution formulae \n";
std::cout<< " in rose and brink \n"; std::cout<< " in Rose and Brinks. \n";
std::cout<< " \n"; std::cout<< " \n";
std::cout<< " Follow the prompt in order to correctly display \n"; std::cout<< " Follow the prompt in order to correctly display \n";
std::cout<< " \n"; std::cout<< " \n";
std::cout<< " To close the gui, press most buttons. \n"; std::cout<< " To close the gui, press most buttons. \n";
std::cout<< " To zoom in, left click then drag and let go. To unzoom\n"; std::cout<< " To zoom in, left click then drag and let go. To unzoom\n";
std::cout<< " press the space bar. To draw, right click\n"; std::cout<< " press the space bar. To draw, right click. \n";
std::cout<< " \n"; std::cout<< " \n";
std::cout<< " ad.txt is generated with geometric stats.\n"; std::cout<< " ad.txt is generated with geometric stats. \n";
std::cout<< " Then at the end it generates CG/Racah\n"; std::cout<< " Multiple different vectors available for \n";
std::cout<< " \n"; std::cout<< " other analysis perspectives. \n";
std::cout<< " \n";
std::cout<< " To run in test mode, see the top of AD.cxx.\n";
std::cout<< " Running in test mode allows for faster use.\n";
std::cout<< " \n";
std::cout<< " \n";
} }
int param_run(int dt, int gt, int at, int st, int jt){ int param_run(int dt, int gt, int at, int st, int jt){

View File

@ -1,10 +1,15 @@
#include "global.h" //#############################################################################
//
//To compile : g++ AD.cxx -o {Input Executable Name} -lX11
// VERSION : 1.1 (Overlay for Angular Fit Display) // VERSION : 1.1 (Overlay for Angular Fit Display)
// Created with thanks to Daniel Folds Holt - University of Cambridge Cavendish Lab //
// The purpose of this GUI is for displaying angular distributions of the
// gamma-ray decays inputed via the *.csv file. It is equipped with error
// bars and a fit overlay. The output of this file is scaled by A0.
//
//############################################################################
#include "global.h"
using namespace std; using namespace std;
@ -209,10 +214,11 @@ int HistoGUIad::Zoom(int mouse_x, int mouse_y){
double HistoGUIad::legval(double theta){ double HistoGUIad::legval(double theta){
double lg; double lg;
double norm = A0;
double aaa = A0/A0; double aaa = A0/norm;
double aab = (A2E/A0)*(1.5 * pow(cos(theta),2) - .5); double aab = (A2E/norm)*(1.5 * pow(cos(theta),2) - .5);
double aac = (A4E/A0)*(35./8. * pow(cos(theta),4) - 30./8. * pow(cos(theta),2) + 3./8. ); double aac = (A4E/norm)*(35./8. * pow(cos(theta),4) - 30./8. * pow(cos(theta),2) + 3./8. );
lg = aaa + aab + aac; lg = aaa + aab + aac;
@ -245,9 +251,9 @@ int HistoGUIad::Draw_Fit(double x_low_win, double y_low_win, double x_hi_win, do
// min_y = y[0]; // min_y = y[0];
//hard set graphical boundaries //hard set graphical boundaries
max_x = 3.1415; max_x = 3.1415;
max_y = 2.; max_y = A0*1.5;
min_x = -.1; min_x = -.1;
min_y = -.1; min_y = A0*.5;
/* for(int i=0; i<x.size(); i++){ /* for(int i=0; i<x.size(); i++){
if(x[i] > max_x) max_x = x[i]; if(x[i] > max_x) max_x = x[i];
if(x[i] < min_x) min_x = x[i]; if(x[i] < min_x) min_x = x[i];
@ -338,9 +344,9 @@ int HistoGUIad::DrawData(double x_low_win, double y_low_win, double x_hi_win, do
// min_y = y[0]; // min_y = y[0];
//hard set graphical boundaries //hard set graphical boundaries
max_x = 3.1415; max_x = 3.1415;
max_y = 2.; max_y = A0*1.5;
min_x = -.1; min_x = -.1;
min_y = -.1; min_y = A0*0.5;
/* for(int i=0; i<x.size(); i++){ /* for(int i=0; i<x.size(); i++){
if(x[i] > max_x) max_x = x[i]; if(x[i] > max_x) max_x = x[i];
if(x[i] < min_x) min_x = x[i]; if(x[i] < min_x) min_x = x[i];

View File

@ -1,10 +1,12 @@
#include <X11/Xlib.h> //####################################################################
#include <stdio.h> //
#include <stdlib.h> // This is a base version of the AD GUI allowing the user to plot two
#include <string.h> // input double vectors. The GUI consists of zooming, crosshair readout,
#include <vector> // and drawing on the canvas.
#include <cmath> //
//####################################################################
#include "global.h"
class HistoGUI{ class HistoGUI{

8
QDK.h
View File

@ -1,3 +1,11 @@
//#####################################################################
//
//This file is a geometric calculation of the efficiency of radiation
//in germanium crystals as a function of energy, and the crystal
//geometry of the experiment.
//
//#####################################################################
#include "global.h" #include "global.h"
using namespace std; using namespace std;

8
ad.txt
View File

@ -1,7 +1,7 @@
Radius = 3 [cm] Radius = 3 [cm]
Distance = 4 [cm] Distance = 4 [cm]
Thickness = 5 [cm] Thickness = 5 [cm]
Atten.C = 0.282206 [cm^-1] Atten.C = 0.476411 [cm^-1]
Gamma_E = 1147 [KeV] Gamma_E = 426 [KeV]
QD2 = 0.802565 QD2 = 0.790549
QD4 = 0.44946 QD4 = 0.42078

View File

@ -1,8 +1,10 @@
#ifndef __iamauniqueid_h__ #ifndef __iamauniqueid_h__
#define __iamauniqueid_h__ #define __iamauniqueid_h__
//########################################################
//define any global data type here. //This file is used for defining global data type and all
//includes needed for the program.
//
//########################################################
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <stdio.h> #include <stdio.h>
#include <cstdio> #include <cstdio>