The problem with histograms created via h2root

Hi,
I’ve found that at least one option does not work for histograms which were created via h2root. For example,

  1. I open the created file - it’s OK
    2)I draw some two histograms - it’s OK
  2. it’s the error message when I try to add them
    Error: Symbol h131 is not defined in current scope (tmpfile):1:
    *** Interpreter error recovered ***
    4)then I make the clones of these histograms
    5)I make the Add of them - it’s OK.
  3. What is wrong?
    $ROOTSYS=/afs/cern.ch/sw/lcg/app/releases/ROOT/5.24.00/slc4_ia32_gcc34/root/

Regards
Oleg
TFile *fin = new TFile(“lambda_2008_exp.hbook_0.0e-3_143.70_9.root”);
h131.Draw()
h132.Draw()
h132.Add(h131,-1.)
TH1F m131=(TH1F) h131->Clone();
TH1F m132=(TH1F) h132->Clone();
m132.Add(m131,-1.)

Your problem has nothing to do with h2root, Instead of:

TFile *fin = new TFile("lambda_2008_exp.hbook_0.0e-3_143.70_9.root"); h131.Draw(); h132.Draw()
do

TFile *fin = new TFile("lambda_2008_exp.hbook_0.0e-3_143.70_9.root"); TH1F *h131 = (TH1F*)fin->Get("h131"); TH1F *h132 = (TH1F*)fin->Get("h132"); h131->Draw(); h132->Draw();

Rene