{ // --------------------------------------------------------------------------- // plot all CBELSA photoproduction reaction //---------------------------------------------------------------------------- #include #include #include #include "TString.h" #include "TRegexp.h" gROOT->Reset(); // clear all variables gROOT->LoadMacro("utility_general.cpp"); gStyle->SetOptStat(0); // display only number events gStyle->SetFillColor(10); gStyle->SetPalette(1,0); TLatex L; L.SetTextSize(0.03); char* let[4]={"0","data","MC","Fit"}; char* let1[6]={"#Delta(1232)-pi","N-#rho(770)","N-#sigma","D13+D33","F15+F35","D15+D35"}; char* let2[2]={"-","+"}; char* let3[6]={"0","1","2","3","4","5"}; char* let4[3]={"N-rho","nucleon","rho exchange"}; Int_t jmax=20; char* my_text; Int_t imax=3; Int_t v[6][6]; TFile f("h_pi_pipi_pm_pra2.root"); fstream infile("res_gp_pipi_pm_pra2.dat",ios::in); infile>>imax; for(Int_t i=1; i<=imax; i++) { for(Int_t j=1; j<=5; j++) { infile>>v[i][j]; } } infile>>jmax; TH1F* hdat; TH1F* hmc; TH1F* hfit; TH1F* hres; Double_t max1; TCanvas *Xx1 = new TCanvas("Xx1","Mgg_org",500,10,700,720); double length =0.08; double x1 = 1.23; double max1; Xx1.SetFillColor(10); Int_t icol; Int_t id; for (Int_t i=1; i<=3; i++){ hdat=h(110+i,f); icol=i; if (i==2) icol=3; if (i==3) icol=2; hdat.SetLineColor(icol); if(i==1) { Double_t max = hdat->GetMaximum(); hdat.Draw("e"); } else { hdat.Draw("same"); TLine* line_MC = new TLine(x1 - length, max, x1, max); line_MC->SetLineColor(icol); line_MC->Draw(); max1=max*0.99; max=max*0.94; if(i<=3) { L.DrawLatex(x1+0.015,max1,let[i]); } } } Xx1.Print("00pe.eps"); TCanvas *Xx = new TCanvas("Xx","Root",500,10,700,720); double length =0.08; double x1 = 1.3; double max1; Xx.SetFillColor(10); Int_t icol=1; Int_t id; hdat=h(113,f); hmc=h(112,f); hdat->Sumw2(); hmc->Sumw2(); hdat->Divide(hdat,hmc); //Double_t max = hdat->GetMaximum(); Double_t max = 20.; Double_t min = 0.; hdat->SetMaximum(max); hdat->SetMinimum(min); hdat.Draw("hist"); hdat.SetLineColor(icol); for (Int_t i=4; i<=6; i++){ hdat=h(110+i,f); hdat->Divide(hdat,hmc); icol=i-2; //if (i>6) icol=i-1; //if (i>8) icol=i; hdat.SetLineColor(icol); hdat.Draw("samehist"); TLine* line_MC = new TLine(x1 - length, max*0.96, x1, max*0.96); line_MC->SetLineColor(icol); line_MC->Draw(); Double_t max1=max*0.95; max=max*0.94; L.DrawLatex(x1+0.015,max1,let1[i-4]); } Xx.Print("00pe_div.eps"); //Xx.Update(); jmax=7 Stat_t mc; Stat_t mc1; Stat_t dat; char* mycut; char* myps; TCanvas* X[2*jmax+1]; Int_t ndc=0; for(Int_t j = 1; j<=jmax; j++){ //getchar(); //1-------------- if (j==1) { mycut="Total";} if (j==2) { mycut="1.25cd(jpad); // Xx->cd(jpad); //----------------- 1 for(Int_t jj = 3; jj<=9; jj++){ Int_t id=1000*it+100*kin+10*j+jj; TH1F* p_MC = h(id,f); // icol=jj; // if (jj==2) icol=3; // if (jj==3) icol=2; icol=jj-2; // if (jj>6) icol=jj-1; p_MC->SetLineColor(icol); p_MC->SetMinimum(min); //----------------- 2 if (jj==3) { p_MC->Draw("hist"); } else { p_MC->Draw("same"); } pt = new TPaveText(0.012,0.900,0.40,1.000,"blNDC"); pt->SetName("title"); pt->SetBorderSize(2); pt->SetFillColor(10); pt->SetTextSize(0.07); text = pt->AddText(my_text); pt->Draw(); pt = new TPaveText(0.40,0.900,0.80,1.000,"blNDC"); pt->SetName("title"); pt->SetBorderSize(2); pt->SetFillColor(10); pt->SetTextSize(0.07); text = pt->AddText(mycut); pt->Draw(); //----------------- 2 } //----------------- 1 } } } else { if (j==1) { myps="10pe_dp.eps"; } if (j==2) { myps="13pe_dp.eps";} if (j==3) { myps="14pe_dp.eps";} if (j==4) { myps="15pe_dp.eps";} if (j==5) { myps="16pe_dp.eps";} if (j==6) { myps="17pe_dp.eps";} if (j==7) { myps="18pe_dp.eps";} if (j==8) { myps="19pe_dp.eps";} if (j==9) { myps="24pe_dp.eps";} if (j==10) { myps="25pe_dp.eps";} X[ndc].Divide(1,1); X[ndc]->cd(1); id=10*j+1; // hdat = h(id,f); // p_MC = h(id+1,f); // Int_t nb = hdat->GetEntries(); /* for ( Int_t ii=1; ii<=nb; ii++) { dat = hdat->GetBinContent(ii); mc = p_MC->GetBinContent(ii); mc1=0; if(mc>0) {mc1=1;} hdat->SetBinContent(ii,mc1); } */ // hdat->Draw("colZ"); // X[ndc]->cd(2); id=10*j+3; p_MC = h(id,f); p_MC->Draw("colZ"); // X[ndc]->cd(3); // id=10*j+2; // p_MC = h(id,f); // p_MC->Draw("colZ"); } X[ndc].Print(myps); } //1-------------- } //X[j].Update(); //Xx.Update(); //printf("Continue?"); } // }