/// \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"); // t->Print(); t1->Draw("y:x"); // 2D TGraph *g = ((TGraph*)(gPad->GetPrimitive("Graph"))); // 2D if (g) { g = new TGraph(*g); // "disconnect" from the drawn graph // g->Print(); M->Add(g); } TTree *t2 = new TTree("ntuple", "loss accounts"); t2->ReadFile("Ref_loss_history_0.06.txt", "x/F:y:z"); // t->Print(); t2->Draw("y:x"); // 2D *g = ((TGraph*)(gPad->GetPrimitive("Graph"))); // 2D if (g) { g = new TGraph(*g); // "disconnect" from the drawn graph // g->Print(); M->Add(g); } } M->Draw("AL");