ROOTPrimer - Example 7.2.1

Hello everybody,

I try to get familiar with the N-Tupel business and therefore copied and ran the write_ntuple_to_file() program from the ROOTPrimer paper, topic 7.2.1. Unfortunately I get a segmentation violation.

I tried with root 5.34 and 5.28. I ran it as a makro. Can anybody tell me where the problem is?

Thanks in advance,
Hendrik

  1. Replace:
    TNtuple cond_data(“cond_data”,
    with:
    TNtuple *cond_data = new TNtuple(“cond_data”,

  2. Replace:
    cond_data.Fill(pot,cur,temp,pres);
    with:
    cond_data->Fill(pot,cur,temp,pres);

  3. Replace:
    cond_data.Write();
    with:
    cond_data->Write();

  4. Complain to the author of this “primer”.

Hi Pepe,

The primer has been updated for ROOT v6 (and Cling) and the macro should work fine there; I am guessing the crash is a CINT (v5) limitation.

Cheers,
Philippe.