#include #include #include void gen_tree() { std::random_device rnd; std::mt19937 mt(rnd()); std::normal_distribution<> norm(10, 1); auto fileName = "test.root", treeName = "tree"; auto f = new TFile(fileName, "recreate"); auto tree = new TTree("tree", "tree"); double x; tree->Branch("x", &x, "x/D"); for (int i = 0; i < 1000000; ++i) { x = norm(mt); tree->Fill(); } tree->Write(); f->Close(); }