Difference between revisions of "CH Code Repository"

From New IAC Wiki
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
='''Preliminary Notes'''=
 +
 +
* The code on this page is intended to be run on DAQ2 locally or via secure shell.
 +
 
='''Header File'''=
 
='''Header File'''=
  
='''Energy Calibration'''=
+
This is a header file created to take care of formatting plots made with ROOT.
 +
This header file can be included in any ROOT script run on DAQ2 by adding
 +
''#include "/home/daq/Harpconn/Root_Scripts/Header_Files/ROOT_Characteristics.h"''
 +
to your script. You will also need to execute
 +
''PlotStyle();''
 +
in your script to take advantage of the header file.
 +
 
 +
[https://wiki.iac.isu.edu/index.php?title=File:ROOT_Characteristics.h Code]
 +
 
 +
='''PAS Experiment'''=
 +
 
 +
=='''Energy Calibration'''==
  
This piece of code calibrates ADC data by using a polynomial regression and can be modified to take input from the user if not using <sup>152</sup>Eu as a calibration source. Currently (Oct 2022), it is configured to automatically assume use of <sup>152</sup>Eu.  
+
This piece of code calibrates ADC data by using a polynomial regression and can be modified to take input from the user if not using <sup>152</sup>Eu as a calibration source. Currently (Oct 2022), it is configured to automatically assume use of <sup>152</sup>Eu. The Non-Uniform Binning is also included in this piece of code, but will also be listed separately.
  
 
[[CH DAQ2 Energy Calibration]]
 
[[CH DAQ2 Energy Calibration]]
  
 +
[https://wiki.iac.isu.edu/index.php?title=File:Cal.c Code]
 +
 +
='''Teller Light'''=
 +
 +
=='''CSV To TSV Conversion and Shot Number Time Correlator'''==
 +
 +
This piece of code will convert CSV files from a Teller Light run to TSV format. Using ROOT is should not be required to run this code.
 +
 +
The code is commented for ease of understanding. The code is set up for columns in the following order: Time, Gun, PMT, Toroid. This can be adjusted if one is not present or if an extra channel was used.
 +
 +
Instructions:
 +
 +
* Place code in whatever directory of your choosing.
 +
** Note: Currently the code is set to point to files in a subdirectory of the directory which contains the script.
 +
 +
* Open the code and change the '''''num''''' integer on line 18 to be the number of files you want to convert.
 +
 +
* Save the code.
 +
 +
* Run the function ''CSV()'' in the code '''only'''.
 +
** Note: The CSV() function calls the TSV() function every loop which converts the files. The main points of the CSV() function are to alter the filenames for the TSV conversion and create the shot number & time file.
 +
 +
This code may take a minute to process depending on how many files you are converting. Normally each file is 10000 data points and three to four columns.
  
 +
[https://wiki.iac.isu.edu/index.php?title=File:CSV.c Code]
  
 
='''Previous Pages'''=
 
='''Previous Pages'''=

Latest revision as of 17:20, 9 December 2022

Preliminary Notes

  • The code on this page is intended to be run on DAQ2 locally or via secure shell.

Header File

This is a header file created to take care of formatting plots made with ROOT. This header file can be included in any ROOT script run on DAQ2 by adding

#include "/home/daq/Harpconn/Root_Scripts/Header_Files/ROOT_Characteristics.h" 

to your script. You will also need to execute

PlotStyle(); 

in your script to take advantage of the header file.

Code

PAS Experiment

Energy Calibration

This piece of code calibrates ADC data by using a polynomial regression and can be modified to take input from the user if not using 152Eu as a calibration source. Currently (Oct 2022), it is configured to automatically assume use of 152Eu. The Non-Uniform Binning is also included in this piece of code, but will also be listed separately.

CH DAQ2 Energy Calibration

Code

Teller Light

CSV To TSV Conversion and Shot Number Time Correlator

This piece of code will convert CSV files from a Teller Light run to TSV format. Using ROOT is should not be required to run this code.

The code is commented for ease of understanding. The code is set up for columns in the following order: Time, Gun, PMT, Toroid. This can be adjusted if one is not present or if an extra channel was used.

Instructions:

  • Place code in whatever directory of your choosing.
    • Note: Currently the code is set to point to files in a subdirectory of the directory which contains the script.
  • Open the code and change the num integer on line 18 to be the number of files you want to convert.
  • Save the code.
  • Run the function CSV() in the code only.
    • Note: The CSV() function calls the TSV() function every loop which converts the files. The main points of the CSV() function are to alter the filenames for the TSV conversion and create the shot number & time file.

This code may take a minute to process depending on how many files you are converting. Normally each file is 10000 data points and three to four columns.

Code

Previous Pages

CaGaS Phase II

PAS_Experiment