データファイルからヒストグラムを作成してその画像を保存する、のようなROOTの機能をC++プログラムから呼び出して使うことが出来る
#include <stdio.h>
#include "TFile.h"
#include "TH1.h"
#include "TCanvas.h"
int main(){
TFile *_file0 = TFile::Open("sample.root");
TCanvas *c1 = new TCanvas();
TH1F* hist1 = (TH1F*)_file0->Get("hist1");
hist1->Draw();
c1->SaveAs("test.pdf");
return 0;
}
g++ sample.cxx -o sample `root-config --cflags --libs`