# Polhe3 analysis code

## in SVN

The source codes are stored in SVN, to learn some basic about the version control system, refer to Subversion help and google more.

To checkout, do this in linux with your jlab user name and password

svn co https://jlabsvn.jlab.org/svnroot/polhe3/

describe what the code does here

- hsfu.cc, NMR field sweep fitting from Chunhua Chen
- NMR.C NMR field sweep fitting from Zhiwen Zhao
- spinup.C spinup code using analytic function to fit from Jie Liu
- tpt_ana_jan11_mr.C temperature test from Yi Zhang
- water_signal_fitting from Yi Zhang
- compass compass calibration including data and fitting code from Yi Zhang
- pressure_broadening integrated several times to better fit the oscillating background from Yi Zhang
- water_fit.C "I attached the water fit code that was originally written by Kevin Kramer. The functions in the beginning of the code form the approximate analytic solution to the Bloch equations (the ones that were solved using the BlochEqs_Approx.nb mathematica notebook). There is a function for a NMR field sweep up and down. These functions occupy lines 1-240. The main function reads in the NMR water data, and selects initial parameter values based on NMR channel, NMR sweep direction and pick up coil location (up/down stream). The code then fits the data with the water function and computes the residual of the fit and data normalized by the peak amplitude. This is then saved into a root file. The main function water_fit() may need to be edited to load the correct files. Let me know if you have any questions." from Matthew Posik
- line3Dfit.C fit the 3D measurement to obtain cylinder radius and position from Zhiwen Zhao and Jie Liu

## in dir

http://hallaweb.jlab.org/equipment/targets/polhe3/lab/analysis_code/

### Jin Huang's matlab code

PolarizationDynamic.zip Analysis.Final.Code.zip

"For the Transversity offline code, I have a set of Matlab code to do NMR, EPR analysis, and polarization dynamic calculation under the two-cell model for a global fitting of the polarization gradient. The code is in the attachment and the principals are described in my thesis. Let me know if some new guy wants to learn Matlab."

### Matthew Posik's matlab code

Mathematica_Water.tar.gz

BlochEqs_Exact.nb -This file gives an exact numerical solution to the water polarization

BlochEqs_Approx.nb -This expands the effective polarization in order to approximate an analytical function. This function is used to then fit the water NMR signal

a tech note by Sebastien Incerti, which I followed when making the Mathematica notebooks