#include "Riostream.h" #include "TFile.h" #include "TTree.h" struct mohammed { Float_t t[34]; Float_t H_mass[34]; Float_t He_mass[34]; }; void try1(){ mohammed obj; // open the data file for reading ifstream file; file.open("properties.txt"); file >> obj.t; //How we link the arraies with the txt files ???? //open ROOT file to save the TTree in TFile *ftree = new TFile("tree_nucnet.root","recreate"); //creation of TTree TTree *tree=new TTree("YU_NUCNET_TOOLS","YU_NUCNET_TOOLS"); //creation of branches to hold the variables of the structure tree->Branch("Time",obj.t,"time/F"); tree->Branch("H_mass",obj.H_mass,"H_mass/F"); tree->Branch("He_mass",obj.He_mass,"He_mass/F"); //creation of Histogram TH1F h1("h1","1H vs. Time",100,0,3.15e16); TH1F h1("h2","4He vs. Time",100,0,3.15e16); //filling the histogrames h1->Fill(obj.H_mass); h2->Fill(obj.He_mass); //Drawing Histogrames h1->Draw(); h2->Draw(); return 0; };