#include "StandardLabels.C" void Ethrown_vs_Erecon(void) { TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGrid(); new TFile("../12degrees/hd_root.root"); TH2D *degrees12 = (TH2D*)gROOT->FindObject("Ethrown_vs_Erecon"); new TFile("../15degrees/hd_root.root"); TH2D *degrees15 = (TH2D*)gROOT->FindObject("Ethrown_vs_Erecon"); new TFile("../20degrees/hd_root.root"); TH2D *degrees20 = (TH2D*)gROOT->FindObject("Ethrown_vs_Erecon"); new TFile("../30degrees/hd_root.root"); TH2D *degrees30 = (TH2D*)gROOT->FindObject("Ethrown_vs_Erecon"); TProfile *degrees12_pfx = degrees12->ProfileX("pfx12"); TProfile *degrees15_pfx = degrees15->ProfileX("pfx15"); TProfile *degrees20_pfx = degrees20->ProfileX("pfx20"); TProfile *degrees30_pfx = degrees30->ProfileX("pfx30"); degrees12_pfx->Fit("pol1"); degrees15_pfx->Fit("pol1"); degrees20_pfx->Fit("pol1"); degrees30_pfx->Fit("pol1"); TF1 *degrees12_pol1 = degrees12_pfx->GetFunction("pol1"); TF1 *degrees15_pol1 = degrees15_pfx->GetFunction("pol1"); TF1 *degrees20_pol1 = degrees20_pfx->GetFunction("pol1"); TF1 *degrees30_pol1 = degrees30_pfx->GetFunction("pol1"); degrees12->SetMarkerColor(kRed); degrees15->SetMarkerColor(kGreen); degrees20->SetMarkerColor(kBlue); degrees30->SetMarkerColor(kMagenta); degrees12->SetMarkerStyle(8); degrees15->SetMarkerStyle(8); degrees20->SetMarkerStyle(8); degrees30->SetMarkerStyle(8); degrees12->SetMarkerSize(0.5); degrees15->SetMarkerSize(0.5); degrees20->SetMarkerSize(0.5); degrees30->SetMarkerSize(0.5); degrees12->SetStats(0); degrees12->SetTitle("BCAL Generated Energy vs. DBCALShower"); degrees12->SetYTitle("E_{gen} (GeV)"); degrees12->SetXTitle("DBCALShower.E (arbitrary units)"); degrees12->Draw(); degrees15->Draw("same"); degrees20->Draw("same"); degrees30->Draw("same"); degrees12_pol1->SetLineColor(degrees12->GetMarkerColor()); degrees15_pol1->SetLineColor(degrees15->GetMarkerColor()); degrees20_pol1->SetLineColor(degrees20->GetMarkerColor()); degrees30_pol1->SetLineColor(degrees30->GetMarkerColor()); degrees12->SetLineColor(degrees12->GetMarkerColor()); degrees15->SetLineColor(degrees15->GetMarkerColor()); degrees20->SetLineColor(degrees20->GetMarkerColor()); degrees30->SetLineColor(degrees30->GetMarkerColor()); degrees12->SetLineWidth(5); degrees15->SetLineWidth(5); degrees20->SetLineWidth(5); degrees30->SetLineWidth(5); degrees12_pol1->Draw("same"); degrees15_pol1->Draw("same"); degrees20_pol1->Draw("same"); degrees30_pol1->Draw("same"); TLegend *leg = new TLegend(0.652, 0.122, 0.885, 0.449); leg->SetFillColor(kWhite); leg->AddEntry(degrees12, "#theta = 12 degrees"); leg->AddEntry(degrees15, "#theta = 15 degrees"); leg->AddEntry(degrees20, "#theta = 20 degrees"); leg->AddEntry(degrees30, "#theta = 30 degrees"); leg->Draw(); StandardLabels(degrees12); c1->SaveAs("Ethrown_vs_Erecon.png"); c1->SaveAs("Ethrown_vs_Erecon.pdf"); }