TH2F draws nothing

Hello,

I have a file which contains a TH2F histogram. I can verify this by f.ls(). I can also verify the histogram content by GetMaximum(), GetBinContent() etc.
But when I draw the histogram totalions->Draw() I get only the axis on the screen and no content. I have tried different options on the Draw() command (col,colz) but nothing changes.
Is there any parameter I should modify?

Thank you in advance,
Makis

ps. the file is attached.
histos.root (20.7 KB)

Have you changed the number of entries by hand ? it is equal to 0 …

root [4] totalions->GetEntries()
(const Double_t)0.00000000000000000e+00

No I haven’t.
The histogram is a 2d variable bin histogram in both axis. The histogram is filled with a AddBinContent function.

Why don’t you use Fill() ?

Because I want each event to go to more than one bin. The code looks like

Int_t nbins=200; Double_t x[200]; for (Int_t i=0; i<nbins; i++){ x[i]=50*pow((1.005/0.995),i); } TH2F *totalions = new TH2F("totalions","number of ions per magnetic rigidity",700,50,400,700,50,400); totalions->SetBins(nbins-1,x,nbins-1,x);
and for the filling of the histogram inside a duoble for loop over i,j glbin=totalions->GetBin(i,j); totalions->AddBinContent(glbin);

If it is important I will try to produce a running example.

So you do not care about the number of entries.
In that case simply do:

totalions->SetEntries(1);

And it will work.

It really does!

Thank you very much,
Makis