void plot_led_alpha_nim(){ gROOT->Reset(); gROOT->SetStyle("Plain"); gROOT->ForceStyle(); gStyle->SetOptStat(0); gStyle->SetOptFit(0); gStyle->SetTitleX(0.1f); gStyle->SetTitleW(0.8f); gStyle->SetTextSize(1.5); gStyle->SetTitleFont(132,"xy"); gStyle->SetLabelFont(132,"xy"); gStyle->SetLabelSize(0.055,"xy"); gStyle->SetTitleSize(0.062,"xy"); gStyle->SetTitleOffset(1.1,"x"); gStyle->SetTitleOffset(1.0,"y"); gStyle->SetTitleBorderSize(0); gStyle->SetOptFit(11); TFile *f1 = new TFile("led.root"); TFile *f2 = new TFile("alpha.root"); TH1F *h1 = (TH1F*)f1->Get("Peak1"); TH1F *h2 = (TH1F*)f2->Get("Peak1"); TH1F *h11 = (TH1F*)f1->Get("Peak2"); TH1F *h21 = (TH1F*)f2->Get("Peak2"); TCanvas *c1 = new TCanvas("c1","c1",200,10, 600, 400); gPad->SetBottomMargin(0.15); gPad->SetTopMargin(0.05); gPad->SetLeftMargin(0.12); gPad->SetRightMargin(0.05); h1->Rebin(4); h2->Rebin(4); h1->GetXaxis()->SetRangeUser(0.,4000); // h1->SetMaximum(1600); h1->SetMaximum(6000); h1->SetTitle("Reference PMT1"); h1->SetLineWidth(2); h1->SetLineColor(2); h1->SetTitle(""); h1->GetXaxis()->SetTitle("ADC count"); h1->GetYaxis()->SetTitle("Events/ADC count"); h1->Draw(); h2->SetLineWidth(2); h2->Draw("same"); // TLatex *text1 = new TLatex(3000, 1350, "LED"); TLatex *text1 = new TLatex(3000, 5062, "LED"); text1 -> SetTextFont(132); text1->SetTextSize(0.07); text1->SetTextColor(2); text1->Draw(); // TLatex *text2 = new TLatex(500, 1350, "Alpha"); TLatex *text2 = new TLatex(400, 5062, "Alpha"); text2 -> SetTextFont(132); text2->SetTextSize(0.07); text2->Draw(); c1->Update(); }