RootV7 RNtuple examples


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


When I am running a macro from Rootv7 tutorials first time it works properly but when I again run it then it is throwing these errors:

error: no member named 'Fill' in 'std::unique_ptr<ROOT::Experimental::RNTupleWriter,
      std::default_delete<ROOT::Experimental::RNTupleWriter> >'
      ntuple->Fill();
      ~~~~~~  ^

Hi,
how are you running the macro? If you are calling .x macroname.C from the prompt twice, you might be encountering this issue.

Cheers,
Enrico

Yes, I am calling in the same way .x macroname.C

Ok so the problem is probably what I pointed out above. There are some easy workarounds:

  1. instead of entering the ROOT prompt, depending on what you need to do you can just run the macro from your shell: root -l -q macroname.C
  2. alternatively, you can load the contents of the macro once with .L macroname.C, and then invoke its “main” function as many times as you want: macroname(); macroname()

I hope this helps!
Enrico