I am trying to extract data from a tree and put it into a histogram using a c++ program, however I am having the issue that the program creates the TCanvas for the histogram when I use the Draw() function, but I never see a canvas pop up on my screen. For reference, I am using a Windows machine, but am running the code on a linux machine I have connected to using bitvise ssh and am using Xming. I am able to see histograms pop up when I create a TBrowser and click on a branch from the tree. I also tried not even filling the histogram with data from the tree and just trying to get the system to draw a histogram I filled with integers generated by a for loop but that did not work either. I have posted my code below for reference.
int main()
{
TFile* F = new TFile("Output.root", "READ", "File");
TTree* T = (TTree*) F->Get("RecTree");
TH1* Hist = new TH1I("Hist", "Energy", 100, 0, 1.3);
int i;
float Energy;
T->SetBranchAddress("VetoEnergy", &Energy);
for(i = 0; i < T->GetEntries(); i++)
{
T->GetEntry(i);
Hist->Fill(Energy);
}
F->Close();
Hist->Draw();
return 0;
}
_ROOT Version: 6.18/04
_Platform: Linux and Windows