I have multiple .ROOT files that I want to open and plot. Since I have many files, I am trying to write a separate function that I can call every time I need, instead of repeating the same process over and over again. Here is a macro that I have. If I copy-paste the following part in the main program, it works fine, ‘’’
TFile* inp = TFile::Open("/root_v6.18.04/macros/HandOff/AlThin/Next steps/27Al(d,n)/DataSets/Disk118.ROOT");
hdetTOF118 = (TH1F*)inp->Get(“Disk118”);
But in a function, it somehow crashes and displays StackTrace something and exits root. Can anybody please help with what is it that I am doing wrong? I am sure it must be a simple fix with a minute detail that I am missing.
edit- Here is the macro I have written and one of the files that I need to plot.
Please help! Thank you for your time!
ROOT Version: 6.18/04
Compiler: Visual Studio Code