{ gROOT->Reset(); gROOT->SetStyle("Plain"); gStyle->SetOptStat(0); gStyle->SetLabelSize(0.03,"x"); gStyle->SetLabelSize(0.03,"y"); gStyle->SetOptFit(73);// print fit parameters in the stats box TFile *t=new TFile("projection.root","RECREATE"); Int_t sizex = 600; Int_t sizey = 500; TCanvas *c1 = new TCanvas("c1","Separation studies",sizex,sizey); TFile f("EMC_62_hists_trackreject_smd_anyone_no_ang_cang_alp_noclus_total.root"); f.ls(); TH2F *NumQinvCF= (TH2F*)f->Get("Pi0mass_vs_angle"); TH2F *DenQinvCF= (TH2F*)f->Get("Pi0mass_vs_angle_mix"); TH1D* num = NumQinvCF->ProjectionY("num",0,1000,"E");//QINV real num->Rebin(2); TH1D* num1 = NumQinvCF->ProjectionX("num1",0,1000,"E");//Angle real TH1D* den = DenQinvCF->ProjectionY("den",0,1000,"E");//QINV mixed den->Rebin(2); TH1D* den1 = DenQinvCF->ProjectionX("den1",0,1000,"E");//angle mixed TH1D* ratioangle = (TH1D*)num1->Clone(); TH1D* ratiocorr = (TH1D*)num->Clone(); ratioangle->SetName("Opening Angle plots"); ratioangle->SetXTitle("Opening Angle"); ratioangle->SetYTitle("Ratio"); ratioangle->SetTitle(" opening angle ratio distribution"); //ratioangle->SetTitle("Normalized Average Separation. in EMC POINTS. The Opening Angle Distribution for Kt>0 ,energy of points>0"); //ratioOne->Sumw2(); const Stat_t topint_angle= num1->Integral(10,1000); const Stat_t botint_angle = den1->Integral(10,1000); //const Stat_t botint2 = (botint/2.0); cout<<"TOP INTEGRAL ANGLE*******"<Divide(num1,den1,botint_angle,topint_angle);//angle ratio ratioangle->SetMarkerStyle(22); ratioangle->SetStats(11); ratioangle->SetMarkerColor(1); num1->SetName("Plots with no Kt and Energy cut"); num1->Scale(botint_angle); num1->SetTitle("Angle plots with no Kt and Energy cut"); num1->SetMarkerStyle(7); num1->SetStats(11); num1->SetMarkerColor(2); num1->SetXTitle("Opening Angle"); num1->SetYTitle("Real and Mixed superimposed and scaled to match"); //num2->Draw("p"); den1->SetName("plots"); den1->Scale(topint_angle); den1->SetTitle("Invariant mass plots"); //den1->SetMarkerStyle(7); //den1->SetMarkerColor(4); den1->SetLineColor(4); den1->SetLineWidth(2); den1->SetStats(11); //den2->SetXTitle("Qinv"); //den2->SetYTitle("Ratio"); /////////////////////////////////////////////////////////////////////////////// const Stat_t topint= num->Integral(200,500); const Stat_t botint = den->Integral(200,500); //const Stat_t botint2 = (botint/2.0); cout<<"TOP INTEGRAL*******"<Divide(num,den,botint,topint);//Qinv ratio ratiocorr->SetName(""); ratiocorr->SetTitle("Ratio distribution. in EMC POINTS without NO Kt and Energy cut"); num->SetName("Plots with no Kt cut"); num->Scale(botint); num->SetTitle("Invariant mass plots with no Kt and Energy cut"); num->SetMarkerStyle(7); num->SetStats(11); num->SetMarkerColor(2); num->SetXTitle("Minv"); num->SetYTitle("Real and Mixed superimposed and scaled to match"); //num2->Draw("p"); den->SetName("ratioOne New"); den->Scale(topint); den->SetTitle("Invariant mass plots"); //den1->SetMarkerStyle(7); //den1->SetMarkerColor(4); den->SetLineColor(4); den->SetLineWidth(2); den->SetStats(11); //den2->SetXTitle("Qinv"); //den2->SetYTitle("Ratio"); c1->Divide(2,1); //proj_ratio->Divide(num,den,1.0,1.0); c1->cd(1); num->Draw(); num->Draw("p"); //c1->cd(2); den->Draw("same"); TLine *l = new TLine(0.02,0.,0.02,20000); l->SetLineStyle(2); l->SetLineColor(6); l->SetLineWidth(3); //l->Draw("same"); TLatex *a = new TLatex(); a->SetNDC(); a->SetTextFont(72); a->SetTextColor(1); a->SetTextSize(1.2); a->SetTextAlign(12); a->SetTextSize(0.04); a->SetTextColor(kRed); a->DrawLatex(0.40,0.87,"#bullet"); a->DrawLatex(0.45,0.87,"Real Events of EMC Points"); a->SetTextColor(kBlue); a->DrawLatex(0.40,0.84,"#topbar"); a->DrawLatex(0.45,0.84,"Mixed Event of EMC Points"); c1->cd(2); //ratioangle->Draw(); TLine *l = new TLine(0.04,0.,0.04,2.0); TLine *l1 = new TLine(0.0,1.0,3.0,1.0); l->SetLineStyle(2); l->SetLineColor(6); l->SetLineWidth(3); l1->SetLineStyle(2); l1->SetLineColor(6); l1->SetLineWidth(3); ratiocorr->Draw(); ratiocorr->SetXTitle("Minv"); ratiocorr->SetYTitle("Ratio"); //l->Draw("same"); //l1->Draw("same"); t->Write(); c1->Modified(); c1->Update(); }