Converts an ASCII spectrum of CAEN DT5781A to a ROOT file. First line in ASCII file must be real time, second line live time
./make_rootfile_spectrum <spectrum_file.txt>
- spectrum_file.txt.root
- TH1D "hist": spectrum
- TVectorD "t_live": live time
- TVectorD "t_real": real time
Fits the peaks in a spectrum with a Gauss+Pol1. The peak position vs. energy is then fitted with a Pol2 to get the energy calibration.
Requires a parameters txt file (see „example_parameters_calibration.txt“) with the following content:
- spectrum file name: name of spectrum ROOT file
For every peak
- fitrange low (ADC channels): lower limit of fit range
- fitrange high (ADC channels): upper limit of fit range
- counts: start parameter for number of counts in peak
- mean (ADC channels): start parameter for peak position
- sigma (ADC channels): start parameter for peak standard deviation
- constant : start parameter for constant
- slope: start parameter for slope
- energy (keV): literature value of peak energy
./energy_calibration <parameters_calibration.txt>
- spectrum_file.txt.root_calibration_fits.root
- TCanvas "c1"
- TH1D "hist": original (uncalibrated) spectrum
- TF1 "fitFunction": fit for every peak
- TCanvas "c1"
- spectrum_file.txt.root_calibration_function.root
- TCanvas "c2"
- TGraphErrors "Graph": peak position vs energy
- TF1 "fitFunction": Pol2 fit to "Graph"
- TCanvas "c2"
calibrates a spectrum txt file with a calibration function
./calibrate_spectrum <spectrum_file.txt> <calibration_function.root>
- spectrum_file.txt_calibrated.root
- TH1D "hist": calibrated spectrum
- TVectorD "t_live": live time
- TVectorD "t_real": real time
Fits the peaks in a calibrated spectrum with Gauss+Pol1. The peaks' standard deviation vs energy is then fitted with a function sqrt(p0+p1x+p2x^2) to get the energy resolution as function of energy.
Requires a parameters txt file (see „example_parameters_resolution.txt“) with the following content:
- spectrum file name: name of spectrum ROOT file
For every peak
- fitrange low (keV): lower limit of fit range
- fitrange high (keV): upper limit of fit range
- counts: start parameter for number of counts in peak
- mean (keV): start parameter for peak position
- sigma (keV): start parameter for peak standard deviation
- constant : start parameter for constant
- slope: start parameter for slope
./energy_resolution <parameters_resolution.txt>
- spectrum_file.txt.root_resolution_fits.root
- TCanvas "c1"
- TH1D "hist": calibrated spectrum
- TF1 "fitFunction": fit for every peak
- TCanvas "c1"
- spectrum_file.txt.root_resolution_function.root
- TCanvas "c2"
- TGraphErrors "Graph": resolution vs energy
- TF1 "fitFunction": fit to "Graph" with sqrt(p0+p1x+p2x^2)
- TCanvas "c2"
Converts a list file (ASCII format) of CAEN DT5781A into a ROOT file
./make_rootfile_list <list_file.dat> <calibration_function.root>
the second argument is optional
- list_file.dat.root
- TTree "dataTree"
- TBranch "energy": energy in keV (only if calibration function was specified)
- TBranch "pulseheight": pulseheight in ADC channels
- TBranch "extras": extra information about pileup, deadtime or saturation
- TBranch "time": timestamp in 10ns units
- TTree "dataTree"
Produces a spectrum from a list file
./make_spectrum_list <arguments>
arguments:
--file <list_file.root>
specifies the list filename
--energy
use the energy calibration
--t_min <t0> --t_max <t1>
select time range [t0,t1]
- list_file.dat.root_(calibrated)_time_t0-t1.root
- TH1D "hist": (calibrated) spectrum
- TVectorD "t_live": live time
- TVectorD "t_real": real time
Produces a rate vs. time plot from list file
./plot_rate <arguments>
arguments:
--file <list_file.root>
specifies the list filename
--energy
use the energy calibration
--range_min <r0> --range_max <r1>
select pulseheight/energy range [r0,r1]
--binwidth <binwidth>
specify bin width (s)
- list_file.dat.root_rate_energy/pulseheight_r0-r1.root
- TH1D "hist": rate vs. time histogram
Adds up two or more spectra
./add_spectra <spectrum1.root> <spectrum2.root> ... <results_filename>
- results_filename.root
- TH1D "hist": sum of spectrum1, spectrum2, ...
- TVectorD "t_live": summed up live time
- TVectorD "t_real": summed up real time
Calculates the integral rate in a certain energy range
./integral_rate <spectrum.root> <E_min> <E_max>
- spectrum_integral_rate_E_min-E_max.pdf
merges the results of several simulated efficiencies into a single file
./merge_simulated_efficiencies <simulated_efficiencies1.root> <simulated_efficiencies2.root> ... <simulated_efficiencies_merged>
- simulated_efficiencies_merged.pdf
- simulated_efficiencies_merged.root
contains all macros which are used by the other scripts