Dear Root talk,
I just wanted to understand why this was happening.
I am reading in a root file and then creating some histograms. I use SetAxisRange to zoom in on a particular region by default.
When I have TFile above the definitions for the histograms the SetAxisRange works. However, as soon as I place it beneath the definitions it no longer works. Instead it goes to the default range.
Any ideas way?
Thanks
Quick_plot()
{
TCanvas *c1 = new TCanvas("c1", "Quick Plots");
TH1F *h1, *h2, *histup, *histdown;
h1 = (TH1F*)gROOT->FindObject("histup");
if(h1) h1->Delete();
h2 = (TH1F*)gROOT->FindObject("histdown");
if(h2) h2->Delete();
TFile *file1 = new TFile("test2_data_run.root", "update");
TH1F *histup = new TH1F("histup", "UP Decays", 300, 1, 300);
histup->SetAxisRange(1, 300);
TH1F *histdown = new TH1F("histdown", "DOWN Decays", 300, 1, 300);
histdown->SetAxisRange(1, 300);
c1->Divide(0,2);
c1->cd(1);
TDC1_ntuple->Draw("UP_time >> histup");
c1->cd(2);
TDC2_ntuple->Draw("DOWN_time >> histdown");
}