Hi, If I have 2 variables, I can plot them using the TH2F but using it, ROOT draws an area like this
I know I can use TGraph to have something like this
root.cern.ch/root/html534/guide … 00005D.png
but I’ve a problem. I don’t have ASCII file with data…I just have unformatted files made by CORSIKA and a program to read CORSIKA files and to make root file. The program has many functions, so using the TH1F, TH2F and TH3F, I can declare the histogram at the beginning of the program:
int nbin5=1000;
float xmin5=10000.;
float xmax5=0.;
TH2F *hngameprim = new TH2F("hngameprim","Energia del Primario- Numero di Fotoni;Energia (GeV)];#Fotoni",nbin5,xmin5,xmax5,nbin5,xmin5,xmax5);
and after write and filling them in each function
hngameprim->Write();
hngameprim->Fill(qdata[2],qdata[7],w);
Using the TGraph, I can’t use the “Fill”, so I can’t declare the graph at the beginning of the program and after calling it in the functions as I can do for TH1F, TH2F and TH3F…for example I can’t write something like this:
TGraph *gngameprim = new TGraph("gngameprim","Energia del Primario- Numero di Fotoni;Energia (GeV)];#Fotoni",nbin5,xmin5,xmax5,nbin5,xmin5,xmax5);
and after writing
gngameprim->Write();
gngameprim->Fill(qdata[2],qdata[7]);
So I wanted to know if it is possible draw a TH2F like a TH1F, or if it is possible to use TH1F class using 2 variables or if exist something like ->Fill(qdata[2],qdata[7]);
that I can use with TGraph.
Thanks