Handle Graph.root file

I make cpp files to make graphs. Then I want to merge each of graphs to multigraph. So, I considered that how do I do. The method I think is following.

  1. Store graphs with .root files
  2. Load that files to one cpp file.
  3. Draw multigraph.

This is possible? I knew the way store graph, but I don’t know Load that files. Could you help me?

ROOT Version: 6.22.06
Platform: WSL2
Compiler: VSCode


auto f = new TFile("thatfile.root");

Is it possible? I try it.

Yes it is … just use TFile as I showed you. Then you can use the Get method from TFile to retrieve the TGraph in the file.

I solve my problem. Thanks you.

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