Hi
I’m having some issues calling back histograms from a TFile
Below is an example of what I see if this was done in terminal.
root [0] TFile *f1 = new TFile("Filtered_0800DT_Flag0_Results.root")
(TFile *) 0x56541b572700
root [1] f1->ls()
TFile** Filtered_0800DT_Flag0_Results.root
TFile* Filtered_0800DT_Flag0_Results.root
KEY: TH1D hidff1;1 Frequency versus time difference between counts
KEY: TH1D hdiff2;1
KEY: TH1D hdiff3;1
KEY: TH1D hdiff4;1
root [2] TH1D* hdiff2 = (TH1D*)f1->Get("hdiff2")
(TH1D *) 0x56541c34b320
root [3] hdiff2->Draw()
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [4]
The problem I have is that the files I have don’t have the exact same names for all four histograms being stored, so I can’t do the exact same calling names. The first Histogram is an example
Where if I do
TH1D* hdiff1 = (TH1D*)f1->Get("hdiff1")
I would get back an empty histogram, maybe because of the title?
What can I do that would give back a TString with the appropriate name for each histogram?
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided