#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() { TFile rootfile("ants_ref.root","new"); Double_t w = 500; Double_t h = 800; TCanvas* c = new TCanvas("c","c",w,h); c->SetGrid(); //------------------------------------------ Read -------------------------------------------------- auto g1 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.06.txt", false, ' ').Graph("Col0", "Col1"); auto g2 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.25.txt", false, ' ').Graph("Col0", "Col1"); auto g3 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.5.txt", false, ' ').Graph("Col0", "Col1"); auto g4 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.6.txt", false, ' ').Graph("Col0", "Col1"); auto g5 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.7.txt", false, ' ').Graph("Col0", "Col1"); auto g6 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.8.txt", false, ' ').Graph("Col0", "Col1"); auto g7 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.9.txt", false, ' ').Graph("Col0", "Col1"); g1->SetLineColor(kBlack); g2->SetLineColor(kRed); g3->SetLineColor(kMagenta); g4->SetLineColor(kBlue); g5->SetLineColor(kCyan); g6->SetLineColor(kGreen); g7->SetLineColor(kYellow); auto mg = new TMultiGraph(); mg->Add(g1.GetPtr()); mg->Add(g2.GetPtr()); mg->Add(g3.GetPtr()); mg->Add(g4.GetPtr()); mg->Add(g5.GetPtr()); mg->Add(g6.GetPtr()); mg->Add(g7.GetPtr()); mg->SetTitle("Reference Case (#beta=5%)"); mg->GetXaxis()->SetTitle("t/s"); mg->GetYaxis()->SetTitle("Loss fraction"); mg->GetYaxis()->SetRangeUser(0,1.0); mg->GetXaxis()->SetRangeUser(0,0.7); mg->GetXaxis()->SetTickLength(-0.02); mg->GetYaxis()->SetNdivisions(211); c->SetLogx(); mg->DrawClone("AL"); auto legend = new TLegend(0.15,0.30,0.30,0.50); legend->AddEntry(g7.GetPtr(),"s = 0.9","l"); legend->AddEntry(g6.GetPtr(),"s = 0.8","l"); legend->AddEntry(g5.GetPtr(),"s = 0.7","l"); legend->AddEntry(g4.GetPtr(),"s = 0.6","l"); legend->AddEntry(g3.GetPtr(),"s = 0.5","l"); legend->AddEntry(g2.GetPtr(),"s = 0.25","l"); legend->AddEntry(g1.GetPtr(),"s = 0.06","l") ; legend->SetMargin(0.38); legend->SetTextSize(0.025); legend->DrawClone(); gPad->Print("ants_ref.tex"); gPad->Print("ants_ref.pdf"); gPad->Print("ants_ref.eps"); mg->Write(); }