How to open .root file in C++ code ? and read and print parameter from .root file using C++ code on terminal ?
you need to install ROOT (https://root.cern.ch/)
then you have couple of options, the simplest is opening it in the interpreter by simply typing in the console:
root your_file.root
and you can look at it in the Browser, type in :
TBrowser b
to open it from a script/C++ code and get the tree stored in it:
#include "TFile.h"
#include "TTree.h"
TFile *f=new TFile("your_file.root");
TTree *tr=(TTree*)f->Get("the_tree_name");