void ThetaPiSystem0(Int_t nev = 1e10, TString comment="" , TString filename="/misc/scratch.lxg0412/zumbruch/pid/prom/particle/data/v6_14/va_pm_00_nc_xx01338000410.root") { gStyle->SetOptTitle(0); gStyle->SetPadRightMargin(0.1); TString canvName = "ThetaPiSystem0"; if (!comment.IsNull()) { canvName+= "_" + comment;} TCanvas *canv = new TCanvas(canvName.Data(),canvName.Data()); TFile *va_pm_00_nc_xx01338000410 = new TFile(filename.Data()); TH1D* pip=PTools::getTH1D("thetaPipSystem0","#Theta distribution of #pi^{+} in system 0 (TOFINO)", 90, 0,90, "#Theta [#circ]","counts / 1 #circ"); TH1D* pim=PTools::getTH1D("thetaPimSystem0","#Theta distribution of #pi^{-} in system 0 (TOFINO)", 90, 0,90, "#Theta [#circ]","counts / 1 #circ"); T->Draw("HMdcParticle.fData.theta*180/acos(-1)>>thetaPipSystem0","HMdcParticle.fData.pid==8 && HMdcParticle.fData.system==0","e1",nev); T->Draw("HMdcParticle.fData.theta*180/acos(-1)>>thetaPimSystem0","HMdcParticle.fData.pid==9 && HMdcParticle.fData.system==0","e1",nev); pip->SetLineColor(8); pim->SetLineColor(2); pim->SetLineWidth(2); pip->SetLineWidth(2); gStyle->SetErrorX(0); pim->Draw("e1"); pip->Draw("e1 sames"); TLegend *leg = new TLegend(.7,.7,.8,.8,""); PTools::setLegendEntry(leg, pip, "#pi^{+}", pip->GetLineColor(),"L"); PTools::setLegendEntry(leg, pim, "#pi^{-}", pim->GetLineColor(),"L"); leg->Draw(); canv->SetGrid(); canv->Update(); PTools::setHistStatsTextColor(pip,pip->GetLineColor()); PTools::setHistStatsTextColor(pim,pim->GetLineColor()); PTools::setHistStatsPosNDC(pip,0.80, 0.98, 0.83, 0.89); PTools::setHistStatsPosNDC(pim,0.80, 0.98, 0.76, 0.82); canv->Update(); pim->Draw("e1"); pip->Draw("e1 sames"); TLegend *leg = new TLegend(.7,.6,.8,.7,""); PTools::setLegendEntry(leg, pip, "#pi^{+}", pip->GetLineColor(),"L"); PTools::setLegendEntry(leg, pim, "#pi^{-}", pim->GetLineColor(),"L"); leg->Draw(); TString title = "#Theta distribution of #pi^{+} and #pi^{-} in system 0 (TOFino)"; if (!comment.IsNull()) { title+= " -- " + comment;} PTools::drawLatex(title, 0.5 , 0.93, 1, 0.04,21); PTools::drawLatex("PWZ", 0.99, 0.01, 1, 0.03,31); PTools::saveToPdf(canv); PTools::saveToPng(canv); canv->Print(); canv->SaveAs(".gif"); }