#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 VMEC_CUT() { //TFile rootfile("ants_ideal.root","new"); Double_t w = 1200; Double_t h = 1600; TCanvas* c = new TCanvas("c","c",w,h); c->SetGrid(); //------------------------------------------ Read -------------------------------------------------- auto g1 = ROOT::RDF::MakeCsvDataFrame("cross_vmec_beta485_ref_bean.txt", false, ' ').Graph("Col0", "Col1"); /*auto g2 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.25", false, ' ').Graph("Col0", "Col1"); auto g3 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.5", false, ' ').Graph("Col0", "Col1"); auto g4 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.6", false, ' ').Graph("Col0", "Col1"); auto g5 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.7", false, ' ').Graph("Col0", "Col1"); auto g6 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.8", false, ' ').Graph("Col0", "Col1"); auto g7 = ROOT::RDF::MakeCsvDataFrame("loss_history_0.9", 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("Ideal Case (#beta=5%)"); //mg->GetXaxis()->SetTitle("t/s"); //mg->GetYaxis()->SetTitle("Loss fraction"); //mg->GetYaxis()->SetRangeUser(0,1.1); //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.20,0.325,0.35,0.525); /*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("VMEC_Cut_Bean.tex"); gPad->Print("VMEC_CUT_Bean.pdf"); mg->Write("mg"); }