#include using namespace std; #include "StandardLabels.C" void TOF_dE(void) { TColor::CreateColorWheel(); TFile *f1 = new TFile("../tof_z35.root"); TTree *DTOFRawHit = (TTree*)gROOT->FindObject("DTOFRawHit"); TH1D *tof_end0_plane0 = new TH1D("tof_end0_plane0", "", 200, 0.0, 0.005); TH1D *tof_end1_plane0 = (TH1D*)tof_end0_plane0->Clone("tof_end1_plane0"); TH1D *tof_end0_plane1 = (TH1D*)tof_end0_plane0->Clone("tof_end0_plane1"); TH1D *tof_end1_plane1 = (TH1D*)tof_end0_plane0->Clone("tof_end1_plane1"); DTOFRawHit->Project("tof_end0_plane0","dE", "lr==0 && plane==0"); DTOFRawHit->Project("tof_end1_plane0","dE", "lr==1 && plane==0"); DTOFRawHit->Project("tof_end0_plane1","dE", "lr==0 && plane==1"); DTOFRawHit->Project("tof_end1_plane1","dE", "lr==1 && plane==1"); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); double max = tof_end0_plane0->GetMaximum()*1.10; TH2D *axes = new TH2D("axes", "W_{#pi#pi}", 100, 0.0, 0.005, 100, 0.0, max); axes->SetStats(0); axes->SetXTitle("W_{#pi^{+}#pi^{-}} (GeV)"); axes->Draw(); tof_end0_plane0->SetLineColor(kBlue); tof_end1_plane0->SetLineColor(kRed); tof_end0_plane1->SetLineColor(kMagenta); tof_end1_plane1->SetLineColor(kGreen+3); tof_end0_plane0->SetLineWidth(2); tof_end1_plane0->SetLineWidth(2); tof_end0_plane1->SetLineWidth(2); tof_end1_plane1->SetLineWidth(2); tof_end0_plane0->Draw("same"); tof_end1_plane0->Draw("same"); tof_end0_plane1->Draw("same"); tof_end1_plane1->Draw("same"); TLegend *leg = new TLegend(0.591, 0.591, 0.848, 0.827); leg->AddEntry(tof_end0_plane0, "end=0, plane=0"); leg->AddEntry(tof_end1_plane0, "end=1, plane=0"); leg->AddEntry(tof_end0_plane1, "end=0, plane=1"); leg->AddEntry(tof_end1_plane1, "end=1, plane=1"); leg->Draw(); double thresh = 0.00125; TLine *lin = new TLine(thresh, 0.0, thresh, max); lin->SetLineStyle(2); lin->SetLineWidth(3); lin->Draw(); StandardLabels(axes, "#pi^{+}#pi^{-} events" , "E_{#gamma} =5.5GeV" , "vertex constraint enabled" , ""); c1->SaveAs("TOF_dE.png"); c1->SaveAs("TOF_dE.pdf"); }