void Draw_CMS_Y1S_RaaVsRap(TLegend *lgd) { const int nbinsRap=6; Double_t RapCMS[nbinsRap]={0.2,0.6,1.0,1.4,1.8,2.2}; Double_t ErrRapCMS[nbinsRap]={0}; Double_t RaaRapCMS[nbinsRap] = {0.402,0.377,0.452,0.461,0.466,0.35}; Double_t RaaRapStatErrCMS[nbinsRap] = {0.025,0.025,0.030,0.034,0.039,0.053}; Double_t RaaRapSystErrCMS[nbinsRap] = {0.0404,0.038,0.046,0.0466,0.0484,0.0373}; TGraphErrors *grRaaRapCMS = new TGraphErrors(nbinsRap, RapCMS, RaaRapCMS, ErrRapCMS, RaaRapStatErrCMS); grRaaRapCMS->SetMarkerStyle(20); grRaaRapCMS->SetMarkerColor(4); grRaaRapCMS->GetYaxis()->SetRangeUser(0,3.0); grRaaRapCMS->GetXaxis()->SetTitle("p_{T}(GeV/c)"); grRaaRapCMS->GetYaxis()->SetTitle("R_{AA}"); TAxis *Xaxis2 = grRaaRapCMS->GetXaxis(); Xaxis2->SetLimits(0.,2.4); grRaaRapCMS->Draw("AP"); TLine *lh4 = new TLine(0.0,1.0,20.0,1.0); lh4->SetLineColor(1); lh4->SetLineStyle(1); lh4->SetLineWidth(2); lh4->Draw("same"); TLatex *tb= new TLatex; tb->SetNDC(); tb->SetTextAlign(12); tb->SetTextColor(1); tb->SetTextSize(0.040); //tb->DrawLatex(0.55,0.22,"PbPb #sqrt{s_{NN}} = 2.76 TeV"); //tb->DrawLatex(0.55,0.16,"#varUpsilon #rightarrow #mu^{+} #mu^{-}, p_{T}^{#varUpsilon} > 0.0 GeV/c"); TBox *RaaRapCMSSys[nbinsRap]; for(int j=0;j<nbinsRap;j++){ RaaRapCMSSys[j] = new TBox(RapCMS[j]-0.1, RaaRapCMS[j]-RaaRapSystErrCMS[j], RapCMS[j]+0.1, RaaRapCMS[j]+RaaRapSystErrCMS[j]); } for(int j=0;j<nbinsRap;j++){ RaaRapCMSSys[j]->SetFillStyle(0000); RaaRapCMSSys[j]->SetLineColor(4); RaaRapCMSSys[j]->Draw("same"); } TBox *CMSGlobalSysRap; CMSGlobalSysRap = new TBox(18-0.2, 1 - 0.083, 18+0.2, 1 + 0.083); CMSGlobalSysRap->SetFillStyle(3001); CMSGlobalSysRap->SetLineColor(4); CMSGlobalSysRap->SetFillColor(4); //CMSGlobalSysRap->Draw("same"); lgd->AddEntry(grRaaRapCMS,"CMS Data", "P"); }
void Draw_ALICEMid_JPsi_RaaVsNpart(TLegend *lgd) { //ALICE MID rapidity int nbinsALICEMid=3; Double_t NPartALICEMid[3]={357,193,46}; Double_t ErrNPartALICEMid[3]={0}; Double_t RaaALICEMid[3] = {0.82,0.65,0.73}; Double_t SystErrALICEMid[3] = {0.15,0.10,0.16}; TGraphErrors *grRaaALICEMid = new TGraphErrors(nbinsALICEMid, NPartALICEMid, RaaALICEMid, ErrNPartALICEMid, SystErrALICEMid); grRaaALICEMid->SetMarkerStyle(20); grRaaALICEMid->SetMarkerColor(2); //grRaaALICEMid->SetLineColor(2); grRaaALICEMid->GetYaxis()->SetRangeUser(0,1.5); TAxis *Xaxis = grRaaALICEMid->GetXaxis(); Xaxis->SetLimits(0.,430.0); grRaaALICEMid->GetXaxis()->SetTitle("N_{Part}"); grRaaALICEMid->GetYaxis()->SetTitle("R_{AA}"); grRaaALICEMid->Draw("Psame"); //TLatex *tb= new TLatex; //tb->SetNDC(); //tb->SetTextAlign(12); //tb->SetTextColor(1); //tb->SetTextSize(0.040); //tb->DrawLatex(0.55,0.90,"PbPb #sqrt{s_{NN}} = 2.76 TeV"); //tb->DrawLatex(0.22,0.16,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 0.0 GeV/c"); //tb->DrawLatex(0.55,0.85,"p_{T}^{J/#psi} > 0.0 GeV/c"); TLine *lh3 = new TLine(0.0,1.0,420,1.0); lh3->SetLineColor(1); lh3->SetLineStyle(1); lh3->SetLineWidth(1.5); lh3->Draw("same"); TBox *RaaJPsiALICEMidSys[12]; for(int j=0;j<3;j++){ RaaJPsiALICEMidSys[j] = new TBox(NPartALICEMid[j]-3, RaaALICEMid[j]-SystErrALICEMid[j], NPartALICEMid[j]+3, RaaALICEMid[j]+SystErrALICEMid[j]); } for(int j=0;j<3;j++){ RaaJPsiALICEMidSys[j]->SetFillStyle(0000); RaaJPsiALICEMidSys[j]->SetLineColor(2); RaaJPsiALICEMidSys[j]->Draw("same"); } TBox *ALICEMidGlobalSysJPsi; ALICEMidGlobalSysJPsi = new TBox(385-5, 1 - 0.26, 385+5, 1 + 0.26); ALICEMidGlobalSysJPsi->SetFillStyle(3001); ALICEMidGlobalSysJPsi->SetLineColor(2); ALICEMidGlobalSysJPsi->SetFillColor(2); ALICEMidGlobalSysJPsi->Draw("same"); lgd->AddEntry(grRaaALICEMid,"ALICE Data p_{T}^{J/#psi} > 0.0 GeV/c, |y^{J/#psi}| #leq 1.0","P"); }
void Draw_ALICEFor_JPsi_RaaVsNpart(TLegend *lgd) { int nbinsALICE=9; Double_t NPartALICE[10]={357,262,187,128,86,53,30,16,8}; Double_t ErrNPartALICE[10]={0}; Double_t RaaALICE[10] = {0.47,0.48,0.51,0.51,0.52,0.61,0.70,0.74,0.94}; Double_t SystErrALICE[10] = {0.03,0.02,0.02,0.02,0.03,0.05,0.06,0.09,0.1}; TGraphErrors *grRaaALICE = new TGraphErrors(nbinsALICE, NPartALICE, RaaALICE, ErrNPartALICE, SystErrALICE); grRaaALICE->SetMarkerStyle(20); grRaaALICE->SetMarkerColor(4); grRaaALICE->GetYaxis()->SetRangeUser(0,1.7); TAxis *Xaxis2 = grRaaALICE->GetXaxis(); Xaxis2->SetLimits(0.,430.0); grRaaALICE->GetXaxis()->SetTitle("N_{Part}"); grRaaALICE->GetYaxis()->SetTitle("R_{AA}"); grRaaALICE->Draw("AP"); TLine *lh3 = new TLine(0.0,1.0,420,1.0); lh3->SetLineColor(1); lh3->SetLineStyle(1); lh3->SetLineWidth(1.5); lh3->Draw("same"); //TLatex *tb= new TLatex; //tb->SetNDC(); //tb->SetTextAlign(12); //tb->SetTextColor(1); //tb->SetTextSize(0.040); //tb->DrawLatex(0.22,0.22,"PbPb #sqrt{s_{NN}} = 2.76 TeV"); //tb->DrawLatex(0.22,0.16,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 0.0 GeV/c"); TBox *RaaJPsiALICESys[12]; for(int j=0;j<9;j++){ RaaJPsiALICESys[j] = new TBox(NPartALICE[j]-3, RaaALICE[j]-SystErrALICE[j], NPartALICE[j]+3, RaaALICE[j]+SystErrALICE[j]); } for(int j=0;j<9;j++){ RaaJPsiALICESys[j]->SetFillStyle(0000); RaaJPsiALICESys[j]->SetLineColor(4); RaaJPsiALICESys[j]->Draw("same"); } TBox *ALICEGlobalSysJPsi; ALICEGlobalSysJPsi = new TBox(400-5, 1 - 0.14, 400+5, 1 + 0.14); ALICEGlobalSysJPsi->SetFillStyle(3001); ALICEGlobalSysJPsi->SetLineColor(4); ALICEGlobalSysJPsi->SetFillColor(4); ALICEGlobalSysJPsi->Draw("same"); Draw_ALICEMid_JPsi_RaaVsNpart(lgd); lgd->AddEntry(grRaaALICE,"ALICE Data p_{T}^{J/#psi} > 0.0 GeV/c, 2.5 #leq y^{J/#psi} #leq 4.0","P"); }
void Draw_CMS_JPsi_RaaVsRap(TLegend *lgd) { //=============== CMS Raa Vs Rap Data ===============================================================// //AvpT 10.92,9.65,8.92 int nbinsRapCMS=3; Double_t RapCMSD[3]={0.6,1.4,2.0}; Double_t ErrRapCMS[3]={0.6,0.2,0.4}; Double_t RaaRapCMS[3] = {0.31,0.33,0.36}; Double_t RaaRapStatErrCMS[3] = {0.02,0.03,0.03}; Double_t RaaRapSystErrCMS[3] = {0.03,0.04,0.04}; TGraphErrors *grRaaRapCMS = new TGraphErrors(nbinsRapCMS, RapCMSD, RaaRapCMS, ErrRapCMS, RaaRapStatErrCMS); grRaaRapCMS->SetMarkerStyle(20); grRaaRapCMS->SetMarkerColor(2); grRaaRapCMS->GetYaxis()->SetRangeUser(0,1.5); grRaaRapCMS->GetXaxis()->SetTitle("|y|"); grRaaRapCMS->GetYaxis()->SetTitle("R_{AA}"); TAxis *XaxisgrRaaRapCMS = grRaaRapCMS->GetXaxis(); XaxisgrRaaRapCMS->SetLimits(0.0,2.4); grRaaRapCMS->Draw("AP"); TLine *lh_grRaaRapCMS = new TLine(0.0,1.0,2.4,1.0); lh_grRaaRapCMS->SetLineColor(1); lh_grRaaRapCMS->SetLineStyle(1); lh_grRaaRapCMS->SetLineWidth(1.5); lh_grRaaRapCMS->Draw("same"); TLatex *tb= new TLatex; tb->SetNDC(); tb->SetTextAlign(12); tb->SetTextColor(1); tb->SetTextSize(0.040); tb->DrawLatex(0.20,0.20,"Pb+Pb #sqrt{s_{NN}} = 2.76 TeV"); tb->DrawLatex(0.20,0.15,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 6.5 GeV/c"); TBox *RaaRapJPsiCMSSys[4]; for(int j=0;j<3;j++){ RaaRapJPsiCMSSys[j] = new TBox(RapCMSD[j]-0.05, RaaRapCMS[j]-RaaRapSystErrCMS[j], RapCMSD[j]+0.05, RaaRapCMS[j]+RaaRapSystErrCMS[j]); } for(int j=0;j<3;j++){ RaaRapJPsiCMSSys[j]->SetFillStyle(0000); RaaRapJPsiCMSSys[j]->SetLineColor(2); RaaRapJPsiCMSSys[j]->Draw("same"); } TBox *CMSGlobalSysJPsiRap; CMSGlobalSysJPsiRap = new TBox(0.2-0.05, 1 - 0.05, 0.2+0.05, 1 + 0.05); CMSGlobalSysJPsiRap->SetFillStyle(3001); CMSGlobalSysJPsiRap->SetLineColor(2); CMSGlobalSysJPsiRap->SetFillColor(2); CMSGlobalSysJPsiRap->Draw("same"); lgd->AddEntry(grRaaRapCMS,"CMS Data", "P"); }
void HiggsPlot::PlotBF(int iDecay, double tBmH_max, double BF_max){ if(iDecay<0 || iDecay>2) {cout<<"iDecay must be 0, 1 or 2"<<endl; return;} styles style; style.setPadsStyle(-1); style.setDefaultStyle(); int nBins = 1000; TString hName, epsName = "public_html/Higgs_BF_TEMP_BaBar.eps", label, Llabel, Rlabel; TString yTitle[] = {"BF(B#rightarrow#tau#nu) (10^{-5})", "R(D)", "R(D*)"}; TString TagDecay[] = {"BF", "R(D)", "R(D*)"}; TCanvas can; TH1F *hBF[2]; for(int his=0; his<1; his++) { hName = "hBF"; hName += his; hBF[his] = new TH1F(hName,"",nBins,0,tBmH_max); } double tBmH, BF[2]; for(int bin=1; bin<=nBins; bin++){ tBmH = hBF[0]->GetBinCenter(bin); Compute(tBmH,BF,iDecay); hBF[0]->SetBinContent(bin, BF[0]); hBF[0]->SetBinError(bin, BF[1]); } hBF[0]->SetFillColor(2); hBF[0]->SetLineColor(2); hName += "1"; hBF[1] = static_cast<TH1F*>(hBF[0]->Clone(hName)); for(int bin=1; bin<=nBins; bin++)hBF[1]->SetBinError(bin,0); hBF[1]->SetFillColor(0);hBF[1]->SetLineColor(1); hBF[1]->SetLineWidth(2); TBox box; box.SetLineColor(4);box.SetFillColor(4); TLine line; line.SetLineStyle(1); line.SetLineColor(4); line.SetLineWidth(3); if(BF_max>0) hBF[0]->SetMaximum(BF_max); hBF[0]->Draw("e3"); box.SetFillStyle(3002); box.DrawBox(0,Measurement[iDecay][0]-Measurement[iDecay][1], tBmH_max,Measurement[iDecay][0]+Measurement[iDecay][1]); line.DrawLine(0,Measurement[iDecay][0],tBmH_max,Measurement[iDecay][0]); hBF[0]->Draw("e3 same"); hBF[1]->Draw("c same"); Compute(0,BF,iDecay); label = "#splitline{"; label += TagDecay[iDecay]; label += "_{SM} = "; if(iDecay==0){ label+="(";label+=RoundNumber(BF[0],1); label+=" #pm "; label+=RoundNumber(BF[1],1); label+=")#times10^{-5}}{BF_{exp} = ("; label+=RoundNumber(Measurement[iDecay][0],1); label+=" #pm "; label+=RoundNumber(Measurement[iDecay][1],1); label+=")#times10^{-5}}"; Llabel = ""; Rlabel = label; } else { label+=RoundNumber(BF[0],3); label+=" #pm "; label+=RoundNumber(BF[1],3); label+="}{"; label += TagDecay[iDecay]; label += "_{exp} = "; label+=RoundNumber(Measurement[iDecay][0],3); label+=" #pm "; label+=RoundNumber(Measurement[iDecay][1],3); label+="}"; Rlabel = ""; Llabel = label; } style.setTitles(hBF[0],"tan#beta/m_{H^{+}} (GeV^{-1})",yTitle[iDecay],Llabel,Rlabel); epsName.ReplaceAll("TEMP",DecayName[iDecay]); can.SaveAs(epsName); for(int his=0; his<2; his++) hBF[his]->Delete(); }
void Draw_CMS_JPsi_RaaVsNpart(TLegend *lgd) { int nbins = 12; Double_t RaaCMS[20]={0.23,0.24,0.29,0.33,0.38,0.40,0.45,0.41,0.52,0.52,0.64,0.64}; Double_t StatErrCMS[20]={0.01,0.01,0.02,0.02,0.02,0.03,0.03,0.03,0.04,0.04,0.05,0.05}; Double_t SystErrCMS[20]={0.02,0.03,0.03,0.03,0.04,0.04,0.05,0.04,0.05,0.05,0.07,0.13}; Double_t NPartCMS[20]={Npart(0,2),Npart(2,4),Npart(4,6),Npart(6,8),Npart(8,10),Npart(10,12), Npart(12,14),Npart(14,16),Npart(16,18),Npart(18,20),Npart(20,24), Npart(24,40)}; Double_t ErrNPartCMS[20]={0}; TGraphErrors *grRaaCMS = new TGraphErrors(nbins, NPartCMS, RaaCMS, ErrNPartCMS, StatErrCMS); grRaaCMS->SetMarkerStyle(21); grRaaCMS->SetMarkerColor(2); grRaaCMS->GetYaxis()->SetRangeUser(0,1.7); grRaaCMS->GetXaxis()->SetTitle("N_{Part}"); grRaaCMS->GetYaxis()->SetTitle("R_{AA}"); grRaaCMS->Draw("AP"); TBox *RaaJPsiSys[12]; for(int j=0;j<12;j++){ RaaJPsiSys[j] = new TBox(NPartCMS[j]-3, RaaCMS[j]-SystErrCMS[j], NPartCMS[j]+3, RaaCMS[j]+SystErrCMS[j]); } for(int j=0;j<12;j++){ RaaJPsiSys[j]->SetFillStyle(0000); RaaJPsiSys[j]->SetLineColor(6); RaaJPsiSys[j]->Draw("same"); } TLine *lh2 = new TLine(0.0,1.0,400,1.0); lh2->SetLineColor(1); lh2->SetLineStyle(1); lh2->SetLineWidth(2); lh2->Draw("same"); TBox *GlobalSysJPsi; GlobalSysJPsi = new TBox(400-5, 1 - 0.06, 400+5, 1 + 0.06); GlobalSysJPsi->SetFillStyle(3001); GlobalSysJPsi->SetLineColor(6); GlobalSysJPsi->SetFillColor(6); GlobalSysJPsi->Draw("same"); TLatex *tb= new TLatex; tb->SetNDC(); tb->SetTextAlign(12); tb->SetTextColor(1); tb->SetTextSize(0.040); tb->DrawLatex(0.17,0.23,"PbPb #sqrt{s_{NN}} = 2.76 TeV"); tb->DrawLatex(0.17,0.17,"p_{T}^{J/#psi} > 6.5 GeV/c"); lgd->AddEntry(grRaaCMS,"CMS Data", "P"); }
//-------------------------- // DrawTargetBoundaries //-------------------------- void DrawTargetBoundaries(int color=target_color) { double Zlo = 50.0; double Zhi = Zlo + 30.0; double Rlo = 0.0; double Rhi = Rlo + 1.5; if (full) { Rlo=-1.5; Rhi=Rlo+3; } TBox *box = new TBox(Zlo, Rlo, Zhi, Rhi); box->SetLineWidth(2.0); if (fill_detectors) { box->SetFillColor(color); box->SetFillStyle(1001); } else box->SetFillStyle(0); box->SetLineColor(color); box->Draw(); TLatex *lab = new TLatex(Zlo-5, 0, "target"); if (full) lab->SetTextAlign(32); else lab->SetTextAlign(31); lab->SetTextSize(0.02); lab->SetTextColor(color); lab->Draw(); }
void Draw_CMS_JPsi_RaaVspT(TLegend *legend_ratio) { int nbinsPtCMS=4; Double_t PtCMSD[4]={7.31,8.97,11.32,16.52}; Double_t ErrPtCMS[4]={0}; Double_t RaaPtCMS[4] = {0.35,0.34,0.34,0.29}; Double_t RaaPtStatErrCMS[4] = {0.09,0.03,0.03,0.04}; Double_t RaaPtSystErrCMS[4] = {0.04,0.04,0.03,0.03}; TGraphErrors *grRaaPtCMS = new TGraphErrors(nbinsPtCMS, PtCMSD, RaaPtCMS, ErrPtCMS, RaaPtStatErrCMS); grRaaPtCMS->SetMarkerStyle(21); grRaaPtCMS->SetMarkerColor(kRed+1); grRaaPtCMS->SetMarkerSize(1.3); //grRaaPtCMS->SetFillColor(kRed); grRaaPtCMS->SetLineColor(1); grRaaPtCMS->GetYaxis()->SetRangeUser(0,1.5); grRaaPtCMS->GetXaxis()->SetTitle("p_{T}(GeV/c)"); grRaaPtCMS->GetYaxis()->SetTitle("R_{AA}"); TLine *lh5 = new TLine(0.0,1.0,20.0,1.0); lh5->SetLineColor(1); lh5->SetLineStyle(1); lh5->SetLineWidth(1.5); TLatex *tb= new TLatex; tb->SetNDC(); tb->SetTextAlign(12); tb->SetTextColor(1); tb->SetTextSize(0.040); TBox *RaaPtJPsiCMSSys[4]; for(int j=0;j<4;j++){ RaaPtJPsiCMSSys[j] = new TBox(PtCMSD[j]-0.4, RaaPtCMS[j]-RaaPtSystErrCMS[j], PtCMSD[j]+0.4, RaaPtCMS[j]+RaaPtSystErrCMS[j]); } for(int j=0;j<4;j++){ RaaPtJPsiCMSSys[j]->SetFillStyle(1001); RaaPtJPsiCMSSys[j]->SetFillColor(kPink+1); RaaPtJPsiCMSSys[j]->SetLineColor(1); } TBox *CMSGlobalSysJPsiPt; //CMSGlobalSysJPsiPt = new TBox(27.0-1.0, 1 - 0.075, 27.0+1.0, 1 + 0.075); CMSGlobalSysJPsiPt = new TBox(19.165,0.923,19.948,1.067); CMSGlobalSysJPsiPt->SetFillStyle(3001); CMSGlobalSysJPsiPt->SetLineColor(2); CMSGlobalSysJPsiPt->SetFillColor(2); TAxis *XaxisgrRaaPtCMS = grRaaPtCMS->GetXaxis(); XaxisgrRaaPtCMS->SetLimits(0.0,20.0); grRaaPtCMS->Draw("AP"); for(int j=0;j<4;j++) RaaPtJPsiCMSSys[j]->Draw("same"); grRaaPtCMS->Draw("Psame"); CMSGlobalSysJPsiPt->Draw("same"); tb->SetTextSize(0.030); //tb->DrawLatex(0.20,0.20,"PbPb #sqrt{s_{NN}} = 2.76 TeV"); tb->DrawLatex(0.71476,0.91289,"J/#psi #rightarrow #mu^{+} #mu^{-}"); lh5->Draw("same"); //legend_ratio->AddEntry(grRaaPtCMS,"PbPb #sqrt{s_{NN}} = 2.76 TeV and Au-Au #sqrt{s_{NN}} = 0.2 TeV", ""); legend_ratio->AddEntry(grRaaPtCMS,"Pb+Pb #sqrt{s_{NN}} = 2.76 TeV", ""); legend_ratio->AddEntry(grRaaPtCMS,"Prompt J/#psi CMS: |y| < 2.4", "P"); //legend_ratio->AddEntry(grRaaPtCMS,"PbPb #sqrt{s_{NN}} = 2.76 TeV and Au-Au #sqrt{s_{NN}} = 0.2 TeV", ""); //legend_ratio->AddEntry(grRaaPtCMS,"CMS: J/#psi #rightarrow #mu^{+} #mu^{-}, |y| < 2.4 & p_{T}^{J/#psi} > 6.5 GeV/c", "P"); //legend_ratio->AddEntry(grRaaPtCMS,"CMS: J/#psi #rightarrow #mu^{+} #mu^{-}, |y| < 2.4 & p_{T}^{J/#psi} > 6.5 GeV/c", "P"); }
void makeV2_DataOnly_Cen(const int flag=0) { gROOT->Reset(); const Double_t MassD = 1.865; const Double_t MassKs = 0.498; const Double_t MassPhi = 1.019; const Double_t MassLa = 1.1156; const Double_t MassXi = 1.3217; const Double_t MassOmega = 1.672; ifstream inData; // new data TFile *fin = new TFile("Systematics_D0vn_SL16d_2016-10-14.ME.root"); TGraphErrors *gr_data_0_80 = (TGraphErrors *)(fin->Get("vnStat_0_80")); gr_data_0_80->RemovePoint(0); TGraphErrors *gr_data_0_80_sys = (TGraphErrors *)(fin->Get("vnSyst_0_80")); gr_data_0_80_sys->RemovePoint(0); cout << gr_data_0_80->GetN() << endl; cout << gr_data_0_80_sys->GetN() << endl; const Double_t scale_w_Ks = 1.0; const Int_t n_data_new = 8; ////////////////////////////////////////////// // Read-in data points for 0-80% centrality ////////////////////////////////////////////// Double_t nonflow[n_data_new] = { 0.032629 , 0.0336555 , 0.0336555 , 0.033947 , 0.0346236 , 0.0353009 , 0.0361988 , 0.0382869}; // full range 0-80% Double_t x_data_new[n_data_new], y_data_new[n_data_new], ye_data_new[n_data_new], yes_data_new[n_data_new], yesL_data_new[n_data_new]; Double_t yeL_data_new[n_data_new], yeU_data_new[n_data_new]; Double_t x_mTScaled_data_new[n_data_new], yScaled_data_new[n_data_new], yeScaled_data_new[n_data_new], yesScaled_data_new[n_data_new], yesLScaled_data_new[n_data_new]; Double_t yeLScaled_data_new[n_data_new], yeUScaled_data_new[n_data_new]; for(int i=0;i<gr_data_0_80->GetN();i++) { cout << i << endl; x_data_new[i] = gr_data_0_80->GetX()[i]; y_data_new[i] = gr_data_0_80->GetY()[i]; ye_data_new[i] = gr_data_0_80->GetEY()[i]; yes_data_new[i] = gr_data_0_80_sys->GetEY()[i]; yesL_data_new[i] = nonflow[i]; x_mTScaled_data_new[i] = (sqrt(x_data_new[i]*x_data_new[i] + MassD*MassD) - MassD)/2; yScaled_data_new[i] = y_data_new[i]/2 * scale_w_Ks; yeScaled_data_new[i] = ye_data_new[i]/2 * scale_w_Ks; yesScaled_data_new[i] = yes_data_new[i]/2 * scale_w_Ks; yesLScaled_data_new[i] = yesL_data_new[i]/2 * scale_w_Ks; yeL_data_new[i] = sqrt(ye_data_new[i]**2+yes_data_new[i]**2+yesL_data_new[i]**2) * scale_w_Ks; yeU_data_new[i] = sqrt(ye_data_new[i]**2+yes_data_new[i]**2) * scale_w_Ks; yeLScaled_data_new[i] = yeL_data_new[i]/2 * scale_w_Ks; yeUScaled_data_new[i] = yeU_data_new[i]/2 * scale_w_Ks; } ////////////////////////////// // different centrality bins ////////////////////////////// const Int_t NCen = 3; TGraphErrors *gr_data_cen[NCen]; TGraphErrors *gr_data_cen_sys[NCen]; TGraphErrors *gr_data_mT_cen[NCen]; const Char_t *CenName[NCen] = {"40_80","10_40","0_10"}; for(int i=0;i<NCen;i++) { gr_data_cen[i] = (TGraphErrors *)(fin->Get(Form("vnStat_%s",CenName[i]))); gr_data_cen[i]->RemovePoint(0); gr_data_cen_sys[i] = (TGraphErrors *)(fin->Get(Form("vnSyst_%s",CenName[i]))); gr_data_cen_sys[i]->RemovePoint(0); } const Int_t n_data_cen = 8; Double_t nonflow_cen[NCen][n_data_cen] = {{ 0.115456 , 0.118967 , 0.118967 , 0.120065 , 0.122454 , 0.124808 , 0.128025 , 0.135539}, { 0.0210766 , 0.0217398 , 0.0217398 , 0.0219309 , 0.0223667 , 0.0228055 , 0.0233849 , 0.0247439}, { 0.0202398 , 0.0208774 , 0.0208774 , 0.0210541 , 0.0214741 , 0.021893 , 0.0224473 , 0.0237127}}; Double_t x_data_cen[NCen][n_data_cen], y_data_cen[NCen][n_data_cen], ye_data_cen[NCen][n_data_cen], yes_data_cen[NCen][n_data_cen], yesL_data_cen[NCen][n_data_cen]; Double_t yeL_data_cen[NCen][n_data_cen], yeU_data_cen[NCen][n_data_cen]; Double_t x_mTScaled_data_cen[NCen][n_data_cen], yScaled_data_cen[NCen][n_data_cen], yeScaled_data_cen[NCen][n_data_cen], yesScaled_data_cen[NCen][n_data_cen], yesLScaled_data_cen[NCen][n_data_cen]; Double_t yeLScaled_data_cen[NCen][n_data_cen], yeUScaled_data_cen[NCen][n_data_cen]; for(int ic=0;ic<NCen;ic++) { for(int i=0;i<gr_data_cen[ic]->GetN();i++) { x_data_cen[ic][i] = gr_data_cen[ic]->GetX()[i]; y_data_cen[ic][i] = gr_data_cen[ic]->GetY()[i]; ye_data_cen[ic][i] = gr_data_cen[ic]->GetEY()[i]; yes_data_cen[ic][i] = gr_data_cen_sys[ic]->GetEY()[i]; yesL_data_cen[ic][i] = nonflow_cen[ic][i]; x_mTScaled_data_cen[ic][i] = (sqrt(x_data_cen[ic][i]*x_data_cen[ic][i] + MassD*MassD) - MassD)/2; yScaled_data_cen[ic][i] = y_data_cen[ic][i]/2 * scale_w_Ks; yeScaled_data_cen[ic][i] = ye_data_cen[ic][i]/2 * scale_w_Ks; yesScaled_data_cen[ic][i] = yes_data_cen[ic][i]/2 * scale_w_Ks; yesLScaled_data_cen[ic][i] = yesL_data_cen[ic][i]/2 * scale_w_Ks; yeL_data_cen[ic][i] = sqrt(ye_data_cen[ic][i]**2+yes_data_cen[ic][i]**2+yesL_data_cen[ic][i]**2) * scale_w_Ks; yeU_data_cen[ic][i] = sqrt(ye_data_cen[ic][i]**2+yes_data_cen[ic][i]**2) * scale_w_Ks; yeLScaled_data_cen[ic][i] = yeL_data_cen[ic][i]/2 * scale_w_Ks; yeUScaled_data_cen[ic][i] = yeU_data_cen[ic][i]/2 * scale_w_Ks; } gr_data_mT_cen[ic] = new TGraphErrors(n_data_cen, x_mTScaled_data_cen[ic], yScaled_data_cen[ic], 0, yeScaled_data_cen[ic]); } cout << " Read-in D0 data done ..." << endl; /* const Int_t n_ks_cen = 19; const Int_t n_la_cen = 18; Double_t x_ks_cen[n_ks_cen], y_ks_cen[NCen][n_ks_cen], ye_ks_cen[NCen][n_ks_cen], yes_ks_cen[NCen][n_ks_cen]; Double_t x_la_cen[n_la_cen], y_la_cen[NCen][n_la_cen], ye_la_cen[NCen][n_la_cen], yes_la_cen[NCen][n_la_cen]; Double_t x_mTScaled_ks_cen[n_ks_cen], yScaled_ks_cen[NCen][n_ks_cen], yeScaled_ks_cen[NCen][n_ks_cen], yesScaled_ks_cen[NCen][n_ks_cen]; Double_t x_mTScaled_la_cen[n_la_cen], yScaled_la_cen[NCen][n_la_cen], yeScaled_la_cen[NCen][n_la_cen], yesScaled_la_cen[NCen][n_la_cen]; inData.open("Run14/ks_v2_cen_PRC77.txt"); for(int i=0;i<n_ks_cen;i++) { double a, b, c; inData >> x_ks_cen[i] >> a >> b >> c >> y_ks_cen[0][i] >> ye_ks_cen[0][i] >> yes_ks_cen[0][i] >> y_ks_cen[1][i] >> ye_ks_cen[1][i] >> yes_ks_cen[1][i] >> y_ks_cen[2][i] >> ye_ks_cen[2][i] >> yes_ks_cen[2][i]; x_mTScaled_ks_cen[i] = (sqrt(x_ks_cen[i]*x_ks_cen[i]+MassKs*MassKs)-MassKs)/2; for(int ic=0;ic<NCen;ic++) { yScaled_ks_cen[ic][i] = y_ks_cen[ic][i]/2.; yeScaled_ks_cen[ic][i] = ye_ks_cen[ic][i]/2.; yesScaled_ks_cen[ic][i] = yes_ks_cen[ic][i]/2.; } } inData.close(); TGraphErrors *gr_ks_cen[NCen], *gr_ks_mT_cen[NCen]; for(int ic=0;ic<NCen;ic++) { gr_ks_cen[ic] = new TGraphErrors(n_ks_cen, x_ks_cen, y_ks_cen[ic], 0, ye_ks_cen[ic]); gr_ks_mT_cen[ic] = new TGraphErrors(n_ks_cen, x_mTScaled_ks_cen, yScaled_ks_cen[ic], 0, yeScaled_ks_cen[ic]); // gr_ks_mT_cen[ic]->Print(); } cout << " Read-in Ks data points done ... " << endl; inData.open("Run14/lambda_v2_cen_PRC77.txt"); for(int i=0;i<n_la_cen;i++) { double a, b, c; inData >> x_la_cen[i] >> a >> b >> c >> y_la_cen[0][i] >> ye_la_cen[0][i] >> yes_la_cen[0][i] >> y_la_cen[1][i] >> ye_la_cen[1][i] >> yes_la_cen[1][i] >> y_la_cen[2][i] >> ye_la_cen[2][i] >> yes_la_cen[2][i]; x_mTScaled_la_cen[i] = (sqrt(x_la_cen[i]*x_la_cen[i]+MassLa*MassLa)-MassLa)/3; for(int ic=0;ic<NCen;ic++) { yScaled_la_cen[ic][i] = y_la_cen[ic][i]/3.; yeScaled_la_cen[ic][i] = ye_la_cen[ic][i]/3.; yesScaled_la_cen[ic][i] = yes_la_cen[ic][i]/3.; } } inData.close(); TGraphErrors *gr_la_cen[NCen], *gr_la_mT_cen[NCen]; for(int ic=0;ic<NCen;ic++) { gr_la_cen[ic] = new TGraphErrors(n_la_cen, x_la_cen, y_la_cen[ic], 0, ye_la_cen[ic]); gr_la_mT_cen[ic] = new TGraphErrors(n_la_cen, x_mTScaled_la_cen, yScaled_la_cen[ic], 0, yeScaled_la_cen[ic]); } cout << " Read-in Lambda data points done ... " << endl; // Xi data points, format is a bit different const Int_t n_xi_cenMax = 9; Int_t n_xi_cen[NCen]; Double_t x_xi_cen[NCen][n_xi_cenMax], y_xi_cen[NCen][n_xi_cenMax], ye_xi_cen[NCen][n_xi_cenMax]; Double_t x_mTScaled_xi_cen[NCen][n_xi_cenMax], yScaled_xi_cen[NCen][n_xi_cenMax], yeScaled_xi_cen[NCen][n_xi_cenMax]; TGraphErrors *gr_xi_cen[NCen]; TGraphErrors *gr_xi_mT_cen[NCen]; for(int ic=0;ic<NCen;ic++) { gr_xi_cen[ic] = new TGraphErrors(Form("Run14/xi_v2_%s.txt",CenName[ic]),"%lg %lg %lg"); n_xi_cen[ic] = gr_xi_cen[ic]->GetN(); for(int i=0;i<gr_xi_cen[ic]->GetN();i++) { x_xi_cen[ic][i] = gr_xi_cen[ic]->GetX()[i]; y_xi_cen[ic][i] = gr_xi_cen[ic]->GetY()[i]; ye_xi_cen[ic][i] = gr_xi_cen[ic]->GetEY()[i]; x_mTScaled_xi_cen[ic][i] = (sqrt(x_xi_cen[ic][i]*x_xi_cen[ic][i]+MassXi*MassXi)-MassXi)/3; yScaled_xi_cen[ic][i] = y_xi_cen[ic][i]/3.; yeScaled_xi_cen[ic][i] = ye_xi_cen[ic][i]/3.; } gr_xi_mT_cen[ic] = new TGraphErrors(n_xi_cen[ic], x_mTScaled_xi_cen[ic], yScaled_xi_cen[ic], 0, yeScaled_xi_cen[ic]); } cout << " Read-in Xi data points done ... " << endl; const Int_t n_phi_cenMax = 7; Int_t n_phi_cen[NCen]; Double_t x_phi_cen[NCen][n_phi_cenMax], y_phi_cen[NCen][n_phi_cenMax], ye_phi_cen[NCen][n_phi_cenMax], yes_phi_cen[NCen][n_phi_cenMax]; Double_t x_mTScaled_phi_cen[NCen][n_phi_cenMax], yScaled_phi_cen[NCen][n_phi_cenMax], yeScaled_phi_cen[NCen][n_phi_cenMax], yesScaled_phi_cen[NCen][n_phi_cenMax]; TGraphErrors *gr_phi_cen[NCen]; TGraphErrors *gr_phi_mT_cen[NCen]; const Char_t *CenName_Phi[NCen] = {"40_80","10_40","0_5"}; for(int ic=0;ic<NCen;ic++) { gr_phi_cen[ic] = new TGraphErrors(Form("Run14/phi_v2_%s_PRC.txt",CenName_Phi[ic]),"%lg %lg %lg"); n_phi_cen[ic] = gr_phi_cen[ic]->GetN(); inData.open(Form("Run14/phi_v2_%s_PRC.txt",CenName_Phi[ic])); for(int i=0;i<gr_phi_cen[ic]->GetN();i++) { x_phi_cen[ic][i] = gr_phi_cen[ic]->GetX()[i]; y_phi_cen[ic][i] = gr_phi_cen[ic]->GetY()[i]; ye_phi_cen[ic][i] = gr_phi_cen[ic]->GetEY()[i]; double a, b, c, d; inData >> a >> b >> c >> d; yes_phi_cen[ic][i] = d; x_mTScaled_phi_cen[ic][i] = (sqrt(x_phi_cen[ic][i]*x_phi_cen[ic][i]+MassPhi*MassPhi)-MassPhi)/2.; yScaled_phi_cen[ic][i] = y_phi_cen[ic][i]/2.; yeScaled_phi_cen[ic][i] = ye_phi_cen[ic][i]/2.; yesScaled_phi_cen[ic][i] = yes_phi_cen[ic][i]/2.; } gr_phi_mT_cen[ic] = new TGraphErrors(n_phi_cen[ic], x_mTScaled_phi_cen[ic], yScaled_phi_cen[ic], 0, yeScaled_phi_cen[ic]); } cout << " Read-in Phi data points done ... " << endl;*/ TCanvas *c1 = new TCanvas("c1", "c1",0,0,1600,900); gStyle->SetOptFit(0); gStyle->SetOptStat(0); gStyle->SetEndErrorSize(0); gStyle->SetTitleBorderSize(0); c1->SetFillColor(10); c1->SetFillStyle(0); c1->SetBorderMode(0); c1->SetBorderSize(0); c1->SetFrameFillColor(10); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); /*TPad* p1 = new TPad("p1","p1",0.,0.5,1.0,1.0); p1->SetFillColor(10); p1->SetFillStyle(0); p1->SetBorderMode(0); p1->SetBorderSize(0); p1->SetFrameFillColor(10); p1->SetFrameFillStyle(0); p1->SetFrameBorderMode(0); //p1->SetLogy(); p1->SetGridx(0); p1->SetGridy(0); p1->SetLeftMargin(0.16); p1->SetBottomMargin(0.15); p1->SetTopMargin(0.02); p1->SetRightMargin(0.02); p1->Draw(); //p1->cd();*/ double x1 = 0.0; double x2 = 6.8; double y1 = -0.05; double y2 = 0.38; TH1 *h0 = new TH1D("h0","",1,x1, x2); h0->SetMinimum(y1); h0->SetMaximum(y2); h0->GetXaxis()->SetNdivisions(208); h0->GetXaxis()->CenterTitle(); h0->GetXaxis()->SetTitle("p_{T} (GeV/c)"); h0->GetXaxis()->SetTitleOffset(.9); h0->GetXaxis()->SetTitleSize(0.05); h0->GetXaxis()->SetLabelOffset(0.005); h0->GetXaxis()->SetLabelSize(0.04); h0->GetXaxis()->SetLabelFont(42); h0->GetXaxis()->SetTitleFont(42); h0->GetYaxis()->SetNdivisions(505); h0->GetYaxis()->CenterTitle(); h0->GetYaxis()->SetTitle("Anisotropy Parameter, v_{2}"); h0->GetYaxis()->SetTitleOffset(.9); h0->GetYaxis()->SetTitleSize(0.05); h0->GetYaxis()->SetLabelOffset(0.005); h0->GetYaxis()->SetLabelSize(0.04); h0->GetYaxis()->SetLabelFont(42); h0->GetYaxis()->SetTitleFont(42); h0->Draw("c"); double pt[2] = {1.766, 4.459}; double pt1Bin[1] = {1.866}; double v2[2] = {0.08329931, 0.126231279}; double eptLow[2] = {.766, .459}; double eptHigh[2] = {2.234, 2.341}; double eptSyst[2] = { 0.0, 0.0}; double eptSyst1Bin[1] = { 0.0}; double ev2Low[2] = { 0.00736501, 0.012241649}; double ev2High[2] = { 0.00736501, 0.012241649}; double ev2Syst[2] = {.0124948965, .02145931743 }; TGraphAsymmErrors *AlexData = new TGraphAsymmErrors(2, pt, v2, eptLow, eptHigh, ev2Low, ev2High); AlexData->SetMarkerColor(2); AlexData->SetMarkerStyle(21); AlexData->SetMarkerSize(2); AlexData->SetLineColor(2); AlexData->SetLineWidth(3); TGraphErrors *AlexDataSyst = new TGraphErrors(2, pt, v2, eptSyst, ev2Syst); AlexDataSyst->SetMarkerColor(2); AlexDataSyst->SetMarkerStyle(21); AlexDataSyst->SetMarkerSize(1.1); AlexDataSyst->SetLineColor(2); AlexDataSyst->SetLineWidth(33); // 8 data points double weights[6] = {0.4034, .3058, .1696, .0778, .0316, .0119}; double avgV2[1] = {0}; double avgV2StatErrorSquared[1] = {0}; double avgV2SystErrorSquared[1] = {0}; double avgV2StatError[1] = {0}; double avgV2SystError[1] = {0}; for(int i = 0; i < 6; i++){ cout << "V2: " << y_data_cen[1][i] << endl; avgV2[0] = avgV2[0] + (weights[i]*y_data_cen[1][i]); avgV2StatErrorSquared[0] = avgV2StatErrorSquared[0] + (weights[i]*weights[i])*(ye_data_cen[1][i]*ye_data_cen[1][i]); avgV2SystErrorSquared[0] = avgV2SystErrorSquared[0] + (weights[i]*weights[i])*(yes_data_cen[1][i]*yes_data_cen[1][i]); } avgV2StatError[0] = TMath::Sqrt(avgV2StatErrorSquared[0]); avgV2SystError[0] = TMath::Sqrt(avgV2SystErrorSquared[0]); TGraphErrors *AvgV2Data = new TGraphErrors(1, pt1Bin, avgV2, eptSyst1Bin, avgV2StatError); AvgV2Data->SetMarkerColor(4); AvgV2Data->SetMarkerStyle(22); AvgV2Data->SetMarkerSize(2.5); AvgV2Data->SetLineColor(4); //AvgV2Data->SetLineWidth(15); TGraphErrors *AvgV2DataSyst = new TGraphErrors(1, pt1Bin, avgV2, eptSyst1Bin, avgV2SystError); AvgV2DataSyst->SetMarkerColor(4); AvgV2DataSyst->SetMarkerStyle(22); AvgV2DataSyst->SetMarkerSize(2.5); AvgV2DataSyst->SetLineColor(4); AvgV2DataSyst->SetLineWidth(29); /*TH1 *hAlex1 = new TH1D("","", 7, 0, 6.8); hAlex1->SetMarkerStyle(20); hAlex1->SetMarkerColor(2); hAlex1->SetMarkerSize(1.5); //hAlex->SetBinContent(3, 0.0801251); //hAlex->SetBinError(3, 0.00244519); hAlex1->SetBinContent(1, 0.122872); hAlex1->SetBinError(1, 0.0149516); // hAlex1->SetBinContent(5, 0.0789727); //hAlex1->SetBinError(5, 0.00444987); TH1 *hAlex2 = new TH1D("","", 1, 1, 4); hAlex2->SetMarkerStyle(20); hAlex2->SetMarkerColor(2); hAlex2->SetMarkerSize(1.5); hAlex2->SetBinContent(1, 0.0801251); hAlex2->SetBinError(1, 0.00244519); TH1 *hAlex3 = new TH1D("","", 1, 4, 6.8); hAlex3->SetMarkerStyle(20); hAlex3->SetMarkerColor(2); hAlex3->SetMarkerSize(1.5); hAlex3->SetBinContent(1, 0.0789727); hAlex3->SetBinError(1, 0.00444987); ////////////////////////////////////////////////////////////////// TH1 *hAlex1Syst = new TH1D("","", 7, 0, 6.8); hAlex1Syst->SetMarkerStyle(20); hAlex1Syst->SetMarkerColor(2); hAlex1Syst->SetMarkerSize(1.5); //hAlex1Syst->SetEndErrorSize(2); hAlex1Syst->SetBinContent(1, 0.122872); hAlex1Syst->SetBinError(1, 0.02); TH1 *hAlex2Syst = new TH1D("","", 1, 1, 4); hAlex2Syst->SetMarkerStyle(20); hAlex2Syst->SetMarkerColor(2); hAlex2Syst->SetMarkerSize(1.5); hAlex2Syst->SetBinContent(1, 0.0801251); hAlex2Syst->SetBinError(1, 0.006172166); TH1 *hAlex3Syst = new TH1D("","", 1, 4, 6.8); hAlex3Syst->SetMarkerStyle(20); hAlex3Syst->SetMarkerColor(2); hAlex3Syst->SetMarkerSize(1.5); hAlex3Syst->SetBinContent(1, 0.0789727); hAlex3Syst->SetBinError(1, 0.004869332);*/ /*TLine *l1 = new TLine(x1,y1,x2,y1); l1->SetLineWidth(2); l1->Draw("same"); TLine *l2 = new TLine(x1,y2,x2,y2); l2->SetLineWidth(2); l2->Draw("same"); TLine *l3 = new TLine(x1,y1,x1,y2); l3->SetLineWidth(2); l3->Draw("same"); TLine *l4 = new TLine(x2,y1,x2,y2); l4->SetLineWidth(2); l4->Draw("same"); TLine *l0 = new TLine(x1, 0, x2, 0); l0->SetLineWidth(2); l0->SetLineStyle(2); l0->Draw("same");*/ /*for(int i=0;i<n_ks_cen;i++) { double x1 = x_ks_cen[i]-0.08; double x2 = x_ks_cen[i]+0.08; double y1 = y_ks_cen[1][i]-yes_ks_cen[1][i]; double y2 = y_ks_cen[1][i]+yes_ks_cen[1][i]; TLine *la = new TLine(x1, y1, x1, y1+0.003); la->Draw("same"); TLine *lb = new TLine(x2, y1, x2, y1+0.003); lb->Draw("same"); TLine *lc = new TLine(x1, y2, x1, y2-0.003); lc->Draw("same"); TLine *ld = new TLine(x2, y2, x2, y2-0.003); ld->Draw("same"); TLine *le = new TLine(x1, y1, x2, y1); le->SetLineWidth(2); le->Draw("same"); TLine *lf = new TLine(x1, y2, x2, y2); lf->SetLineWidth(2); lf->Draw("same"); }*/ /*gr_ks_cen[1]->Print(); gr_ks_cen[1]->SetMarkerStyle(25); gr_ks_cen[1]->SetMarkerColor(1); gr_ks_cen[1]->SetMarkerSize(1.2); gr_ks_cen[1]->SetLineColor(1); gr_ks_cen[1]->SetLineWidth(2); gr_ks_cen[1]->Draw("p");*/ /* for(int i=0;i<n_la_cen;i++) { double x1 = x_la_cen[i]-0.08; double x2 = x_la_cen[i]+0.08; double y1 = y_la_cen[1][i]-yes_la_cen[1][i]; double y2 = y_la_cen[1][i]+yes_la_cen[1][i]; TLine *la = new TLine(x1, y1, x1, y1+0.003); la->Draw("same"); TLine *lb = new TLine(x2, y1, x2, y1+0.003); lb->Draw("same"); TLine *lc = new TLine(x1, y2, x1, y2-0.003); lc->Draw("same"); TLine *ld = new TLine(x2, y2, x2, y2-0.003); ld->Draw("same"); TLine *le = new TLine(x1, y1, x2, y1); le->SetLineWidth(2); le->Draw("same"); TLine *lf = new TLine(x1, y2, x2, y2); lf->SetLineWidth(2); lf->Draw("same"); } gr_la_cen[1]->Print(); gr_la_cen[1]->SetMarkerStyle(24); gr_la_cen[1]->SetMarkerColor(1); gr_la_cen[1]->SetMarkerSize(1.2); gr_la_cen[1]->SetLineColor(1); gr_la_cen[1]->SetLineWidth(2); gr_la_cen[1]->Draw("p"); gr_xi_cen[1]->Print(); gr_xi_cen[1]->SetMarkerStyle(26); gr_xi_cen[1]->SetMarkerColor(1); gr_xi_cen[1]->SetMarkerSize(1.2); gr_xi_cen[1]->SetLineColor(1); gr_xi_cen[1]->SetLineWidth(2); gr_xi_cen[1]->Draw("p"); gr_phi_cen[1]->Print(); gr_phi_cen[1]->SetMarkerStyle(25); gr_phi_cen[1]->SetMarkerColor(1); gr_phi_cen[1]->SetMarkerSize(1.2); gr_phi_cen[1]->SetLineColor(1); gr_phi_cen[1]->SetLineWidth(2); // gr_phi_cen[1]->Draw("p");*/ for(int i=0;i<n_data_cen[1];i++) { double x1 = x_data_cen[1][i]-0.08; double x2 = x_data_cen[1][i]+0.08; double y1 = y_data_cen[1][i]-yes_data_cen[1][i]; double y2 = y_data_cen[1][i]+yes_data_cen[1][i]; double y3 = y_data_cen[1][i] - yesL_data_cen[1][i]; double y4 = y_data_cen[1][i]; TBox *box = new TBox(x1, y3, x2, y4); box->SetLineColor(16); box->SetFillColor(16); box->Draw("same"); TLine *la = new TLine(x1, y1, x1, y1+0.003); la->SetLineColor(4); la->Draw("same"); TLine *lb = new TLine(x2, y1, x2, y1+0.003); lb->SetLineColor(4); lb->Draw("same"); TLine *lc = new TLine(x1, y2, x1, y2-0.003); lc->SetLineColor(4); lc->Draw("same"); TLine *ld = new TLine(x2, y2, x2, y2-0.003); ld->SetLineColor(4); ld->Draw("same"); TLine *le = new TLine(x1, y1, x2, y1); le->SetLineWidth(2); le->SetLineColor(4); le->Draw("same"); TLine *lf = new TLine(x1, y2, x2, y2); lf->SetLineWidth(2); lf->SetLineColor(4); lf->Draw("same"); } gr_data_cen[1]->SetMarkerStyle(20); //gr_data_cen[1]->SetMarkerColorAlpha(4, 0.35); gr_data_cen[1]->SetMarkerColor(4); gr_data_cen[1]->SetMarkerSize(1.5); gr_data_cen[1]->SetLineWidth(2); gr_data_cen[1]->SetLineColor(4); gr_data_cen[1]->Draw("p"); /////MY DATA HERE//////////////////////// for(int i = 0; i < 2; i++) { double x1 = pt[i]-0.08; double x2 = pt[i]+0.08; double y1 = v2[i]-ev2Syst[i]; double y2 = v2[i]+ev2Syst[i]; TLine *la = new TLine(x1, y1, x1, y1+0.003); la->SetLineColor(2); la->Draw("same"); TLine *lb = new TLine(x2, y1, x2, y1+0.003); lb->SetLineColor(2); lb->Draw("same"); TLine *lc = new TLine(x1, y2, x1, y2-0.003); lc->SetLineColor(2); lc->Draw("same"); TLine *ld = new TLine(x2, y2, x2, y2-0.003); ld->SetLineColor(2); ld->Draw("same"); TLine *le = new TLine(x1, y1, x2, y1); le->SetLineWidth(2); le->SetLineColor(2); le->Draw("same"); TLine *lf = new TLine(x1, y2, x2, y2); lf->SetLineWidth(2); lf->SetLineColor(2); lf->Draw("same"); } //TLatex *tex = new TLatex(5.5, 0.28, "10-40%"); //tex->SetTextFont(42); //tex->SetTextSize(0.055); //tex->Draw(); TLegend *leg = new TLegend(0.1, 0.72, 0.55, 0.9); leg->SetFillStyle(0); leg->SetLineStyle(4000); leg->SetLineColor(10); //leg->SetLineWidth(1.0); leg->SetBorderSize(0.0); leg->SetTextSize(0.045); leg->AddEntry(gr_data_cen[1], "D^{0} Event Plane, 10-40% ", "p"); leg->AddEntry(AlexData, "D^{0}-Hadron Angular Corr, 20-50%", "p"); //leg->AddEntry(AvgV2Data, "D^{0} Event Plane Avg. of 1 GeV/c < p_{t} < 4 GeV/c", "p"); //leg->AddEntry(gr_xi_cen[1], "#Xi^{-}", "p"); //leg->AddEntry(gr_la_cen[1], "#Lambda", "p"); //leg->AddEntry(gr_ks_cen[1], "K_{S}", "p"); // leg->AddEntry(gr_phi_cen[1], "#phi", "p"); leg->Draw(); AlexData->Draw("SAME P"); //AlexDataSyst->Draw("SAME []"); //AvgV2Data->Draw("SAME P"); //AvgV2DataSyst->Draw("SAME []"); TString starPrelim = "STAR Preliminary"; TPaveText *starPrelimTextBox = new TPaveText(0.7, 0.7, .8, .77, "NB NDC"); starPrelimTextBox->SetFillColor(0); starPrelimTextBox->AddText(starPrelim); starPrelimTextBox->GetLine(0)->SetTextSize(.055); starPrelimTextBox->GetLine(0)->SetTextColor(2); starPrelimTextBox->Draw("SAME"); TLatex *tex = new TLatex(4.2, 0.345, "STAR Au+Au @ 200 GeV"); tex->SetTextFont(42); tex->SetTextSize(0.05); tex->Draw(); //hAlex2->Draw("SAME"); //hAlex3->Draw("SAME"); //hAlex1Syst->Draw("SAME E1"); //hAlex2Syst->Draw("SAME E1"); //hAlex3Syst->Draw("SAME E1"); // tex = new TLatex(0.2, 0.34, "a)"); //tex->SetTextFont(42); //tex->SetTextSize(0.065); //tex->Draw(); //p1->Modified(); //c1->Update(); //c1->cd(); /*TPad* p2 = new TPad("p2","",0.,0.,1.0,0.5); p2->SetFillColor(10); p2->SetFillStyle(0); p2->SetBorderMode(0); p2->SetBorderSize(0); p2->SetFrameFillColor(10); p2->SetFrameFillStyle(0); p2->SetFrameBorderMode(0); //p2->SetLogy(); p2->SetGridx(0); p2->SetGridy(0); p2->SetLeftMargin(0.16); p2->SetBottomMargin(0.18); p2->SetTopMargin(0.01); p2->SetRightMargin(0.02); p2->Draw(); p2->cd();*/ /* double x1 = 0.; double x2 = 2.8; double y1 = -0.025; double y2 = 0.18; TH1 *h0 = new TH1D("h0","",1,x1, x2); h0->SetMinimum(y1); h0->SetMaximum(y2); h0->GetXaxis()->SetNdivisions(208); h0->GetXaxis()->CenterTitle(); h0->GetXaxis()->SetTitle("(m_{T} - m_{0}) / n_{q} (GeV/c^{ 2})"); h0->GetXaxis()->SetTitleOffset(1.1); h0->GetXaxis()->SetTitleSize(0.065); h0->GetXaxis()->SetLabelOffset(0.01); h0->GetXaxis()->SetLabelSize(0.055); h0->GetXaxis()->SetLabelFont(42); h0->GetXaxis()->SetTitleFont(42); h0->GetYaxis()->SetNdivisions(505); h0->GetYaxis()->CenterTitle(); h0->GetYaxis()->SetTitle("Anisotropy Parameter, v_{2} / n_{q}"); h0->GetYaxis()->SetTitleOffset(1.1); h0->GetYaxis()->SetTitleSize(0.065); h0->GetYaxis()->SetLabelOffset(0.015); h0->GetYaxis()->SetLabelSize(0.055); h0->GetYaxis()->SetLabelFont(42); h0->GetYaxis()->SetTitleFont(42); h0->Draw("c"); TLine *l1 = new TLine(x1,y1,x2,y1); l1->SetLineWidth(2); l1->Draw("same"); TLine *l2 = new TLine(x1,y2,x2,y2); l2->SetLineWidth(2); l2->Draw("same"); TLine *l3 = new TLine(x1,y1,x1,y2); l3->SetLineWidth(2); l3->Draw("same"); TLine *l4 = new TLine(x2,y1,x2,y2); l4->SetLineWidth(2); l4->Draw("same"); TLine *l0 = new TLine(x1, 0, x2, 0); l0->SetLineWidth(2); l0->SetLineStyle(2); l0->Draw("same");*/ /*for(int i=0;i<n_ks_cen;i++) { double x1 = x_mTScaled_ks_cen[i]-0.04; double x2 = x_mTScaled_ks_cen[i]+0.04; double y1 = yScaled_ks_cen[1][i]-yesScaled_ks_cen[1][i]; double y2 = yScaled_ks_cen[1][i]+yesScaled_ks_cen[1][i]; TLine *la = new TLine(x1, y1, x1, y1+0.0015); la->Draw("same"); TLine *lb = new TLine(x2, y1, x2, y1+0.0015); lb->Draw("same"); TLine *lc = new TLine(x1, y2, x1, y2-0.0015); lc->Draw("same"); TLine *ld = new TLine(x2, y2, x2, y2-0.0015); ld->Draw("same"); TLine *le = new TLine(x1, y1, x2, y1); le->SetLineWidth(2); le->Draw("same"); TLine *lf = new TLine(x1, y2, x2, y2); lf->SetLineWidth(2); lf->Draw("same"); } gr_ks_mT_cen[1]->Print(); gr_ks_mT_cen[1]->SetMarkerStyle(25); gr_ks_mT_cen[1]->SetMarkerColor(1); gr_ks_mT_cen[1]->SetMarkerSize(1.2); gr_ks_mT_cen[1]->SetLineColor(1); gr_ks_mT_cen[1]->SetLineWidth(2); gr_ks_mT_cen[1]->Draw("p"); for(int i=0;i<n_la_cen;i++) { double x1 = x_mTScaled_la_cen[i]-0.04; double x2 = x_mTScaled_la_cen[i]+0.04; double y1 = yScaled_la_cen[1][i]-yesScaled_la_cen[1][i]; double y2 = yScaled_la_cen[1][i]+yesScaled_la_cen[1][i]; TLine *la = new TLine(x1, y1, x1, y1+0.0015); la->Draw("same"); TLine *lb = new TLine(x2, y1, x2, y1+0.0015); lb->Draw("same"); TLine *lc = new TLine(x1, y2, x1, y2-0.0015); lc->Draw("same"); TLine *ld = new TLine(x2, y2, x2, y2-0.0015); ld->Draw("same"); TLine *le = new TLine(x1, y1, x2, y1); le->SetLineWidth(2); le->Draw("same"); TLine *lf = new TLine(x1, y2, x2, y2); lf->SetLineWidth(2); lf->Draw("same"); } gr_la_mT_cen[1]->Print(); gr_la_mT_cen[1]->SetMarkerStyle(24); gr_la_mT_cen[1]->SetMarkerColor(1); gr_la_mT_cen[1]->SetMarkerSize(1.2); gr_la_mT_cen[1]->SetLineColor(1); gr_la_mT_cen[1]->SetLineWidth(2); gr_la_mT_cen[1]->Draw("p"); gr_xi_mT_cen[1]->Print(); gr_xi_mT_cen[1]->SetMarkerStyle(26); gr_xi_mT_cen[1]->SetMarkerColor(1); gr_xi_mT_cen[1]->SetMarkerSize(1.2); gr_xi_mT_cen[1]->SetLineColor(1); gr_xi_mT_cen[1]->SetLineWidth(2); gr_xi_mT_cen[1]->Draw("p"); gr_phi_mT_cen[1]->Print(); gr_phi_mT_cen[1]->SetMarkerStyle(25); gr_phi_mT_cen[1]->SetMarkerColor(1); gr_phi_mT_cen[1]->SetMarkerSize(1.2); gr_phi_mT_cen[1]->SetLineColor(1); gr_phi_mT_cen[1]->SetLineWidth(2); // gr_phi_mT_cen[1]->Draw("p");*/ /* for(int i=0;i<n_data_cen[1];i++) { double x1 = x_mTScaled_data_cen[1][i]-0.04; double x2 = x_mTScaled_data_cen[1][i]+0.04; double y1 = yScaled_data_cen[1][i]-yesScaled_data_cen[1][i]; double y2 = yScaled_data_cen[1][i]+yesScaled_data_cen[1][i]; double y3 = yScaled_data_cen[1][i] - yesLScaled_data_cen[1][i]; double y4 = yScaled_data_cen[1][i]; TBox *box = new TBox(x1, y3, x2, y4); box->SetLineColor(16); box->SetFillColor(16); box->Draw("same"); TLine *la = new TLine(x1, y1, x1, y1+0.0015); la->SetLineColor(4); la->Draw("same"); TLine *lb = new TLine(x2, y1, x2, y1+0.0015); lb->SetLineColor(4); lb->Draw("same"); TLine *lc = new TLine(x1, y2, x1, y2-0.0015); lc->SetLineColor(4); lc->Draw("same"); TLine *ld = new TLine(x2, y2, x2, y2-0.0015); ld->SetLineColor(4); ld->Draw("same"); TLine *le = new TLine(x1, y1, x2, y1); le->SetLineColor(4); le->SetLineWidth(2); le->Draw("same"); TLine *lf = new TLine(x1, y2, x2, y2); lf->SetLineColor(4); lf->SetLineWidth(2); lf->Draw("same"); }*/ //gr_data_mT_cen[1]->SetMarkerStyle(20); //gr_data_mT_cen[1]->SetMarkerColor(4); //gr_data_mT_cen[1]->SetMarkerSize(1.5); //gr_data_mT_cen[1]->SetLineWidth(2); //gr_data_mT_cen[1]->SetLineColor(4); //gr_data_mT_cen[1]->Draw("p"); //TLegend *leg = new TLegend(0.22, 0.66, 0.5, 0.96); //leg->SetFillStyle(0); //leg->SetLineStyle(4000); //leg->SetLineColor(-1); //leg->SetLineWidth(0); //leg->SetTextSize(0.06); //leg->AddEntry(gr_data_mT_cen[1], "D^{0}", "p"); //leg->AddEntry(gr_xi_mT_cen[1], "#Xi^{-}", "p"); //leg->AddEntry(gr_la_mT_cen[1], "#Lambda", "p"); //leg->AddEntry(gr_ks_mT_cen[1], "K_{S}", "p"); // leg->AddEntry(gr_phi_mT_cen[1], "#phi", "p"); //leg->Draw(); //TLatex *tex = new TLatex(1.2, 0.155, "STAR Au+Au @ 200 GeV"); // tex->SetTextFont(42); //tex->SetTextSize(0.065); //tex->Draw(); //TLatex *tex = new TLatex(2.27, 0.13, "10-40%"); //tex->SetTextFont(42); //tex->SetTextSize(0.065); //tex->Draw(); //tex = new TLatex(0.08, 0.155, "b)"); //tex->SetTextFont(42); //tex->SetTextSize(0.065); //tex->Draw(); //p2->Modified(); //c1->Update(); //c1->cd(); //c1->SaveAs("v2CompareWithData.eps"); c1->SaveAs("v2_plot.png"); }
void control(TString var,TString bin, TCut cuts, TCut cutsA, TString cutpoint,bool log,Double_t ymax){ setstyle(); TH1::SetDefaultSumw2(true); TCanvas *c2 = new TCanvas("canvas"+var+cutpoint,"canname"+var+cutpoint,700,800); TPad *mainPad = new TPad("","",0.01,0.25,0.99,0.99); mainPad->SetNumber(1); mainPad->Draw(); TPad *ratioPad = new TPad("","",0.01,0.01,0.99,0.25); ratioPad->SetNumber(2); ratioPad->Draw(); c2->cd(1); TCut lo = cuts && mu_pt_lo; TCut hi = cuts && mu_pt_hi; // TH1D *Ctrl_lo = GetHist("AS",kBlack,var,lo,bin,astQCD,cutpoint); // TH1D *Sig_lo = GetHist("S",kRed,var,lo,bin,stQCD,cutpoint); TH1D *Ctrl_hi = GetHist("AS",kBlack,var,cuts,bin,astQCD,cutpoint); TH1D *Sig_hi = GetHist("S",kRed,var,cuts,bin,stQCD,cutpoint); // Ctrl_lo->Scale(1.94); // Sig_lo->Scale(1.94); TH1D *Ctrl = Ctrl_hi->Clone(); TH1D *Sig = Sig_hi->Clone(); // Ctrl->Add(Ctrl_hi); // Sig->Add(Sig_hi); Sig->Scale(intlumi); // TH1D *Ctrl = GetHist("AS",kBlack,var,cuts,bin,astQCD,cutpoint); if(Ctrl->Integral()!=0){ Ctrl->Scale(Sig->Integral()/Ctrl->Integral()); } if(log){ c2->cd(1)->SetLogy();} TLegend *leg = new TLegend(0.564,0.719,0.775,0.875); leg->SetTextSize(0.054); leg->SetFillColor(0); leg->SetLineColor(0); // leg->AddEntry(Ctrl,"Anti-Selected","LF"); leg->AddEntry(Sig,"Selected","LF"); leg->AddEntry(Ctrl,"Anti-Selected","LF"); Ctrl->Draw("EHIST9"); Sig->Draw("E9same"); Sig->SetMarkerStyle(20); Sig->SetMarkerColor(kRed); leg->Draw("same"); Ctrl->SetTitle(); Ctrl->GetXaxis()->SetTitle(var); if(log){ Ctrl->GetYaxis()->SetRangeUser(0.001,ymax); } else{ ymax=(Ctrl->GetMaximum()*1.6); Ctrl->GetYaxis()->SetRangeUser(0.,ymax); } TH1D *RatioBottom = (TH1D*)Ctrl->Clone("Ratiob"); TH1D *RatioTop = (TH1D*)Sig->Clone("Ratiot"); RatioTop->GetYaxis()->SetTitle("Selected / Anti-Selected"); RatioTop->GetXaxis()->SetTitle(); RatioTop->SetTitle(); RatioTop->Divide(RatioBottom); c2->cd(2); gPad->SetGridx(); gPad->SetGridy(); RatioTop->SetTitleSize(0.1, "XYZ"); RatioTop->SetTitleOffset(0.55, "X"); RatioTop->SetTitleOffset(0.3, "Y"); RatioTop->SetLabelSize(0.06,"XY"); RatioTop->GetYaxis()->SetRangeUser(-2.,5.0); RatioTop->SetLineColor(kBlack); RatioTop->Draw(); TBox *unity = new TBox(RatioTop->GetXaxis()->GetBinLowEdge(RatioTop->GetXaxis()->GetFirst()), 0.79,RatioTop->GetXaxis()->GetBinLowEdge(RatioTop->GetXaxis()->GetLast()), 1.21); unity->SetLineWidth(2); unity->SetLineColor(2); unity->SetFillColor(2); unity->SetFillStyle(3002); unity->Draw(); c2->Update(); c2->SaveAs(plots+"SAS_Muon_10to25"+var+"_"+cutpoint+".png"); // c2->Close(); }
void CorrPtCut(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname = "LHC10d4", char *filename="Et.ESD.new.sim.LHC10d4.pp.merged.root"){ gStyle->SetOptTitle(0); gStyle->SetOptStat(0); gStyle->SetOptFit(0); TCanvas *c = new TCanvas("c","c",500,400); c->SetTopMargin(0.04); c->SetRightMargin(0.04); c->SetLeftMargin(0.181452); c->SetBottomMargin(0.134409); c->SetBorderSize(0); c->SetFillColor(0); c->SetFillColor(0); c->SetBorderMode(0); c->SetFrameFillColor(0); c->SetFrameBorderMode(0); float etacut = 0.7; cout<<"Pt cut = 150 MeV/c"<<endl; TH1D *High = GetHisto(0.15-.001,"High",filename,etacut); float tpcHigh=highbound; float tpcLow=lowbound; float tpcsyserr = syserr; float tpcmean = mean; float x1 = High->GetXaxis()->GetBinLowEdge(1); //TBox *tpcBox = new TBox(-x1*.99,1.0-tpcLow,x1*.99,1.0-tpcHigh); TBox *tpcBox = new TBox(-x1*.99,1.0-(mean-syserr),x1*.99,1.0-(mean+syserr)); tpcBox->SetFillColor(5); tpcBox->SetLineColor(0); tpcBox->SetFillStyle(1001); cout<<"Pt cut = 100 MeV/c"<<endl; TH1D *Low = GetHisto(0.1-.001,"Low",filename,etacut); float itsHigh=highbound; float itsLow=lowbound; float itssyserr = syserr; float itsmean = mean; cout<<Form("dataset & %2.4f \\pm %2.4f & %2.4f \\pm %2.4f \\",itsmean,itssyserr,tpcmean,tpcsyserr)<<endl; float x = Low->GetXaxis()->GetBinLowEdge(1); //TBox *itsBox = new TBox(-x*.99,1.0-itsLow,x*.99,1.0-itsHigh); TBox *itsBox = new TBox(-x1*.99,1.0-(mean-syserr),x1*.99,1.0-(mean+syserr)); itsBox->SetFillColor(5); itsBox->SetLineColor(0); itsBox->SetFillStyle(1001); cout<<"Pt cut = 50 MeV/c"<<endl; TH1D *Lowest = GetHisto(0.05-.001,"Lowest",filename,etacut); TF1 *funcLow = new TF1("funcLow","[0]",-.7,.7); funcLow->SetParameter(0,0.01); Low->Fit(funcLow); TF1 *funcHigh = new TF1("funcHigh","[0]",-.7,.7); funcHigh->SetParameter(0,0.02); High->Fit(funcLow); High->SetMaximum(0.06); High->SetMinimum(0.0); High->SetMarkerColor(2); Low->SetMarkerColor(4); High->SetLineColor(2); Low->SetLineColor(4); High->SetMinimum(0.0); High->SetMarkerStyle(20); Low->SetMarkerStyle(21); Lowest->SetMarkerStyle(22); High->Draw(); tpcBox->Draw("f"); High->Draw("same"); itsBox->Draw("f"); //return; Low->Draw("same"); //Lowest->Draw("same"); TLatex *tex = new TLatex(-0.723444,0.0373593+0.019,prodname); tex->SetTextSize(0.0537634); tex->Draw(); TLegend *leg = new TLegend(0.217742,0.696237,0.477823,0.873656); leg->AddEntry(High,"p_{T} cut-off = 0.15 GeV/c"); leg->AddEntry(Low,"p_{T} cut-off = 0.1 GeV/c"); //leg->AddEntry(Lowest,"p_{T} cut-off = 0.05 GeV/c"); leg->SetFillStyle(0); leg->SetFillColor(0); leg->SetBorderSize(0); leg->SetTextSize(0.0537634); leg->Draw(); c->SaveAs(Form("pics/%s/fptcut.eps",shortprodname)); c->SaveAs(Form("pics/%s/fptcut.png",shortprodname)); c->SaveAs(Form("pics/%s/fptcut.pdf",shortprodname)); }
void Plot(TString var,TCut cut,TString bins,Double_t xmax,TString cutpoint){ setstyle(); TH1::SetDefaultSumw2(true); TCanvas *c2 = new TCanvas("canvas"+var+cutpoint,"canname"+var+cutpoint,800,800); TPad *mainPad = new TPad("","",0.01,0.25,0.99,0.99); mainPad->SetNumber(1); mainPad->Draw(); TPad *ratioPad = new TPad("","",0.01,0.01,0.99,0.25); ratioPad->SetNumber(2); ratioPad->Draw(); c2->cd(1); // if (cutpoint == "noHT"){ TCut cut = numpj; TCut cutData = numpjData;} // else if (cutpoint == "HT200"){ TCut cut = HT200; TCut cutData = HT200Data; }// // else if (cutpoint == "anoHT"){ TCut cut = anumpj; TCut cutData = anumpjData;} // else if (cutpoint == "aHT200"){ TCut cut = aHT200; TCut cutData = aHT200Data; } // else if (cutpoint == "HT300"){ TCut cut = HT300; TCut cutData = HT300Data;} // else if (cutpoint == "HT350"){ TCut cut = HT350; TCut cutData = HT350Data; } // else if (cutpoint == "aT"){ TCut cut = aT; TCut cutData = aTData;} // else if (cutpoint == "early"){TCut cut = earlyaT; TCut cutData = earlyaTData;} //else{cout << "ERRORRRR: BRaaaaaaaaaaaaaaaaaains" << endl; } TCut cutData = trig && hbhe && cut; TH1D* lm0 = GetHist("LM0",kRed,var,cut,bins,tLM0,cutpoint); /// cout << "lm0" << endl; TH1D* lm1 = GetHist("LM1",kRed,var,cut,bins,tLM1,cutpoint); // cout << "lm1" << endl; TH1D* qcd = GetHist("QCD_AllPtBins_7TeV_Pythia",kOrange+4,var,cut && mu_pt_hi,bins,tQCD,cutpoint); // cout << "qcd" << endl; TH1D* data = GetHist("Data",1,var,cutData,bins,tData,cutpoint); // cout << "data" << endl; TH1D* W = GetHist("Wjets_vols",kBlue,var,cut,bins,tW,cutpoint); //cout << "W" << endl; TH1D* tt = GetHist("ttbarTauola",kGreen,var,cut,bins,tTT,cutpoint); // cout << "tt" << endl; TH1D* Z = GetHist("ZJets_madgraph",kYellow,var,cut,bins,tZ,cutpoint); // cout << "Z" << endl; //TH1D* qcd_lo = GetHist("QCD_AllPtBins_7TeV_Pythia",kOrange+4,var,cut && mu_pt_lo,bins,tQCD,cutpoint); // qcd_lo->Scale(1.94); // qcd->Add(qcd_lo); // TH1D* SM = GetHist("SM",kGray+2,var,cut,binstLM0,cutpoint); lm1->SetLineStyle(2); W->Scale(1.29557302); tt->Scale(1.65789474); Z->Scale(3048./2400.); TH1::SetDefaultSumw2(true); TH1D *SM = (TH1D*)qcd->Clone(); SM->Add(Z); SM->Add(tt); SM->Add(W); //SM->SetLineColor(kGray+2); // SM->SetFillStyle(3001); // SM->SetFillColor(kGray+2); // SM->SetMarkerSize(0.); //for(int bnum = 1; bnum <9; bnum++){ // if(data->GetBinContent(bnum)>0){ // cout << "Bin Number " << bnum << " has qcd " << qcd->GetBinContent(bnum) << " and data " << data->GetBinContent(bnum) << " and SM " << SM->GetBinContent(bnum) << " and scale factor to QCD " << data->GetBinContent(bnum)/qcd->GetBinContent(bnum) << " and scale factor to SM " << data->GetBinContent(bnum)/SM->GetBinContent(bnum) << endl; // } // } c2->cd(1)->SetLogy(); // data->Draw("PE0"); SM->Draw("E"); THStack bkg("bkg","test stacked histograms"); bkg.Add(Z); bkg.Add(tt); bkg.Add(W); bkg.Add(qcd); bkg.Draw("HIST0SAME"); // data->Draw("PE0SAME"); //qcd->Draw("HIST0same"); /* W->Draw("HIST0same"); Z->Draw("HIST0same"); tt->Draw("HIST0same"); */ lm0->Draw("HIST0same"); lm0->SetLineColor(1); lm0->SetFillColor(0); lm1->Draw("HIST0same"); lm1->SetLineColor(1); lm1->SetFillColor(0); lm1->SetLineStyle(2); // data->Draw("EPSAME"); if(xmax == 1337){ double ymax=SM->GetMaximum()*12.6;} else{ double ymax=SM->GetMaximum()*10.6;} SM->GetYaxis()->SetRangeUser(0.05,ymax); if (var=="AlphaT_Lep") { data->GetXaxis()->SetRangeUser(0.,xmax);} SM->GetXaxis()->SetTitle(var); SM->SetTitle(); TLegend *leg = new TLegend(0.73803,0.591026,0.88137,0.880819); // leg->SetShadowColor(0); //leg->SetBorderSize(0); //leg->SetFillStyle(4100); leg->SetTextSize(0.04); leg->SetFillColor(0); leg->SetLineColor(0); // leg->AddEntry(data,"DATA","PL"); leg->AddEntry(qcd,"QCD","FL"); leg->AddEntry(W,"W","FL"); leg->AddEntry(Z,"Z","FL"); leg->AddEntry(tt,"TTbar","FL"); leg->AddEntry(lm0,"LM0","FL"); leg->AddEntry(lm1,"LM1","FL"); //leg->AddEntry(SM,"SM BKGD","FL"); leg->Draw("same"); TLatex *prelim = new TLatex(0.1152,0.81981,"CMS preliminary 2010"); TLatex *lumi = new TLatex(0.1015,.9403,"#scale[0.8]{#int L dt = " +luminum+ "pb^{-1}, #sqrt{s} = 7 TeV}"); prelim->SetNDC(); lumi->SetNDC(); // prelim->Draw("same"); lumi->Draw("same"); TH1D *RatioBottom = (TH1D*)SM->Clone("Ratiob"); TH1D *RatioTop = (TH1D*)data->Clone("Ratiot"); RatioTop->GetYaxis()->SetTitle("data / sim"); RatioTop->GetXaxis()->SetTitle(); RatioTop->Divide(RatioBottom); c2->cd(2); gPad->SetGridx(); gPad->SetGridy(); RatioTop->SetTitleSize(0.1, "XYZ"); RatioTop->SetTitleOffset(0.55, "X"); RatioTop->SetTitleOffset(0.3, "Y"); RatioTop->SetLabelSize(0.06,"XY"); RatioTop->GetYaxis()->SetRangeUser(-2.,4.0); RatioTop->Draw(); RatioTop->GetYaxis()->SetLabelSize(0.05); TBox *unity = new TBox(RatioTop->GetXaxis()->GetBinLowEdge(RatioTop->GetXaxis()->GetFirst()), 0.89,RatioTop->GetXaxis()->GetBinLowEdge(RatioTop->GetXaxis()->GetLast()), 1.11); unity->SetLineWidth(2); unity->SetLineColor(2); unity->SetFillColor(2); unity->SetFillStyle(3002); unity->Draw(); c2->Update(); if(cutpoint == "early"){ c2->SaveAs(plots+erlee+"Muon_ND"+selec+var+"_"+cutpoint+".png"); } else if (xmax == 90003){ c2->SaveAs(plots+"Muon_ND"+selec+"_zooomed_"+var+"_"+cutpoint+".png");} else{ c2->SaveAs(plots+"Muon_ND"+ptsec++selec+var+"_"+cutpoint+".png");} c2->Close(); }
void plotXY(char* fname){ // input: root file from GBL gStyle->SetOptStat(0); Double_t w = 1.2; // number of RMS for gaussian fit TString filename = fname; TCanvas *cTop = new TCanvas("cTop","Residuals in lab frame, TOP", 800, 1000); TCanvas *cBot = new TCanvas("cBot","Residuals in lab frame, BOTTOM",800, 1000); cTop->SetFillColor(kBlue-10); cTop->SetFillStyle(3001); cBot->SetFillColor(kMagenta-10); cBot->SetFillStyle(3001); Double_t halfWid = 38.34/2.; Double_t halfLen = 98.33/2.; TBox *module = new TBox(-halfLen, -halfWid, halfLen, halfWid); module->SetLineColor(kMagenta); module->SetFillStyle(0); Int_t ic=0; TFile *f = new TFile(filename.Data()); // extract string Int_t idx2 = filename.Index("/"); Int_t idx1 = filename.Index("_"); TString outn = filename(idx1+1,idx2-(idx1+1)); TString outname ="predXY_"; outname += outn.Data(); outname += ".txt"; TString topName ="predXY_"; topName += outn.Data(); topName += "_topO.gif"; TString botName ="predXY_"; botName += outn.Data(); botName += "_botO.gif"; // ofstream outf(outname.Data()); // top Int_t nrow = 13; Double_t space = 0.007; Double_t space1 = 0.03; Double_t y2 = 1./13*nrow-space1; Double_t y1 = 1./13*(--nrow)-space1; TPad *tp1 = new TPad("tp1","tp1",0.33,y1,0.66,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *tp2 = new TPad("tp2","tp2",0.33,y1,0.66,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *tp3 = new TPad("tp3","tp3",0.33,y1,0.66,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *tp4 = new TPad("tp4","tp4",0.33,y1,0.66,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *tp5 = new TPad("tp5","tp5",0.33,y1,0.66,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *tp6 = new TPad("tp6","tp6",0.33,y1,0.66,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; Double_t off = 0.12; off = 0.165; y1 -= space1; y2 -= space1; space1 *= 2; TPad *tp7 = new TPad("tp7","tp7",0.+off,y1,0.33+off,y2); TPad *tp8 = new TPad("tp8","tp8",0.66-off,y1,1.-off,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *tp9 = new TPad("tp9","tp9",0.+off,y1,0.33+off,y2); TPad *tp10 = new TPad("tp10","tp10",0.66-off,y1,1.-off,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *tp11 = new TPad("tp11","tp11",0.+off,y1,0.33+off,y2); TPad *tp12 = new TPad("tp12","tp12",0.66-off,y1,1.-off,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *tp13 = new TPad("tp13","tp13",0.+off,y1,0.33+off,y2); TPad *tp14 = new TPad("tp14","tp14",0.66-off,y1,1.-off,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *tp15 = new TPad("tp15","tp15",0.+off,y1,0.33+off,y2); TPad *tp16 = new TPad("tp16","tp16",0.66-off,y1,1.-off,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *tp17 = new TPad("tp17","tp17",0.+off,y1,0.33+off,y2); TPad *tp18 = new TPad("tp18","tp18",0.66-off,y1,1.-off,y2); cout << " TOP " << endl; cTop->cd(); tp1->Draw(); tp2->Draw(); tp3->Draw(); tp4->Draw(); tp5->Draw(); tp6->Draw(); tp7->Draw(); tp8->Draw(); tp9->Draw(); tp10->Draw(); tp11->Draw(); tp12->Draw(); tp13->Draw(); tp14->Draw(); tp15->Draw(); tp16->Draw(); tp17->Draw(); tp18->Draw(); ic = 2; Int_t ipad=0; for(Int_t i=1; i<4; i++){ TString hisname = "h_xy_module_L"; hisname += i; hisname += "t_halfmodule_axial_sensor0"; TString layer = "L"; layer+=i; layer+= "TA"; TH2D *his2 = (TH2D*) f->Get(hisname.Data()); TH1D *his = (TH1D*)his2->ProjectionY(); ipad++; TString pd = "tp"; pd+=ipad; TPad *pad = (TPad*) cTop->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); Double_t low = his->GetMean()-w*his->GetRMS(); Double_t up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); TF1 *fit = his->GetFunction("gaus"); // cout << "sensor " << i << " axial mean : " << his->GetMean()*1000. << " - RMS : " << his->GetRMS()*1000. << " (um) " << " " << his->GetEntries() << endl; // cout << "sensor " << i << " axial mu : " << fit->GetParameter(1)*1000. << " - sigma : " << fit->GetParameter(2)*1000. << " (um) " << endl; // outf << layer.Data() << " " << fit->GetParameter(1)*1000. << " " << fit->GetParameter(2)*1000. << " " << his->GetEntries() << endl; hisname = "h_xy_module_L"; hisname += i; hisname += "t_halfmodule_stereo_sensor0"; layer = "L"; layer+=i; layer+= "TS"; his2 = (TH2D*) f->Get(hisname.Data()); his = (TH1D*)his2->ProjectionY(); ipad++; pd = "tp"; pd+=ipad; pad = (TPad*) cTop->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); } // ic = 19; for(Int_t i=4; i<7; i++){ TString hisname = "h_xy_module_L"; hisname += i; TString hisname2 = hisname; hisname += "t_halfmodule_axial_hole_sensor0"; hisname2 += "t_halfmodule_axial_slot_sensor0"; TH2D *hisOther = (TH2D*) f->Get(hisname2.Data()); Double_t norma2 = hisOther->GetMaximum(); TString layer = "L"; layer+=i; layer+= "TAHo"; TH2D *his2 = (TH2D*) f->Get(hisname.Data()); TH1D *his = (TH1D*)his2->ProjectionY(); Double_t norma1 = his2->GetMaximum(); Double_t normamax = TMath::Max(norma1,norma2); his2->SetMaximum(normamax); ipad++; TString pd = "tp"; pd+=ipad; TPad *pad = (TPad*) cTop->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); Double_t low = his->GetMean()-w*his->GetRMS(); Double_t up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); TF1 *fit = his->GetFunction("gaus"); hisname = "h_xy_module_L"; hisname += i; hisname2 = hisname; hisname += "t_halfmodule_stereo_hole_sensor0"; hisname2 += "t_halfmodule_stereo_slot_sensor0"; TH2D *hisOther = (TH2D*) f->Get(hisname2.Data()); norma2 = hisOther->GetMaximum(); TString layer = "L"; layer+=i; layer+= "TAHo"; TH2D *his2 = (TH2D*) f->Get(hisname.Data()); TH1D *his = (TH1D*)his2->ProjectionY(); norma1 = his2->GetMaximum(); normamax2 = TMath::Max(norma1,norma2); his2->SetMaximum(normamax2); layer = "L"; layer+=i; layer+= "TSHo"; his2 = (TH2D*) f->Get(hisname.Data()); his = (TH1D*)his2->ProjectionY(); ipad++; ipad++; pd = "tp"; pd+=ipad; pad = (TPad*) cTop->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); hisname = "h_xy_module_L"; hisname += i; hisname += "t_halfmodule_axial_slot_sensor0"; layer = "L"; layer+=i; layer+= "TASl"; his2 = (TH2D*) f->Get(hisname.Data()); his2->SetMaximum(normamax); his = (TH1D*)his2->ProjectionY(); ipad--; pd = "tp"; pd+=ipad; pad = (TPad*) cTop->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); hisname = "h_xy_module_L"; hisname += i; hisname += "t_halfmodule_stereo_slot_sensor0"; layer = "L"; layer+=i; layer+= "TSSl"; his2 = (TH2D*) f->Get(hisname.Data()); his2->SetMaximum(normamax2); his = (TH1D*)his2->ProjectionY(); ipad++; ipad++; pd = "tp"; pd+=ipad; pad = (TPad*) cTop->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); } cout << endl; cout << "------------------------" << endl; cout << endl; cout << " BOTTOM " << endl; nrow = 13; space = 0.007; space1 = 0.03; y2 = 1./13*nrow-space1; y1 = 1./13*(--nrow)-space1; TPad *bp1 = new TPad("bp1","bp1",0.33,y1,0.66,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *bp2 = new TPad("bp2","bp2",0.33,y1,0.66,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *bp3 = new TPad("bp3","bp3",0.33,y1,0.66,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *bp4 = new TPad("bp4","bp4",0.33,y1,0.66,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *bp5 = new TPad("bp5","bp5",0.33,y1,0.66,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *bp6 = new TPad("bp6","bp6",0.33,y1,0.66,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; off = 0.165; y1 -= space1; y2 -= space1; space1 *= 2; TPad *bp7 = new TPad("bp7","bp7",0.+off,y1,0.33+off,y2); TPad *bp8 = new TPad("bp8","bp8",0.66-off,y1,1.-off,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *bp9 = new TPad("bp9","bp9",0.+off,y1,0.33+off,y2); TPad *bp10 = new TPad("bp10","bp10",0.66-off,y1,1.-off,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *bp11 = new TPad("bp11","bp11",0.+off,y1,0.33+off,y2); TPad *bp12 = new TPad("bp12","bp12",0.66-off,y1,1.-off,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *bp13 = new TPad("bp13","bp13",0.+off,y1,0.33+off,y2); TPad *bp14 = new TPad("bp14","bp14",0.66-off,y1,1.-off,y2); y2 = y1-space; y1 = 1./13.*(--nrow)-space1; TPad *bp15 = new TPad("bp15","bp15",0.+off,y1,0.33+off,y2); TPad *bp16 = new TPad("bp16","bp16",0.66-off,y1,1.-off,y2); y2 = y1; y1 = 1./13.*(--nrow)-space1; TPad *bp17 = new TPad("bp17","bp17",0.+off,y1,0.33+off,y2); TPad *bp18 = new TPad("bp18","bp18",0.66-off,y1,1.-off,y2); cBot->cd(); bp1->Draw(); bp2->Draw(); bp3->Draw(); bp4->Draw(); bp5->Draw(); bp6->Draw(); bp7->Draw(); bp8->Draw(); bp9->Draw(); bp10->Draw(); bp11->Draw(); bp12->Draw(); bp13->Draw(); bp14->Draw(); bp15->Draw(); bp16->Draw(); bp17->Draw(); bp18->Draw(); cBot->cd(); bp1->Draw(); bp2->Draw(); bp3->Draw(); bp4->Draw(); bp5->Draw(); bp6->Draw(); bp7->Draw(); bp8->Draw(); bp9->Draw(); bp10->Draw(); bp11->Draw(); bp12->Draw(); bp13->Draw(); bp14->Draw(); bp15->Draw(); bp16->Draw(); bp17->Draw(); bp18->Draw(); ic=0; ipad = 0; for(Int_t i=1; i<4; i++){ TString hisname = "h_xy_module_L"; hisname += i; TString hisname2 = hisname; hisname += "b_halfmodule_stereo_sensor0"; hisname2 += "b_halfmodule_axial_sensor0"; TH2D *hisOther = (TH2D*) f->Get(hisname2.Data()); Double_t norma2 = hisOther->GetMaximum(); TString layer = "L"; layer+=i; layer+= "BS"; TH2D *his2 = (TH2D*) f->Get(hisname.Data()); Double_t norma1 = his2->GetMaximum(); Double_t normamax = TMath::Max(norma1,norma2); // his2->SetMaximum(normamax); TH1D *his = (TH1D*)his2->ProjectionY(); if(layer.Contains("1")){his->SetFillColor(kRed);} else if(layer.Contains("2")){his->SetFillColor(kOrange);} else if(layer.Contains("3")){his->SetFillColor(kYellow);} else if(layer.Contains("4")){his->SetFillColor(kGreen);} else if(layer.Contains("5")){his->SetFillColor(kCyan);} else if(layer.Contains("6")){his->SetFillColor(kBlue);} if(layer.Contains("A")){his->SetFillStyle(3007);} else if(layer.Contains("S")){his->SetFillStyle(3004);} // cBot->cd(++ic); ipad++; TString pd = "bp"; pd+=ipad; TPad *pad = (TPad*) cBot->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); Double_t low = his->GetMean()-w*his->GetRMS(); Double_t up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); TF1 *fit = his->GetFunction("gaus"); hisname = "h_xy_module_L"; hisname += i; hisname += "b_halfmodule_axial_sensor0"; layer = "L"; layer+=i; layer+= "BA"; his2 = (TH2D*) f->Get(hisname.Data()); // his2->SetMaximum(normamax); his = (TH1D*)his2->ProjectionY(); ipad++; pd = "bp"; pd+=ipad; pad = (TPad*) cBot->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); } for(Int_t i=4; i<7; i++){ TString hisname = "h_xy_module_L"; hisname += i; TString hisname2 = hisname; hisname += "b_halfmodule_stereo_hole_sensor0"; hisname2 += "b_halfmodule_stereo_slot_sensor0"; TH2D *hisOther = (TH2D*) f->Get(hisname2.Data()); Double_t norma2 = hisOther->GetMaximum(); TString layer = "L"; layer+=i; layer+= "BSHo"; TH2D *his2 = (TH2D*) f->Get(hisname.Data()); TH1D *his = (TH1D*)his2->ProjectionY(); Double_t norma1 = his2->GetMaximum(); Double_t normamax1 = TMath::Max(norma1,norma2); his2->SetMaximum(normamax1); ipad++; TString pd = "bp"; pd+=ipad; TPad *pad = (TPad*) cBot->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); Double_t low = his->GetMean()-w*his->GetRMS(); Double_t up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); TF1 *fit = his->GetFunction("gaus"); hisname = "h_xy_module_L"; hisname += i; TString hisname2 = hisname; hisname += "b_halfmodule_axial_hole_sensor0"; hisname2 += "b_halfmodule_axial_slot_sensor0"; TH2D *hisOther = (TH2D*) f->Get(hisname2.Data()); Double_t norma2 = hisOther->GetMaximum(); TString layer = "L"; layer+=i; layer+= "BAHo"; TH2D *his2 = (TH2D*) f->Get(hisname.Data()); TH1D *his = (TH1D*)his2->ProjectionY(); Double_t norma1 = his2->GetMaximum(); Double_t normamax2 = TMath::Max(norma1,norma2); his2->SetMaximum(normamax2); ipad++; ipad++; pd = "bp"; pd+=ipad; pad = (TPad*) cBot->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); hisname = "h_xy_module_L"; hisname += i; hisname += "b_halfmodule_stereo_slot_sensor0"; layer = "L"; layer+=i; layer+= "BSSl"; his2 = (TH2D*) f->Get(hisname.Data()); his2->SetMaximum(normamax1); his = (TH1D*)his2->ProjectionY(); ipad--; pd = "bp"; pd+=ipad; pad = (TPad*) cBot->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); hisname = "h_xy_module_L"; hisname += i; hisname += "b_halfmodule_axial_slot_sensor0"; layer = "L"; layer+=i; layer+= "BASl"; his2 = (TH2D*) f->Get(hisname.Data()); his2->SetMaximum(normamax2); his = (TH1D*)his2->ProjectionY(); ipad++; ipad++; pd = "bp"; pd+=ipad; pad = (TPad*) cBot->GetListOfPrimitives()->FindObject(pd.Data()); pad->cd(); low = his->GetMean()-w*his->GetRMS(); up = his->GetMean()+w*his->GetRMS(); his->Fit("gaus","Q0","",low,up); his2->Draw("colz"); module->Draw("same"); fit = his->GetFunction("gaus"); } // outf.close(); cTop->SaveAs(topName.Data()); cBot->SaveAs(botName.Data()); }
void FakePhotonSystematic(){ TFile FMCRSSig("DsTolnu/SP1005Skim/DsReco/Final/HistosForFit.root"); TFile FMCWSSig("DsTolnu/SP1005Skim/DsReco/FinalWS/HistosForFit.root"); //TFile FMCRS("DsTolnu/MC/Final/HistosForFit.root"); //TFile FMCWS("DsTolnu/MC/FinalWS/HistosForFit.root"); TFile FMCRS("DsTolnu/SP1005Skim/DsReco/Final/HistosForFit.root"); TFile FMCWS("DsTolnu/SP1005Skim/DsReco/FinalWS/HistosForFit.root"); TFile FDataRS("DsTolnu/Data/Final/HistosForFit.root"); TFile FDataWS("DsTolnu/Data/FinalWS/HistosForFit.root"); TCanvas C; C.Clear(); C.Print("FakePhotonSystematic.ps["); C.Clear(); C.Divide(2,2); C.cd(1); // TH1F* HMCRS=(TH1F*)FMCRS.Get("HEvtMultiplicity"); // HMCRS->SetTitle(TString("MC RS =")+(long)HMCRS->GetMean()+"."+(long)(1000*(HMCRS->GetMean()-1.))); // HMCRS->Draw(); // C.cd(2); // TH1F* HMCWS=(TH1F*)FMCWS.Get("HEvtMultiplicity"); // HMCWS->SetTitle(TString("MC WS =")+(long)HMCWS->GetMean()+"."+(long)(1000*(HMCWS->GetMean()-1.))); // HMCWS->Draw(); C.cd(3); TH1F* HDataRS=(TH1F*)FDataRS.Get("HEvtMultiplicity"); HDataRS->SetTitle(TString("Data RS =")+(long)HDataRS->GetMean()+"."+(long)(1000*(HDataRS->GetMean()-1.))); HDataRS->Draw(); C.cd(4); TH1F* HDataWS=(TH1F*)FDataWS.Get("HEvtMultiplicity"); HDataWS->SetTitle(TString("Data WS =")+(long)HDataWS->GetMean()+"."+(long)(1000*(HDataWS->GetMean()-1.))); HDataWS->Draw(); C.Print("FakePhotonSystematic.ps"); C.Clear(); C.Divide(2,2); C.cd(1); TH1F* HSigMCRS=(TH1F*)FMCRSSig.Get("HEvtMultiplicitySig"); HSigMCRS->SetTitle(TString("MC Sig RS =")+(long)HSigMCRS->GetMean()+"."+(long)(1000*(HSigMCRS->GetMean()-1.))); HSigMCRS->Draw(); C.cd(2); TH1F* HSigMCWS=(TH1F*)FMCWSSig.Get("HEvtMultiplicitySig"); HSigMCWS->SetTitle(TString("MC Sig WS =")+(long)HSigMCWS->GetMean()+"."+(long)(1000*(HSigMCWS->GetMean()-1.))); HSigMCWS->Draw(); C.cd(3); TH1F* HBkgMCRS=(TH1F*)FMCRS.Get("HEvtMultiplicityBkg"); HBkgMCRS->SetTitle(TString("MC Bkg RS =")+(long)HBkgMCRS->GetMean()+"."+(long)(1000*(HBkgMCRS->GetMean()-1.))); HBkgMCRS->Draw(); C.cd(4); TH1F* HBkgMCWS=(TH1F*)FMCWS.Get("HEvtMultiplicityBkg"); HBkgMCWS->SetTitle(TString("MC Bkg WS =")+(long)HBkgMCWS->GetMean()+"."+(long)(1000*(HBkgMCWS->GetMean()-1.))); HBkgMCWS->Draw(); C.Print("FakePhotonSystematic.ps"); C.Clear(); THStack HMCStack("HMCStack",""); HBkgMCRS->SetFillColor(1);HMCStack.Add(HBkgMCRS); HSigMCRS->SetFillColor(2);HSigMCRS->SetLineColor(2);HMCStack.Add(HSigMCRS); HMCStack.Draw(); C.Print("FakePhotonSystematic.ps"); //--------------------------------------------- //subtract background from Data //--------------------------------------------- TH1F*HDataRSBkg=(TH1F*)HDataWS->Clone("HDataRSBkg"); TH1F*HBkgMCWSCl=(TH1F*)HBkgMCWS->Clone("HBkgMCWSCl"); //need to fix the WS first by subtracting the signal component HSigMCWS->Scale(11350./HSigMCWS->Integral());//scale to number of WS signal events in Data HDataRSBkg->Add(HSigMCWS,-1); //construct correction ratio from MC to correct the WS distribution TH1F*HBkgMCRSCl=(TH1F*)HBkgMCRS->Clone("HBkgMCRSCl"); HBkgMCWSCl->Scale(1./HBkgMCWSCl->Integral()); HBkgMCRSCl->Scale(1./HBkgMCRSCl->Integral()); TH1F*HBkgMCRatio=(TH1F*)HBkgMCRSCl->Clone("HBkgMCRatio"); HBkgMCRatio->Divide(HBkgMCWSCl); C.Clear(); delete HBkgMCRatio->FindObject("stats"); HBkgMCRatio->SetFillColor(0);HBkgMCRatio->SetLineColor(1); HBkgMCRatio->SetStats(0); HBkgMCRatio->GetYaxis()->SetRangeUser(0,1.5); HBkgMCRatio->Draw("hist"); C.Print("FakePhotonSystematic.ps"); //correct the WS distribution HDataRSBkg->Multiply(HBkgMCRatio); C.Clear(); HDataWS->Scale(1./HDataWS->Integral()); HDataRSBkg->Scale(1./HDataRSBkg->Integral()); delete HDataWS->FindObject("stats"); HDataWS->SetTitle(""); HDataWS->GetXaxis()->SetTitle("Reconstruction Multiplicity"); HDataWS->Draw("p"); HDataRSBkg->SetLineColor(0); HDataRSBkg->SetFillColor(4); HDataRSBkg->Draw("hist same"); HDataWS->Draw("psame"); C.Print("FakePhotonSystematic.ps"); //scale Data WS up to Data RS bkg HDataRSBkg->Scale((6.9952e+05)/HDataRSBkg->Integral());//scale to number of Bkg events in data //+(106000*.06)modify bkg by initial guess on error of Signal .06 comes from a 10% increase in the fake photon yield C.Clear(); HDataRS->GetYaxis()->SetRangeUser(0,HDataRS->GetMaximum()*1.3); HDataRS->GetXaxis()->SetTitle("Reconstruction Multiplicity"); HDataRS->SetTitle(""); HDataRS->Draw("pe"); HDataRSBkg->SetFillColor(4);HDataRSBkg->SetLineColor(0); delete HDataRSBkg->FindObject("stats"); HDataRSBkg->Draw("same"); C.Print("FakePhotonSystematic.ps"); //Perform subtraction TH1F*HDataRSCl=new TH1F("HDataRSCl","",HDataRS->GetXaxis()->GetNbins(), HDataRS->GetXaxis()->GetXmin(),HDataRS->GetXaxis()->GetXmax()); HDataRSCl->Add(HDataRS); Float_t Ntot=0,Nw=0; for(Int_t b=1;b<=HDataRSCl->GetXaxis()->GetNbins();b++){ Nw+=HDataRSCl->GetBinContent(b)*HDataRSCl->GetBinCenter(b); Ntot+=HDataRSCl->GetBinContent(b); } cout<<"before "<<HDataRSCl->GetMean()<<" "<<Nw/Ntot<<endl; delete HDataRSCl->FindObject("stats"); HDataRSCl->Add(HDataRSBkg,-1); Ntot=0,Nw=0; for(Int_t b=1;b<=HDataRSCl->GetXaxis()->GetNbins();b++){ Nw+=HDataRSCl->GetBinContent(b)*HDataRSCl->GetBinCenter(b); Ntot+=HDataRSCl->GetBinContent(b); } cout<<"after "<<HDataRSCl->GetMean()<<" "<<Nw/Ntot<<endl; //compare Data signal to MC signal TH1F*HSigMCRSCl=(TH1F*)HSigMCRS->Clone("HSigMCRSCl"); HSigMCRSCl->Scale(HDataRSCl->Integral()/HSigMCRSCl->Integral()); HSigMCRSCl->SetFillColor(0);HSigMCRSCl->SetLineColor(1); C.Clear(); HDataRSCl->GetYaxis()->SetRangeUser(0,HDataRSCl->GetMaximum()*1.3); //HDataRSCl->SetTitle(TString("Data Sig =")+(long)(Nw/Ntot)+"."+(long)(1000*(Nw/Ntot-1.))); HDataRSCl->SetTitle(""); HDataRSCl->GetXaxis()->SetTitle("Reconstruction Multiplicity"); delete HDataRSCl->FindObject("stats"); HDataRSCl->SetStats(0); HDataRSCl->Draw("pe"); HSigMCRSCl->SetStats(0); HSigMCRSCl->Draw("same"); C.Print("FakePhotonSystematic.ps"); TH1F*HDataSigMCSigDiff=new TH1F("HDataSigMCSigDiff","",HDataRS->GetXaxis()->GetNbins(), HDataRS->GetXaxis()->GetXmin(),HDataRS->GetXaxis()->GetXmax()); HDataSigMCSigDiff->Add(HDataRSCl); HDataSigMCSigDiff->Add(HSigMCRSCl,-1); C.Clear(); delete HDataSigMCSigDiff->FindObject("stats"); HDataSigMCSigDiff->SetStats(0); HDataSigMCSigDiff->Draw(""); C.Print("FakePhotonSystematic.ps"); //Signal multiplicity for modified photon backgrounds C.Clear(); HSigMCRSCl->SetFillColor(0);HSigMCRSCl->SetLineColor(1); HSigMCRSCl->GetYaxis()->SetRangeUser(0,HSigMCRSCl->GetMaximum()*1.1); HSigMCRSCl->GetXaxis()->SetRangeUser(.5,3.5); HSigMCRSCl->SetStats(0); HSigMCRSCl->Draw("l"); TGraph GMult; Int_t npts=0; TH1F* HDiff[21]; TH1F* HSigMCRSMod[21]; for(Int_t m=0;m<11;m++){ HSigMCRSMod[m]=(TH1F*)FMCRSSig.Get(TString("HEvtMultiplicitySigMod")+(long)m); if(HSigMCRSMod[m]->Integral()>0){ GMult.SetPoint(npts,1+(m-10)*.01,HSigMCRSMod[m]->GetMean()); npts++; HSigMCRSMod[m]->Scale(HDataRSCl->Integral()/HSigMCRSMod[m]->Integral()); } HSigMCRSMod[m]->SetLineColor(4); HSigMCRSMod[m]->SetStats(0); HSigMCRSMod[m]->Draw("lsame"); HDiff[m]=(TH1F*)HSigMCRSMod[m]->Clone(TString("HEvtMultiplicitySigModCl")+(long)m); HDiff[m]->Add(HSigMCRSCl,-1); } HSigMCRSCl->Draw("lsame"); HDataRSCl->SetLineColor(2); HDataRSCl->SetStats(0); HDataRSCl->Draw("lsame"); C.Print("FakePhotonSystematic.ps"); //fix the multiplicity on the plus side GMult.SetPoint(npts,1.1,HSigMCRSMod[10]->GetMean()+(HSigMCRSMod[10]->GetMean()-HSigMCRSMod[0]->GetMean())); TH1F* HDataDiff=(TH1F*)HDataRSCl->Clone("HDataDiff"); HDataDiff->Add(HSigMCRSCl,-1); TH1F* HMCDiff=(TH1F*)HSigMCRSCl->Clone("HMCDiff"); HMCDiff->Add(HSigMCRSCl,-1); C.Clear(); HMCDiff->GetYaxis()->SetRangeUser(-6000,3000); HMCDiff->Draw("l"); for(Int_t m=0;m<11;m++) HDiff[m]->Draw("lsame"); HMCDiff->Draw("lsame"); HDataDiff->Draw("lsame"); C.Print("FakePhotonSystematic.ps"); GMult.GetXaxis()->SetTitle("Amount of Fake Photon Background"); GMult.GetYaxis()->SetTitle("Avg. Reconstruction Multiplicity"); C.Clear(); //just the map GMult.Draw("apl"); C.Print("FakePhotonSystematic.ps"); //no Data error C.Clear(); GMult.Draw("apl"); TLine line; line.SetLineColor(2); line.SetLineWidth(2); line.DrawLine(.9,Nw/Ntot,1.1,Nw/Ntot); C.Print("FakePhotonSystematic.ps"); //with Data error C.Clear(); GMult.Draw("apl"); TBox box; box.SetLineColor(0); box.SetFillColor(3); box.SetFillStyle(1001); box.DrawBox(.9,Nw/Ntot-(1.769-1.763),1.1,Nw/Ntot+(1.769-1.763)); line.DrawLine(.9,Nw/Ntot,1.1,Nw/Ntot); GMult.Draw("plsame"); C.Print("FakePhotonSystematic.ps"); C.Print("FakePhotonSystematic.ps]"); }
void Test_UnfoldQ2(int Type = 0){ TString TypeName[] = {"Efficiency", "Unfold"}; if(Type==-1) { for(int type=0; type<nType; type++) cout<<type<<" "<<TypeName[type]<<", "; cout<<endl; return; } BToDtaunu Dtaunu; BToDstaunu Dstaunu; int nBins = 18, nValues = 50, nBinsRes = 80; double limQ2[] = {3.5, 12.5}, limRes = 2, ml[] = {Dtaunu.mTau, Dtaunu.mTau, Dtaunu.mMu}; if(Type==0){limQ2[0] = 4; nBins = 17;} TString mcCuts[3][6] = {{"weight*((MCType==5&&candType==1||MCType==11&&candType==3)&&candM2>1.5)", "weight*((MCType==6&&candType==2||MCType==12&&candType==4)&&candM2>1.5)" , "weight*((MCType==5&&candType==1||MCType==11&&candType==3))", "weight*((MCType==6&&candType==2||MCType==12&&candType==4))", "weight*(((MCType==1||MCType==3)&&candType==1||(MCType==7||MCType==9)&&candType==3))", "weight*(((MCType==2||MCType==4)&&candType==2||(MCType==8||MCType==10)&&candType==4))"}, {"weight*((MCType==11&&candType==3)&&candM2>1.5)", "weight*((MCType==12&&candType==4)&&candM2>1.5)" , "weight*((MCType==11&&candType==3))", "weight*((MCType==12&&candType==4))", "weight*(((MCType==7||MCType==9)&&candType==3))", "weight*(((MCType==8||MCType==10)&&candType==4))"}, {"weight*((MCType==5&&candType==1)&&candM2>1.5)", "weight*((MCType==6&&candType==2)&&candM2>1.5)" , "weight*((MCType==5&&candType==1))", "weight*((MCType==6&&candType==2))", "weight*(((MCType==1||MCType==3)&&candType==1))", "weight*(((MCType==2||MCType==4)&&candType==2))"}}; TString PadLabel[] = {"a", "b", "x", "d", "e", "f", "(g)", "(h)", "(i)"}; TString Units[] = {" GeV^{2})", "0.35 GeV^{2})"}, hName; TString xTitle[] = {"Q", "R"}; TBox box; box.SetLineColor(10);box.SetFillColor(10); gStyle->SetOptStat(0); int nRows = 2, nCols = 3; int Colors[] = {8,4,2}, ColorP[] = {4,1,2,8}; TLatex label; label.SetTextFont(132); label.SetNDC(kTRUE); TCanvas can("dataMC","data Vs MC",700,150*nRows); TPad *Pads[nPads][2]; TH1D *hbini[nPads], *hxini[nPads][3], *hQ2[nPads][3], *hEff[nPads][3], *hRes[nPads], *hRes2[nPads]; TH1D *hP[2][4], hTemp("hTemp","",100,0,3.4); TChain MC("ntp1"); MC.Add("AWG82/ntuples/small/FitRAllNewx100_RunAll.root"); TLegend *leg1[3]; double scaleEff = 1; double dRows = (double)nRows, dCols = (double) nCols; double bMargin = 0.12, padH = (1-bMargin)/dRows, padW = 1/dCols, LeftMargin = 0.2; for(int col=0; col<nCols; col++){ for(int row=0; row<nRows; row++){ can.cd(0); int pad = nRows*col+row; double TextSize = 0.08; double RightMargin = 0.04, TopMargin=0, BottomMargin=bMargin/(bMargin+padH)*row; double PadXY[2][2] = {{padW*col, padW*(col+1)},{(padH+bMargin)*(dRows-1-row), bMargin+padH*(2-row)}}; if(row==0) TextSize *= (bMargin+padH)/padH; hName = "Pad0_"; hName += pad; //cout<<hName<<": "<<PadXY[0][0]<<", "<<PadXY[1][0]<<", "<<PadXY[0][1]<<", "<<PadXY[1][1]<<endl; Pads[pad][0] = new TPad(hName,"",PadXY[0][0], PadXY[1][0], PadXY[0][1], PadXY[1][1]); Pads[pad][0]->SetLeftMargin(LeftMargin); Pads[pad][0]->SetRightMargin(RightMargin); Pads[pad][0]->SetBottomMargin(BottomMargin); Pads[pad][0]->SetTopMargin(TopMargin); Pads[pad][0]->Draw(); Pads[pad][0]->cd(); if(Type==0){ for(int isNorm=2; isNorm>=0; isNorm--){ hName = "xini"; hName += pad; hName += isNorm; hxini[pad][isNorm] = new TH1D(hName,"",nBins, limQ2[0], limQ2[1]); formatHisto(hxini[pad][isNorm], Colors[isNorm], TextSize); MC.Project(hName,"candQ2",mcCuts[col][row+2*isNorm]); if(row==1) hxini[pad][isNorm]->SetXTitle(xTitle[0]); //cout<<pad<<" Calculating q2"<<isNorm<<endl; hName = "hQ2"; hName += pad; hName += isNorm; hQ2[pad][isNorm] = new TH1D(hName,"",nBins, limQ2[0], limQ2[1]); hQ2[pad][isNorm]->SetLineColor(Colors[isNorm]); for(int bin=1; bin<=nBins; bin++){ double q2 = hQ2[pad][isNorm]->GetBinLowEdge(bin), val=0; double dq2 = (hQ2[pad][isNorm]->GetBinLowEdge(bin)-q2)/(double)nValues; q2 += dq2/2.; for(int ival=0; ival<nValues; ival++) { if(row==0) val += 1e16*Dtaunu.Compute(q2,1, ml[isNorm]); else val += 1e16*Dstaunu.Compute(q2,1, ml[isNorm]); q2 += dq2; } hQ2[pad][isNorm]->SetBinContent(bin,val); hQ2[pad][isNorm]->SetBinError(bin,0); } hEff[pad][isNorm] = (TH1D*)hxini[pad][isNorm]->Clone(); hEff[pad][isNorm]->Divide(hQ2[pad][isNorm]); if(isNorm==2) scaleEff = 1/hEff[pad][isNorm]->GetMaximum(); if(isNorm==1) scaleEff = hEff[pad][2]->Integral(nBins/3,nBins/3*2)/ hEff[pad][1]->Integral(nBins/3,nBins/3*2); hEff[pad][isNorm]->Scale(scaleEff); hEff[pad][isNorm]->SetMinimum(0); if(row==1) hEff[pad][isNorm]->SetMaximum(1.72); } //cout<<pad<<" Drawing"<<endl; hEff[pad][1]->Draw(); if(col==0) hEff[pad][0]->Draw("same"); hEff[pad][2]->Draw("same"); hEff[pad][1]->Draw("same"); //hQ2[pad][2]->Draw(); hQ2[pad][1]->Draw("same"); // Labels label.SetTextAngle(0); label.SetTextSize(TextSize/0.93); TString chanLabel = PadLabel[pad]; double Xchan = 0.92, Ychan = 0.89; if(Type>2) Xchan = LeftMargin+0.06; label.SetTextAlign(22); label.DrawLatex(Xchan, Ychan, chanLabel); } if(Type==1){ int isNorm=1; switch(col){ case 0: hName = "xini"; hName += pad; hName += isNorm; hxini[pad][isNorm] = new TH1D(hName,"",nBins, limQ2[0], limQ2[1]); formatHisto(hxini[pad][isNorm], Colors[isNorm], TextSize); MC.Project(hName,"trueQ2",mcCuts[col][row+2*isNorm]); if(row==1) hxini[pad][isNorm]->SetXTitle(xTitle[0]); hName = "bini"; hName += pad; hName += isNorm; hbini[pad] = new TH1D(hName,"",nBins, limQ2[0], limQ2[1]); formatHisto(hbini[pad], 1, TextSize); MC.Project(hName,"candQ2",mcCuts[col][row+2*isNorm]); hxini[pad][isNorm]->SetMarkerSize(0.); hxini[pad][isNorm]->SetMaximum(hxini[pad][isNorm]->GetMaximum()*1.2); hxini[pad][isNorm]->Draw("hist"); hbini[pad]->Draw("same"); if(row==0){ double legXY[2][2] = {{0.78, 0.98}, {0.67, 0.95}}; leg1[col] = new TLegend(legXY[0][0], legXY[1][0], legXY[0][1], legXY[1][1]); leg1[col]->SetTextSize(TextSize); leg1[col]->SetFillStyle(0); leg1[col]->SetTextFont(132); leg1[col]->SetBorderSize(0); leg1[col]->AddEntry(hxini[pad][isNorm],"t"); leg1[col]->AddEntry(hbini[pad],"d"); leg1[col]->Draw(); } break; case 1: isNorm=1; hName = "Res"; hName += row; hRes[row] = new TH1D(hName,"",nBinsRes, -limRes, limRes); formatHisto(hRes[row], Colors[isNorm], TextSize); MC.Project(hName,"candQ2-trueQ2", mcCuts[0][row+2*isNorm]); isNorm=2; hName = "Res2"; hName += row; hRes2[row] = new TH1D(hName,"",nBinsRes, -limRes, limRes); formatHisto(hRes2[row], Colors[isNorm], TextSize); hRes[row]->SetMarkerSize(0.3); hRes2[row]->SetMarkerSize(0.); MC.Project(hName,"candQ2-trueQ2", mcCuts[0][row+2*isNorm]); hRes2[row]->Scale(hRes[row]->Integral()/hRes2[row]->Integral()); hRes2[row]->SetMaximum(hRes2[row]->GetMaximum()*1.15); hRes2[row]->Draw("hist"); hRes[row]->Draw("same"); if(row==1) hRes2[row]->SetXTitle(xTitle[1]); hName = "#splitline{#mu_{sig} = "; hName += RoundNumber(hRes[row]->GetMean(),2); hName += "}{#mu_{nor} = "; hName += RoundNumber(hRes2[row]->GetMean(),2); hName += "}"; label.SetTextAlign(33); label.SetTextAngle(0); label.SetTextSize(TextSize); label.DrawLatex(1-RightMargin-0.05, 1-0.05, hName); hName = "#splitline{#sigma_{sig} = "; hName += RoundNumber(hRes[row]->GetRMS(),2); hName += "}{#sigma_{nor} = "; hName += RoundNumber(hRes2[row]->GetRMS(),2); hName += "}"; label.DrawLatex(1-RightMargin-0.05, 1-0.37-0.06*(row==0), hName); if(row==0){ double legXY[2][2] = {{LeftMargin+0.05, LeftMargin+0.25}, {0.67, 0.95}}; leg1[col] = new TLegend(legXY[0][0], legXY[1][0], legXY[0][1], legXY[1][1]); leg1[col]->SetTextSize(TextSize); leg1[col]->SetFillStyle(0); leg1[col]->SetTextFont(132); leg1[col]->SetBorderSize(0); leg1[col]->AddEntry(hRes2[row],"Norm."); leg1[col]->AddEntry(hRes[row],"Signal"); leg1[col]->Draw(); } break; case 2: double maxH = 0; for(isNorm=0; isNorm<3; isNorm++){ hName = "hP"; hName += pad; hName += isNorm; hP[pad][isNorm] = new TH1D(hName,"",nBins, limQ2[0], limQ2[1]); formatHisto(hP[pad][isNorm], ColorP[isNorm], TextSize); double q2 = limQ2[0], dq2 = (limQ2[1]-limQ2[0])/(double)nBins; for(int bin=1; bin<=nBins; bin++){ hName = "weight*(trueQ2>="; hName += q2; hName += "&&trueQ2<"; hName += q2+dq2; hName += "&&"; TString Cuts = mcCuts[0][2+row+2*(isNorm>1)]; Cuts.ReplaceAll("weight*(", hName); TString var = "candPLep"; if(isNorm%2==1) var = "candPstarD"; double entries = MC.Project("hTemp",var, Cuts); //cout<<hTemp.GetMean()<<", "<<Cuts<<endl; hP[pad][isNorm]->SetBinContent(bin, hTemp.GetMean()); if(entries>1) hP[pad][isNorm]->SetBinError(bin, hTemp.GetRMS()/sqrt(entries)); else hP[pad][isNorm]->SetBinError(bin, hTemp.GetMean()); q2 += dq2; } if(hP[pad][isNorm]->GetMaximum()>maxH) maxH = hP[pad][isNorm]->GetMaximum(); } for(isNorm=0; isNorm<3; isNorm++){ if(isNorm==0) { hP[pad][isNorm]->SetMaximum(maxH*1.17); hP[pad][isNorm]->Draw(); if(row==1) hP[pad][isNorm]->SetXTitle(xTitle[0]); } else{ //hP[pad][isNorm]->Scale(hP[pad][0]->Integral()/hP[pad][isNorm]->Integral()); hP[pad][isNorm]->Draw("same"); } } if(row==1){ double legXY[2][2] = {{LeftMargin+0.05, LeftMargin+0.25}, {0.25, 0.5}}; leg1[col] = new TLegend(legXY[0][0], legXY[1][0], legXY[0][1], legXY[1][1]); leg1[col]->SetTextSize(TextSize); leg1[col]->SetFillStyle(0); leg1[col]->SetTextFont(132); leg1[col]->SetBorderSize(0); leg1[col]->AddEntry(hP[pad][0],"ls"); leg1[col]->AddEntry(hP[pad][2],"ln"); leg1[col]->AddEntry(hP[pad][1],"D"); leg1[col]->Draw(); } break; } } } can.cd(0); hName = "Normalized efficiency/("; if(Type==1) hName = "Events/("; if(Type==1&&col==1) hName += RoundNumber(2*limRes,2,nBinsRes); else hName += RoundNumber((limQ2[1]-limQ2[0]),2,nBins); hName += Units[0]; if(Type==1&&col==2) hName = "Momentum (GeV)"; label.SetTextAlign(23); label.SetTextAngle(90); label.SetTextSize(0.055); label.DrawLatex(0.01+col/dCols, 0.56, hName); if(Type==0 || Type==1) { box.DrawBox(padW*(LeftMargin+col)-0.02, bMargin+padH, padW*(LeftMargin+col)-0.002, bMargin+padH+0.02); label.SetTextAlign(32); label.SetTextAngle(0); label.SetTextSize(0.044); label.DrawLatex(padW*(LeftMargin+col)-0.0025, bMargin+padH+0.003, "0"); } } TString pName = "public_html/Test_Q2_"; pName += TypeName[Type]; pName += ".eps"; can.SaveAs(pName); for(int row=0; row<nRows; row++){ if(Type==1){ if(hRes[row]) hRes[row]->Delete(); if(hRes2[row]) hRes2[row]->Delete(); } for(int col=0; col<nCols; col++){ int pad = nRows*col+row; //if(Type==1 && hbini[pad]) hbini[pad]->Delete(); for(int isNorm=0; isNorm<3; isNorm++){ if(Type==0){ if(hEff[pad][isNorm]) hEff[pad][isNorm]->Delete(); if(hQ2[pad][isNorm]) hQ2[pad][isNorm]->Delete(); if(hxini[pad][isNorm]) hxini[pad][isNorm]->Delete(); } } } } }
void NuclearModificationFactor(TString inputPP="ROOTfiles/CrossSectionPP.root", TString inputPbPb="ROOTfiles/CrossSectionPbPb.root",TString label="PbPb",TString outputfile="RAAfile.root", Float_t centMin=0., Float_t centMax=100.) { // drawDRAA = true; // drawChHad = true; // drawThm = true; float pti = ptBins[0]-2.; float pte = ptBins[nBins]+5.; if(drawDRAA){ pti = 1; pte = 400.; } if(drawThm){ pti = 5; pte = 110.; } gStyle->SetOptTitle(0); gStyle->SetOptStat(0); gStyle->SetEndErrorSize(0); gStyle->SetMarkerStyle(20); gStyle->SetPadRightMargin(0.03);//###0.020 gStyle->SetPadLeftMargin(0.12); gStyle->SetPadTopMargin(0.075); gStyle->SetPadBottomMargin(0.12); TFile *fpp=new TFile(inputPP.Data()); TFile *fPbPb=new TFile(inputPbPb.Data()); TH1D*hSigmaPPStat=(TH1D*)fpp->Get("hPtSigma"); hSigmaPPStat->SetName("hSigmaPPStat"); TH1D*hNuclearModification=(TH1D*)fPbPb->Get("hPtSigma"); hNuclearModification->SetName("hNuclearModification"); hNuclearModification->Divide(hSigmaPPStat); double apt[nBins]; //bin half width double aptl[nBins]; //number of every rebined bin double bin_num[nBins]; for (int ibin=0; ibin<nBins; ibin++){ apt[ibin]=(ptBins[ibin+1]+ptBins[ibin])/2.; aptl[ibin] = (ptBins[ibin+1]-ptBins[ibin])/2; bin_num[ibin]=aptl[ibin]/binsize*2; } Double_t xr[nBins], yr[nBins], xrlow[nBins], yrlow[nBins],xrhigh[nBins],yrhigh[nBins]; for(int i=0;i<nBins;i++) { yr[i] = hNuclearModification->GetBinContent(i+1); double systematic=0.01*systematicsForRAA(hNuclearModification->GetBinCenter(i+1),centMin,centMax,0.,0.); //double systematic=0.; yrlow[i] = hNuclearModification->GetBinContent(i+1)*systematic; yrhigh[i] =hNuclearModification->GetBinContent(i+1)*systematic; } TGraphAsymmErrors* gNuclearModification = new TGraphAsymmErrors(nBins,apt,yr,aptl,aptl,yrlow,yrhigh); gNuclearModification->SetName("gNuclearModification"); TCanvas*canvasRAA=new TCanvas("canvasRAA","canvasRAA",600,600); canvasRAA->cd(); canvasRAA->SetLogx(); TH2F* hemptyEff=new TH2F("hemptyEff","",50,pti,pte,10.,0,1.55); hemptyEff->GetXaxis()->CenterTitle(); hemptyEff->GetYaxis()->CenterTitle(); hemptyEff->GetYaxis()->SetTitle("R_{AA}"); hemptyEff->GetXaxis()->SetTitle("p_{T} (GeV/c)"); hemptyEff->GetXaxis()->SetTitleOffset(1.0); hemptyEff->GetYaxis()->SetTitleOffset(1.1); hemptyEff->GetXaxis()->SetTitleSize(0.05); hemptyEff->GetYaxis()->SetTitleSize(0.05); hemptyEff->GetXaxis()->SetTitleFont(42); hemptyEff->GetYaxis()->SetTitleFont(42); hemptyEff->GetXaxis()->SetLabelFont(42); hemptyEff->GetYaxis()->SetLabelFont(42); hemptyEff->GetXaxis()->SetLabelSize(0.04); hemptyEff->GetYaxis()->SetLabelSize(0.04); hemptyEff->SetMaximum(2); hemptyEff->SetMinimum(0.); hemptyEff->Draw(); TLine *line = new TLine(pti,1,pte,1); line->SetLineStyle(2); line->SetLineWidth(2); line->Draw(); //gNuclearModification->SetFillColor(kOrange);//1 //gNuclearModification->SetFillColor(kPink+7);//1 gNuclearModification->SetFillColor(kAzure+7);//1 gNuclearModification->SetFillStyle(3001);//0 gNuclearModification->SetLineWidth(1);//3 gNuclearModification->SetMarkerSize(1); gNuclearModification->SetMarkerStyle(21); //gNuclearModification->SetLineColor(kOrange);//kGreen+4 //gNuclearModification->SetMarkerColor(kRed);//kGreen+4 gNuclearModification->SetLineColor(kAzure+7);//kGreen+4 gNuclearModification->SetMarkerColor(kViolet+3);//kGreen+4 hNuclearModification->SetLineWidth(3); //hNuclearModification->SetLineColor(kRed); //hNuclearModification->SetMarkerColor(kRed); //hNuclearModification->SetLineColor(kTeal+7); hNuclearModification->SetLineColor(kViolet+3); hNuclearModification->SetMarkerColor(kViolet+3); hNuclearModification->SetMarkerStyle(21); Float_t systnorm = normalizationUncertaintyForRAA()*1.e-2; TBox* bSystnorm = new TBox(pti,1-systnorm,pti+0.35,1+systnorm); cout<<systnorm<<endl; if(drawDRAA) bSystnorm = new TBox(pti,1-systnorm,pti+0.2,1+systnorm); bSystnorm->SetLineColor(16); bSystnorm->SetFillColor(16); bSystnorm->Draw(); TLatex * tlatexeff2=new TLatex(0.38,0.595,"Centrality 0-100%"); tlatexeff2->SetNDC(); tlatexeff2->SetTextColor(1); tlatexeff2->SetTextFont(42); tlatexeff2->SetTextSize(0.050); tlatexeff2->Draw(); TLatex * texY = new TLatex(0.41,0.53,"|y| < 1.0");//0.2612903,0.8425793 texY->SetNDC(); texY->SetTextColor(1); texY->SetTextFont(42); texY->SetTextSize(0.045); texY->SetLineWidth(2); //texY->Draw(); TLatex* texlumi = new TLatex(0.13,0.936,"25.8 pb^{-1} (5.02 TeV pp) + 350.68 #mub^{-1} (5.02 TeV PbPb)"); texlumi->SetNDC(); //texlumi->SetTextAlign(31); texlumi->SetTextFont(42); texlumi->SetTextSize(0.038); texlumi->SetLineWidth(2); texlumi->Draw(); TLatex* texcms = new TLatex(0.15,0.90,"CMS"); texcms->SetNDC(); texcms->SetTextAlign(13); texcms->SetTextFont(62);//61 texcms->SetTextSize(0.06); texcms->SetLineWidth(2); texcms->Draw(); TLatex* texpre = new TLatex(0.15,0.84,"Preliminary"); texpre->SetNDC(); texpre->SetTextAlign(13); texpre->SetTextFont(52); texpre->SetTextSize(0.05); texpre->SetLineWidth(2); texpre->Draw(); //TLegend *legendSigma=new TLegend(0.40,0.5168644,0.8084677,0.6605932,""); TLegend *legendSigma=new TLegend(0.6036242,0.7474695,0.942953,0.8457592,""); if(drawDRAA)legendSigma=new TLegend(0.4236242,0.6774695,0.812953,0.8757592,""); if(drawThm)legendSigma=new TLegend(0.5636242,0.6774695,0.922953,0.8757592,""); legendSigma->SetBorderSize(0); legendSigma->SetLineColor(0); legendSigma->SetFillColor(0); legendSigma->SetFillStyle(1001); legendSigma->SetTextFont(42); legendSigma->SetTextSize(0.04); // TLegendEntry *ent_SigmaPP=legendSigma->AddEntry(hNuclearModification,"R_{AA} stat. unc.","pf"); // ent_SigmaPP->SetTextFont(42); // ent_SigmaPP->SetLineColor(1); // ent_SigmaPP->SetMarkerColor(1); // ent_SigmaPP->SetTextSize(0.045); // // TLegendEntry *ent_Sigmapp=legendSigma->AddEntry(gNuclearModification,"R_{AA} syst.","f"); // ent_Sigmapp->SetTextFont(42); // ent_Sigmapp->SetLineColor(5); // ent_Sigmapp->SetMarkerColor(1); // ent_Sigmapp->SetTextSize(0.045); TLegendEntry *ent_B = legendSigma->AddEntry(gNuclearModification,"B^{+} |y| < 1.0","pf"); ent_B->SetTextFont(42); ent_B->SetLineColor(4); ent_B->SetMarkerColor(4); ent_B->SetTextSize(0.038);//0.03 TLatex* texSystnorm = new TLatex(0.23,0.70,"T_{AA} and lumi."); if(drawDRAA) texSystnorm = new TLatex(0.17,0.70,"T_{AA} and lumi."); texSystnorm->SetNDC(); texSystnorm->SetTextColor(1); texSystnorm->SetTextFont(42); texSystnorm->SetTextSize(0.04); texSystnorm->SetLineWidth(2); texSystnorm->Draw(); texSystnorm = new TLatex(0.23,0.65,"uncertainty"); if(drawDRAA) texSystnorm = new TLatex(0.17,0.65,"uncertainty"); texSystnorm->SetNDC(); texSystnorm->SetTextColor(1); texSystnorm->SetTextFont(42); texSystnorm->SetTextSize(0.04); texSystnorm->SetLineWidth(2); texSystnorm->Draw(); if(drawChHad){ RAA_0_100(); } if(drawDRAA){ TGraphAsymmErrors* gDNuclearModification = new TGraphAsymmErrors(); Draw_DRAA(canvasRAA, gDNuclearModification); gDNuclearModification->SetFillColor(kYellow-9); //gDNuclearModification->SetFillColor(5); TLegendEntry *ent_Dhighpt = legendSigma->AddEntry(gDNuclearModification,"D^{0} |y| < 1.0","pf"); ent_Dhighpt->SetTextFont(42); // ent_Dhighpt->SetLineColor(4); ent_Dhighpt->SetMarkerColor(4); ent_Dhighpt->SetTextSize(0.038);//0.03 } if(drawChHad){ TGraphAsymmErrors* gChHadDummy = new TGraphAsymmErrors(); gChHadDummy->SetFillColor(TColor::GetColor("#ffcc00")); gChHadDummy->SetMarkerColor(kRed); TLegendEntry *ent_ChHad = legendSigma->AddEntry(gChHadDummy,"charged hadrons |y| < 1.0","pf"); ent_ChHad->SetTextFont(42); ent_ChHad->SetLineColor(4); ent_ChHad->SetMarkerColor(4); ent_ChHad->SetTextSize(0.038);//0.03 } if(drawThm){ plotTheory(); TGraphAsymmErrors* gThmDummy1 = new TGraphAsymmErrors(); TGraphAsymmErrors* gThmDummy2 = new TGraphAsymmErrors(); TGraphAsymmErrors* gThmDummy3 = new TGraphAsymmErrors(); gThmDummy1->SetLineColor(kGreen+4); //gThmDummy2->SetLineColor(kViolet-6); gThmDummy2->SetLineColor(kOrange+8); gThmDummy3->SetLineColor(4); gThmDummy1->SetLineWidth(4.5); gThmDummy2->SetLineWidth(4.5); gThmDummy3->SetLineWidth(4.5); TLegendEntry *ent_thm1 = legendSigma->AddEntry(gThmDummy1,"M. Djordjevic et al.","l"); TLegendEntry *ent_thm2 = legendSigma->AddEntry(gThmDummy2,"M. He et al.","l"); TLegendEntry *ent_thm3 = legendSigma->AddEntry(gThmDummy3,"CUJET3.0 0-20%","l"); ent_thm1->SetTextSize(0.038);//0.03 ent_thm2->SetTextSize(0.038);//0.03 ent_thm3->SetTextSize(0.038);//0.03 } gNuclearModification->Draw("5same"); hNuclearModification->Draw("same"); legendSigma->Draw(); canvasRAA->Update(); canvasRAA->RedrawAxis(); TString AddOn = ""; if(drawDRAA){ AddOn = AddOn += "_DRAA"; } if(drawChHad){ AddOn = AddOn += "_ChHadRAA"; } if(drawThm){ AddOn = AddOn += "_ThmRAA"; } canvasRAA->SaveAs(Form("plotRAA/canvasRAA%s_%.0f_%.0f%s.pdf",label.Data(),centMin,centMax,AddOn.Data())); canvasRAA->SaveAs(Form("plotRAA/canvasRAA%s_%.0f_%.0f%s.png",label.Data(),centMin,centMax,AddOn.Data())); canvasRAA->SaveAs(Form("plotRAA/canvasRAA%s_%.0f_%.0f%s.C",label.Data(),centMin,centMax,AddOn.Data())); TFile *fRAA=new TFile(outputfile.Data(),"recreate"); fRAA->cd(); gNuclearModification->Write(); hNuclearModification->Write(); }
//------------------------------------------------------------------------------ // // drawXS // //------------------------------------------------------------------------------ void drawXS(UInt_t theCharge = WInclusive) { gStyle->SetEndErrorSize(5); // 7 TeV inclusive //---------------------------------------------------------------------------- xs_value[WInclusive][EEE] = 23.00; xs_value[WInclusive][EEM] = 19.67; xs_value[WInclusive][MME] = 19.81; xs_value[WInclusive][MMM] = 21.02; xs_value[WInclusive][all] = 20.76; xs_stat[WInclusive][EEE] = 3.10; xs_stat[WInclusive][EEM] = 2.73; xs_stat[WInclusive][MME] = 2.60; xs_stat[WInclusive][MMM] = 2.30; xs_stat[WInclusive][all] = 1.32; xs_syst[WInclusive][EEE] = 1.39; xs_syst[WInclusive][EEM] = 1.50; xs_syst[WInclusive][MME] = 1.55; xs_syst[WInclusive][MMM] = 1.47; xs_syst[WInclusive][all] = 1.13; xs_lumi[WInclusive][EEE] = 0.51; xs_lumi[WInclusive][EEM] = 0.43; xs_lumi[WInclusive][MME] = 0.44; xs_lumi[WInclusive][MMM] = 0.46; xs_lumi[WInclusive][all] = 0.46; // 7 TeV W+ //---------------------------------------------------------------------------- xs_value[WPlus][EEE] = 13.39; xs_value[WPlus][EEM] = 13.18; xs_value[WPlus][MME] = 14.14; xs_value[WPlus][MMM] = 11.43; xs_value[WPlus][all] = 12.73; xs_stat[WPlus][EEE] = 2.39; xs_stat[WPlus][EEM] = 2.24; xs_stat[WPlus][MME] = 2.19; xs_stat[WPlus][MMM] = 1.71; xs_stat[WPlus][all] = 1.04; xs_syst[WPlus][EEE] = 0.75; xs_syst[WPlus][EEM] = 0.64; xs_syst[WPlus][MME] = 0.74; xs_syst[WPlus][MMM] = 0.53; xs_syst[WPlus][all] = 0.59; xs_lumi[WPlus][EEE] = 0.29; xs_lumi[WPlus][EEM] = 0.29; xs_lumi[WPlus][MME] = 0.31; xs_lumi[WPlus][MMM] = 0.25; xs_lumi[WPlus][all] = 0.28; // 7 TeV W- //---------------------------------------------------------------------------- xs_value[WMinus][EEE] = 9.49; xs_value[WMinus][EEM] = 6.51; xs_value[WMinus][MME] = 5.73; xs_value[WMinus][MMM] = 9.48; xs_value[WMinus][all] = 7.46; xs_stat[WMinus][EEE] = 1.95; xs_stat[WMinus][EEM] = 1.58; xs_stat[WMinus][MME] = 1.40; xs_stat[WMinus][MMM] = 1.52; xs_stat[WMinus][all] = 0.79; xs_syst[WMinus][EEE] = 0.60; xs_syst[WMinus][EEM] = 0.37; xs_syst[WMinus][MME] = 0.37; xs_syst[WMinus][MMM] = 0.50; xs_syst[WMinus][all] = 0.40; xs_lumi[WMinus][EEE] = 0.21; xs_lumi[WMinus][EEM] = 0.14; xs_lumi[WMinus][MME] = 0.13; xs_lumi[WMinus][MMM] = 0.21; xs_lumi[WMinus][all] = 0.16; // Do the work //---------------------------------------------------------------------------- TGraphErrors* gStat = new TGraphErrors(nChannel); TGraphErrors* gSyst = new TGraphErrors(nChannel); TGraphErrors* gLumi = new TGraphErrors(nChannel); for (UInt_t i=0; i<nChannel; i++) { Double_t errorSquared = (xs_stat[theCharge][i] * xs_stat[theCharge][i]); gStat->SetPointError(i, sqrt(errorSquared) / xs_nlo[theCharge], 0.0); errorSquared += (xs_syst[theCharge][i] * xs_syst[theCharge][i]); gSyst->SetPointError(i, sqrt(errorSquared) / xs_nlo[theCharge], 0.0); errorSquared += (xs_lumi[theCharge][i] * xs_lumi[theCharge][i]); gLumi->SetPointError(i, sqrt(errorSquared) / xs_nlo[theCharge], 0.0); gStat->SetPoint(i, xs_value[theCharge][i] / xs_nlo[theCharge], nChannel-i-1); gSyst->SetPoint(i, xs_value[theCharge][i] / xs_nlo[theCharge], nChannel-i-1); gLumi->SetPoint(i, xs_value[theCharge][i] / xs_nlo[theCharge], nChannel-i-1); } // Cosmetics //---------------------------------------------------------------------------- gStat->SetLineWidth (2); gStat->SetMarkerSize (1.3); gStat->SetMarkerStyle(kFullCircle); gSyst->SetLineColor (kRed); gSyst->SetLineWidth (2); gSyst->SetMarkerSize (1.3); gSyst->SetMarkerStyle(kFullCircle); gLumi->SetLineColor (kBlue); gLumi->SetLineWidth (2); gLumi->SetMarkerSize (1.3); gLumi->SetMarkerStyle(kFullCircle); // Draw //---------------------------------------------------------------------------- TString suffix = "7TeV_" + sCharge[theCharge]; TCanvas* canvas = new TCanvas("ratioNLO_" + suffix, "ratioNLO_" + suffix); canvas->SetLeftMargin(canvas->GetRightMargin()); Double_t xmin = 0.0; Double_t xmax = 2.0; Double_t ylegend = 1.2; Double_t ymin = -0.6; Double_t ymax = nChannel + ymin + ylegend; TH2F* h2 = new TH2F("h2_" + suffix, "", 100, xmin, xmax, 100, ymin, ymax); h2->Draw(); // NLO WZ cross-section //---------------------------------------------------------------------------- TBox* nlo = new TBox(1. - xs_nlo_left [theCharge] / xs_nlo[theCharge], ymin, 1. + xs_nlo_right[theCharge] / xs_nlo[theCharge], ymax - ylegend); nlo->SetLineColor(0); nlo->SetFillColor(kGray); nlo->SetFillStyle(1001); nlo->Draw("e2,same"); TLine* line = new TLine(1., ymin, 1., ymax - ylegend); line->SetLineColor(kGray+1); line->SetLineWidth(2); line->Draw("same"); // Cross sections //---------------------------------------------------------------------------- gLumi->Draw("p,same"); gSyst->Draw("p,same"); gStat->Draw("p,same"); // Labels //---------------------------------------------------------------------------- for (UInt_t i=0; i<nChannel; i++) { Double_t x = gStat->GetX()[i]; Double_t y = gStat->GetY()[i]; Double_t gStatError = gStat->GetErrorX(i); Double_t gSystError = gSyst->GetErrorX(i); Double_t gLumiError = gLumi->GetErrorX(i); DrawTLatex(42, xmin+0.06, y+0.15, 0.035, 12, Form("%s %.2f #pm %.2f", lChannel[i].Data(), x, gLumiError), 0); gLumiError = sqrt(gLumiError*gLumiError - gSystError*gSystError); gSystError = sqrt(gSystError*gSystError - gStatError*gStatError); DrawTLatex(42, xmin+0.06, y-0.15, 0.025, 12, Form("%.2f #pm %.2f #pm %.2f #pm %.2f", x, gStatError, gSystError, gLumiError), 0); } DrawTLatex(42, 0.050, 0.975, _bigLabelSize, 13, "CMS Preliminary"); DrawTLatex(42, 0.940, 0.983, _bigLabelSize, 33, Form("#sqrt{s} = 7 TeV, L = %.1f fb^{-1}", luminosity/1e3)); TString swz = ""; if (theCharge == WPlus) swz = "W^{+}Z"; else if (theCharge == WMinus) swz = "W^{-}Z"; else swz = "W^{#pm}Z"; h2->GetXaxis()->CenterTitle(); h2->GetXaxis()->SetTitleOffset(1.4); h2->GetXaxis()->SetTitle(Form("#sigma_{%s}^{exp} / #sigma_{%s}^{theory}", swz.Data(), swz.Data())); h2->GetYaxis()->SetTitle(""); // Remove y-axis labels //---------------------------------------------------------------------------- TAxis* yaxis = h2->GetYaxis(); for (Int_t j=1; j<yaxis->GetNbins(); j++) yaxis->SetBinLabel(j, ""); // Additional legend //---------------------------------------------------------------------------- DrawLegend(0.645, 0.840, gStat, " stat.", "lp"); DrawLegend(0.645, 0.795, nlo, " theory", "f"); DrawLegend(0.800, 0.840, gSyst, " syst.", "l"); DrawLegend(0.800, 0.795, gLumi, " lumi.", "l"); // Save //---------------------------------------------------------------------------- canvas->Update(); canvas->GetFrame()->DrawClone(); canvas->RedrawAxis(); canvas->SaveAs(Form("pdf/ratioNLO_%s.pdf", suffix.Data())); canvas->SaveAs(Form("png/ratioNLO_%s.png", suffix.Data())); }
void Draw_ALICEFor_JPsi_RaaVspT(TLegend *legend_ratio) { // Centrality, rapidity and transverse momentum dependence of // J/psi suppression in Pb-Pb collisions at sqrt{s} = 2.76 TeV ALICE // arxiv.1311.0214v1 //================= ALICE Forward Rapidity Raa Vs Pt ===================================// int nbinsPtALICEFor=7; Double_t PtALICEFor[7]={0.50,1.50,2.50,3.50,4.50,5.50,7.0}; Double_t ErrPtALICEFor[7]={0}; //Double_t RaaPtALICEFor[7] = {0.61,0.53,0.45,0.38,0.37,0.34,0.35}; //Double_t RaaPtStatErrALICEFor[7] = {0.06,0.04,0.03,0.04,0.05,0.06,0.07}; //Double_t RaaPtSystErrALICEFor[7] = {0.08,0.07,0.06,0.05,0.05,0.05,0.04}; Double_t RaaPtALICEFor[7] = {0.78,0.68,0.52,0.43,0.41,0.32,0.36}; Double_t RaaPtStatErrALICEFor[7] = {0.08,0.05,0.04,0.04,0.05,0.05,0.08}; Double_t RaaPtSystErrALICEFor[7] = {0.11,0.08,0.06,0.05,0.05,0.04,0.04}; TGraphErrors *grRaaPtALICEFor = new TGraphErrors(nbinsPtALICEFor, PtALICEFor, RaaPtALICEFor, ErrPtALICEFor, RaaPtStatErrALICEFor); grRaaPtALICEFor->SetMarkerStyle(20); grRaaPtALICEFor->SetMarkerColor(4); grRaaPtALICEFor->SetMarkerSize(1.3); grRaaPtALICEFor->SetLineColor(1); grRaaPtALICEFor->GetYaxis()->SetRangeUser(0,1.5); grRaaPtALICEFor->GetXaxis()->SetTitle("p_{T}(GeV/c)"); grRaaPtALICEFor->GetYaxis()->SetTitle("R_{AA}"); TLine *lh4 = new TLine(0.0,1.0,7.6,1.0); lh4->SetLineColor(1); lh4->SetLineStyle(1); lh4->SetLineWidth(1.5); //lh4->Draw("same"); TLatex *tb= new TLatex; tb->SetNDC(); tb->SetTextAlign(12); tb->SetTextColor(1); tb->SetTextSize(0.040); TBox *RaaPtJPsiALICEForSys[12]; for(int j=0;j<7;j++){ RaaPtJPsiALICEForSys[j] = new TBox(PtALICEFor[j]-0.4, RaaPtALICEFor[j]-RaaPtSystErrALICEFor[j], PtALICEFor[j]+0.4, RaaPtALICEFor[j]+RaaPtSystErrALICEFor[j]); } for(int j=0;j<7;j++){ RaaPtJPsiALICEForSys[j]->SetFillStyle(1001); RaaPtJPsiALICEForSys[j]->SetFillColor(kAzure-4); RaaPtJPsiALICEForSys[j]->SetLineColor(1); } TBox *ALICEGlobalSysJPsiPtFor; //ALICEGlobalSysJPsiPtFor = new TBox(7.2-0.2, 1 - 0.14, 7.2+0.2, 1 + 0.14); //ALICEGlobalSysJPsiPtFor = new TBox(18.424,0.858,19.165,1.137); // By Abd ALICEGlobalSysJPsiPtFor = new TBox(18.424,1.0-0.08,19.165,1.0+0.08); // By Abd ALICEGlobalSysJPsiPtFor->SetFillStyle(3001); ALICEGlobalSysJPsiPtFor->SetLineColor(4); ALICEGlobalSysJPsiPtFor->SetFillColor(4); grRaaPtALICEFor->Draw("sameP"); for(int j=0;j<7;j++) RaaPtJPsiALICEForSys[j]->Draw("sameL"); grRaaPtALICEFor->Draw("Psame"); ALICEGlobalSysJPsiPtFor->Draw("sameL"); legend_ratio->SetTextColor(4); //tb->DrawLatex(0.22,0.16,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 0.0 GeV/c"); //legend_ratio->AddEntry(grRaaPtALICEFor,"ALICE: J/#psi #rightarrow #mu^{+} #mu^{-}, 2.5 < |y| < 2.4 & p_{T}^{J/#psi} > 0.0 GeV/c", "P"); legend_ratio->AddEntry(grRaaPtALICEFor,"J/#psi ALICE: 2.5 < |y| < 2.4", "P"); }
void Draw_Phenix_JPsi_RaaVspT(TLegend *legend_ratio) { //================= Phenix Forward Rapidity Raa Vs Pt ===================================// //r_aa at forward rapidity (|y| in [1.2,2.2]) //"J/psi Production vs Centrality, Transverse Momentum, and Rapidity in Au+Au Collisions at s(NN)**(1/2) = 200-GeV" //Preprint: nucl-ex/0611020 inSPIRE, Citations //Submitted: 2006-11-12 //Published: Phys. Rev. Lett. 98, 232301 (2007) , 2007-06-07 Double_t PtPhenix[7]={0.50,1.50,2.50,3.50,4.50}; Double_t ErrPtPhenix[7]={0}; // 0-20% //int nbinsPtPhenix=6; //Double_t RaaPtPhenix[7] = {0.18,0.18,0.19,0.17,0.60,0.26}; //Double_t RaaPtStatErrPhenix[7] = {0.03,0.03,0.04,0.07,0.17,0.06}; //Double_t RaaPtSystErrPhenix[7] = {0.03,0.02,0.03,0.02,0.08,0.05}; // 0-93% int nbinsPtPhenix=5; Double_t RaaPtPhenix[7] = {0.152,0.207,0.352,0.323,0.499}; Double_t RaaPtStatErrPhenix[7] = {0.016,0.016,0.024,0.036,0.071}; Double_t RaaPtSystErrPhenix[7] = {0.015,0.020,0.035,0.032,0.049}; TGraphErrors *grRaaPtPhenix = new TGraphErrors(nbinsPtPhenix, PtPhenix, RaaPtPhenix, ErrPtPhenix, RaaPtStatErrPhenix); grRaaPtPhenix->SetMarkerStyle(34); grRaaPtPhenix->SetMarkerColor(kGreen+2); grRaaPtPhenix->SetMarkerSize(1.3); grRaaPtPhenix->SetLineColor(1); TLine *lh4 = new TLine(0.0,1.0,7.6,1.0); lh4->SetLineColor(1); lh4->SetLineStyle(1); lh4->SetLineWidth(1.5); //lh4->Draw("same"); TLatex *tb= new TLatex; tb->SetNDC(); tb->SetTextAlign(12); tb->SetTextColor(1); tb->SetTextSize(0.040); TBox *RaaPtJPsiPhenixSys[12]; for(int j=0;j<nbinsPtPhenix;j++){ RaaPtJPsiPhenixSys[j] = new TBox(PtPhenix[j]-0.4, RaaPtPhenix[j]-RaaPtSystErrPhenix[j], PtPhenix[j]+0.4, RaaPtPhenix[j]+RaaPtSystErrPhenix[j]); } for(int j=0;j<nbinsPtPhenix;j++){ RaaPtJPsiPhenixSys[j]->SetFillStyle(1001); RaaPtJPsiPhenixSys[j]->SetFillColor(kGreen+6); RaaPtJPsiPhenixSys[j]->SetLineColor(1); } TBox *PhenixGlobalSysJPsiPtFor; PhenixGlobalSysJPsiPtFor = new TBox(28.42,0.88,29.0,1.16); PhenixGlobalSysJPsiPtFor->SetFillStyle(3001); PhenixGlobalSysJPsiPtFor->SetLineColor(1); PhenixGlobalSysJPsiPtFor->SetFillColor(1); grRaaPtPhenix->Draw("sameP"); for(int j=0;j<nbinsPtPhenix;j++) RaaPtJPsiPhenixSys[j]->Draw("sameL"); grRaaPtPhenix->Draw("Psame"); //PhenixGlobalSysJPsiPtFor->Draw("sameL"); //tb->DrawLatex(0.22,0.16,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 0.0 GeV/c"); legend_ratio->SetTextColor(1); //legend_ratio->AddEntry(grRaaPtPhenix,"PHENIX: J/#psi #rightarrow #mu^{+} #mu^{-}, 1.2 < |y| < 2.2 & p_{T}^{J/#psi} > 0.0 GeV/c", "P"); legend_ratio->AddEntry(grRaaPtPhenix,"Au+Au #sqrt{s_{NN}} = 200 GeV, J/#psi PHENIX: 1.2 < |y| < 2.2", "P"); }
void Draw_CMS_Y2S_RaaVspT(TLegend *lgd) { //================= CMS Y2S Raa Vs Pt ===================================// const int nbinsPt=3; Double_t PtCMS[nbinsPt]={2.5,8.5,16.0}; Double_t ErrPtCMS[nbinsPt]={0}; Double_t RaaPtCMS[nbinsPt] = {0.0821,0.0656,0.141}; Double_t RaaPtStatErrCMS[nbinsPt] = {0.0471,0.0457,0.0585}; Double_t RaaPtSystErrCMS[nbinsPt] = {0.0182,0.0115,0.025}; TGraphErrors *grRaaPtCMS = new TGraphErrors(nbinsPt, PtCMS, RaaPtCMS, ErrPtCMS, RaaPtStatErrCMS); grRaaPtCMS->SetMarkerStyle(20); grRaaPtCMS->SetMarkerColor(4); grRaaPtCMS->GetYaxis()->SetRangeUser(-0.2,3.0); grRaaPtCMS->GetXaxis()->SetTitle("p_{T}(GeV/c)"); grRaaPtCMS->GetYaxis()->SetTitle("R_{AA}"); TAxis *Xaxis2 = grRaaPtCMS->GetXaxis(); Xaxis2->SetLimits(0.,20.0); grRaaPtCMS->Draw("AP"); TLine *lh4 = new TLine(0.0,1.0,20.0,1.0); lh4->SetLineColor(1); lh4->SetLineStyle(1); lh4->SetLineWidth(2); lh4->Draw("same"); TLatex *tb= new TLatex; tb->SetNDC(); tb->SetTextAlign(12); tb->SetTextColor(1); tb->SetTextSize(0.040); //tb->DrawLatex(0.55,0.22,"PbPb #sqrt{s_{NN}} = 2.76 TeV"); //tb->DrawLatex(0.55,0.16,"#varUpsilon #rightarrow #mu^{+} #mu^{-}, p_{T}^{#varUpsilon} > 0.0 GeV/c"); TBox *RaaPtCMSSys[nbinsPt]; for(int j=0;j<nbinsPt;j++){ RaaPtCMSSys[j] = new TBox(PtCMS[j]-0.5, RaaPtCMS[j]-RaaPtSystErrCMS[j], PtCMS[j]+0.5, RaaPtCMS[j]+RaaPtSystErrCMS[j]); } for(int j=0;j<nbinsPt;j++){ RaaPtCMSSys[j]->SetFillStyle(0000); RaaPtCMSSys[j]->SetLineColor(4); RaaPtCMSSys[j]->Draw("same"); } TBox *CMSGlobalSysPt; CMSGlobalSysPt = new TBox(18-0.2, 1 - 0.083, 18+0.2, 1 + 0.083); CMSGlobalSysPt->SetFillStyle(3001); CMSGlobalSysPt->SetLineColor(4); CMSGlobalSysPt->SetFillColor(4); //CMSGlobalSysPt->Draw("same"); lgd->AddEntry(grRaaPtCMS,"CMS Data", "P"); }
void NuclearModification( TString particle, const int nbins, Double_t xbins[], Double_t xhbins[], Double_t exl[], Double_t exl2[], Double_t exl0[], Double_t yPercSigmapPbSystTotHigh[], Double_t yPercSigmapPbSystTotLow[], Double_t commonErrorP, Double_t commonErrorN, Double_t FFsysterror, Double_t tagandprobcorrection[], TCanvas *canvasSigma, TCanvas *canvasRpA, int PadNum ){ gROOT->SetStyle("Plain"); gStyle->SetOptTitle(0); gStyle->SetOptStat(0); TFile*filePPReference=new TFile(Form("../../../fonll/output%s.root",particle.Data())); //###TFile*filePPReference=new TFile(Form("../../fonll/output%s.root",particle.Data())); TGraphAsymmErrors*gaeBplusReference=(TGraphAsymmErrors*)filePPReference->Get(Form("gaeSigmaDecay%s",particle.Data())); gaeBplusReference->SetName(Form("gae%sReference",particle.Data())); TFile*filepPb=new TFile(Form("../Results%s/Sigma%s.root",particle.Data(),particle.Data())); TH1F*hSigmapPbStat=(TH1F*)filepPb->Get("hPtSigma"); TH1F*hPt=(TH1F*)filepPb->Get("hPt"); TH1F*hEff=(TH1F*)filepPb->Get("hEff"); double scalingfactor=1e-6; double yvalue,xvalue,yerrorhigh,yerrorlow; for (int i=0;i<nbins;i++){ hSigmapPbStat->SetBinContent(i+1,scalingfactor*hSigmapPbStat->GetBinContent(i+1)); hSigmapPbStat->SetBinError(i+1,scalingfactor*hSigmapPbStat->GetBinError(i+1)); yvalue=-1.; xvalue=-1.; yerrorhigh=-1.; yerrorlow=-1.; gaeBplusReference->GetPoint(i,xvalue,yvalue); yerrorhigh=gaeBplusReference->GetEYhigh()[i]; yerrorlow=gaeBplusReference->GetEYlow()[i]; gaeBplusReference->SetPoint(i,xvalue,yvalue*scalingfactor); gaeBplusReference->SetPointEYhigh(i,yerrorhigh*scalingfactor); gaeBplusReference->SetPointEYlow(i,yerrorlow*scalingfactor); } for (int i=0;i<nbins;i++){ hSigmapPbStat->SetBinContent(i+1,(1./tagandprobcorrection[i])*hSigmapPbStat->GetBinContent(i+1)); hSigmapPbStat->SetBinError(i+1,(1./tagandprobcorrection[i])*hSigmapPbStat->GetBinError(i+1)); } Double_t yRefPP[nbins]; //value y reference Double_t xRefPP[nbins]; //value x reference Double_t yPPsystFONLLhigh[nbins]; //y err syst FONLL high Double_t yPPsystFONLLlow[nbins]; //y err syst FONLL low Double_t yPercPPsystFONLLhigh[nbins]; //y percentuale err syst FONLL high Double_t yPercPPsystFONLLlow[nbins]; //y percentuale err syst FONLL low Double_t ySigmapPb[nbins]; //value y pPb Double_t xSigmapPb[nbins]; //value x pPb Double_t ySigmapPbStat[nbins]; //y err stat pPb Double_t yPercSigmapPbStat[nbins]; //y err stat pPb Double_t yFONLL[nbins]; //1 Double_t yRpA[nbins]; //value y RpA Double_t yRpAStat[nbins]; //y err stat RpA Double_t yRpAsystFONLLhigh[nbins]; //y err syst FONLL RpA high Double_t yRpAsystFONLLlow[nbins]; //y err syst FONLL RpA lzow Double_t yPercRpAsystFONLLhigh[nbins]; //y percentuale err syst FONLL RpA high Double_t yPercRpAsystFONLLlow[nbins]; //y percentuale err syst FONLL RpA low Double_t ySigmapPbSystTotHigh[nbins]; //y percentuale err syst pPb TOT Double_t ySigmapPbSystTotLow[nbins]; //y percentuale err syst pPb TOT Double_t yPercRpPbSystTotHigh[nbins]; //y percentuale err syst RpPb TOT Double_t yPercRpPbSystTotLow[nbins]; //y percentuale err syst RpPb TOT Double_t yRpPbSystTotHigh[nbins]; //y percentuale err syst RpPb TOT Double_t yRpPbSystTotLow[nbins]; //y percentuale err syst RpPb TOT double x,y; for (Int_t i=0;i<nbins;i++) { gaeBplusReference->GetPoint(i,xRefPP[i],yRefPP[i]); yPPsystFONLLhigh[i]=gaeBplusReference->GetEYhigh()[i]; yPPsystFONLLlow[i]=gaeBplusReference->GetEYlow()[i]; yPercPPsystFONLLhigh[i]=yPPsystFONLLhigh[i]/yRefPP[i]; yPercPPsystFONLLlow[i]=yPPsystFONLLlow[i]/yRefPP[i]; yPercPPsystFONLLhigh[i]=TMath::Sqrt(yPercPPsystFONLLhigh[i]*yPercPPsystFONLLhigh[i]+FFsysterror*FFsysterror); yPercPPsystFONLLlow[i]=TMath::Sqrt(yPercPPsystFONLLlow[i]*yPercPPsystFONLLlow[i]+FFsysterror*FFsysterror); } for(Int_t i=0;i<nbins;i++) { ySigmapPb[i]=hSigmapPbStat->GetBinContent(i+1); ySigmapPbStat[i]=hSigmapPbStat->GetBinError(i+1); yPercSigmapPbStat[i]=ySigmapPbStat[i]/ySigmapPb[i]; ySigmapPbSystTotHigh[i]=yPercSigmapPbSystTotHigh[i]*ySigmapPb[i]; ySigmapPbSystTotLow[i]=yPercSigmapPbSystTotLow[i]*ySigmapPb[i]; } for(Int_t i=0;i<nbins;i++) { yRpA[i]=ySigmapPb[i]/yRefPP[i]; yRpAStat[i]=ySigmapPbStat[i]/yRefPP[i]; yFONLL[i]=yRpA[i]; yPercRpAsystFONLLhigh[i]=(yPercPPsystFONLLlow[i]/(1-yPercPPsystFONLLlow[i])); yPercRpAsystFONLLlow[i]=(yPercPPsystFONLLhigh[i]/(1+yPercPPsystFONLLhigh[i])); yRpAsystFONLLhigh[i]=yPercRpAsystFONLLhigh[i]*yRpA[i]; yRpAsystFONLLlow[i]=yPercRpAsystFONLLlow[i]*yRpA[i]; yRpPbSystTotHigh[i]=yPercSigmapPbSystTotHigh[i]*yRpA[i]; yRpPbSystTotLow[i]=yPercSigmapPbSystTotLow[i]*yRpA[i]; std::cout << i << " , " << xbins[i] << " , " << ySigmapPb[i] << " , sta: " << ySigmapPbStat[i] << " , syslow: " << ySigmapPbSystTotLow[i] << " ,syshigh: " << ySigmapPbSystTotHigh[i] << std::endl; std::cout << "FONLL: " << yRefPP[i] << " - " << yPPsystFONLLlow[i] << " + " << yPPsystFONLLhigh[i] << std::endl; std::cout << i << " ####### " << xbins[i] << " , " << yRpA[i] << " , sta: " << yRpAStat[i] << " , syslow: " << yRpPbSystTotLow[i] << " ,syshigh: " << yRpPbSystTotHigh[i] << " ,FONLLlow: " << yRpAsystFONLLlow[i] << " , FONLLhigh: " << yRpAsystFONLLhigh[i] << std::endl; TGraphAsymmErrors *gRpAstat = new TGraphAsymmErrors(nbins,xbins,yRpA,exl0,exl0,yRpAStat,yRpAStat); TGraphAsymmErrors *gRpAsyst = new TGraphAsymmErrors(nbins,xbins,yRpA,exl,exl,yRpPbSystTotLow,yRpPbSystTotHigh); TGraphAsymmErrors *gRpAsystFONLL = new TGraphAsymmErrors(nbins,xbins,yFONLL,exl,exl,yRpAsystFONLLlow,yRpAsystFONLLhigh); } TGraphAsymmErrors *gSigmasyst = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl2,exl2,ySigmapPbSystTotLow,ySigmapPbSystTotHigh); //###TGraphAsymmErrors *gSigmasyst = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl,exl,ySigmapPbSystTotLow,ySigmapPbSystTotHigh); gSigmasyst->SetTitle("Sigma syst uncertainty from pPb"); gSigmasyst->SetMarkerColor(1); gSigmasyst->SetLineColor(1); gSigmasyst->SetLineWidth(1); gSigmasyst->SetMarkerStyle(21); gSigmasyst->SetMarkerColor(1); gSigmasyst->SetFillColor(kYellow-7);//5 gSigmasyst->SetFillStyle(1001); TGraphAsymmErrors*gSigmasyst2=(TGraphAsymmErrors*)gSigmasyst->Clone(); gSigmasyst2->SetMarkerColor(1); gSigmasyst2->SetMarkerStyle(25); gSigmasyst2->SetFillColor(0); gSigmasyst2->SetFillStyle(0); gSigmasyst2->SetLineColor(1);//5 gSigmasyst2->SetLineStyle(1); gSigmasyst2->SetLineWidth(1); //###TGraphAsymmErrors *gSigmastat = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl,exl,ySigmapPbStat,ySigmapPbStat); TGraphAsymmErrors *gSigmastat = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl0,exl0,ySigmapPbStat,ySigmapPbStat); gSigmastat->SetTitle("Sigma stat uncertainty from pPb"); gSigmastat->SetMarkerColor(1); gSigmastat->SetLineColor(1); gSigmastat->SetLineWidth(2);//### gSigmastat->SetMarkerStyle(21); gSigmastat->SetMarkerColor(1); gSigmastat->SetFillColor(0); gSigmastat->SetFillStyle(0); gSigmastat->SetFillStyle(0); Double_t padcorrection; if (particle=="Bplus") padcorrection=Bp_padratio/Bp_padratio; else if (particle=="Bzero") padcorrection=Bp_padratio/B0_padratio; else if (particle=="Bs") padcorrection=Bp_padratio/Bs_padratio; std::cout << "padcorrection: " << padcorrection << std::endl; canvasSigma->cd(PadNum); //canvasSigma->Range(-1.989924,-0.2917772,25.49622,2.212202); canvasSigma->SetFillColor(0); canvasSigma->SetBorderMode(0); canvasSigma->SetBorderSize(2); //canvasSigma->SetLeftMargin(0.1451613); //canvasSigma->SetRightMargin(0.05443548); //canvasSigma->SetTopMargin(0.005);//0.08474576 //canvasSigma->SetBottomMargin(0.1165254); canvasSigma->SetFrameBorderMode(0); canvasSigma->SetFrameBorderMode(0); canvasSigma->SetLogy(); //###TH2F* hempty=new TH2F("hempty","", 10, 0.1, 65., 10., 0.1, 1e3); TH2F* hempty=new TH2F("hempty","", 10, 0.1, 65., 10., 0.3, 1e3); hempty->GetXaxis()->SetTitle("p_{T} (GeV/c)"); //if(particle=="Bplus") hempty->GetYaxis()->SetTitle("d#sigma / dp_{T} (B^{+}) (pb GeV^{-1}c)"); //if(particle=="Bzero") hempty->GetYaxis()->SetTitle("d#sigma / dp_{T} (B^{0}) (pb GeV^{-1}c)"); //if(particle=="Bs") hempty->GetYaxis()->SetTitle("d#sigma / dp_{T} (B_{s}) (pb GeV^{-1}c)"); hempty->GetXaxis()->CenterTitle(); hempty->GetYaxis()->CenterTitle(); //###hempty->GetYaxis()->SetTitle("d#sigma / dp_{T}( #mub GeV^{-1}c)"); hempty->GetYaxis()->SetTitle("d#sigma / dp_{T}(#mub/(GeV/c))"); //###hempty->GetXaxis()->SetTitleOffset(1.0);//###1.0 if (particle=="Bplus") hempty->GetXaxis()->SetTitleOffset(0.90);//###1.0 else if (particle=="Bzero") hempty->GetXaxis()->SetTitleOffset(0.90);//###0.80 else if (particle=="Bs") hempty->GetXaxis()->SetTitleOffset(0.90);//###0.85 hempty->GetYaxis()->SetTitleOffset(1.0);//###1.3 hempty->GetXaxis()->SetTitleSize(0.070*padcorrection);//###0.055 hempty->GetYaxis()->SetTitleSize(0.070*padcorrection);//###0.055 hempty->GetXaxis()->SetTitleFont(42); hempty->GetYaxis()->SetTitleFont(42); hempty->GetXaxis()->SetLabelFont(42); hempty->GetYaxis()->SetLabelFont(42); hempty->GetXaxis()->SetLabelSize(0.060*padcorrection);//###0.055 hempty->GetYaxis()->SetLabelSize(0.060*padcorrection);//###0.055 if (particle=="Bplus") hempty->GetXaxis()->SetLabelOffset(0.005);//###0.005 else if (particle=="Bzero") hempty->GetXaxis()->SetLabelOffset(0.005);//###0.0001 else if (particle=="Bs") hempty->GetXaxis()->SetLabelOffset(0.005);//###0.0005 //###hempty->GetXaxis()->SetLabelOffset(0.005);//###0.005 hempty->SetMaximum(2); hempty->SetMinimum(0.); hempty->Draw(); gaeBplusReference->SetMarkerColor(1); gaeBplusReference->SetMarkerStyle(25); gaeBplusReference->SetFillColor(kYellow-7);//5 gaeBplusReference->SetFillStyle(1001); gaeBplusReference->SetLineColor(kAzure-3); gaeBplusReference->SetLineWidth(1); gSigmastat->SetMarkerColor(1); gSigmastat->SetLineColor(1); gSigmastat->SetLineWidth(2); gSigmastat->SetMarkerStyle(21); gSigmastat->SetMarkerColor(1); // Histogram style TH1D* hBplusReference = new TH1D("hBplusReference","",nbins,xhbins); TH1D* hBplusReferenceEYhigh = new TH1D("hBplusReferenceEYhigh","",nbins,xhbins); TH1D* hBplusReferenceEYlow = new TH1D("hBplusReferenceEYlow","",nbins,xhbins); for (int i=0;i<nbins;i++){ double xgae,ygae; gaeBplusReference->GetPoint(i,xgae,ygae); hBplusReference->SetBinContent(i+1,ygae); hBplusReferenceEYhigh->SetBinContent(i+1,ygae+gaeBplusReference->GetEYhigh()[i]); hBplusReferenceEYlow->SetBinContent(i+1,ygae-gaeBplusReference->GetEYlow()[i]); std::cout << "### FONLL (" << i << ") : " << ygae << " + " << gaeBplusReference->GetEYhigh()[i] << " - " << gaeBplusReference->GetEYlow()[i] << std::endl; } //hBplusReference->SetMarkerColor(1); //hBplusReference->SetMarkerStyle(25); //hBplusReference->SetFillColor(kYellow-7);//5 //hBplusReference->SetFillStyle(1001); hBplusReference->SetLineColor(kAzure-3); hBplusReference->SetLineWidth(2); hBplusReferenceEYhigh->SetLineColor(kAzure-3); hBplusReferenceEYhigh->SetLineWidth(2); hBplusReferenceEYhigh->SetLineStyle(2); hBplusReferenceEYlow->SetLineColor(kAzure-3); hBplusReferenceEYlow->SetLineWidth(2); hBplusReferenceEYlow->SetLineStyle(2); /* hBplusReference->Draw("][,same"); hBplusReferenceEYhigh->Draw("][,same"); hBplusReferenceEYlow->Draw("][,same"); */ /* gaeBplusReference->Draw("2psame");//2same TGraphAsymmErrors*gaeBplusReference2=(TGraphAsymmErrors*)gaeBplusReference->Clone(); gaeBplusReference2->SetMarkerColor(1); gaeBplusReference2->SetMarkerStyle(25); gaeBplusReference2->SetFillColor(0); gaeBplusReference2->SetFillStyle(0); gaeBplusReference2->SetLineColor(kAzure-3); gaeBplusReference2->SetLineWidth(1); gaeBplusReference2->Draw("2psame");//2same */ //coord. for legend for sigma in the B+ pannel //###TLegend *legendSigma=new TLegend(0.468298,0.7045614,0.7678185,0.8757895,""); //###TLegend *legendSigma=new TLegend(0.55,0.63,0.85,0.80,""); TLegend *legendSigma=new TLegend(0.38,0.67,0.68,0.84,""); legendSigma->SetBorderSize(0); legendSigma->SetLineColor(0); legendSigma->SetFillColor(0); legendSigma->SetFillStyle(1001); legendSigma->SetTextFont(42); legendSigma->SetTextSize(0.060);//###0.045 /* TBox *c = new TBox(3,1-commonErrorN,7,1+commonErrorP); c->SetLineColor(5); c->SetFillColor(5); c->Draw(); TBox *c2 = c->Clone(); c2->SetLineColor(1); c2->SetFillStyle(0); c2->Draw(); */ //TLegendEntry *ent_SigmapPb=legendSigma->AddEntry(gSigmastat,"pPb","pf"); TLegendEntry *ent_SigmapPb=legendSigma->AddEntry(gSigmasyst,"pPb","pf"); /* ent_SigmapPb->SetTextFont(42); ent_SigmapPb->SetLineColor(1); ent_SigmapPb->SetMarkerColor(1); ent_SigmapPb->SetFillColor(0); ent_SigmapPb->SetFillStyle(0); */ ent_SigmapPb->SetTextFont(42); ent_SigmapPb->SetMarkerColor(1); ent_SigmapPb->SetMarkerStyle(25); //ent_SigmapPb->SetFillColor(kYellow-7);//5 //ent_SigmapPb->SetFillStyle(1001); ent_SigmapPb->SetLineColor(1); ent_SigmapPb->SetLineWidth(0); ent_SigmapPb->SetLineStyle(0); /* TLegendEntry *ent_Sigmapp=legendSigma->AddEntry(gaeBplusReference,"FONLL pp ref.","pf"); ent_Sigmapp->SetTextFont(42); ent_Sigmapp->SetLineColor(kAzure-3);//5 ent_Sigmapp->SetLineStyle(1); ent_Sigmapp->SetMarkerColor(1); ent_Sigmapp->SetMarkerStyle(21); */ TLegendEntry *ent_Sigmapp=legendSigma->AddEntry(hBplusReference,"Scaled FONLL pp ref.","l"); ent_Sigmapp->SetTextFont(42); ent_Sigmapp->SetLineColor(kAzure-3);//5 ent_Sigmapp->SetLineStyle(1); ent_Sigmapp->SetMarkerColor(1); ent_Sigmapp->SetMarkerStyle(21); TLegendEntry *ent_Sigmapperr=legendSigma->AddEntry(hBplusReferenceEYhigh,"FONLL pp ref. uncert.","l"); ent_Sigmapperr->SetTextFont(42); ent_Sigmapperr->SetLineColor(kAzure-3);//5 ent_Sigmapperr->SetLineStyle(2); ent_Sigmapperr->SetMarkerColor(1); ent_Sigmapperr->SetMarkerStyle(21); //###gSigmasyst->SetFillColor(0); //###gSigmasyst->SetFillStyle(0); for (int i=0;i<nbins;i++){ double xgae,ygae; gSigmastat->GetPoint(i,xgae,ygae); std::cout << "### cross section (" << i << ") : " << ygae << " stat: " << gSigmastat->GetEYhigh()[i] << " syst: " << gSigmasyst->GetEYhigh()[i] << std::endl; } gSigmasyst->Draw("2esame");//###2psame gSigmasyst2->Draw("2esame"); hBplusReference->Draw("][,same"); hBplusReferenceEYhigh->Draw("][,same"); hBplusReferenceEYlow->Draw("][,same"); gSigmastat->SetFillColor(0); gSigmastat->Draw("epsame"); /* TBox *d = new TBox(0.1,1-commonErrorN,4,1+commonErrorP); d->SetLineColor(1); d->SetFillColor(0); d->Draw(); */ //if(PadNum==0 || PadNum==1){ if(PadNum==3 || PadNum==1 || PadNum==2){ legendSigma->Draw("same"); //TLatex * tlatex1=new TLatex(0.21,0.88801268,"CMS"); TLatex * tlatex1=new TLatex(0.19,0.86,"CMS"); tlatex1->SetNDC(); tlatex1->SetTextColor(1); tlatex1->SetTextFont(62);//42 tlatex1->SetTextSize(0.07);//0.045 tlatex1->Draw(); /* TLatex * tlatex12=new TLatex(0.35,0.86,"Preliminary"); tlatex12->SetNDC(); tlatex12->SetTextColor(1); tlatex12->SetTextFont(52);//42 tlatex12->SetTextSize(0.05);//0.045 tlatex12->Draw(); */ //TLatex * tlatexlumi=new TLatex(0.471371,0.88801268,"L = 34.8 nb^{-1} (pPb 5.02 TeV)"); //TLatex * tlatexlumi=new TLatex(0.471371,0.88801268,"34.6 nb^{-1} (pPb 5.02 TeV)"); TLatex * tlatexlumi; //###TLatex * tlatexlumi=new TLatex(0.390,0.950,"34.6 nb^{-1} (pPb 5.02 TeV)"); if (PadNum==1) tlatexlumi = new TLatex(0.41,0.94,"34.6 nb^{-1} (pPb 5.02 TeV)"); else tlatexlumi = new TLatex(0.39,0.94,"34.6 nb^{-1} (pPb 5.02 TeV)"); tlatexlumi->SetNDC(); tlatexlumi->SetTextColor(1); tlatexlumi->SetTextFont(42); tlatexlumi->SetTextSize(0.06);//0.045 tlatexlumi->Draw(); } //if(PadNum==2){ if(PadNum==3 || PadNum==1 || PadNum==2) { //TLatex * tlatex4=new TLatex(0.60,0.73,"|y_{lab}| < 2.4"); TLatex * tlatex4=new TLatex(0.65,0.50,"|y_{lab}| < 2.4"); tlatex4->SetNDC(); tlatex4->SetTextColor(1); tlatex4->SetTextFont(42);//42 tlatex4->SetTextSize(0.07);//0.045 tlatex4->Draw(); } double GloUnc; double xtl5=0.54; if(PadNum==1) {GloUnc=Bp_commonErrorP*100;xtl5=0.54;}//###0.57 if(PadNum==2) {GloUnc=B0_commonErrorP*100;xtl5=0.47;} if(PadNum==3) {GloUnc=Bs_commonErrorP*100;xtl5=0.42;} xtl5=0.54; //TLegend *legendSigma=new TLegend(0.55,0.63,0.85,0.80,""); TLatex * tlatex5=new TLatex(xtl5,0.60,Form("Global uncert. %2.1f%%",GloUnc)); tlatex5->SetNDC(); tlatex5->SetTextColor(1); tlatex5->SetTextFont(42);//42 tlatex5->SetTextSize(0.05*padcorrection);//0.045 tlatex5->Draw(); //###double xpos=0.8528226; //###double ypos=0.6849894; double xpos=0.90;//0.86 double ypos=0.85;//0.86 TString mypar; if(particle=="Bplus") mypar="B^{+}"; if(particle=="Bzero") mypar="B^{0}"; if(particle=="Bs") mypar="B_{s}^{0}"; double xlgap=0.04; /* if(particle=="Bplus") xpos=(0.365816-xlgap)/0.365816; if(particle=="Bzero") xpos=1-xlgap/(0.673101-0.365816); if(particle=="Bs") xpos=0.94-xlgap/(1-0.673101);; */ TLatex * tlatex3=new TLatex(xpos,ypos,mypar.Data()); tlatex3->SetNDC(); tlatex3->SetTextColor(1); tlatex3->SetTextFont(42); tlatex3->SetTextSize(0.07*padcorrection); tlatex3->Draw(); TGraphAsymmErrors *gRpAstat = new TGraphAsymmErrors(nbins,xbins,yRpA,exl0,exl0,yRpAStat,yRpAStat); gRpAstat->SetTitle("RpA stat uncertainty from pPb"); gRpAstat->SetMarkerStyle(21); gRpAstat->SetMarkerColor(1); gRpAstat->SetLineColor(1); gRpAstat->SetLineWidth(2); gRpAstat->SetFillColor(0); TGraphAsymmErrors *gRpAsyst = new TGraphAsymmErrors(nbins,xbins,yRpA,exl,exl,yRpPbSystTotLow,yRpPbSystTotHigh); gRpAsyst->SetTitle("RpA syst uncertainty from pPb"); gRpAsyst->SetName("gRpAsyst"); /* gRpAsyst->SetFillColor(0); gRpAsyst->SetMarkerSize(0); gRpAsyst->SetLineColor(1); gRpAsyst->SetLineWidth(2); gRpAsyst->SetFillStyle(0); */ gRpAsyst->SetFillColor(kYellow-7);//###0 //gRpAsyst->SetMarkerSize(0); gRpAsyst->SetLineColor(1); gRpAsyst->SetLineWidth(2); gRpAsyst->SetFillStyle(1001); gRpAsyst->SetMarkerStyle(21); gRpAsyst->SetMarkerColor(1); TGraphAsymmErrors*gRpAsyst2=(TGraphAsymmErrors*)gRpAsyst->Clone(); gRpAsyst2->SetMarkerColor(1); gRpAsyst2->SetMarkerStyle(25); gRpAsyst2->SetFillColor(0); gRpAsyst2->SetFillStyle(0); gRpAsyst2->SetLineColor(1);//5 gRpAsyst2->SetLineStyle(1); gRpAsyst2->SetLineWidth(2); TGraphAsymmErrors *gRpAsystFONLL = new TGraphAsymmErrors(nbins,xbins,yFONLL,exl,exl,yRpAsystFONLLlow,yRpAsystFONLLhigh); gRpAsystFONLL->SetTitle("RpA syst uncertainty from FONLL reference"); /* gRpAsystFONLL->SetFillColor(kYellow-7);//5 gRpAsystFONLL->SetLineColor(kAzure-3);//5 gRpAsystFONLL->SetMarkerColor(4);//kAzure-3); TGraphAsymmErrors *gRpAsystFONLL2 = (TGraphAsymmErrors*)gRpAsystFONLL->Clone(); gRpAsystFONLL2->SetFillStyle(0); gRpAsystFONLL2->SetLineColor(kAzure-3);//5 gRpAsystFONLL2->SetMarkerColor(4);//kAzure-3); */ gRpAsystFONLL->SetFillColor(0);//5,kYellow-7 gRpAsystFONLL->SetLineColor(kAzure-3);//5 gRpAsystFONLL->SetMarkerColor(4);//kAzure-3); gRpAsystFONLL->SetLineStyle(1); gRpAsystFONLL->SetLineWidth(2); TGraphAsymmErrors*gRpAsystFONLL2=(TGraphAsymmErrors*)gRpAsystFONLL->Clone(); gRpAsystFONLL2->SetMarkerColor(1); gRpAsystFONLL2->SetMarkerStyle(25); gRpAsystFONLL2->SetFillColor(0); gRpAsystFONLL2->SetFillStyle(0); gRpAsystFONLL2->SetLineColor(kAzure-3);//5 gRpAsystFONLL2->SetLineStyle(1); gRpAsystFONLL2->SetLineWidth(2); canvasRpA->cd(PadNum); //canvasRpA->Range(-1.989924,-0.2917772,25.49622,2.212202); canvasRpA->SetFillColor(0); canvasRpA->SetBorderMode(0); canvasRpA->SetBorderSize(2); /* canvasRpA->SetLeftMargin(0.1451613); canvasRpA->SetRightMargin(0.05443548); canvasRpA->SetTopMargin(0.08474576); canvasRpA->SetBottomMargin(0.1165254); */ canvasRpA->SetFrameBorderMode(0); canvasRpA->SetFrameBorderMode(0); hempty=new TH2F("hempty","",10,0.1, 62. ,30.,0.,3.0); hempty->GetXaxis()->CenterTitle(); hempty->GetYaxis()->CenterTitle(); hempty->GetXaxis()->SetTitle("p_{T} (GeV/c)"); hempty->GetYaxis()->SetTitle("R^{FONLL}_{pA}"); //###hempty->GetXaxis()->SetTitleOffset(1.0);//###1.3 hempty->GetYaxis()->SetTitleOffset(1.0);//###1.1 hempty->GetXaxis()->SetTitleSize(0.070*padcorrection);//###0.055 hempty->GetYaxis()->SetTitleSize(0.070*padcorrection);//###0.055 hempty->GetXaxis()->SetTitleFont(42); hempty->GetYaxis()->SetTitleFont(42); hempty->GetXaxis()->SetLabelFont(42); hempty->GetYaxis()->SetLabelFont(42); hempty->GetXaxis()->SetLabelSize(0.060*padcorrection);//###0.055 hempty->GetYaxis()->SetLabelSize(0.060*padcorrection);//###0.055 if (particle=="Bplus") hempty->GetXaxis()->SetTitleOffset(0.90);//###1.0 else if (particle=="Bzero") hempty->GetXaxis()->SetTitleOffset(0.90);//###0.80 else if (particle=="Bs") hempty->GetXaxis()->SetTitleOffset(0.90);//###0.85 if (particle=="Bplus") hempty->GetXaxis()->SetLabelOffset(0.005);//###0.005 else if (particle=="Bzero") hempty->GetXaxis()->SetLabelOffset(0.005);//###0.0001 else if (particle=="Bs") hempty->GetXaxis()->SetLabelOffset(0.005);//###0.0005 //###hempty->SetMaximum(2); hempty->SetMaximum(3.0); hempty->SetMinimum(0.); hempty->Draw(); TLine *l = new TLine(0,1, 65.,1); l->SetLineStyle(2); //TLine *line = new TLine(8.740882,1.017445,61,1.008586); //###TLine *line = new TLine(4.740882,1.017445,61,1.008586); TLine *line = new TLine(4.740882,1.00,61,1.00); line->SetLineColor(kRed);//### line->SetLineStyle(2); line->SetLineWidth(2); /* gRpAsystFONLL->Draw("2same"); gRpAsystFONLL2->Draw("2same"); line->Draw(); gRpAsyst->Draw("2esame"); gRpAstat->Draw("psame"); */ gRpAstat->SetMarkerStyle(21); gRpAstat->SetLineColor(1); gRpAstat->SetMarkerColor(1); for (int i=0;i<nbins;i++){ double xgae,ygae; gRpAstat->GetPoint(i,xgae,ygae); std::cout << "####### RpA (" << i << ") : " << ygae << " stat: " << gRpAstat->GetEYhigh()[i] << " syst: " << gRpAsyst->GetEYhigh()[i] << std::endl; std::cout << "########### FONLL (" << i << ") : " << " + " << gRpAsystFONLL->GetEYhigh()[i] << " - " << gRpAsystFONLL->GetEYlow()[i] << std:: endl; } gRpAsystFONLL->Draw("2same"); gRpAsystFONLL2->Draw("2same"); //###line->Draw(); gRpAsyst->Draw("2esame"); gRpAsyst2->Draw("2esame"); gRpAstat->Draw("psame"); line->Draw(); TBox *a = new TBox(0.1,1-commonErrorN,4,1+commonErrorP); a->SetLineColor(1); a->SetFillColor(0); a->Draw(); std::cout << "%%%%%%% RpA commonError " << " - " << commonErrorN << " + " << commonErrorP << std::endl; TBox *b = new TBox(0.1,1-commonErrorN,4,1+commonErrorP); b->SetLineColor(1); b->SetFillColor(kGray); b->Draw(); TBox *b2 = (TBox*)b->Clone(); b2->SetLineColor(1); b2->SetFillStyle(0); b2->Draw(); TLegend *legendRpA=new TLegend(0.22,0.60,0.51,0.83,""); legendRpA->SetBorderSize(0); legendRpA->SetLineColor(0); legendRpA->SetFillColor(0); legendRpA->SetFillStyle(1001); legendRpA->SetTextFont(42); legendRpA->SetTextSize(0.060);//###0.045 TLegendEntry *ent_RpAstat=legendRpA->AddEntry(gRpAstat,"R^{FONLL}_{pA}","p"); //###TLegendEntry *ent_RpAstat=legendRpA->AddEntry(gRpAstat,"pPb data","pf"); /* ent_RpAstat->SetTextFont(42); ent_RpAstat->SetLineColor(2); ent_RpAstat->SetMarkerColor(2); */ ent_RpAstat->SetTextFont(42); ent_RpAstat->SetMarkerColor(1); ent_RpAstat->SetMarkerStyle(25); //ent_RpAstat->SetFillColor(kYellow-7);//5 //ent_RpAstat->SetFillStyle(1001); ent_RpAstat->SetLineColor(1); ent_RpAstat->SetLineWidth(2); ent_RpAstat->SetLineStyle(0); TLegendEntry *ent_RpAsyst=legendRpA->AddEntry(gRpAsyst,"Syst. pPb data","f"); ent_RpAsyst->SetTextFont(42); ent_RpAsyst->SetMarkerColor(1); ent_RpAsyst->SetMarkerStyle(25); //ent_RpAsyst->SetFillColor(kYellow-7);//5 //ent_RpAsyst->SetFillStyle(1001); ent_RpAsyst->SetLineColor(1); ent_RpAsyst->SetLineWidth(2); ent_RpAsyst->SetLineStyle(0); TLegendEntry *ent_RpAsystFONLL=legendRpA->AddEntry(gRpAsystFONLL,"Syst. FONLL pp ref.","f"); /* ent_RpAsystFONLL->SetTextFont(42); ent_RpAsystFONLL->SetLineColor(kAzure-3);//5 ent_RpAsystFONLL->SetLineStyle(1); ent_RpAsystFONLL->SetLineWidth(1); ent_RpAsystFONLL->SetMarkerColor(kYellow-7);//5 */ ent_RpAsystFONLL->SetTextFont(42); ent_RpAsystFONLL->SetLineColor(2);//###5 ent_RpAsystFONLL->SetLineStyle(1); ent_RpAsystFONLL->SetMarkerColor(kYellow-7);//5 TLegendEntry *ent_RpAsystData=legendRpA->AddEntry(b,"Syst. int. lumi + B","f"); /* ent_RpAsystData->SetTextFont(42); ent_RpAsystData->SetLineColor(1); ent_RpAsystData->SetMarkerColor(2); */ ent_RpAsystData->SetTextFont(42); ent_RpAsystData->SetLineColor(2); ent_RpAsystData->SetMarkerColor(2); //if(PadNum==1||PadNum==3){ if(PadNum==3 || PadNum==1 || PadNum==2) { legendRpA->Draw(); //TLatex * tlatex4=new TLatex(0.21,0.88801268,"CMS"); TLatex * tlatex4=new TLatex(0.19,0.85,"CMS"); tlatex4->SetNDC(); tlatex4->SetTextColor(1); tlatex4->SetTextFont(62);//42 tlatex4->SetTextSize(0.07);//0.045 tlatex4->Draw(); /* TLatex * tlatex42=new TLatex(0.35,0.86,"Preliminary"); tlatex42->SetNDC(); tlatex42->SetTextColor(1); tlatex42->SetTextFont(52);//42 tlatex42->SetTextSize(0.05);//0.045 tlatex42->Draw(); */ //TLatex * tlatex2=new TLatex(0.471371,0.88801268,"L = 34.8 nb^{-1} (pPb 5.02 TeV)"); //TLatex * tlatex2=new TLatex(0.471371,0.88801268,"34.6 nb^{-1} (pPb 5.02 TeV)"); //###TLatex * tlatex2=new TLatex(0.390,0.950,"34.6 nb^{-1} (pPb 5.02 TeV)"); TLatex * tlatex2; if (PadNum==1) tlatex2 = new TLatex(0.41,0.94,"34.6 nb^{-1} (pPb 5.02 TeV)"); else tlatex2 = new TLatex(0.39,0.94,"34.6 nb^{-1} (pPb 5.02 TeV)"); tlatex2->SetNDC(); tlatex2->SetTextColor(1); tlatex2->SetTextFont(42); tlatex2->SetTextSize(0.06);//0.045 tlatex2->Draw(); } //if(PadNum==2){ if(PadNum==3 || PadNum==1 || PadNum==2) { TLatex * tlatex4=new TLatex(0.65,0.23,"|y_{lab}| < 2.4"); tlatex4->SetNDC(); tlatex4->SetTextColor(1); tlatex4->SetTextFont(42);//42 tlatex4->SetTextSize(0.07);//0.045 tlatex4->Draw(); } tlatex3->Draw(); TFile *fout=new TFile(Form("../Results%s/fileRpA%s.root",particle.Data(),particle.Data()),"recreate"); fout->cd(); gSigmasyst->SetName("gSigmasyst"); gSigmasyst->Write(); gaeBplusReference->Write(); hSigmapPbStat->Write(); }
void HiggsPlot::PlotgSLPRL(int isgSR, double tBmH_max){ double b = 0.12; styles style; style.setPadsStyle(-2); style.TitleSize = 0.1; style.PadBottomMargin = 2*b/(1+b); style.setDefaultStyle(); int nBins = 1000, iDecay, colors[2][2] = {{2,1},{kBlue-10,kBlue+1}}; double PadLimit[2][2] = {{(1-b)/2.,1}, {0, (1+b)/2.}}; double maxRD[] = {0.82, 0.47}, minRD[] = {0.1, 0.21}, TopMargin[] = {0.01, 0}; TString hName, epsName = "public_html/Conclusions_gSR.eps", label, padName; //TString TagDecay[] = {"R(D)", "R(D*)"}, xTitle = "-g_{SR} (GeV^{-1})"; TString TagDecay[] = {"R(D)", "R(D*)"}, xTitle = "g"; TBox box; box.SetLineColor(4);box.SetFillColor(4); TLine line; line.SetLineStyle(1); line.SetLineColor(4); line.SetLineWidth(3); TCanvas can("can","RD Vs Higgs"); TPad *Pads[2]; TH1F *hBF[3][2], *hMeas[3][2]; if(isgSR==0){ colors[0][0] = kGreen+1; RDCoef[1][0][1] = -RDCoef[1][0][1]; epsName.ReplaceAll("gSR","gSL"); //xTitle = "-g_{SL} (GeV^{-1})"; } for(int his=0; his<1; his++) { for(int isDs=0; isDs<3; isDs++){ hName = "hBF"; hName += his; hName += isDs; hBF[isDs][his] = new TH1F(hName,"",nBins,0,tBmH_max); hBF[isDs][his]->SetFillColor(colors[0][his]); hBF[isDs][his]->SetLineColor(colors[0][his]); hBF[isDs][his]->SetLineWidth(2); hName = "hMeas"; hName += his; hName += isDs; hMeas[isDs][his] = new TH1F(hName,"",nBins,0,tBmH_max); hMeas[isDs][his]->SetFillColor(colors[1][his]); hMeas[isDs][his]->SetLineColor(colors[1][his]); hMeas[isDs][his]->SetLineWidth(3); } } double tBmH, BF[2], gSL; for(int isDs=0; isDs<2; isDs++){ can.cd(0); padName = "Pad"; padName += isDs; Pads[isDs] = new TPad(padName,"",0,PadLimit[isDs][0], 1, PadLimit[isDs][1]); Pads[isDs]->SetTopMargin(TopMargin[isDs]); Pads[isDs]->Draw(); Pads[isDs]->cd(); iDecay = isDs+1; for(int bin=1; bin<=nBins; bin++){ gSL = hBF[isDs][0]->GetBinCenter(bin)/mTau; tBmH = sqrt(gSL/4.2); Compute(tBmH,BF,iDecay); hBF[isDs][0]->SetBinContent(bin, BF[0]); hBF[isDs][0]->SetBinError(bin, BF[1]); if(_varyRD){ hMeas[isDs][0]->SetBinContent(bin, MeasuredRD[isDs]->Eval(tBmH)); hMeas[isDs][0]->SetBinError(bin, MeasuredRD[isDs+2]->Eval(tBmH)); } else { hMeas[isDs][0]->SetBinContent(bin, Measurement[isDs+1][0]); hMeas[isDs][0]->SetBinError(bin, Measurement[isDs+1][1]); } } hName += isDs; hBF[isDs][1] = static_cast<TH1F*>(hBF[isDs][0]->Clone(hName)); hName += isDs; hMeas[isDs][1] = static_cast<TH1F*>(hMeas[isDs][0]->Clone(hName)); for(int bin=1; bin<=nBins; bin++){hBF[isDs][1]->SetBinError(bin,0);hMeas[isDs][1]->SetBinError(bin,0);} //hMeas[isDs][0]->SetFillStyle(3002); hBF[isDs][1]->SetFillColor(0); hBF[isDs][1]->SetLineColor(colors[0][1]); hBF[isDs][1]->SetLineWidth(2); hMeas[isDs][1]->SetFillColor(0); hMeas[isDs][1]->SetLineColor(colors[1][1]); hMeas[isDs][1]->SetLineWidth(3); hBF[isDs][0]->GetXaxis()->CenterTitle(true); hBF[isDs][0]->GetYaxis()->CenterTitle(true); hBF[isDs][0]->SetMinimum(minRD[isDs]); hBF[isDs][0]->SetMaximum(maxRD[isDs]); hBF[isDs][0]->Draw("e3"); hMeas[isDs][0]->Draw("e3 same"); hMeas[isDs][1]->Draw("c same"); hBF[isDs][0]->Draw("e3 same"); hBF[isDs][1]->Draw("c same"); if(0){ RDCoef[isDs][0][1] = -RDCoef[isDs][0][1]; for(int bin=1; bin<=nBins; bin++){ gSL = hBF[isDs+1][0]->GetBinCenter(bin); tBmH = sqrt(gSL/4.2); Compute(tBmH,BF,iDecay); hBF[isDs+1][0]->SetBinContent(bin, BF[0]); hBF[isDs+1][0]->SetBinError(bin, BF[1]); } hBF[isDs+1][0]->SetFillColor(8); hBF[isDs][0]->SetLineColor(8); hName += isDs+1; hBF[isDs+1][1] = static_cast<TH1F*>(hBF[isDs+1][0]->Clone(hName)); for(int bin=1; bin<=nBins; bin++)hBF[isDs+1][1]->SetBinError(bin,0); hBF[isDs+1][1]->SetFillColor(0);hBF[isDs+1][1]->SetLineColor(1); hBF[isDs+1][1]->SetLineWidth(2); hBF[isDs][0]->SetMinimum(minRD[isDs]); hBF[isDs][0]->SetMaximum(maxRD[isDs]); hBF[isDs+1][0]->Draw("e3"); hMeas[isDs][0]->Draw("e3 same"); hMeas[isDs][1]->Draw("c same"); hBF[isDs+1][0]->Draw("e3 same"); hBF[isDs+1][0]->Draw("e3 same"); hBF[isDs+1][1]->Draw("c same"); RDCoef[isDs][0][1] = -RDCoef[isDs][0][1]; } TString Title = xTitle; if(isDs==0) Title = ""; style.setTitles(hBF[isDs][0],Title,TagDecay[isDs]); hBF[isDs][0]->Draw("axis same"); } can.SaveAs(epsName); for(int isDs=0; isDs<3; isDs++){ //Pads[isDs]->Delete(); for(int his=0; his<2; his++) { if(isDs==2 && his == 1) continue; hBF[isDs][his]->Delete(); } hMeas[isDs][0]->Delete(); } }
void NuclearModificationFactorCent(TString inputPP="ROOTfiles/CrossSectionPP.root", TString inputPbPb="ROOTfiles/CrossSectionPbPb.root", TString inputEffPP = "ROOTfiles/MCstudiesPP_INC.root", TString inputEffPbPb = "ROOTfiles/MCstudiesPbPb_CENT.root", TString label="PbPb", TString outputfile="RAAfile.root", int doDataCor = 0, double PPlumi=1., double nMBEvt=1., Float_t centMin=0., Float_t centMax=100.) { float pti = _ptBins[0]; float pte = _ptBins[_nBins]; gStyle->SetOptTitle(0); gStyle->SetOptStat(0); gStyle->SetEndErrorSize(0); gStyle->SetMarkerStyle(20); gStyle->SetPadRightMargin(0.03);//###0.020 gStyle->SetPadLeftMargin(0.12); gStyle->SetPadTopMargin(0.075); gStyle->SetPadBottomMargin(0.12); TFile *fpp=new TFile(inputPP.Data()); TFile *fPbPb=new TFile(inputPbPb.Data()); TFile *fEffpp=new TFile(inputEffPP.Data()); TFile *fEffPbPb=new TFile(inputEffPbPb.Data()); TH1D*hSigmaPP1Bin=(TH1D*)fpp->Get("hPt"); TH1D*hSigmaPbPb=(TH1D*)fPbPb->Get("hPt"); TH1D*hEffPP1Bin=(TH1D*)fEffpp->Get("hEff"); TH1D*hEffPbPb=(TH1D*)fEffPbPb->Get("hEff"); TH1D*hSigmaPPStat = new TH1D("hSigmaPPStat","",_nBins,_ptBins); TH1D*hEffPP = new TH1D("hEffPP","",_nBins,_ptBins); for(int i=0;i<_nBins;i++){ hSigmaPPStat->SetBinContent(i+1,hSigmaPP1Bin->GetBinContent(1)); hSigmaPPStat->SetBinError(i+1,hSigmaPP1Bin->GetBinError(1)); hEffPP->SetBinContent(i+1,hEffPP1Bin->GetBinContent(1)); hEffPP->SetBinError(i+1,hEffPP1Bin->GetBinError(1)); } if(doDataCor != 1) hSigmaPPStat->Divide(hEffPP); hSigmaPPStat->Scale(1./(2*PPlumi*BRchain)); TH1D*hSigmaPbPbStat=(TH1D*)fPbPb->Get("hPt"); for(int i=0;i<_nBins;i++){ } hSigmaPbPbStat->SetName("hSigmaPbPbStat"); if(doDataCor != 1) hSigmaPbPbStat->Divide(hEffPbPb); hSigmaPbPbStat->Divide(hSigmaPPStat); for(int i=0;i<_nBins;i++){ double pbpbScale = 2*BRchain*(nMBEvt*(_ptBins[i+1]-_ptBins[i])/2/100*TAA[i]/1e9); hSigmaPbPbStat->SetBinContent(i+1, hSigmaPbPbStat->GetBinContent(i+1)/pbpbScale); hSigmaPbPbStat->SetBinError(i+1, hSigmaPbPbStat->GetBinError(i+1)/pbpbScale); //std::cout<<"RAA: "<<hSigmaPbPbStat->GetBinContent(i+1)<<std::endl; } /* double mod_ptBins[_nBins+1]; for(int i=0;i<_nBins+1;i++){ mod_ptBins[i] = _ptBins[i]/2.; } TH1D*hNuclearModification = new TH1D("hNuclearModification","",_nBins,mod_ptBins); for(int i=0;i<_nBins;i++){ hNuclearModification->SetBinContent(i+1, hSigmaPbPbStat->GetBinContent(i+1)); hNuclearModification->SetBinError(i+1, hSigmaPbPbStat->GetBinError(i+1)); } double apt[_nBins]; //bin half width double aptl[_nBins]; //number of every rebined bin double bin_num[_nBins]; for (int ibin=0; ibin<_nBins; ibin++){ apt[ibin]=(mod_ptBins[ibin+1]+mod_ptBins[ibin])/2.; aptl[ibin] = (mod_ptBins[ibin+1]-mod_ptBins[ibin])/2; bin_num[ibin]=aptl[ibin]/binsize*2; } pti = pti/2.; pte = pte/2.; Double_t xr[_nBins], yr[_nBins], xrlow[_nBins], yrlow[_nBins],xrhigh[_nBins],yrhigh[_nBins]; for(int i=0;i<_nBins;i++) { yr[i] = hNuclearModification->GetBinContent(i+1); double systematic=0.01*systematicsForRAACent(hNuclearModification->GetBinCenter(i+1),centMin,centMax,0.,0.); //double systematic=0.; yrlow[i] = hNuclearModification->GetBinContent(i+1)*systematic; yrhigh[i] =hNuclearModification->GetBinContent(i+1)*systematic; } */ double mod_ptBins[_nBins]; for(int i=0;i<_nBins;i++){ mod_ptBins[i] = npart[_nBins-1-i]; } double apt[_nBins]; //bin half width double aptl[_nBins]; //number of every rebined bin double bin_num[_nBins]; for (int ibin=0; ibin<_nBins; ibin++){ apt[ibin] = mod_ptBins[ibin]; aptl[ibin] = 10; } pti = 0; pte = apt[_nBins-1]+50; Double_t xr[_nBins], yr[_nBins], xrlow[_nBins], yrlow[_nBins],xrhigh[_nBins],yrhigh[_nBins]; Double_t yrStatlow[_nBins], yrStathigh[_nBins]; for(int i=0;i<_nBins;i++) { yr[i] = hSigmaPbPbStat->GetBinContent(_nBins-i); double systematic=0.01*systematicsForRAACent(hSigmaPbPbStat->GetBinCenter(_nBins-i)/2.,centMin,centMax,0.,0.); //double systematic=0.; yrStatlow[i] = hSigmaPbPbStat->GetBinError(_nBins-i); yrStathigh[i] = hSigmaPbPbStat->GetBinError(_nBins-i); yrlow[i] = hSigmaPbPbStat->GetBinContent(_nBins-i)*systematic; yrhigh[i] = hSigmaPbPbStat->GetBinContent(_nBins-i)*systematic; } TGraphAsymmErrors* hNuclearModification = new TGraphAsymmErrors(_nBins,apt,yr,aptl,aptl,yrStatlow,yrStathigh); hNuclearModification->SetName("hNuclearModification"); TGraphAsymmErrors* gNuclearModification = new TGraphAsymmErrors(_nBins,apt,yr,aptl,aptl,yrlow,yrhigh); gNuclearModification->SetName("gNuclearModification"); TCanvas*canvasRAA=new TCanvas("canvasRAA","canvasRAA",600,600); canvasRAA->cd(); //canvasRAA->SetLogx(); TH2F* hemptyEff=new TH2F("hemptyEff","",50,pti,pte,10.,0,1.55); hemptyEff->GetXaxis()->CenterTitle(); hemptyEff->GetYaxis()->CenterTitle(); hemptyEff->GetYaxis()->SetTitle("B^{+} R_{AA}"); hemptyEff->GetXaxis()->SetTitle("N_{part}"); hemptyEff->GetXaxis()->SetTitleOffset(1.0); hemptyEff->GetYaxis()->SetTitleOffset(1.1); hemptyEff->GetXaxis()->SetTitleSize(0.05); hemptyEff->GetYaxis()->SetTitleSize(0.05); hemptyEff->GetXaxis()->SetTitleFont(42); hemptyEff->GetYaxis()->SetTitleFont(42); hemptyEff->GetXaxis()->SetLabelFont(42); hemptyEff->GetYaxis()->SetLabelFont(42); hemptyEff->GetXaxis()->SetLabelSize(0.04); hemptyEff->GetYaxis()->SetLabelSize(0.04); hemptyEff->SetMaximum(2); hemptyEff->SetMinimum(0.); hemptyEff->Draw(); TLine *line = new TLine(pti,1,pte,1); line->SetLineStyle(2); line->SetLineWidth(2); line->Draw(); //gNuclearModification->SetFillColor(5);//1 gNuclearModification->SetFillColor(kOrange);//1 gNuclearModification->SetFillStyle(3001);//0 gNuclearModification->SetLineWidth(1);//3 gNuclearModification->SetMarkerSize(1); gNuclearModification->SetMarkerStyle(21); //gNuclearModification->SetLineColor(1);//kGreen+4 //gNuclearModification->SetMarkerColor(1);//kGreen+4 gNuclearModification->SetLineColor(kOrange);//kGreen+4 //gNuclearModification->SetMarkerColor(kOrange);//kGreen+4 gNuclearModification->SetMarkerColor(kRed);//kGreen+4 gNuclearModification->Draw("5same"); hNuclearModification->SetLineWidth(3); hNuclearModification->SetLineColor(kRed); hNuclearModification->SetMarkerColor(kRed); hNuclearModification->SetMarkerStyle(21); //hNuclearModification->Draw("same"); hNuclearModification->Draw("same p"); Float_t systnorm = normalizationUncertaintyForRAA()*1.e-2; TBox* bSystnorm = new TBox(pti,1-systnorm,pti+10,1+systnorm); if(drawDRAA) bSystnorm = new TBox(pti,1-systnorm,pti+10,1+systnorm); bSystnorm->SetLineColor(16); bSystnorm->SetFillColor(16); bSystnorm->Draw(); TLatex * tlatexeff2=new TLatex(0.41,0.58,Form("p_{T} %.0f-%.0f (GeV/c)",ptBinsInc[0], ptBinsInc[1])); tlatexeff2->SetNDC(); tlatexeff2->SetTextColor(1); tlatexeff2->SetTextFont(42); tlatexeff2->SetTextSize(0.050); tlatexeff2->Draw(); TLatex * texY = new TLatex(0.41,0.53,"|y| < 2.4");//0.2612903,0.8425793 texY->SetNDC(); texY->SetTextColor(1); texY->SetTextFont(42); texY->SetTextSize(0.045); texY->SetLineWidth(2); //texY->Draw(); TLatex* texlumi = new TLatex(0.13,0.936,"27.7 pb^{-1} (5.02 TeV pp) + 350.68 #mub^{-1} (5.02 TeV PbPb)"); texlumi->SetNDC(); //texlumi->SetTextAlign(31); texlumi->SetTextFont(42); texlumi->SetTextSize(0.038); texlumi->SetLineWidth(2); texlumi->Draw(); TLatex* texcms = new TLatex(0.15,0.90,"CMS"); texcms->SetNDC(); texcms->SetTextAlign(13); texcms->SetTextFont(62);//61 texcms->SetTextSize(0.06); texcms->SetLineWidth(2); texcms->Draw(); TLatex* texpre = new TLatex(0.15,0.84,"Preliminary"); texpre->SetNDC(); texpre->SetTextAlign(13); texpre->SetTextFont(52); texpre->SetTextSize(0.05); texpre->SetLineWidth(2); texpre->Draw(); //TLegend *legendSigma=new TLegend(0.40,0.5168644,0.8084677,0.6605932,""); TLegend *legendSigma=new TLegend(0.5436242,0.7474695,0.942953,0.8457592,""); if(drawDRAA)legendSigma=new TLegend(0.5436242,0.6774695,0.942953,0.8757592,""); legendSigma->SetBorderSize(0); legendSigma->SetLineColor(0); legendSigma->SetFillColor(0); legendSigma->SetFillStyle(1001); legendSigma->SetTextFont(42); legendSigma->SetTextSize(0.045); // TLegendEntry *ent_SigmaPP=legendSigma->AddEntry(hNuclearModification,"R_{AA} stat. unc.","pf"); // ent_SigmaPP->SetTextFont(42); // ent_SigmaPP->SetLineColor(1); // ent_SigmaPP->SetMarkerColor(1); // ent_SigmaPP->SetTextSize(0.045); // // TLegendEntry *ent_Sigmapp=legendSigma->AddEntry(gNuclearModification,"R_{AA} syst.","f"); // ent_Sigmapp->SetTextFont(42); // ent_Sigmapp->SetLineColor(5); // ent_Sigmapp->SetMarkerColor(1); // ent_Sigmapp->SetTextSize(0.045); TLegendEntry *ent_B = legendSigma->AddEntry(gNuclearModification,"R_{AA} B^{+} |y| < 2.4","pf"); ent_B->SetTextFont(42); ent_B->SetLineColor(4); ent_B->SetMarkerColor(4); ent_B->SetTextSize(0.043);//0.03 TLatex* texSystnorm = new TLatex(0.23,0.70,"T_{AA} and lumi."); if(drawDRAA) texSystnorm = new TLatex(0.17,0.70,"T_{AA} and lumi."); texSystnorm->SetNDC(); texSystnorm->SetTextColor(1); texSystnorm->SetTextFont(42); texSystnorm->SetTextSize(0.04); texSystnorm->SetLineWidth(2); texSystnorm->Draw(); texSystnorm = new TLatex(0.23,0.65,"uncertainty"); if(drawDRAA) texSystnorm = new TLatex(0.17,0.65,"uncertainty"); texSystnorm->SetNDC(); texSystnorm->SetTextColor(1); texSystnorm->SetTextFont(42); texSystnorm->SetTextSize(0.04); texSystnorm->SetLineWidth(2); texSystnorm->Draw(); if(drawDRAA){ TGraphAsymmErrors* gDNuclearModification = new TGraphAsymmErrors(); Draw_DRAA(canvasRAA, gDNuclearModification); gDNuclearModification->SetFillColor(kYellow-9); TLegendEntry *ent_Dhighpt = legendSigma->AddEntry(gDNuclearModification,"R_{AA} D^{0} |y| < 1.0","pf"); ent_Dhighpt->SetTextFont(42); ent_Dhighpt->SetLineColor(4); ent_Dhighpt->SetMarkerColor(4); ent_Dhighpt->SetTextSize(0.043);//0.03 } legendSigma->Draw(); canvasRAA->Update(); canvasRAA->RedrawAxis(); TString _postfix = ""; if(doDataCor==1) _postfix = "_EFFCOR"; if(!drawDRAA){ canvasRAA->SaveAs(Form("plotRAA/canvasRAA%s_%.0f_%.0f_Cent%s.pdf",label.Data(),centMin,centMax,_postfix.Data())); canvasRAA->SaveAs(Form("plotRAA/canvasRAA%s_%.0f_%.0f_Cent%s.png",label.Data(),centMin,centMax,_postfix.Data())); } if(drawDRAA){ canvasRAA->SaveAs(Form("plotRAA/canvasRAA_DRAA_%s_%.0f_%.0f_Cent%s.pdf",label.Data(),centMin,centMax,_postfix.Data())); canvasRAA->SaveAs(Form("plotRAA/canvasRAA_DRAA_%s_%.0f_%.0f_Cent%s.png",label.Data(),centMin,centMax,_postfix.Data())); } TFile *fRAA=new TFile(outputfile.Data(),"recreate"); fRAA->cd(); gNuclearModification->Write(); hNuclearModification->Write(); }
void canvasRAAPbPb_0_100() { //=========Macro generated from canvas: canvasRAA/canvasRAA //========= (Mon Nov 21 04:10:29 2016) by ROOT version6.02/10 TCanvas *canvasRAA = new TCanvas("canvasRAA", "canvasRAA",0,0,600,600); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); canvasRAA->SetHighLightColor(2); canvasRAA->Range(0.5519499,-0.2310559,1.777118,1.69441); canvasRAA->SetFillColor(0); canvasRAA->SetBorderMode(0); canvasRAA->SetBorderSize(2); canvasRAA->SetLogx(); canvasRAA->SetLeftMargin(0.12); canvasRAA->SetRightMargin(0.03); canvasRAA->SetTopMargin(0.075); canvasRAA->SetBottomMargin(0.12); canvasRAA->SetFrameBorderMode(0); canvasRAA->SetFrameBorderMode(0); TH2F *hemptyEff1 = new TH2F("hemptyEff1","",50,5,55,10,0,1.55); hemptyEff1->SetMinimum(0); hemptyEff1->SetMaximum(2); hemptyEff1->SetStats(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); hemptyEff1->SetLineColor(ci); hemptyEff1->SetMarkerStyle(20); hemptyEff1->GetXaxis()->SetTitle("p_{T} (GeV/c)"); hemptyEff1->GetXaxis()->CenterTitle(true); hemptyEff1->GetXaxis()->SetLabelFont(42); hemptyEff1->GetXaxis()->SetTitleSize(0.05); hemptyEff1->GetXaxis()->SetTitleFont(42); hemptyEff1->GetYaxis()->SetTitle("R_{AA}"); hemptyEff1->GetYaxis()->CenterTitle(true); hemptyEff1->GetYaxis()->SetLabelFont(42); hemptyEff1->GetYaxis()->SetTitleSize(0.05); hemptyEff1->GetYaxis()->SetTitleOffset(1.1); hemptyEff1->GetYaxis()->SetTitleFont(42); hemptyEff1->GetZaxis()->SetLabelFont(42); hemptyEff1->GetZaxis()->SetLabelSize(0.035); hemptyEff1->GetZaxis()->SetTitleSize(0.035); hemptyEff1->GetZaxis()->SetTitleFont(42); hemptyEff1->Draw(""); TLine *line = new TLine(5,1,55,1); line->SetLineStyle(2); line->SetLineWidth(2); line->Draw(); TBox *box = new TBox(5,0.8492652,5.35,1.150735); box->SetFillColor(16); box->SetLineColor(16); box->Draw(); TLatex * tex = new TLatex(0.38,0.595,"Centrality 0-100%"); tex->SetNDC(); tex->SetTextFont(42); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.13,0.936,"25.8 pb^{-1} (5.02 TeV pp) + 350.68 #mub^{-1} (5.02 TeV PbPb)"); tex->SetNDC(); tex->SetTextFont(42); tex->SetTextSize(0.038); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.15,0.9,"CMS"); tex->SetNDC(); tex->SetTextAlign(13); tex->SetTextSize(0.06); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.15,0.84,"Preliminary"); tex->SetNDC(); tex->SetTextAlign(13); tex->SetTextFont(52); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.23,0.7,"T_{AA} and lumi."); tex->SetNDC(); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); tex = new TLatex(0.23,0.65,"uncertainty"); tex->SetNDC(); tex->SetTextFont(42); tex->SetTextSize(0.04); tex->SetLineWidth(2); tex->Draw(); Double_t gNuclearModification_fx3001[5] = { 8.5, 12.5, 17.5, 25, 40}; Double_t gNuclearModification_fy3001[5] = { 0.2588925, 0.3541164, 0.4248931, 0.6428491, 0.3291394}; Double_t gNuclearModification_felx3001[5] = { 1.5, 2.5, 2.5, 5, 10}; Double_t gNuclearModification_fely3001[5] = { 0.06471243, 0.08566381, 0.1025233, 0.1541752, 0.07884685}; Double_t gNuclearModification_fehx3001[5] = { 1.5, 2.5, 2.5, 5, 10}; Double_t gNuclearModification_fehy3001[5] = { 0.06471243, 0.08566381, 0.1025233, 0.1541752, 0.07884685}; TGraphAsymmErrors *grae = new TGraphAsymmErrors(5,gNuclearModification_fx3001,gNuclearModification_fy3001,gNuclearModification_felx3001,gNuclearModification_fehx3001,gNuclearModification_fely3001,gNuclearModification_fehy3001); grae->SetName("gNuclearModification"); grae->SetTitle("Graph"); ci = TColor::GetColor("#0099ff"); grae->SetFillColor(ci); grae->SetFillStyle(3001); ci = TColor::GetColor("#0099ff"); grae->SetLineColor(ci); ci = TColor::GetColor("#330066"); grae->SetMarkerColor(ci); grae->SetMarkerStyle(21); TH1F *Graph_gNuclearModification3001 = new TH1F("Graph_gNuclearModification3001","Graph",100,2.7,54.3); Graph_gNuclearModification3001->SetMinimum(0.1338956); Graph_gNuclearModification3001->SetMaximum(0.8573087); Graph_gNuclearModification3001->SetDirectory(0); Graph_gNuclearModification3001->SetStats(0); ci = TColor::GetColor("#000099"); Graph_gNuclearModification3001->SetLineColor(ci); Graph_gNuclearModification3001->SetMarkerStyle(20); Graph_gNuclearModification3001->GetXaxis()->SetLabelFont(42); Graph_gNuclearModification3001->GetXaxis()->SetLabelSize(0.035); Graph_gNuclearModification3001->GetXaxis()->SetTitleSize(0.035); Graph_gNuclearModification3001->GetXaxis()->SetTitleFont(42); Graph_gNuclearModification3001->GetYaxis()->SetLabelFont(42); Graph_gNuclearModification3001->GetYaxis()->SetLabelSize(0.035); Graph_gNuclearModification3001->GetYaxis()->SetTitleSize(0.035); Graph_gNuclearModification3001->GetYaxis()->SetTitleFont(42); Graph_gNuclearModification3001->GetZaxis()->SetLabelFont(42); Graph_gNuclearModification3001->GetZaxis()->SetLabelSize(0.035); Graph_gNuclearModification3001->GetZaxis()->SetTitleSize(0.035); Graph_gNuclearModification3001->GetZaxis()->SetTitleFont(42); grae->SetHistogram(Graph_gNuclearModification3001); grae->Draw("5"); Double_t xAxis1[6] = {7, 10, 15, 20, 30, 50}; TH1D *hNuclearModification2 = new TH1D("hNuclearModification2","",5, xAxis1); hNuclearModification2->SetBinContent(1,0.2588925); hNuclearModification2->SetBinContent(2,0.3541164); hNuclearModification2->SetBinContent(3,0.4248931); hNuclearModification2->SetBinContent(4,0.6428491); hNuclearModification2->SetBinContent(5,0.3291394); hNuclearModification2->SetBinError(1,0.1738922); hNuclearModification2->SetBinError(2,0.08216078); hNuclearModification2->SetBinError(3,0.09029037); hNuclearModification2->SetBinError(4,0.1168973); hNuclearModification2->SetBinError(5,0.1254217); hNuclearModification2->SetEntries(54.19682); ci = TColor::GetColor("#330066"); hNuclearModification2->SetLineColor(ci); hNuclearModification2->SetLineWidth(3); ci = TColor::GetColor("#330066"); hNuclearModification2->SetMarkerColor(ci); hNuclearModification2->SetMarkerStyle(21); hNuclearModification2->SetMarkerSize(1.2); hNuclearModification2->GetXaxis()->SetTitle("D^{0} p_{T} (GeV/c)"); hNuclearModification2->GetXaxis()->SetLabelFont(42); hNuclearModification2->GetXaxis()->SetLabelSize(0.035); hNuclearModification2->GetXaxis()->SetTitleSize(0.035); hNuclearModification2->GetXaxis()->SetTitleFont(42); hNuclearModification2->GetYaxis()->SetTitle("Uncorrected dN(D^{0})/dp_{T}"); hNuclearModification2->GetYaxis()->SetLabelFont(42); hNuclearModification2->GetYaxis()->SetLabelSize(0.035); hNuclearModification2->GetYaxis()->SetTitleSize(0.035); hNuclearModification2->GetYaxis()->SetTitleFont(42); hNuclearModification2->GetZaxis()->SetLabelFont(42); hNuclearModification2->GetZaxis()->SetLabelSize(0.035); hNuclearModification2->GetZaxis()->SetTitleSize(0.035); hNuclearModification2->GetZaxis()->SetTitleFont(42); hNuclearModification2->Draw("same"); TLegend *leg = new TLegend(0.6036242,0.7474695,0.942953,0.8457592,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetTextSize(0.04); leg->SetLineColor(0); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(1001); TLegendEntry *entry=leg->AddEntry("gNuclearModification","B^{+} |y| < 1.0","pf"); ci = TColor::GetColor("#0099ff"); entry->SetFillColor(ci); entry->SetFillStyle(3001); ci = TColor::GetColor("#0099ff"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(1); ci = TColor::GetColor("#330066"); entry->SetMarkerColor(ci); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry->SetTextSize(0.038); leg->Draw(); TH2F *hemptyEff_copy3 = new TH2F("hemptyEff_copy3","",50,5,55,10,0,1.55); hemptyEff_copy3->SetMinimum(0); hemptyEff_copy3->SetMaximum(2); hemptyEff_copy3->SetDirectory(0); hemptyEff_copy3->SetStats(0); ci = TColor::GetColor("#000099"); hemptyEff_copy3->SetLineColor(ci); hemptyEff_copy3->SetMarkerStyle(20); hemptyEff_copy3->GetXaxis()->SetTitle("p_{T} (GeV/c)"); hemptyEff_copy3->GetXaxis()->CenterTitle(true); hemptyEff_copy3->GetXaxis()->SetLabelFont(42); hemptyEff_copy3->GetXaxis()->SetTitleSize(0.05); hemptyEff_copy3->GetXaxis()->SetTitleFont(42); hemptyEff_copy3->GetYaxis()->SetTitle("R_{AA}"); hemptyEff_copy3->GetYaxis()->CenterTitle(true); hemptyEff_copy3->GetYaxis()->SetLabelFont(42); hemptyEff_copy3->GetYaxis()->SetTitleSize(0.05); hemptyEff_copy3->GetYaxis()->SetTitleOffset(1.1); hemptyEff_copy3->GetYaxis()->SetTitleFont(42); hemptyEff_copy3->GetZaxis()->SetLabelFont(42); hemptyEff_copy3->GetZaxis()->SetLabelSize(0.035); hemptyEff_copy3->GetZaxis()->SetTitleSize(0.035); hemptyEff_copy3->GetZaxis()->SetTitleFont(42); hemptyEff_copy3->Draw("sameaxis"); canvasRAA->Modified(); canvasRAA->cd(); canvasRAA->SetSelected(canvasRAA); }
void HiggsPlot::PlotPRL(int isPsfrag){ double bottom = 0.12; styles style; style.setPadsStyle(-2); style.PadBottomMargin = 2*bottom/(1+bottom); style.setDefaultStyle(); int nBins = 1000, iDecay, colors[2][2] = {{2,1},{kBlue-10,kBlue+1}}; int iniHig = 0, iHig = iniHig, finHig = 100, dHig = 5, bin, nFiles = (finHig-iniHig)/dHig+1; double tBmH_max = 1, PadLimit[2][2] = {{(1-bottom)/2.,1}, {0, (1+bottom)/2.}}; double maxRD[] = {0.82, 0.47}, minRD[] = {0.08, 0.17}, TopMargin[] = {0.01, 0}; TString hName, epsName = "public_html/PRL_Higgs.eps", label, padName; TString TagDecay[] = {"R(D)", "R(D*)"}; TBox box; box.SetLineColor(4);box.SetFillColor(4); TLine line; line.SetLineStyle(1); line.SetLineColor(4); line.SetLineWidth(3); TCanvas can("can","RD Vs Higgs"); TPad *Pads[2]; TH1F *hBF[2][2], *hMeas[2][2]; for(int his=0; his<1; his++) { for(int isDs=0; isDs<2; isDs++){ hName = "hBF"; hName += his; hName += isDs; hBF[isDs][his] = new TH1F(hName,"",nBins,0,tBmH_max); hBF[isDs][his]->SetFillColor(colors[0][his]); hBF[isDs][his]->SetLineColor(colors[0][his]); hBF[isDs][his]->SetLineWidth(2); hName = "hMeas"; hName += his; hName += isDs; hMeas[isDs][his] = new TH1F(hName,"",nBins,0,tBmH_max); hMeas[isDs][his]->SetFillColor(colors[1][his]); hMeas[isDs][his]->SetLineColor(colors[1][his]); hMeas[isDs][his]->SetLineWidth(3); } } double RD[2][30], errorRD[2][30], List_tBmH[30], SysUncert[] = {0.095, 0.053}; TString folder = "FitAll/fits/TextFinalIsoDataHi2x", text = ""; for(int file=0; file<nFiles; file++){ TString fileName = folder; if(iHig<100) fileName += "0"; if(iHig<10) fileName += "0"; fileName += iHig; fileName += ".txt"; fstream textFile; textFile.open(fileName,fstream::in); bin = 0; while(!text.Contains("R(D")) { textFile>>text; bin++; if(bin>1000) {cout<<"R(D) not found in "<<fileName<<endl; return;} } for(int cand=0; cand<2; cand++){ if(cand>0) textFile>>text; textFile>>text; RD[cand][file] = text.Atof(); textFile>>text; textFile>>text; text.ReplaceAll(",",""); errorRD[cand][file] = text.Atof(); for(int i=0; i<12; i++) textFile>>text; //cout<<RD[file][cand]<<" #pm "<<errorRD[cand][file]<<endl; errorRD[cand][file] = sqrt(pow(errorRD[cand][file],2)+pow(RD[cand][file]*SysUncert[cand],2)); // Syst. error added List_tBmH[file] = static_cast<double>(iHig)/100.; } //cout<<endl; iHig += dHig; } double tBmH, BF[2]; for(int isDs=0; isDs<2; isDs++){ can.cd(0); padName = "Pad"; padName += isDs; Pads[isDs] = new TPad(padName,"",0,PadLimit[isDs][0], 1, PadLimit[isDs][1]); Pads[isDs]->SetTopMargin(TopMargin[isDs]); Pads[isDs]->Draw(); Pads[isDs]->cd(); iDecay = isDs+1; for(int ibin=1; ibin<=nBins; ibin++){ tBmH = hBF[isDs][0]->GetBinCenter(ibin); Compute(tBmH,BF,iDecay); hBF[isDs][0]->SetBinContent(ibin, BF[0]); hBF[isDs][0]->SetBinError(ibin, BF[1]); if(_varyRD){ hMeas[isDs][0]->SetBinContent(ibin, MeasuredRD[isDs]->Eval(hMeas[isDs][0]->GetBinCenter(ibin))); hMeas[isDs][0]->SetBinError(ibin, MeasuredRD[isDs+2]->Eval(hMeas[isDs][0]->GetBinCenter(ibin))); } else { hMeas[isDs][0]->SetBinContent(ibin, Measurement[isDs+1][0]); hMeas[isDs][0]->SetBinError(ibin, Measurement[isDs+1][1]); } } hName += isDs; hBF[isDs][1] = static_cast<TH1F*>(hBF[isDs][0]->Clone(hName)); hName += isDs; hMeas[isDs][1] = static_cast<TH1F*>(hMeas[isDs][0]->Clone(hName)); for(int ibin=1; ibin<=nBins; ibin++){hBF[isDs][1]->SetBinError(ibin,0);hMeas[isDs][1]->SetBinError(ibin,0);} //hMeas[isDs][0]->SetFillStyle(3002); hBF[isDs][1]->SetFillColor(0); hBF[isDs][1]->SetLineColor(colors[0][1]); hBF[isDs][1]->SetLineWidth(2); hMeas[isDs][1]->SetFillColor(0); hMeas[isDs][1]->SetLineColor(colors[1][1]); hMeas[isDs][1]->SetLineWidth(3); hBF[isDs][0]->GetXaxis()->CenterTitle(true); hBF[isDs][0]->GetYaxis()->CenterTitle(true); hBF[isDs][0]->SetMinimum(minRD[isDs]); hBF[isDs][0]->SetMaximum(maxRD[isDs]); hBF[isDs][0]->Draw("e3"); hMeas[isDs][0]->Draw("e3 same"); hMeas[isDs][1]->Draw("c same"); hBF[isDs][0]->Draw("e3 same"); hBF[isDs][1]->Draw("c same"); TString xTitle = "tan#beta/m_{H^{+}} (GeV^{-1})"; if(isPsfrag) xTitle = "t"; if(isDs==0) xTitle = ""; style.setTitles(hBF[isDs][0],xTitle,TagDecay[isDs]); hBF[isDs][0]->Draw("axis same"); } if(isPsfrag) epsName.ReplaceAll(".eps","psfrag.eps"); can.SaveAs(epsName); for(int isDs=0; isDs<2; isDs++){ //Pads[isDs]->Delete(); for(int his=0; his<2; his++) { hBF[isDs][his]->Delete(); hMeas[isDs][his]->Delete(); } } }
void createDataVsMC(TString folderName,TString histoName,int rebin,double xMin,double xMax,TString xName, TString yName, vector<TString> MCFileNames, vector<TString> MCNames, vector<int> MCColors, vector<bool> AddToBkg,vector<TString> DataFileNames,vector<TString> dataNames,vector<int> dataColors,vector<TString> SystNames,vector<int> SystColors, TCanvas *cCanvas, int padNr, bool UseLog,GlobalParameterSet Parameters) { // CREATE ALL HISTOGRAMS ======================================================== TString lumi = ""; lumi+=Parameters.intLumi; if(Parameters.GlobalLog) { UseLog = true; } // SM background histo TH1D *hSM0=0; // Create MC histos and add them SM0 vector<TH1D*> MChistos; bool noneAdded = true; float eventsMC=0; if(Parameters.MuPred){ for(unsigned int i =0;i<3;i++) { TFile* fhh = TFile::Open(MCFileNames[i],"READONLY"); TH1D *hTemp = (TH1D*)fhh->Get(folderName+"/CounterCtrl_tot"); eventsMC += hTemp->GetBinContent(1); cout << "eventsMC " <<eventsMC<< endl; //delete hTemp; // delete fhh; } TFile* fdata_test = TFile::Open(DataFileNames[0],"READONLY"); TH1D *hTempddd = (TH1D*)fdata_test->Get(folderName+"/CounterCtrl_tot"); cout << "eventsMC " << eventsMC<< " "<<hTempddd->GetBinContent(1) << endl; Parameters.intLumi = 100*hTempddd->GetBinContent(1)/eventsMC; } // delete fdata_test; // delete hTempddd; for(unsigned int i =0;i<MCFileNames.size();i++) { MChistos.push_back(plot1Dhisto(Parameters.intLumi,TFile::Open(MCFileNames[i],"READONLY"),folderName,histoName,MCColors[i],rebin,xMin,xMax,xName,yName,"MC",true)); if(noneAdded&&AddToBkg[i]) { hSM0 = (TH1D *) MChistos[i]->Clone(); noneAdded = false; } else { if(AddToBkg[i]) { hSM0->Add(MChistos[i],1); } } } hSM0->SetLineColor(2); // Create Histograms with the different systematics vector<TH1D*> SystHistos; if(Parameters.UseSystematics) { for(unsigned int i=0; i<SystNames.size(); i++) { noneAdded = true; for(unsigned int j=0; j<MCFileNames.size(); j++) { if(AddToBkg[j]) { TString SystFileName = MCFileNames[j]; SystFileName.Insert(SystFileName.Last('/'),"_"+SystNames[i]); TFile *SystMCFile = TFile::Open(SystFileName,"READONLY"); TH1D *SystHistoTemp = plot1Dhisto(Parameters.intLumi,SystMCFile,folderName,histoName,SystColors[i],rebin,xMin,xMax,xName,yName,"MC",true); SystHistoTemp->SetLineStyle(2); if(noneAdded) { SystHistos.push_back((TH1D *) SystHistoTemp->Clone()); noneAdded = false; } else { SystHistos.back()->Add(SystHistoTemp,1); } } } } } // Create Histograms for error band TH1D* hSM0allErrors = (TH1D *) hSM0->Clone(); TH1D* hSM0systErrors = (TH1D *) hSM0->Clone(); if(Parameters.UseSystematics) { for(int j = hSM0->FindBin(xMin); j<=hSM0->FindBin(xMax); j++) { double downerror=0; double uperror=0; for(unsigned int i=0; i<SystHistos.size(); i++) { double diff = SystHistos[i]->GetBinContent(j) - hSM0->GetBinContent(j); if(diff>0) uperror += diff*diff; else downerror += diff*diff; } downerror = TMath::Sqrt(downerror); uperror = TMath::Sqrt(uperror); double maxerror = TMath::Max(downerror,uperror); double staterror = hSM0->GetBinError(j); hSM0systErrors->SetBinError(j,maxerror); hSM0allErrors->SetBinError(j,TMath::Sqrt(maxerror*maxerror+staterror*staterror)); hSM0systErrors->SetFillColor(5); hSM0systErrors->SetLineColor(5); hSM0allErrors->SetLineColor(3); hSM0allErrors->SetFillColor(3); } } // Create Data Histograms vector<TH1D *> dataHistos; for(unsigned int i=0; i<DataFileNames.size();i++) { dataHistos.push_back(plot1Dhisto(Parameters.intLumi,TFile::Open(DataFileNames[i],"READONLY"),folderName,histoName,dataColors[i],rebin,xMin,xMax,xName,yName,"Data",false)); dataHistos[i]->SetMarkerSize(1.2); dataHistos[i]->SetMarkerColor(dataColors[i]); dataHistos[i]->SetMarkerStyle(20); // remove error manually if(!Parameters.ShowStatErrorbars){ NoError(dataHistos[i],xMin,xMax); } // y-axis range if (UseLog){ dataHistos[i]->GetYaxis()->SetRangeUser(1.,3.5*(dataHistos[i]->GetBinContent(dataHistos[i]->GetMaximumBin()))); } else{ float maximum = hSM0->GetMaximum(); if(maximum<dataHistos[i]->GetMaximum())maximum=dataHistos[i]->GetMaximum(); dataHistos[i]->GetYaxis()->SetRangeUser(0.,maximum*1.8); } } cCanvas->SetName(folderName+histoName); cCanvas->cd(2*padNr+1); if(UseLog) { gPad->SetLogy(); } dataHistos[0]->Draw("P E0"); //DRAW ALL HISTOGRAMS ===================================================== if(Parameters.ShowMCComposition){ for(unsigned int i=1; Parameters.StackMCComposition&&i<MChistos.size();i++) { MChistos[i]->Add(MChistos[i],MChistos[i-1]); MChistos[i]->SetFillColor(MCColors[i]); MChistos[i]->SetLineStyle(1); MChistos[i]->SetFillStyle(3004); MChistos[i-1]->SetFillStyle(3004); MChistos[i-1]->SetFillColor(MCColors[i-1]); } for(int i=MChistos.size()-1;i>=0;i--) { if(Parameters.ShowMCStatErrorbars) MChistos[i]->Draw("HIST E0 same"); else MChistos[i]->Draw("HIST same"); } } hSM0->SetLineColor(kRed); if(Parameters.ShowErrorBand) { hSM0allErrors->Draw("E2 same"); hSM0systErrors->Draw("E2 same"); } if(!Parameters.ShowMCStatErrorbars&&!Parameters.StackMCComposition) hSM0->Draw("HIST same"); if(Parameters.ShowSystematicsDetails) { for(unsigned int i=0; i<SystHistos.size();i++) { SystHistos[i]->Draw("HIST same"); } } for(int i=dataHistos.size()-1;i>=0;i--) { dataHistos[i]->Draw("P E0 same"); } if(Parameters.ShowMCStatErrorbars&&!Parameters.StackMCComposition) { hSM0->Draw("HIST same E0"); } // Draw Legend TLegend *lSamples = legendRAW(0.77,0.58,0.95,0.89); if(!Parameters.StackMCComposition) lSamples->AddEntry(hSM0,"Total MC","FL"); if(Parameters.ShowErrorBand) { lSamples->AddEntry(hSM0systErrors,"Systematic Error","FL"); lSamples->AddEntry(hSM0allErrors,"MC Syst. #oplus Stat. Error","FL"); } for(unsigned int i=0; i<dataHistos.size(); i++) { lSamples->AddEntry(dataHistos[i],dataNames[i],"PL"); } for(unsigned int i =0;i<MChistos.size()&&Parameters.ShowMCComposition;i++) { lSamples->AddEntry(MChistos[i],MCNames[i],"FL"); } for(unsigned int i =0;i<SystHistos.size()&&Parameters.ShowSystematicsDetails;i++) { lSamples->AddEntry(SystHistos[i],SystNames[i],"FL"); } lSamples->Draw("same"); TLatex *lWhichLepton; if (Parameters.electrons) { lWhichLepton = new TLatex(0.73,0.9,"Electrons"); } else { lWhichLepton = new TLatex(0.73,0.9,"Muons"); } lWhichLepton->SetNDC(); lWhichLepton->Draw("same"); TLatex *lPreliminary = new TLatex(0.19,0.96,"CMS Preliminary 2011"); // TLatex *lIntLumi = new TLatex(0.15,0.89,"#scale[0.8]{#int L dt = "+lumi+" pb^{-1}, #sqrt{s} = 7 TeV}"); TLatex *lIntLumi = new TLatex(0.22,0.88,"#scale[1.]{4.7 fb^{-1}, #sqrt{s} = 7 TeV}"); TLatex *lIntLumiB = new TLatex(0.22,0.79,"#scale[1.]{#sqrt{s} = 7 TeV}"); lPreliminary->SetNDC(); lIntLumi->SetNDC(); lIntLumiB->SetNDC(); lPreliminary->Draw("same"); lIntLumi->Draw("same"); gPad->SetFillColor(0); // lIntLumiB->Draw("same"); // gPad->SetGridx(); // gPad->SetGridy(); // --- create HT and STlep legends //"ANplots150_NOLPsecondD500" folderNames TString HT500 = "secondD500"; TString HT750 = "secondD750"; TString HT1000 = "secondD1000"; TString ST150 = "plots150"; TString ST250 = "plots250"; TString ST350 = "plots350"; TString ST450 = "plots450"; TString tmpLegendHT, tmpLegendST; if (((folderName.SubString(HT500)).Length())>0) { if (Parameters.htBins) { tmpLegendHT = "H_{T}#in[500,750]"; } else { tmpLegendHT = "H_{T}>500";} } else if (((folderName.SubString(HT750)).Length())>0) { if (Parameters.htBins) { tmpLegendHT = "H_{T}#in[750,1000]"; } else { tmpLegendHT = "H_{T}>750";} } else if (((folderName.SubString(HT1000)).Length())>0) { if (Parameters.htBins) { tmpLegendHT = "H_{T}>1000"; } else { tmpLegendHT = "H_{T}>1000";} } else { tmpLegendHT = "error"; } if (((folderName.SubString(ST150)).Length())>0) { tmpLegendST = "S^{lep}_{T}#in[150,250]"; } else if (((folderName.SubString(ST250)).Length())>0) { tmpLegendST = "S^{lep}_{T}#in[250,350]"; } else if (((folderName.SubString(ST350)).Length())>0) { tmpLegendST = "S^{lep}_{T}#in[350,450]"; } else if (((folderName.SubString(ST450)).Length())>0) { tmpLegendST = "S^{lep}_{T}>450"; } else { tmpLegendST = "error"; } TString legendHTandST = tmpLegendHT+" , "+tmpLegendST; TLatex *lHTandST = new TLatex(0.22,0.8,legendHTandST); lHTandST->SetNDC(); // lHTandST->Draw("same"); TLatex *lHT = new TLatex(0.22,0.8,tmpLegendHT); lHT->SetNDC(); lHT->Draw("same"); TLatex *lST = new TLatex(0.22,0.7,tmpLegendST); lST->SetNDC(); lST->Draw("same"); // DRAW RATIO PLOTS ============================================================================ if (Parameters.ratioplot) { vector<TH1D*> hRatio; for(unsigned int i=0; i<dataHistos.size()&&MChistos.size()>0; i++) { hRatio.push_back((TH1D*)dataHistos[i]->Clone("")); hRatio.back()->Divide(dataHistos[i],hSM0); hRatio.back()->GetYaxis()->SetTitle("Data / MC"); hRatio.back()->GetYaxis()->SetTitleSize(0.16); hRatio.back()->GetXaxis()->SetTitle(""); hRatio.back()->GetYaxis()->SetNdivisions(409); hRatio.back()->GetYaxis()->SetRangeUser(0.,2.); hRatio.back()->SetTitleSize(0.16, "XY"); hRatio.back()->SetTitleOffset(0.5, "Y"); hRatio.back()->SetLabelSize(0.165,"XY"); } for(unsigned int i=0; Parameters.UseSystematics&&Parameters.ShowSystematicsDetails&&i<SystHistos.size(); i++) { hRatio.push_back((TH1D*)SystHistos[i]->Clone("")); hRatio.back()->Divide(SystHistos[i],hSM0); hRatio.back()->GetYaxis()->SetTitle("Data&Syst/MC"); hRatio.back()->GetYaxis()->SetRangeUser(0.5,1.5); hRatio.back()->GetXaxis()->SetTitle(""); hRatio.back()->SetTitleSize(0.06, "XY"); hRatio.back()->SetTitleOffset(0.8, "Y"); hRatio.back()->SetLabelSize(0.08,"XY"); NoError(hRatio.back(),xMin,xMax); } cCanvas->cd(2*padNr+2); // TBox *unity = new TBox(xMin-0.1,0.95,xMax+0.15, 1.05); // LP TBox *unity = new TBox(xMin-0.1,0.95,xMax+0.15, 1.05); unity->SetLineWidth(2); //unity.SetLineStyle(Root.kDashed); unity->SetLineColor(2); unity->SetFillColor(2); unity->SetFillStyle(3002); // unity->Draw(); // gPad->SetGridx(); // gPad->SetGridy(); for(unsigned int i=hRatio.size()-1; i<hRatio.size(); i--) { if(i==hRatio.size()-1) { hRatio[i]->Draw(); // unity->Draw("same"); hRatio[i]->Draw("same"); } else { hRatio[i]->GetYaxis()->SetTitleSize(0.055); hRatio[i]->Draw("same"); } } } // ratio stuff close }
void HiggsPlot::PlotgSLTauNu(double b, double tBmH_max){ styles style; style.setPadsStyle(-2); style.PadBottomMargin = 2*b/(1+b); style.setDefaultStyle(); int nBins = 1000; double PadLimit[2][2] = {{(1-b)/2.,1}, {0, (1+b)/2.}}; double maxRD[] = {45, 45}, minRD[] = {0., 0.}, TopMargin[] = {0.01, 0}; TString hName, epsName = "public_html/Higgs_TauNu_gSL.eps", label, padName; TString TagDecay[] = {"BF(B#rightarrow#tau#nu) (10^{-5})", "BF(B#rightarrow#tau#nu) (10^{-5})"}; TBox box; box.SetLineColor(4);box.SetFillColor(4); TLine line; line.SetLineStyle(1); line.SetLineColor(4); line.SetLineWidth(3); TCanvas can("can","RD Vs Higgs"); TPad *Pads[2]; TH1F *hBF[4][2]; for(int his=0; his<1; his++) { for(int isDs=0; isDs<4; isDs++){ hName = "hBF"; hName += his; hName += isDs; hBF[isDs][his] = new TH1F(hName,"",nBins,0,tBmH_max); } } Vub[1] = 0.0003; double tBmH, BF[2], gSL; for(int isDs=0; isDs<2; isDs++){ can.cd(0); if(isDs==0) Vub[0] = 0.00313; else Vub[0] = 0.00431; padName = "Pad"; padName += isDs; Pads[isDs] = new TPad(padName,"",0,PadLimit[isDs][0], 1, PadLimit[isDs][1]); Pads[isDs]->SetTopMargin(TopMargin[isDs]); Pads[isDs]->Draw(); Pads[isDs]->cd(); for(int bin=1; bin<=nBins; bin++){ gSL = hBF[isDs][0]->GetBinCenter(bin); tBmH = sqrt(gSL/4.2); Compute(tBmH,BF,0); hBF[isDs][0]->SetBinContent(bin, BF[0]); hBF[isDs][0]->SetBinError(bin, BF[1]); } hBF[isDs][0]->SetFillColor(2); hBF[isDs][0]->SetLineColor(2); hName += isDs; hBF[isDs][1] = static_cast<TH1F*>(hBF[isDs][0]->Clone(hName)); for(int bin=1; bin<=nBins; bin++)hBF[isDs][1]->SetBinError(bin,0); hBF[isDs][1]->SetFillColor(0);hBF[isDs][1]->SetLineColor(1); hBF[isDs][1]->SetLineWidth(2); hBF[isDs][0]->SetMinimum(minRD[isDs]); hBF[isDs][0]->SetMaximum(maxRD[isDs]); hBF[isDs][0]->Draw("e3"); box.SetFillStyle(3002); box.DrawBox(0,Measurement[0][0]-Measurement[0][1], tBmH_max,Measurement[0][0]+Measurement[0][1]); line.DrawLine(0,Measurement[0][0],tBmH_max,Measurement[0][0]); hBF[isDs][0]->Draw("e3 same"); hBF[isDs][1]->Draw("c same"); _isgS = -1; for(int bin=1; bin<=nBins; bin++){ gSL = hBF[isDs+2][0]->GetBinCenter(bin); tBmH = sqrt(gSL/4.2); Compute(tBmH,BF,0); hBF[isDs+2][0]->SetBinContent(bin, BF[0]); hBF[isDs+2][0]->SetBinError(bin, BF[1]); } hBF[isDs+2][0]->SetFillColor(8); hBF[isDs][0]->SetLineColor(8); hName += isDs+2; hBF[isDs+2][1] = static_cast<TH1F*>(hBF[isDs+2][0]->Clone(hName)); for(int bin=1; bin<=nBins; bin++)hBF[isDs+2][1]->SetBinError(bin,0); hBF[isDs+2][1]->SetFillColor(0);hBF[isDs+2][1]->SetLineColor(1); hBF[isDs+2][1]->SetLineWidth(2); hBF[isDs][0]->SetMinimum(minRD[isDs]); hBF[isDs][0]->SetMaximum(maxRD[isDs]); hBF[isDs+2][0]->Draw("e3 same"); hBF[isDs+2][0]->Draw("e3 same"); hBF[isDs+2][1]->Draw("c same"); _isgS = 1; style.setTitles(hBF[isDs][0],"-g (GeV^{-1})",TagDecay[isDs]); } can.SaveAs(epsName); for(int isDs=0; isDs<4; isDs++){ //Pads[isDs]->Delete(); for(int his=0; his<2; his++) hBF[isDs][his]->Delete(); } }
//////---------- channel: 0==muon dijet, 1== electron dijet ///// 2==muon boosted, 3== electron boosted void makeATGCLimitDataCards(int channel) { // const Int_t bins = 8; // const Float_t dm_min = 200.; // const Float_t dm_max = 600.; Int_t bins = 7; Float_t dm_min = 100.; Float_t dm_max = 275.; if(channel>1) { bins = 15; dm_min = 200.; dm_max = 800; } Int_t binsmc = (int)(10*(dm_max - dm_min)); // units of 0.1GeV, set up for smearing post-binning! domu = true; if(channel==1 || channel==3) domu = false; TString outfile = (domu?TString("mu"):TString("el"))+ (channel<2?TString("dijet"):TString("boosted")); TFile* outputForLimit = TFile::Open(outfile+".root", "recreate"); TString cutsDijet("(W_pt<200.) && (dijetPt>70.) && (abs(JetPFCor_Eta[0])<2.4) && (abs(JetPFCor_Eta[1])<2.4) && (abs(JetPFCor_Eta[0]-JetPFCor_Eta[1])<1.5) &&(abs(JetPFCor_dphiMET[0])>0.4) &&(W_mt>30.) &&(JetPFCor_Pt[0]>40.) &&(JetPFCor_Pt[1]>35.) &&(JetPFCor_Pt[2]<30.) &&(JetPFCor_bDiscriminatorCSV[0]<0.244) &&(JetPFCor_bDiscriminatorCSV[1]<0.244) && (Mass2j_PFCor>70. && Mass2j_PFCor<100.)"); // Do not put jet pt in the cut string here, since it is going to be smeared TString cutsMerged("(vbf_event==0) && (W_pt>200.) &&(abs(GroomedJet_CA8_eta[0])<2.4)&&(ggdboostedWevt==1) && (GroomedJet_CA8_deltaphi_METca8jet[0]>2.0) && (GroomedJet_CA8_deltaR_lca8jet[0]>1.57) && (numPFCorJetBTags<1) && (GroomedJet_CA8_tau2tau1[0]<0.55) && (GroomedJet_CA8_mass_pr[0]>70. && GroomedJet_CA8_mass_pr[0]<100.)"); // && (GroomedJet_CA8_deltaR_lca8jet[1]<-900 || GroomedJet_CA8_deltaR_lca8jet[1]>7.0) TString lepton_cut = "(event_met_pfmet >30) && (W_electron_pt>35.)"; if(channel==0) lepton_cut = "(event_met_pfmet >25) &&(abs(W_muon_eta)<2.1) && (W_muon_pt>25.)"; if(channel==1) lepton_cut = "(event_met_pfmet >30) && (W_electron_pt>30.)"; if(channel==2) lepton_cut = "(event_met_pfmet >50) &&(abs(W_muon_eta)<2.1) && (W_muon_pt>30.)"; if(channel==3) lepton_cut = "(event_met_pfmet >70) && (W_electron_pt>35.)"; TString And = " && "; TString jet_cut = cutsDijet; TString jetptcut,mcjetptcut; if(channel>1) jet_cut = cutsMerged; char* observable = "dijetPt"; char* mcobservable = "dijetPt"; char* xtitle = "p_{T}^{jj} [GeV]"; double jetptcutval; if(channel>1) { double jetthresh = 80; /*observable = "(GroomedJet_CA8_pt[0]>jetthresh)+\ (GroomedJet_CA8_pt[1]>jetthresh)+\ (GroomedJet_CA8_pt[2]>jetthresh)+\ (GroomedJet_CA8_pt[3]>jetthresh)+\ (GroomedJet_CA8_pt[4]>jetthresh)+\ (GroomedJet_CA8_pt[5]>jetthresh)";*/ mcobservable = "GroomedJet_CA8_pt_smeared[0]"; //mcobservable = "GroomedJet_CA8_pt[0]"; observable = "GroomedJet_CA8_pt[0]"; jetptcutval = 200.; jetptcut = Form("(%s > %f)", observable,jetptcutval); mcjetptcut = Form("(%s > %f)",mcobservable,jetptcutval); xtitle = "p_{T}^{j} [GeV]"; } TCut mccut( TString("(effwt*puwt)*(")+ lepton_cut+And+jet_cut+And+mcjetptcut + TString(")") ); TCut datacut( TString("(") + lepton_cut+And+jet_cut+And+jetptcut + TString(")") ); //TCut the_cut( TString("(effwt*puwt)*(")+ lepton_cut+And+jet_cut+And+jetptcut + TString(")") ); // for combining ttbar files TString mttstr ("sqrt((W_top_E+W_atop_E)^2 -(W_top_px+W_atop_px)^2 -(W_top_py+W_atop_py)^2 -(W_top_pz+W_atop_pz)^2)"); // weight default sample by 1 for mtt<700, by half above for adding the high mtt samples TCut mttwt(TString("(")+mttstr+TString("<700)?1.0:0.5")); InstantiateTrees(); //th1data = new TH1D("th1data", "th1data", bins, ptbins_boosted); // bins, dm_min, dm_max); th1data = new TH1D("th1data", "th1data", bins, dm_min, dm_max); th1data->Sumw2(); th1data->SetMarkerStyle(20); th1data->SetMarkerSize(1.25); th1data->SetLineWidth(2); th1data->SetMinimum(0.0); TString drawstr = TString(observable)+TString(">>th1data"); cout << TString("treedata->Draw(\"")+drawstr+TString("\", \"")+ TString((const char*)datacut)+TString("\", \"goff\")") << endl; treedata->Draw(drawstr, datacut, "goff"); // ------- Get WW/WZ ------- th1wwlo = new TH1D("th1wwlo", "th1wwlo", bins, dm_min, dm_max); th1wwhi = new TH1D("th1wwhi", "th1wwhi", bins, dm_min, dm_max); th1ww = new TH1D("th1ww", "th1ww", bins, dm_min, dm_max); th1wzlo = new TH1D("th1wzlo", "th1wzlo", bins, dm_min, dm_max); th1wzhi = new TH1D("th1wzhi", "th1wzhi", bins, dm_min, dm_max); th1wz = new TH1D("th1wz", "th1wz", bins, dm_min, dm_max); //th1wz = new TH1D("th1wz", "th1wz", bins, ptbins_boosted); th1wwlo->Sumw2(); th1wwhi->Sumw2(); th1wzlo->Sumw2(); th1wzhi->Sumw2(); th1wz->Sumw2(); fillMChisto(th1wwlo,treewwlo,mcobservable,mccut); fillMChisto(th1wwhi,treewwhi,mcobservable,mccut); fillMChisto(th1wzlo,treewzlo,mcobservable,mccut); fillMChisto(th1wzhi,treewzhi,mcobservable,mccut); // ------- Get ttbar ------- th1Top = new TH1D("th1Top", "th1Top", bins, dm_min, dm_max); th1toplo = new TH1D("th1toplo", "th1toplo", bins, dm_min, dm_max); th1topmd = new TH1D("th1topmd", "th1topmd", bins, dm_min, dm_max); th1tophi = new TH1D("th1tophi", "th1tophi", bins, dm_min, dm_max); //th1Top = new TH1D("th1Top", "th1Top", bins, ptbins_boosted); th1Top->Sumw2(); th1toplo->Sumw2(); th1topmd->Sumw2(); th1tophi->Sumw2(); fillMChisto(th1toplo,treettblo,mcobservable,mttwt*mccut); fillMChisto(th1topmd,treettbmd,mcobservable,mccut); fillMChisto(th1tophi,treettbhi,mcobservable,mccut); // ------- Get WJets ------- th1wjlo = new TH1D("th1wjlo", "th1wjlo", bins, dm_min, dm_max); th1wjhi = new TH1D("th1wjhi", "th1wjhi", bins, dm_min, dm_max); th1wjets = new TH1D("th1wjets", "th1wjets", bins, dm_min, dm_max); th1wjlo->Sumw2(); th1wjhi->Sumw2(); fillMChisto(th1wjlo,treewjlo,mcobservable,mccut); fillMChisto(th1wjhi,treewjhi,mcobservable,mccut); //th1wjets = new TH1D("th1wjets", "th1wjets", bins, ptbins_boosted); // ------- Get QCD ------- //th1qcd = new TH1D("th1qcd", "th1qcd", bins, dm_min, dm_max); //th1qcd = new TH1D("th1qcd", "th1qcd", bins, ptbins_boosted); //th1qcd->Sumw2(); //treeqcd->Draw(TString(observable)+TString(">>th1qcd"), mccut, "goff"); // ------- Get Z+Jets ------- //th1zjets = new TH1D("th1zjets", "th1zjets", bins, dm_min, dm_max); //th1zjets->Sumw2(); //treezj->Draw(TString(observable)+TString(">>th1zjets"), mccut, "goff"); // ------- Get Single top ------- th1stops = new TH1D("th1stops", "th1stops", bins, dm_min, dm_max); th1stopt = new TH1D("th1stopt", "th1stopt", bins, dm_min, dm_max); th1stoptw = new TH1D("th1stoptw", "th1stoptw", bins, dm_min, dm_max); //th1stops = new TH1D("th1stops", "th1stops", bins, ptbins_boosted); //th1stopt = new TH1D("th1stopt", "th1stopt", bins, ptbins_boosted); //th1stoptw = new TH1D("th1stoptw", "th1stoptw", bins, ptbins_boosted); th1stops->Sumw2(); th1stopt->Sumw2(); th1stoptw->Sumw2(); fillMChisto(th1stops,treests,mcobservable,mccut); fillMChisto(th1stopt,treestt,mcobservable,mccut); fillMChisto(th1stoptw,treestw,mcobservable,mccut); th1stopps = new TH1D("th1stopps", "th1stopps", bins, dm_min, dm_max); th1stoppt = new TH1D("th1stoppt", "th1stoppt", bins, dm_min, dm_max); th1stopptw = new TH1D("th1stopptw", "th1stopptw", bins, dm_min, dm_max); //th1stopps = new TH1D("th1stopps", "th1stopps", bins, ptbins_boosted); //th1stoppt = new TH1D("th1stoppt", "th1stoppt", bins, ptbins_boosted); //th1stopptw = new TH1D("th1stopptw", "th1stopptw", bins, ptbins_boosted); th1stopps->Sumw2(); th1stoppt->Sumw2(); th1stopptw->Sumw2(); fillMChisto(th1stopps,tree64,mcobservable,mccut); fillMChisto(th1stoppt,tree65,mcobservable,mccut); fillMChisto(th1stopptw,tree66,mcobservable,mccut); // ---- Scale the histos ---- ScaleHistos(channel); #if 0 // ---- Make smooth diboson shape ---------- TH1D* th1wvclone = (TH1D *)th1wv->Clone("th1wvclone"); float tmin = 200.0; if(channel>1) tmin = 300.0; gaus2 = new TF1("gaus2","gaus", tmin, 1000000000.); th1wvclone->Fit(gaus2,"I0",""); #endif // ---- Empty histograms for display/plotting ---- SetupEmptyHistogram(bins, dm_min, dm_max, xtitle); //SetupEmptyHistogram(bins, ptbins_boosted, xtitle); // ---- Sum all backgrounds ---------- TH1D* th1wv_no_overflow = (TH1D *)th1wv->Clone("th1wv_no_overflow"); SumAllBackgrounds(); #if 1 // ---- Get signal histogram ---------- TCut wwsigratio= GetSigRatioFunction(mcobservable); TCut wzsigratio= GetSigRatioFunction(mcobservable,"wz"); TCut wwsigcut = mccut*wwsigratio; TCut wzsigcut = mccut*wzsigratio; wwatgc4Display = new TH1D("wwatgc4Display","wwatgc4Display",bins,dm_min,dm_max); wzatgc4Display = new TH1D("wzatgc4Display","wzatgc4Display",bins,dm_min,dm_max); //wwatgc4Display = new TH1D("wwatgc4Display","wwatgc4Display",bins,ptbins_boosted); drawstr = TString(mcobservable)+TString(">>wwatgc4Display"); cout << TString("wwtree->Draw(\"")+drawstr+TString("\", \"")+ TString((const char*)wwsigcut)+TString("\", \"goff\")") << endl; TH1D *th1wwlosc = new TH1D("sigwwlo","sigwwlo",bins,dm_min,dm_max); TH1D *th1wwhisc = new TH1D("sigwwhi","sigwwhi",bins,dm_min,dm_max); TH1D *th1wzlosc = new TH1D("sigwzlo","sigwzlo",bins,dm_min,dm_max); TH1D *th1wzhisc = new TH1D("sigwzhi","sigwzhi",bins,dm_min,dm_max); fillMChisto(th1wwlosc,treewwlo,mcobservable,wwsigcut,false); fillMChisto(th1wwhisc,treewwhi,mcobservable,wwsigcut,false); fillMChisto(th1wzlosc,treewzlo,mcobservable,wzsigcut,false); fillMChisto(th1wzhisc,treewzhi,mcobservable,wzsigcut,false); th1wwlosc->Scale(WW_scale_lo); th1wwhisc->Scale(WW_scale_hi); th1wzlosc->Scale(WZ_scale_lo); th1wzhisc->Scale(WZ_scale_hi); // stitch the two histograms together into one, post-smearing. for (int ibin=1;ibin<=wwatgc4Display->GetNbinsX();ibin++) { if (wwatgc4Display->GetBinLowEdge(ibin)<stitchwwgev) { wwatgc4Display->SetBinContent(ibin,th1wwlosc->GetBinContent(ibin)); wwatgc4Display->SetBinError (ibin,th1wwlosc->GetBinError (ibin)); } else { wwatgc4Display->SetBinContent(ibin,th1wwhisc->GetBinContent(ibin)); wwatgc4Display->SetBinError (ibin,th1wwhisc->GetBinError (ibin)); } } wwatgc4Display->Scale(WW_scale_NLO * (domu ? intLUMIinvpb_mu : intLUMIinvpb_el)); // stitch the two WZ histograms together into one, post-smearing. for (int ibin=0;ibin<=wzatgc4Display->GetNbinsX()+1;ibin++) { if (wzatgc4Display->GetBinLowEdge(ibin)<stitchwzgev) { wzatgc4Display->SetBinContent(ibin,th1wzlosc->GetBinContent(ibin)); wzatgc4Display->SetBinError (ibin,th1wzlosc->GetBinError (ibin)); } else { wzatgc4Display->SetBinContent(ibin,th1wzhisc->GetBinContent(ibin)); wzatgc4Display->SetBinError (ibin,th1wzhisc->GetBinError (ibin)); } } wzatgc4Display->Scale(WZ_scale_NLO * (domu ? intLUMIinvpb_mu : intLUMIinvpb_el)); cout << "wwatgc4Display nentries = " << wwatgc4Display->GetEntries() << endl; // ----- need to subtract the diboson contribution wwatgc4Display->SetLineWidth(2); wwatgc4Display->SetLineColor(1); wwatgc4Display->SetFillColor(0); // ----- need to subtract the diboson contribution wzatgc4Display->SetLineWidth(2); wzatgc4Display->SetLineColor(1); wzatgc4Display->SetFillColor(0); wzatgc4Display->SetLineStyle(2); //-------- Add overflow bin ---------------- AddOverflowBin(wwatgc4Display); AddOverflowBin(wzatgc4Display); #endif // ---- Compose the stack ---------- THStack* hs = new THStack("hs","MC contribution"); //hs->Add(th1zjets); //hs->Add(th1qcd); hs->Add(th1Top); hs->Add(th1wjets); hs->Add(th1wv); // add WW in with backgrounds for display only hs->Add(wwatgc4Display); hs->Add(wzatgc4Display); // ---- Stack for shape systematics Up ---------- double bkgd_norm_fracerror = domu ? mu_bkgd_norm_error : el_bkgd_norm_error; double sig_norm_fracerror = domu ? mu_sig_norm_error : el_sig_norm_error; cout << "Background normalization fractional systematic = " << bkgd_norm_fracerror << endl; cout << "Signal normalization fractional systematic = " << sig_norm_fracerror << endl; //TF1* formScaleUp = new TF1("formScaleUp", "1.0+0.4*log(x/5)", dm_min, dm_max); //TF1* formScaleDn = new TF1("formScaleDn", "1.0-0.2*log(x/5)", dm_min, dm_max); TF1* formScaleUp = new TF1("formScaleUp", Form("1.0+%f",bkgd_norm_fracerror), dm_min, dm_max); TF1* formScaleDn = new TF1("formScaleDn", Form("1.0-%f",bkgd_norm_fracerror), dm_min, dm_max); systUp = (TH1D*) th1wjets->Clone("systUp"); systUp->Multiply(formScaleUp); //systUp->Add(th1zjets); //systUp->Add(th1qcd); systUp->Add(th1Top); systUp->SetFillColor(0); systUp->SetLineStyle(2); systUp->SetLineColor(2); systUp->SetLineWidth(3); // ---- Stack for shape systematics Down ---------- systDown = (TH1D*) th1wjets->Clone("systDown"); systDown->Multiply(formScaleDn); //systDown->Add(th1zjets); //systDown->Add(th1qcd); systDown->Add(th1Top); systDown->SetFillColor(0); systDown->SetLineWidth(3); systDown->SetLineStyle(2); systDown->SetLineColor(2); ///////////////////////////////////////// /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // ------- Setup the canvas ------- gStyle->SetOptStat(0); gStyle->SetOptTitle(0); // gStyle->SetPadTopMargin(0.1); gStyle->SetPadLeftMargin(0.15); // gStyle->SetPadRightMargin(0.2); gStyle->SetPadBottomMargin(0.3); // gStyle->SetErrorX(0.5); TCanvas* c1 = new TCanvas("dijetPt", "", 10,10, 500, 500); TPad *d1, *d2; c1->Divide(1,2,0,0); d1 = (TPad*)c1->GetPad(1); d1->SetPad(0.01,0.30,0.95,0.99); d2 = (TPad*)c1->GetPad(2); d2->SetPad(0.01,0.02,0.95,0.30); d1->cd(); gPad->SetBottomMargin(0.005); gPad->SetTopMargin(0.1); gPad->SetRightMargin(0.04); // gPad->SetLeftMargin(0.14); // Draw it all double ymax= 5000000.; double ymin= 7.0; if(channel>1) { ymax= 3000.; ymin= 0.10; } th1totempty->GetYaxis()->SetRangeUser(ymin, ymax); th1data->GetYaxis()->SetRangeUser(ymin, ymax); th1totempty->Draw(); hs->Draw("samehist"); for (int i=1;i<=th1tot->GetNbinsX();i++) { double val = th1tot->GetBinContent(i); // / (ptbins_boosted[i]-ptbins_boosted[i-1]); double err = fabs(th1tot->GetBinError(i)); // / (ptbins_boosted[i]-ptbins_boosted[i-1]); TBox *b = new TBox(th1tot->GetBinLowEdge(i), val-err,th1tot->GetBinLowEdge(i+1),val+err); b->SetLineColor(1); b->SetFillColor(1); b->SetFillStyle(3001); b->SetLineStyle(3001); b->Draw(); } //data2draw->Draw("esame"); #ifndef BLINDED th1data->Draw("esame"); #endif cmspre(); // Set up the legend TLegend* Leg = GetLegend(channel); Leg->Draw(); gPad->SetLogy(); gPad->RedrawAxis(); d2->cd(); gPad->SetTopMargin(0.02); gPad->SetRightMargin(0.04); gPad->SetFrameBorderSize(0); gPad->SetBottomMargin(0.45); gPad->SetTickx(); th1emptyclone->Draw(); #ifndef BLINDED hhratio->Draw("esame"); //hhratioUp->Draw("hist lsame"); //hhratioDown->Draw("hist lsame"); #endif TLine *line; line = new TLine(dm_min,1.0,dm_max,1.0); line->SetLineStyle(1); line->SetLineWidth(1); line->SetLineColor(1); line->Draw(); //gPad->WaitPrimitive(); c1->Modified(); c1->Update(); c1->Print(TString("OutDir/")+outfile #ifdef BLINDED +TString("_fatjetPt_blinded.png") #else +TString("_fatjetPt_unblinded.png") #endif ); c1->SaveAs(TString("OutDir/") + outfile #ifdef BLINDED +TString("_fatjetPt_blinded.pdf") #else +TString("_fatjetPt_unblinded.pdf") #endif ); c1->SaveAs(TString("OutDir/") + outfile #ifdef BLINDED +TString("_fatjetPt_blinded.root") #else +TString("_fatjetPt_unblinded.root") #endif ); ///// -------------------------------////// if(saveDataCards_) { outputForLimit->cd(); th1data->SetName("data_obs"); th1data->Write("data_obs"); th1tot->SetName("background"); th1tot->Write("background"); th1ww->SetName("ww"); th1ww->Write("ww"); th1ww->SetName("wz"); th1wz->Write("wz"); th1wv->SetName("diboson"); th1wv->Write("diboson"); th1wv_no_overflow->Write("th1wv_no_overflow"); char* tempname = "background_backshapeUp"; if(channel==0) tempname = "background_mudijet_backshapeUp"; if(channel==1) tempname = "background_eldijet_backshapeUp"; if(channel==2) tempname = "background_muboosted_backshapeUp"; if(channel==3) tempname = "background_elboosted_backshapeUp"; systUp->SetName(tempname); systUp->Write(tempname); tempname = "background_backshapeDown"; if(channel==0) tempname = "background_mudijet_backshapeDown"; if(channel==1) tempname = "background_eldijet_backshapeDown"; if(channel==2) tempname = "background_muboosted_backshapeDown"; if(channel==3) tempname = "background_elboosted_backshapeDown"; systDown->SetName(tempname); systDown->Write(tempname); outputForLimit->Close(); } ///// close if saveDataCards_ //delete th1wvclone; }
void plotAnaMult4(char *infname="ana.root") { TFile *inf = new TFile(infname); TTree *tData = (TTree*) inf->Get("Data_tree"); TTree *tMC = (TTree*) inf->Get("MC_tree"); TTree *tPP = (TTree*) inf->Get("PP_tree"); TCanvas *c1 = new TCanvas("c","",1200,700); // c->Divide(4,1); TCut recoCut = "leadingJetPt>120&&subleadingJetPt>50&&dphi>5*3.14159265358979/6.&&abs(leadingJetEta)<1.6&&abs(subleadingJetEta)<1.6"; TCut genCut = "genleadingJetPt>120&&gensubleadingJetPt>50&&genDphi>5*3.14159265358979/6.&&abs(genleadingJetEta)<1.6&&abs(gensubleadingJetEta)<1.6"; const int nPtBin=5; Float_t PtBins[nPtBin+1] = {0.001,0.5,1,1.5,2,3.2}; Int_t centBin[5] = {200,100,60,20,0}; makeMultiPanelCanvas(c1,4,2,0.0,0.0,0.2,0.2,0.02); for (int i=0;i<4;i++) { c1->cd(i+1); TH1D * empty=new TH1D("empty","",100,0,3.19); // empty->Fill(0.5,1000); empty->SetMaximum(39.99); empty->SetMinimum(0.001); empty->SetNdivisions(105,"X"); empty->GetXaxis()->SetTitleSize(28); empty->GetXaxis()->SetTitleFont(43); empty->GetXaxis()->SetTitleOffset(1.8); empty->GetXaxis()->SetLabelSize(22); empty->GetXaxis()->SetLabelFont(43); empty->GetYaxis()->SetTitleSize(28); empty->GetYaxis()->SetTitleFont(43); empty->GetYaxis()->SetTitleOffset(1.8); empty->GetYaxis()->SetLabelSize(22); empty->GetYaxis()->SetLabelFont(43); empty->GetXaxis()->CenterTitle(); empty->GetYaxis()->CenterTitle(); empty->SetXTitle("#Delta#eta_{1,2}"); empty->SetYTitle("Multiplicity Difference"); TProfile *pData = new TProfile(Form("pData%d",i),"",nPtBin,PtBins); TProfile *pMC = new TProfile(Form("pMC%d",i),"",nPtBin,PtBins); TProfile *pPP = new TProfile(Form("pPP%d",i),"",nPtBin,PtBins); TProfile *pGen = new TProfile(Form("pGen%d",i),"",nPtBin,PtBins); TCut centCut = Form("hiBin>=%d&&hiBin<%d",centBin[i+1],centBin[i]); tData->Draw(Form("-multDiff:abs(leadingJetEta-subleadingJetEta)>>pData%d",i),recoCut&¢Cut); tPP->Draw(Form("-multDiff:abs(leadingJetEta-subleadingJetEta)>>pPP%d",i),recoCut); tMC->Draw(Form("-multDiff:abs(leadingJetEta-subleadingJetEta)>>pMC%d",i),recoCut&¢Cut); tMC->Draw(Form("-genMultDiff:abs(genleadingJetEta-gensubleadingJetEta)>>pGen%d",i),genCut&¢Cut); pMC->SetLineColor(2); pMC->SetMarkerColor(2); pPP->SetLineColor(4); pPP->SetMarkerColor(4); // pData->SetAxisRange(0,50,"Y"); // pData->SetAxisRange(0,0.49,"X"); empty->Draw(); double diff=0; if (i==0) diff=0.1; drawText(Form("%d-%d %%",(int)(0.5*centBin[i+1]),(int)(0.5*centBin[i])),0.22+diff,0.65); if (i==0) drawText("PbPb #sqrt{s_{NN}}=2.76 TeV 150/#mub",0.22+diff,0.85); if (i==0) drawText("pp #sqrt{s_{NN}}=2.76 TeV 5.3/pb",0.22+diff,0.75); if (i==3) drawText("CMS Preliminary",0.3+diff,0.85); Float_t sys[4]={1,1,2.5,3}; for (int j=1;j<=pData->GetNbinsX();j++) { TBox *b = new TBox(pData->GetBinLowEdge(j),pData->GetBinContent(j)-sys[i],pData->GetBinLowEdge(j+1),pData->GetBinContent(j)+sys[i]); //b->SetFillColor(kGray); b->SetFillStyle(0); b->SetLineColor(1); b->Draw(); TBox *b2 = new TBox(pPP->GetBinLowEdge(j),pPP->GetBinContent(j)-1,pPP->GetBinLowEdge(j+1),pPP->GetBinContent(j)+1); //b2->SetFillColor(65); b2->SetFillStyle(0); b2->SetLineColor(4); b2->Draw(); } pData->Draw("same"); pMC->Draw("same"); pPP->Draw("same"); pGen->SetMarkerColor(4); pGen->SetMarkerStyle(24); pData->Draw("same"); // pGen->Draw(" same"); c1->cd(5+i); TH1D *empty2 = (TH1D*)empty->Clone("empty2"); empty2->SetYTitle("PbPb - pp"); empty2->SetMinimum(-5); empty2->SetMaximum(+29.99); empty2->Draw(); // TProfile *pDiff = (TProfile*)pData->Clone("pDiff"); TH1D *pDiff = new TH1D("pDiff","",nPtBin,PtBins); for (int j=1;j<=pData->GetNbinsX();j++) { pDiff->SetBinContent(j,pData->GetBinContent(j)-pPP->GetBinContent(j)); pDiff->SetBinError(j,sqrt(pData->GetBinError(j)*pData->GetBinError(j)+pPP->GetBinError(j)*pPP->GetBinError(j))); TBox *b = new TBox(pDiff->GetBinLowEdge(j),pDiff->GetBinContent(j)-sys[i],pDiff->GetBinLowEdge(j+1),pDiff->GetBinContent(j)+sys[i]); TBox *b2 = new TBox(pDiff->GetBinLowEdge(j),pDiff->GetBinContent(j)-sys[i],pDiff->GetBinLowEdge(j+1),pDiff->GetBinContent(j)+sys[i]); b->SetFillColor(TColor::GetColor("#FFEE00")); b2->SetLineColor(1); b2->SetFillStyle(0); b->Draw(); b2->Draw(); } pDiff->Draw("p same"); TLegend *leg = new TLegend(0.3,0.6,0.9,0.9); leg->SetFillStyle(0); leg->SetBorderSize(0); leg->AddEntry(pData,"PbPb","pl"); leg->AddEntry(pPP,"pp","pl"); leg->AddEntry(pMC,"PYTHIA+HYDJET","pl"); if (i==0) leg->Draw(); if (i==1) drawText("p_{T,1} > 120 GeV/c",0.22+diff,0.85); if (i==1) drawText("p_{T,2} > 50 GeV/c",0.22+diff,0.75); if (i==1) drawText("#Delta#phi_{1,2} > 5#pi/6",0.22+diff,0.65); } /* TCanvas *c1 = new TCanvas("c1","",(ncent+1)*300,700); makeMultiPanelCanvas(c1,ncent+1,2,0.0,0.0,0.2,0.2,0.02); TH1D * empty=new TH1D("empty",Form(";%s;<#slash{p}_{T}^{#parallel}> (GeV)",axistitle[index_var].Data()),nalpha/2+1,frac); TH1D * empty2=new TH1D("empty2",Form(";%s;<#slash{p}_{T}^{#parallel}> (GeV)",axistitle[index_var].Data()),nalpha/2+1,frac); empty->Fill(0.5,1000); empty2->Fill(0.5,1000); if(doIntegrate){ if(index_var==0){ empty->SetMaximum(30); empty->SetMinimum(-70); }else{ empty->SetMaximum(35); empty->SetMinimum(-45); } }else{ empty->SetMaximum(15); empty->SetMinimum(-10); empty2->SetMaximum(15); empty2->SetMinimum(-10); } empty->GetXaxis()->SetTitleSize(28); empty->GetXaxis()->SetTitleFont(43); empty->GetXaxis()->SetTitleOffset(2.2); empty->GetXaxis()->SetLabelSize(22); empty->GetXaxis()->SetLabelFont(43); empty->GetYaxis()->SetTitleSize(28); empty->GetYaxis()->SetTitleFont(43); empty->GetYaxis()->SetTitleOffset(2.2); empty->GetYaxis()->SetLabelSize(22); empty->GetYaxis()->SetLabelFont(43); empty2->GetXaxis()->SetTitleSize(28); empty2->GetXaxis()->SetTitleFont(43); empty2->GetXaxis()->SetTitleOffset(2.2); empty2->GetXaxis()->SetLabelSize(22); empty2->GetXaxis()->SetLabelFont(43); empty2->GetYaxis()->SetTitleSize(28); empty2->GetYaxis()->SetTitleFont(43); empty2->GetYaxis()->SetTitleOffset(2.2); empty2->GetYaxis()->SetLabelSize(22); empty2->GetYaxis()->SetLabelFont(43); c1->cd(ncent+2); */ c1->SaveAs("results/MultiplicityDifference-DeltaEta.C"); c1->SaveAs("results/MultiplicityDifference-DeltaEta.gif"); c1->SaveAs("results/MultiplicityDifference-DeltaEta.eps"); c1->SaveAs("results/MultiplicityDifference-DeltaEta.pdf"); }
void DrawWaveform(char *file, int event, int col, int row, bool common_mode_subtract = false) { TFile *f1 = new TFile(file); TTree *EventTree = (TTree *) f1->Get("EventTree"); float ASIC_ADC[4][4][8][4][64]; unsigned short int ASIC_OriginWindow[4][4][8][4]; bool ASIC_TriggerStream[4][4][8][16]; EventTree->SetBranchAddress("ASIC_ADC",ASIC_ADC); EventTree->SetBranchAddress("ASIC_OriginWindow",ASIC_OriginWindow); EventTree->SetBranchAddress("ASIC_TriggerStream",ASIC_TriggerStream); TCanvas *C = new TCanvas("Waveforms","Waveforms",1024,768); C->Divide(4,2); TGraph *graph[8]; while(1) { EventTree->GetEvent(event); for (int i = 0; i < 8; ++i) { graph[i] = NULL; } for (int ch = 0; ch < 8; ++ch) { if (graph[ch]) { delete graph[ch]; } graph[ch] = new TGraph(); for (int i = 0; i < 4; ++i) { int this_origin_window = ASIC_OriginWindow[col][row][ch][i]; for (int j = 0; j < 64; ++j) { float value = ASIC_ADC[col][row][ch][i][j]; if (common_mode_subtract) { value -= ASIC_ADC[col][row][(ch+1)%8][i][j]; } graph[ch]->SetPoint(i*64+j,(float) i*64+j,value); } } C->cd(ch+1); graph[ch]->Draw("APL"); double low = graph[ch]->GetYaxis()->GetXmin(); double high = graph[ch]->GetYaxis()->GetXmax(); for (int i = 0; i < 4*2; ++i) { int offset = 2; // cout << "Checking window " << offset + i << " : " << ASIC_TriggerStream[col][row][ch][offset+i] << endl; if (ASIC_TriggerStream[col][row][ch][offset+i]) { int window = 8 - i - 1; TBox *highlight = new TBox(window*32,low,(window+1)*32,high); highlight->SetFillColor(kRed); highlight->SetLineColor(kRed); highlight->SetLineWidth(2); highlight->SetFillStyle(0); highlight->Draw(); } } bool any_hit = false; for (int i = 0; i < 16; ++i) { if (ASIC_TriggerStream[col][row][ch][offset+i]) { any_hit = true; break; } } cout << "Window begin at: " << ASIC_OriginWindow[col][row][ch][0] << endl; cout << "Hit status (from trigger stream): " << any_hit << endl; } C->Modified(); C->Update(); getchar(); event++; } }