/******************************************************** * File: DataAnalysis_disk118 * Brief: This program is the correct code for the analysis of althin data. This performs time calibration, creates raw data plots, time and energy spectrum and excitation energy plots. * * Name: Nisha Singh * Email: ns525219@ohio.edu * Date: 06/01/2022 [mm/dd/yyyy] * Last Modified: 06/13/2022 * Discription: This program is the correct code for the analysis of althin data. * * Notes: The plots for the time spectrum is created using histogram which has a square like structure to the peaks due to some problem with binning * * * On Deck: * Need to create the plots after time spectrum as graphs instead of histograms to check if the peaks retain their proper shapes after conversion to other plots. That has been done in a different code. Go to Next Steps folder in this same folder and look for DataAnalysis_disk118 * * ******************************************************/ #include #include #include #include #include "TAxis.h" #include "TH1.h" #include "TH2F.h" #include "TArrayD.h" #include "TSpectrum.h" #include #include "Riostream.h" #include //defines EXIT_SUCCESS and EXIT_FAILURE #include //enables cout/cin #include //enables I/O streams #include //enables strings #include //enables vectors #include "TFile.h" //enables TFile #include "TString.h" //root strings #include //to see type info #include //printf #include // Data analysis functions void Plot_TOF(string path_to_file, TCanvas* canvas, TH1F* histo, const char* name); using namespace std; /// ......................................All functions defined here ............................... /****************************************************** * Function: Plot_TOF() * Brief: Plots the tof histogram from .root file * * SubFunctions: * * Parameters: * * Note: ****************************************************/ void Plot_TOF(string path_to_file, TCanvas* canvas, TH1F* histo, const char* name){ /* inputfile = TFile::Open(path_to_file.c_str()); inputfile->ls(); histo = (TH1F*)inputfile->Get(name); canvas->cd(); histo -> Draw("hist");*/ TFile* inp = TFile::Open(path_to_file); inp->ls(); histo = (TH1F*)inp->Get(name); canvas->cd(); histo->Draw(); } // ..................................................................................... void EnergyPlot() { // Input Parameters; const char* Disk118; TH1F* hdetTOF118 = new TH1F("hdet1TOF118", "althin118 TOF 1", 801, 0 , 800); TCanvas *cdetTOF118=new TCanvas("cdetTOF118","cdetTOF118"); /* TFile* inp = TFile::Open("Disk118.ROOT"); inp->ls(); hdetTOF118 = (TH1F*)inp->Get("Disk118"); cdetTOF118->cd(); hdetTOF118->Draw(); */ Plot_TOF("Disk118.ROOT", cdetTOF118, hdetTOF118, Disk118); return 0; }