Save MultiGraph in .root file and read it in another file

my task sounds quite easy but I have difficulties to achieving it.
I produce 3 MultiGraphs in 3 Different Root files. I would like to read all three of them in another file and display them in one canvas next to each other. I used as an orientation for splitting the canvas but when I want to draw my multigraph I get the error, that it is pointing to NULL which means that I am reading it out wrong or writing it wrong into the file … I am lost and nobody else seems to have difficulties with that :s

I am attaching the main file
ANTSAll.c (7.5 KB)

Together with the three Root files:
ants_ref.root (338.3 KB)
ants_ideal.root (291.7 KB)
ants_stoch.root (302.2 KB)

Additionally I am attaching one of the three files that produce the .root file (they are nearly the same) together with the input data.
ANTS.c (2.4 KB)
loss_history_0.06.txt (21.7 KB)
loss_history_0.25.txt (51.9 KB)
loss_history_0.5.txt (106.0 KB)
loss_history_0.9.txt (271.8 KB)
loss_history_0.8.txt (279.5 KB)
loss_history_0.7.txt (277.9 KB)
loss_history_0.6.txt (233.7 KB)

ROOT Version: 6.14
Platform: Ubuntu
Compiler: Not Provided

In your root file you try to access the multigraphs “mg” but none of then contain a multigraph named “mg” "

$ rootls ants_ref.root

$ rootls ants_stoch.root

$ rootls ants_ideal.root


But in file Ants.c (last line) I am writing the multigraph into the .root file with mg->write()?

yes but you create the multigraph without name

1 Like
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.