/// \file /// \ingroup tutorial_hist /// \notebook -js /// Illustrate use of the TH1::GetCumulative method. /// /// \macro_image /// \macro_code /// /// \author M. Schiller #include #include #include #include "TH1.h" #include "TTree.h" #include "TNtuple.h" #include "TH1D.h" #include "TCanvas.h" #include "TRandom.h" #include #include #include #include #include #include #include void ants() { TCanvas* c = new TCanvas(); Int_t i=0; Int_t nlines = 0; Float_t x,y,z,a,b; ifstream inp; //------------------------------------------ Read -------------------------------------------------- auto M = new TMultiGraph(); TTree *t1 = new TTree("ntuple", "loss accounts"); t1->ReadFile("8000_loss_history_0.06.txt", "x/F:y:z"); TTree *t2 = new TTree("ntuple", "loss accounts"); t2->ReadFile("Ref_loss_history_0.06.txt", "x/F:y:z"); Double_t *X1 = t1->GetVal(0); Double_t *Y1 = t1->GetVal(1); Double_t *X2 = t2->GetVal(0); Double_t *Y2 = t2->GetVal(0); TGraph *g1 = new TGraph(t1->GetEntries(),X1,Y1); TGraph *g2 = new TGraph(t2->GetEntries(),X2,Y2); M->Add(g1); M->Add(g2); M->Draw("AL"); }