#include "Core.h" /* string str1[4] = {"MonteCarlo/ntpl_jpsi_incl.root", "Bes/umcinc.root", "Bes/udata.root", "mcsig_09jpsi_phieta.root"}; string str2[4] = {"MCBadger", "MCBes", "DataBes", "NewMCBadger"}; */ /*void SetISN(TH1D* his); void CoreBg(TF1* sum, TF1* graph1, TF1* graph2); void DrwHis(TH1D* his, TF1* core, TF1* bg); */ //static Double_t inf, sup, nor; Double_t MEta = 0.548; void Pi0( int nu = 1 ) { TCanvas* c1 = new TCanvas("Pi0", "Pi0", 500, 10, 1000, 1000); string str = "/home/pogodin/Data_Files/" + str1[nu]; TFile* f = new TFile(str.c_str()); TNtupleD* data; gDirectory->GetObject("one/a5C", data); double ch2; double Ppip; double Cpip; double phipip; double Ppim; double Cpim; double phipim; double Ppi0; double Cpi0; double phipi0; double P2g; double C2g; double phi2g; double M2pi3; double M2gg; double M2rec; double dec; double deceta; double decphi; double M2pi0; data->SetBranchAddress("ch2", &ch2); data->SetBranchAddress("Ppip", &Ppip); data->SetBranchAddress("Cpip", &Cpip); data->SetBranchAddress("phipip", &phipip); data->SetBranchAddress("Ppim", &Ppim); data->SetBranchAddress("Cpim", &Cpim); data->SetBranchAddress("phipim", &phipim); data->SetBranchAddress("Ppi0", &Ppi0); data->SetBranchAddress("Cpi0", &Cpi0); data->SetBranchAddress("phipi0", &phipi0); data->SetBranchAddress("P2g", &P2g); data->SetBranchAddress("C2g", &C2g); data->SetBranchAddress("phi2g", &phi2g); data->SetBranchAddress("M2pi3", &M2pi3); data->SetBranchAddress("M2gg", &M2gg); data->SetBranchAddress("M2rec", &M2rec); data->SetBranchAddress("dec", &dec); data->SetBranchAddress("deceta", &deceta); data->SetBranchAddress("decphi", &decphi); data->SetBranchAddress("M2pi0", &M2pi0); int n = data->GetEntries(); TH1D *Mpi0 = new TH1D("Mpi0","M_{#pi^{0}};M_{#pi^{0}}, GeV/c^{2};Entries/0.001GeV/c^{2}", 80, 0.100, 0.180); TH1D *Mpi0_1 = new TH1D("Mpi0_1","M_{#pi^{0}};M_{#pi^{0}}, GeV/c^{2};Entries/0.001GeV/c^{2}", 80, 0.100, 0.180); TH1D *Mpi0_2 = new TH1D("Mpi0_2","M_{#pi^{0}};M_{#pi^{0}}, GeV/c^{2};Entries/0.001GeV/c^{2}", 80, 0.100, 0.180); for ( int i = 0; i < n ; i++ ) { data->GetEntry(i); if ( ch2 < 100 && abs( sqrt(M2gg) - MEta ) < 0.016 && abs( sqrt(M2pi3) - 1.02 ) < 0.01 ) { Mpi0->Fill( sqrt(M2pi0) ); if ( dec == 68 ) Mpi0_1->Fill( sqrt(M2pi0) ); else Mpi0_2->Fill( sqrt(M2pi0) ); } } SetISN(Mpi0); TF1 *core = new TF1("core","[0]*TMath::BreitWigner(x,[1],[2])", inf, sup); TF1 *bg = new TF1("bg","pol1", inf, sup); TF1 *total = new TF1("tot","core*0.001 + bg", inf, sup); TF1 *core2 = new TF1("core2","[0]*TMath::BreitWigner(x,[1],[2])", inf, sup); TF1 *bg2 = new TF1("bg2","pol1", inf, sup); TF1 *total2 = new TF1("tot2","core*0.001 + bg", inf, sup); TF1 *core3 = new TF1("core3","[0]*TMath::BreitWigner(x,[1],[2])", inf, sup); TF1 *bg3 = new TF1("bg3","pol1", inf, sup); TF1 *total3 = new TF1("tot3","core*0.001 + bg", inf, sup); total->SetParameter(0, 10000); total->SetParameter(1, 0.132); total->SetParameter(2, 0.010); total->SetParName(0, "N"); total->SetParName(1, "M");//"#mu"); total->SetParName(2, "#Gamma");//"#sigma"); total->SetParName(3, "Const 1"); total->SetParName(4, "Const 2"); total2->SetParameter(0, 10000); total2->SetParameter(1, 0.132); total2->SetParameter(2, 0.010); total2->SetParName(0, "N"); total2->SetParName(1, "M");//"#mu"); total2->SetParName(2, "#Gamma");//"#sigma"); total2->SetParName(3, "Const 1"); total2->SetParName(4, "Const 2"); total3->SetParameter(0, 10000); total3->SetParameter(1, 0.132); total3->SetParameter(2, 0.010); total3->SetParName(0, "N"); total3->SetParName(1, "M");//"#mu"); total3->SetParName(2, "#Gamma");//"#sigma"); total3->SetParName(3, "Const 1"); total3->SetParName(4, "Const 2"); Mpi0->Fit("tot","R","", 0.112, 0.152); Mpi0_1->Fit("tot2","","", inf, sup); Mpi0_2->Fit("tot3","","", inf, sup); CoreBg(total, core, bg); CoreBg(total2, core2, bg2); CoreBg(total3, core3, bg3); gStyle->SetOptStat(10); gStyle->SetOptFit(112); c1->Clear(); c1->Divide(2,2); c1->cd(1); DrwHis(Mpi0, core, bg); c1->cd(2); DrwHis(Mpi0_1, core2, bg2); c1->cd(3); DrwHis(Mpi0_2, core3, bg3); c1->Update(); string ns; ns = "/home/pogodin/Art_Files/GraphPi0" + str2[nu] + ".pdf"; c1->SaveAs(ns.c_str()); } /* void SetISN(TH1D* his) { inf = his->GetXaxis()->GetXmin(); sup = his->GetXaxis()->GetXmax(); nor = (sup - inf)/his->GetNbinsX(); } void CoreBg(TF1* sum, TF1* graph1, TF1* graph2) { graph1->SetParameter(0, sum->GetParameter(0)*nor); for ( Int_t i = 1; i < graph1->GetNpar(); i++) graph1->SetParameter(i, sum->GetParameter(i)); for ( Int_t i = 0; i < sum->GetNpar() - graph1->GetNpar(); i++ ) graph2->SetParameter(i, sum->GetParameter(graph1->GetNpar() + i)); graph1->SetLineColor(4); graph1->SetLineStyle(2); graph2->SetLineColor(620); graph2->SetLineStyle(2); } void DrwHis(TH1D* his, TF1* core, TF1* bg) { gPad->SetGrid(); his->SetMinimum(0); his->Draw("E"); TLegend* legend = new TLegend(0.1,0.7,0.4,0.9); legend->SetHeader("Designations","C"); legend->AddEntry(his,"Data"); legend->AddEntry(core, "Core"); legend->AddEntry(bg, "Background"); legend->Draw(); core->Draw("same"); bg->Draw("same"); } */