// macro for comparision DPM model and E760 model with their uncertainty in LMD range #include #include #include #include #include //#include #include //#include #include // macro to repoduce DPM fit #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "TVirtualFitter.h" #include #include using namespace std; int main(){ gROOT->Macro("$VMCWORKDIR/macro/lmd/Anastasia/tests/ModelUncert/rootlogon.C"); TLegend *leg_sigt = new TLegend(0.64,0.45,0.87,0.7); leg_sigt->SetFillColor(0); leg_sigt->SetTextFont(42); leg_sigt->SetTextSize(0.04); leg_sigt->SetHeader("P_{lab} = 10.0 GeV/c"); double plab = 10.0; //part 1: draw hadronic contribution ---------------------------------- double t_min = 1e-7; double t_max = 1e0; // double t_max = 1e1; //all LumiFit::PndLmdFitModelOptions model_options; PndLmdDPMAngModel1D modelDPM("dpm_angular_1d", LumiFit::ALL); shared_ptr para( new PndLmdDPMModelParametrization(modelDPM.getModelParameterSet())); modelDPM.getModelParameterHandler().registerParametrizations( modelDPM.getModelParameterSet(), para); modelDPM.getModelParameterSet().setModelParameterValue("p_lab", plab); modelDPM.getModelParameterSet().setModelParameterValue("luminosity", 1); // modelDPM->init(); ((Model1D*) &modelDPM)->init(); //all PndLmdDPMAngModel1D modelE760("e760_angular_1d", LumiFit::ALL); // shared_ptr modelE760 = model_factory.generate1DModel(model_options, mom); shared_ptr parae760( new PndLmdE760LikeModelParametrization(modelE760.getModelParameterSet())); modelE760.getModelParameterHandler().registerParametrizations( modelE760.getModelParameterSet(), parae760); modelE760.getModelParameterSet().setModelParameterValue("p_lab", plab); modelE760.getModelParameterSet().setModelParameterValue("luminosity", 1); ((Model1D*) &modelE760)->init(); PndLmdLumiHelper *lmd_help = new PndLmdLumiHelper(); double th1 = 2e-3; double th2 = 1e-2; double t_1 = fabs(lmd_help->getMomentumTransferFromTheta(plab, th1)); double t_2 = fabs(lmd_help->getMomentumTransferFromTheta(plab, th2)); TBox *lmd_range_box = new TBox(t_1,-15,t_2,110); lmd_range_box->SetFillColor(12); lmd_range_box->SetFillStyle(3005); cout<<"t_1 = "<SetLogx(); TMultiGraph *mgr = new TMultiGraph(); TGraph *gr_had_ratio = new TGraph(Nstep,t_axis,cs_ratio); gr_had_ratio->SetLineColor(kBlue+1); gr_had_ratio->SetTitle("DPM"); gr_had_ratio->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); gr_had_ratio->GetYaxis()->SetTitle("(#sigma_{had}+#sigma_{iterf})/#sigma_{el}, %"); gr_had_ratio->GetYaxis()->SetRangeUser(-15,110); // gr_had_ratio->Draw("AL"); mgr->Add(gr_had_ratio); TGraph *gr_had_ratio_e760 = new TGraph(Nstep,t_axis,cs_ratio_e760); gr_had_ratio_e760->SetLineColor(kAzure+1); gr_had_ratio_e760->SetTitle("E760 like"); gr_had_ratio_e760->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); gr_had_ratio_e760->GetYaxis()->SetTitle("(#sigma_{had}+#sigma_{iterf})/#sigma_{el}, %"); gr_had_ratio_e760->GetYaxis()->SetRangeUser(-15,110); // gr_had_ratio_e760->Draw("AL"); mgr->Add(gr_had_ratio_e760); mgr->Draw("AL"); mgr->GetYaxis()->SetRangeUser(-15,110); mgr->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); mgr->GetYaxis()->SetTitle("(#sigma_{had}+#sigma_{iterf})/#sigma_{el}, %"); leg_sigt->AddEntry(gr_had_ratio,"DPM","l"); leg_sigt->AddEntry(gr_had_ratio_e760,"E760","l"); lmd_range_box->Draw("same"); leg_sigt->Draw(); // c1.SetLogx(); // c1.cd(3); gPad->SetLogx(); // TGraph *gr_had_ratio_e760 = new TGraph(Nstep,t_axis,cs_ratio_e760); // gr_had_ratio_e760->SetLineColor(kAzure+1); // gr_had_ratio_e760->SetTitle("E760 like"); // gr_had_ratio_e760->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); // gr_had_ratio_e760->GetYaxis()->SetTitle("(#sigma_{had}+#sigma_{iterf})/#sigma_{el}, %"); // gr_had_ratio_e760->GetYaxis()->SetRangeUser(-15,110); // gr_had_ratio_e760->Draw("AL"); // lmd_range_box->Draw("same"); //[end] part 1: draw hadronic contribution --------------------------- c1.cd(3); gPad->SetLogx(); gPad->SetLogy(); TMultiGraph *mg_had = new TMultiGraph(); TGraph *gr_had_dpm = new TGraph(Nstep,t_axis,cs_had_dpm_y); gr_had_dpm->SetLineColor(kBlue+1); TGraph *gr_had_e760 = new TGraph(Nstep,t_axis,cs_had_e760_y); gr_had_e760->SetLineColor(kAzure+1); mg_had->Add(gr_had_dpm); mg_had->Add(gr_had_e760); mg_had->Draw("AL"); mg_had->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); mg_had->GetYaxis()->SetTitle("(d#sigma/dt)^{had}, mb/(GeV/c)^{2}"); // mg_had->GetXaxis()->SetRangeUser(1e-7,2e-1); //part2 draw data --------------------------------------------------------- c1.cd(2); gPad->SetLogx(); TFile *fin_dpm = new TFile("/home/karavdina/Disser/reports/pbarp_prev_exp/DPMfitUncert/DPM_vs_E760/dS_rel/dS_DPM_10GeV.root","READ"); TGraphErrors *gr_dpm = (TGraphErrors *)fin_dpm->Get("Graph"); double x_dpm,y_dpm; gr_dpm->GetPoint(0,x_dpm,y_dpm); //gr_dpm->GetYaxis()->SetRangeUser(-100,100); // gr_dpm->GetXaxis()->SetRangeUser(1e-7,2e-1); //gr_dpm->GetXaxis()->SetRangeUser(1e-7,1); // gr_dpm->Draw("AP"); // TF1 *fa1 = new TF1("fa1","[0]+[1]*x",x_dpm,5e-1); //gr_dpm->Fit(fa1,"","",x_dpm*0.95,2.5e-1); // gr_dpm->Fit(fa1,"","",1e-2,1e-1); // TF1 *fa1 = new TF1("fa1","[0]+[1]*x",x_dpm,1); TF1 *fa1 = new TF1("fa1","[0]",x_dpm,1); //gr_dpm->Fit(fa1,"","",x_dpm*0.95,2.6e-1); // gr_dpm->Fit(fa1,"","",1e-2,1.3e-1); cout<<"x_dpm*0.95 = "<Fit(fa1,"","",x_dpm*0.95,t_2); // gr_dpm->Fit(fa1,"","",8e-2,2e-1); double p0_dpm = fa1->GetParameter(0); double errp0_dpm = fa1->GetParError(0); cout<<"DPM: p0 = "<Add(gr_dpm); TFile *fin_e760 = new TFile("/home/karavdina/Disser/reports/pbarp_prev_exp/DPMfitUncert/DPM_vs_E760/dS_rel/dS_e760_10GeV.root","READ"); TGraphErrors *gr_e760 = (TGraphErrors *)fin_e760->Get("Graph"); gr_e760->GetYaxis()->SetRangeUser(-100,100); gr_e760->GetXaxis()->SetRangeUser(1e-7,2e-1); // gr_e760->Draw("AP"); mg_sys->Add(gr_e760); mg_sys->Draw("AP"); mg_sys->GetYaxis()->SetRangeUser(-100,100); // mg_sys->GetXaxis()->SetRangeUser(1e-7,5e-1); // mg_sys->GetXaxis()->SetRangeUser(1e-7,1); mg_sys->GetYaxis()->SetTitle("((d#sigma/dt)_{exp}-(d#sigma/dt)_{model})/(d#sigma/dt)_{exp}, %"); mg_sys->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); // TF1 *fa2 = new TF1("fa2","[0]+[1]*x",x_dpm,5e-1); // gr_e760->Fit(fa2,"","",x_dpm*0.95,2.5e-1); // gr_e760->Fit(fa2,"","",1e-2,1e-1); // TF1 *fa2 = new TF1("fa2","[0]+[1]*x",x_dpm,1); TF1 *fa2 = new TF1("fa2","[0]",x_dpm,1); //gr_e760->Fit(fa2,"","",x_dpm*0.95,2.6e-1); // gr_e760->Fit(fa2,"","",1e-2,1.3e-1); // gr_e760->Fit(fa2,"","",8e-2,2e-1); gr_e760->Fit(fa2,"","",x_dpm*0.95,t_2); double p0_e760 = fa2->GetParameter(0); double errp0_e760 = fa2->GetParError(0); cout<<"E760: p0 = "<SetMarkerColor(kBlue+1); dpm_err->SetLineColor(kBlue+1); dpm_err->SetMarkerStyle(21); double e760_sys[1]={fabs(p0_e760*1e-2*cs_had_rat_E760)}; double erre760_sys[1]={fabs(errp0_e760*1e-2*cs_had_rat_E760)}; TGraphErrors *e760_err = new TGraphErrors(1,plab_x,e760_sys,0,erre760_sys); e760_err->SetMarkerColor(kAzure+1); e760_err->SetLineColor(kAzure+1); e760_err->SetMarkerStyle(20); TMultiGraph *mg_err = new TMultiGraph(); mg_err->Add(dpm_err); mg_err->Add(e760_err); mg_err->Draw("AP"); mg_err->GetYaxis()->SetTitle("model system.err, %"); mg_err->GetXaxis()->SetTitle("P_{lab}, GeV/c"); //[end] part2 draw data -------------------------------------------------- c1.SaveAs("direct_syserr_estim_10GeV.pdf"); c1.SaveAs("direct_syserr_estim_10GeV.root"); return 0; }