void fitcomparingcuts_LM_optimized_DD1_sigregonly()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Fri May 13 23:29:18 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(1075.63,-26.4,1149.704,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_5602550__1 = new TH1D("frame_5602550__1","",100,1086,1146);
   frame_5602550__1->SetBinContent(1,3.745406);
   frame_5602550__1->SetMinimum(-8.8);
   frame_5602550__1->SetMaximum(8.8);
   frame_5602550__1->SetEntries(1);
   frame_5602550__1->SetDirectory(0);
   frame_5602550__1->SetStats(0);
   frame_5602550__1->SetLineWidth(2);
   frame_5602550__1->SetMarkerStyle(20);
   frame_5602550__1->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5602550__1->GetXaxis()->SetNdivisions(505);
   frame_5602550__1->GetXaxis()->SetLabelFont(132);
   frame_5602550__1->GetXaxis()->SetLabelOffset(0.01);
   frame_5602550__1->GetXaxis()->SetLabelSize(0.15);
   frame_5602550__1->GetXaxis()->SetTitleSize(0.2);
   frame_5602550__1->GetXaxis()->SetTitleOffset(1.1);
   frame_5602550__1->GetXaxis()->SetTitleFont(132);
   frame_5602550__1->GetYaxis()->SetTitle("Pull");
   frame_5602550__1->GetYaxis()->CenterTitle(true);
   frame_5602550__1->GetYaxis()->SetNdivisions(505);
   frame_5602550__1->GetYaxis()->SetLabelFont(132);
   frame_5602550__1->GetYaxis()->SetLabelOffset(0.01);
   frame_5602550__1->GetYaxis()->SetLabelSize(0.15);
   frame_5602550__1->GetYaxis()->SetTitleSize(0.15);
   frame_5602550__1->GetYaxis()->SetTitleOffset(0.45);
   frame_5602550__1->GetYaxis()->SetTitleFont(132);
   frame_5602550__1->GetZaxis()->SetLabelFont(132);
   frame_5602550__1->GetZaxis()->SetLabelSize(0.06);
   frame_5602550__1->GetZaxis()->SetTitleSize(0.072);
   frame_5602550__1->GetZaxis()->SetTitleOffset(1.2);
   frame_5602550__1->GetZaxis()->SetTitleFont(132);
   frame_5602550__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[24] = {
   1109.1,
   1109.7,
   1110.3,
   1110.9,
   1111.5,
   1112.1,
   1112.7,
   1113.3,
   1113.9,
   1114.5,
   1115.1,
   1115.7,
   1116.3,
   1116.9,
   1117.5,
   1118.1,
   1118.7,
   1119.3,
   1119.9,
   1120.5,
   1121.1,
   1121.7,
   1122.3,
   1122.9};
   Double_t pull_Hist_curvetot_fy3001[24] = {
   -0.3330637,
   -1.949993,
   -3.139195,
   -0.6971619,
   -1.655885,
   1.42007,
   1.006975,
   -0.1414765,
   -0.1440619,
   -0.3520065,
   0.8182724,
   1.900459,
   0.5393396,
   -1.447405,
   -1.879962,
   -1.916407,
   0.9788169,
   0.6653271,
   2.369949,
   0.4574603,
   2.123165,
   0.6650093,
   0.5132994,
   -1.11117};
   Double_t pull_Hist_curvetot_felx3001[24] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[24] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   Double_t pull_Hist_curvetot_fehx3001[24] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[24] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(24,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__R_M and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__R_M and Projection of totalPdf",100,1107.72,1124.28);
   Graph_pull_Hist_curvetot3001->SetMinimum(-4.890109);
   Graph_pull_Hist_curvetot3001->SetMaximum(4.120863);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_5602550__2 = new TH1D("frame_5602550__2","",100,1086,1146);
   frame_5602550__2->SetBinContent(1,3.745406);
   frame_5602550__2->SetMinimum(-8.8);
   frame_5602550__2->SetMaximum(8.8);
   frame_5602550__2->SetEntries(1);
   frame_5602550__2->SetDirectory(0);
   frame_5602550__2->SetStats(0);
   frame_5602550__2->SetLineWidth(2);
   frame_5602550__2->SetMarkerStyle(20);
   frame_5602550__2->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5602550__2->GetXaxis()->SetNdivisions(505);
   frame_5602550__2->GetXaxis()->SetLabelFont(132);
   frame_5602550__2->GetXaxis()->SetLabelOffset(0.01);
   frame_5602550__2->GetXaxis()->SetLabelSize(0.15);
   frame_5602550__2->GetXaxis()->SetTitleSize(0.2);
   frame_5602550__2->GetXaxis()->SetTitleOffset(1.1);
   frame_5602550__2->GetXaxis()->SetTitleFont(132);
   frame_5602550__2->GetYaxis()->SetTitle("Pull");
   frame_5602550__2->GetYaxis()->CenterTitle(true);
   frame_5602550__2->GetYaxis()->SetNdivisions(505);
   frame_5602550__2->GetYaxis()->SetLabelFont(132);
   frame_5602550__2->GetYaxis()->SetLabelOffset(0.01);
   frame_5602550__2->GetYaxis()->SetLabelSize(0.15);
   frame_5602550__2->GetYaxis()->SetTitleSize(0.15);
   frame_5602550__2->GetYaxis()->SetTitleOffset(0.45);
   frame_5602550__2->GetYaxis()->SetTitleFont(132);
   frame_5602550__2->GetZaxis()->SetLabelFont(132);
   frame_5602550__2->GetZaxis()->SetLabelSize(0.06);
   frame_5602550__2->GetZaxis()->SetTitleSize(0.072);
   frame_5602550__2->GetZaxis()->SetTitleOffset(1.2);
   frame_5602550__2->GetZaxis()->SetTitleFont(132);
   frame_5602550__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(1075.63,0,1149.704,1077.436);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_5368230__3 = new TH1D("frame_5368230__3","A RooPlot of \"#Lambda mass\"",100,1086,1146);
   frame_5368230__3->SetBinContent(1,1012.789);
   frame_5368230__3->SetMaximum(1012.789);
   frame_5368230__3->SetEntries(1);
   frame_5368230__3->SetDirectory(0);
   frame_5368230__3->SetStats(0);
   frame_5368230__3->SetLineWidth(2);
   frame_5368230__3->SetMarkerStyle(20);
   frame_5368230__3->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5368230__3->GetXaxis()->SetNdivisions(505);
   frame_5368230__3->GetXaxis()->SetLabelFont(132);
   frame_5368230__3->GetXaxis()->SetLabelOffset(0.01);
   frame_5368230__3->GetXaxis()->SetLabelSize(0.06);
   frame_5368230__3->GetXaxis()->SetTitleSize(0.072);
   frame_5368230__3->GetXaxis()->SetTitleOffset(0.95);
   frame_5368230__3->GetXaxis()->SetTitleFont(132);
   frame_5368230__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_5368230__3->GetYaxis()->SetLabelFont(132);
   frame_5368230__3->GetYaxis()->SetLabelOffset(0.01);
   frame_5368230__3->GetYaxis()->SetLabelSize(0.06);
   frame_5368230__3->GetYaxis()->SetTitleSize(0.072);
   frame_5368230__3->GetYaxis()->SetTitleOffset(0.95);
   frame_5368230__3->GetYaxis()->SetTitleFont(132);
   frame_5368230__3->GetZaxis()->SetLabelFont(132);
   frame_5368230__3->GetZaxis()->SetLabelSize(0.06);
   frame_5368230__3->GetZaxis()->SetTitleSize(0.072);
   frame_5368230__3->GetZaxis()->SetTitleOffset(1.2);
   frame_5368230__3->GetZaxis()->SetTitleFont(132);
   frame_5368230__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   1086.3,
   1086.9,
   1087.5,
   1088.1,
   1088.7,
   1089.3,
   1089.9,
   1090.5,
   1091.1,
   1091.7,
   1092.3,
   1092.9,
   1093.5,
   1094.1,
   1094.7,
   1095.3,
   1095.9,
   1096.5,
   1097.1,
   1097.7,
   1098.3,
   1098.9,
   1099.5,
   1100.1,
   1100.7,
   1101.3,
   1101.9,
   1102.5,
   1103.1,
   1103.7,
   1104.3,
   1104.9,
   1105.5,
   1106.1,
   1106.7,
   1107.3,
   1107.9,
   1108.5,
   1109.1,
   1109.7,
   1110.3,
   1110.9,
   1111.5,
   1112.1,
   1112.7,
   1113.3,
   1113.9,
   1114.5,
   1115.1,
   1115.7,
   1116.3,
   1116.9,
   1117.5,
   1118.1,
   1118.7,
   1119.3,
   1119.9,
   1120.5,
   1121.1,
   1121.7,
   1122.3,
   1122.9,
   1123.5,
   1124.1,
   1124.7,
   1125.3,
   1125.9,
   1126.5,
   1127.1,
   1127.7,
   1128.3,
   1128.9,
   1129.5,
   1130.1,
   1130.7,
   1131.3,
   1131.9,
   1132.5,
   1133.1,
   1133.7,
   1134.3,
   1134.9,
   1135.5,
   1136.1,
   1136.7,
   1137.3,
   1137.9,
   1138.5,
   1139.1,
   1139.7,
   1140.3,
   1140.9,
   1141.5,
   1142.1,
   1142.7,
   1143.3,
   1143.9,
   1144.5,
   1145.1,
   1145.7};
   Double_t Hist_fy3002[100] = {
   12,
   9,
   17,
   11,
   12,
   7,
   15,
   7,
   11,
   19,
   12,
   13,
   12,
   11,
   10,
   9,
   8,
   9,
   12,
   8,
   8,
   10,
   9,
   12,
   14,
   10,
   9,
   8,
   14,
   6,
   11,
   14,
   17,
   16,
   23,
   17,
   23,
   23,
   36,
   36,
   40,
   70,
   84,
   155,
   217,
   304,
   451,
   619,
   809,
   934,
   880,
   716,
   545,
   381,
   297,
   195,
   158,
   99,
   94,
   64,
   51,
   32,
   46,
   39,
   23,
   20,
   21,
   20,
   17,
   22,
   14,
   13,
   19,
   11,
   15,
   13,
   18,
   19,
   20,
   14,
   14,
   14,
   15,
   7,
   12,
   17,
   12,
   14,
   12,
   13,
   15,
   21,
   17,
   10,
   13,
   12,
   21,
   12,
   10,
   4};
   Double_t Hist_felx3002[100] = {
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3};
   Double_t Hist_fely3002[100] = {
   3.464102,
   3,
   4.123106,
   3.316625,
   3.464102,
   2.645751,
   3.872983,
   2.645751,
   3.316625,
   4.358899,
   3.464102,
   3.605551,
   3.464102,
   3.316625,
   3.162278,
   3,
   2.828427,
   3,
   3.464102,
   2.828427,
   2.828427,
   3.162278,
   3,
   3.464102,
   3.741657,
   3.162278,
   3,
   2.828427,
   3.741657,
   2.44949,
   3.316625,
   3.741657,
   4.123106,
   4,
   4.795832,
   4.123106,
   4.795832,
   4.795832,
   6,
   6,
   6.324555,
   8.3666,
   9.165151,
   12.4499,
   14.73092,
   17.4356,
   21.23676,
   24.87971,
   28.44293,
   30.56141,
   29.66479,
   26.75818,
   23.34524,
   19.51922,
   17.23369,
   13.96424,
   12.56981,
   9.949874,
   9.69536,
   8,
   7.141428,
   5.656854,
   6.78233,
   6.244998,
   4.795832,
   4.472136,
   4.582576,
   4.472136,
   4.123106,
   4.690416,
   3.741657,
   3.605551,
   4.358899,
   3.316625,
   3.872983,
   3.605551,
   4.242641,
   4.358899,
   4.472136,
   3.741657,
   3.741657,
   3.741657,
   3.872983,
   2.645751,
   3.464102,
   4.123106,
   3.464102,
   3.741657,
   3.464102,
   3.605551,
   3.872983,
   4.582576,
   4.123106,
   3.162278,
   3.605551,
   3.464102,
   4.582576,
   3.464102,
   3.162278,
   2};
   Double_t Hist_fehx3002[100] = {
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3};
   Double_t Hist_fehy3002[100] = {
   3.464102,
   3,
   4.123106,
   3.316625,
   3.464102,
   2.645751,
   3.872983,
   2.645751,
   3.316625,
   4.358899,
   3.464102,
   3.605551,
   3.464102,
   3.316625,
   3.162278,
   3,
   2.828427,
   3,
   3.464102,
   2.828427,
   2.828427,
   3.162278,
   3,
   3.464102,
   3.741657,
   3.162278,
   3,
   2.828427,
   3.741657,
   2.44949,
   3.316625,
   3.741657,
   4.123106,
   4,
   4.795832,
   4.123106,
   4.795832,
   4.795832,
   6,
   6,
   6.324555,
   8.3666,
   9.165151,
   12.4499,
   14.73092,
   17.4356,
   21.23676,
   24.87971,
   28.44293,
   30.56141,
   29.66479,
   26.75818,
   23.34524,
   19.51922,
   17.23369,
   13.96424,
   12.56981,
   9.949874,
   9.69536,
   8,
   7.141428,
   5.656854,
   6.78233,
   6.244998,
   4.795832,
   4.472136,
   4.582576,
   4.472136,
   4.123106,
   4.690416,
   3.741657,
   3.605551,
   4.358899,
   3.316625,
   3.872983,
   3.605551,
   4.242641,
   4.358899,
   4.472136,
   3.741657,
   3.741657,
   3.741657,
   3.872983,
   2.645751,
   3.464102,
   4.123106,
   3.464102,
   3.741657,
   3.464102,
   3.605551,
   3.872983,
   4.582576,
   4.123106,
   3.162278,
   3.605551,
   3.464102,
   4.582576,
   3.464102,
   3.162278,
   2};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__R_M");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__R_M",100,1080,1152);
   Graph_Hist3002->SetMinimum(0);
   Graph_Hist3002->SetMaximum(1060.818);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   1108.505,
   1108.653,
   1108.802,
   1108.95,
   1109.099,
   1109.247,
   1109.396,
   1109.544,
   1109.693,
   1109.842,
   1109.99,
   1110.139,
   1110.287,
   1110.436,
   1110.584,
   1110.733,
   1110.882,
   1111.03,
   1111.179,
   1111.327,
   1111.476,
   1111.624,
   1111.773,
   1111.922,
   1112.07,
   1112.219,
   1112.367,
   1112.516,
   1112.664,
   1112.813,
   1112.961,
   1113.11,
   1113.259,
   1113.407,
   1113.556,
   1113.704,
   1113.853,
   1114.001,
   1114.15,
   1114.299,
   1114.447,
   1114.596,
   1114.744,
   1114.893,
   1115.041,
   1115.19,
   1115.339,
   1115.487,
   1115.636,
   1115.784,
   1115.933,
   1116.081,
   1116.23,
   1116.378,
   1116.527,
   1116.676,
   1116.824,
   1116.973,
   1117.121,
   1117.27,
   1117.418,
   1117.567,
   1117.716,
   1117.864,
   1118.013,
   1118.161,
   1118.31,
   1118.458,
   1118.607,
   1118.756,
   1118.904,
   1119.053,
   1119.201,
   1119.35,
   1119.498,
   1119.647,
   1119.795,
   1119.944,
   1120.093,
   1120.241,
   1120.39,
   1120.538,
   1120.687,
   1120.835,
   1120.984,
   1121.133,
   1121.281,
   1121.43,
   1121.578,
   1121.727,
   1121.875,
   1122.024,
   1122.173,
   1122.321,
   1122.47,
   1122.618,
   1122.767,
   1122.915,
   1123.064,
   1123.212,
   1123.361,
   1123.361};
   Double_t curvetot_fy1[102] = {
   30.29978,
   32.0559,
   33.91896,
   35.89256,
   37.98048,
   40.18694,
   42.51682,
   44.97598,
   47.57177,
   50.31356,
   53.2135,
   56.28743,
   59.556,
   63.04591,
   66.79149,
   70.8363,
   75.23501,
   80.05526,
   85.37962,
   91.30726,
   97.95553,
   105.4609,
   113.9791,
   123.6849,
   134.7698,
   147.4391,
   161.9068,
   178.3894,
   197.097,
   218.2234,
   241.9346,
   268.3554,
   297.5564,
   329.54,
   364.228,
   401.45,
   440.935,
   482.3067,
   525.0822,
   568.6765,
   612.4121,
   655.5338,
   697.2294,
   736.6539,
   772.9585,
   805.3213,
   832.9784,
   855.2553,
   871.5944,
   881.5791,
   884.9519,
   881.6256,
   871.6873,
   855.3946,
   833.1642,
   805.5535,
   773.2371,
   736.9789,
   697.6009,
   655.9518,
   612.8765,
   569.1873,
   525.6395,
   482.9104,
   441.5852,
   402.1465,
   364.971,
   330.3295,
   298.3922,
   269.2377,
   242.8633,
   219.1986,
   198.1186,
   179.4575,
   163.0213,
   148.6,
   135.9772,
   124.9387,
   115.2793,
   106.8075,
   99.34864,
   92.74681,
   86.8656,
   81.58768,
   76.81386,
   72.46159,
   68.46322,
   64.76408,
   61.3206,
   58.09848,
   55.07098,
   52.21747,
   49.52212,
   46.97277,
   44.56004,
   42.27661,
   40.11658,
   38.0751,
   36.14794,
   34.33131,
   32.62163,
   32.62163};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,1107.019,1124.847);
   Graph_curvetot1->SetMinimum(0);
   Graph_curvetot1->SetMaximum(970.4171);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t bkg_fx2[102] = {
   1108.505,
   1108.653,
   1108.802,
   1108.95,
   1109.099,
   1109.247,
   1109.396,
   1109.544,
   1109.693,
   1109.842,
   1109.99,
   1110.139,
   1110.287,
   1110.436,
   1110.584,
   1110.733,
   1110.882,
   1111.03,
   1111.179,
   1111.327,
   1111.476,
   1111.624,
   1111.773,
   1111.922,
   1112.07,
   1112.219,
   1112.367,
   1112.516,
   1112.664,
   1112.813,
   1112.961,
   1113.11,
   1113.259,
   1113.407,
   1113.556,
   1113.704,
   1113.853,
   1114.001,
   1114.15,
   1114.299,
   1114.447,
   1114.596,
   1114.744,
   1114.893,
   1115.041,
   1115.19,
   1115.339,
   1115.487,
   1115.636,
   1115.784,
   1115.933,
   1116.081,
   1116.23,
   1116.378,
   1116.527,
   1116.676,
   1116.824,
   1116.973,
   1117.121,
   1117.27,
   1117.418,
   1117.567,
   1117.716,
   1117.864,
   1118.013,
   1118.161,
   1118.31,
   1118.458,
   1118.607,
   1118.756,
   1118.904,
   1119.053,
   1119.201,
   1119.35,
   1119.498,
   1119.647,
   1119.795,
   1119.944,
   1120.093,
   1120.241,
   1120.39,
   1120.538,
   1120.687,
   1120.835,
   1120.984,
   1121.133,
   1121.281,
   1121.43,
   1121.578,
   1121.727,
   1121.875,
   1122.024,
   1122.173,
   1122.321,
   1122.47,
   1122.618,
   1122.767,
   1122.915,
   1123.064,
   1123.212,
   1123.361,
   1123.361};
   Double_t bkg_fy2[102] = {
   9.168666,
   9.178623,
   9.188847,
   9.199339,
   9.2101,
   9.221128,
   9.232424,
   9.243988,
   9.25582,
   9.26792,
   9.280288,
   9.292923,
   9.305827,
   9.318999,
   9.332438,
   9.346145,
   9.360121,
   9.374364,
   9.388875,
   9.403654,
   9.418701,
   9.434016,
   9.449599,
   9.46545,
   9.481568,
   9.497955,
   9.514609,
   9.531532,
   9.548722,
   9.56618,
   9.583906,
   9.601901,
   9.620163,
   9.638692,
   9.65749,
   9.676556,
   9.69589,
   9.715491,
   9.735361,
   9.755498,
   9.775904,
   9.796577,
   9.817518,
   9.838727,
   9.860204,
   9.881949,
   9.903962,
   9.926243,
   9.948792,
   9.971608,
   9.994693,
   10.01805,
   10.04167,
   10.06555,
   10.08971,
   10.11413,
   10.13883,
   10.16379,
   10.18901,
   10.21451,
   10.24027,
   10.26631,
   10.2926,
   10.31917,
   10.34601,
   10.37311,
   10.40048,
   10.42812,
   10.45603,
   10.4842,
   10.51265,
   10.54136,
   10.57034,
   10.59958,
   10.6291,
   10.65888,
   10.68893,
   10.71925,
   10.74984,
   10.78069,
   10.81181,
   10.8432,
   10.87486,
   10.90679,
   10.93898,
   10.97144,
   11.00417,
   11.03717,
   11.07043,
   11.10397,
   11.13777,
   11.17184,
   11.20617,
   11.24078,
   11.27565,
   11.31079,
   11.3462,
   11.38188,
   11.41782,
   11.45404,
   11.49052,
   11.49052};
   graph = new TGraph(102,bkg_fx2,bkg_fy2);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg2 = new TH1F("Graph_bkg2","Projection of totalPdf",102,1107.019,1124.847);
   Graph_bkg2->SetMinimum(8.936481);
   Graph_bkg2->SetMaximum(11.7227);
   Graph_bkg2->SetDirectory(0);
   Graph_bkg2->SetStats(0);
   Graph_bkg2->SetLineWidth(2);
   Graph_bkg2->SetMarkerStyle(20);
   Graph_bkg2->GetXaxis()->SetNdivisions(505);
   Graph_bkg2->GetXaxis()->SetLabelFont(132);
   Graph_bkg2->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetXaxis()->SetTitleFont(132);
   Graph_bkg2->GetYaxis()->SetLabelFont(132);
   Graph_bkg2->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetYaxis()->SetTitleFont(132);
   Graph_bkg2->GetZaxis()->SetLabelFont(132);
   Graph_bkg2->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg2);
   
   graph->Draw("l");
   
   Double_t sigLM_fx3[102] = {
   1108.505,
   1108.653,
   1108.802,
   1108.95,
   1109.099,
   1109.247,
   1109.396,
   1109.544,
   1109.693,
   1109.842,
   1109.99,
   1110.139,
   1110.287,
   1110.436,
   1110.584,
   1110.733,
   1110.882,
   1111.03,
   1111.179,
   1111.327,
   1111.476,
   1111.624,
   1111.773,
   1111.922,
   1112.07,
   1112.219,
   1112.367,
   1112.516,
   1112.664,
   1112.813,
   1112.961,
   1113.11,
   1113.259,
   1113.407,
   1113.556,
   1113.704,
   1113.853,
   1114.001,
   1114.15,
   1114.299,
   1114.447,
   1114.596,
   1114.744,
   1114.893,
   1115.041,
   1115.19,
   1115.339,
   1115.487,
   1115.636,
   1115.784,
   1115.933,
   1116.081,
   1116.23,
   1116.378,
   1116.527,
   1116.676,
   1116.824,
   1116.973,
   1117.121,
   1117.27,
   1117.418,
   1117.567,
   1117.716,
   1117.864,
   1118.013,
   1118.161,
   1118.31,
   1118.458,
   1118.607,
   1118.756,
   1118.904,
   1119.053,
   1119.201,
   1119.35,
   1119.498,
   1119.647,
   1119.795,
   1119.944,
   1120.093,
   1120.241,
   1120.39,
   1120.538,
   1120.687,
   1120.835,
   1120.984,
   1121.133,
   1121.281,
   1121.43,
   1121.578,
   1121.727,
   1121.875,
   1122.024,
   1122.173,
   1122.321,
   1122.47,
   1122.618,
   1122.767,
   1122.915,
   1123.064,
   1123.212,
   1123.361,
   1123.361};
   Double_t sigLM_fy3[102] = {
   21.13111,
   22.87727,
   24.73012,
   26.69322,
   28.77038,
   30.96581,
   33.28439,
   35.73199,
   38.31595,
   41.04564,
   43.93321,
   46.99451,
   50.25017,
   53.72691,
   57.45905,
   61.49015,
   65.87488,
   70.6809,
   75.99074,
   81.90361,
   88.53683,
   96.02684,
   104.5295,
   114.2194,
   125.2882,
   137.9411,
   152.3922,
   168.8579,
   187.5483,
   208.6573,
   232.3507,
   258.7535,
   287.9362,
   319.9013,
   354.5705,
   391.7734,
   431.2391,
   472.5913,
   515.3469,
   558.921,
   602.6362,
   645.7372,
   687.4118,
   726.8151,
   763.0983,
   795.4393,
   823.0745,
   845.3291,
   861.6456,
   871.6075,
   874.9572,
   871.6075,
   861.6456,
   845.3291,
   823.0745,
   795.4393,
   763.0983,
   726.8151,
   687.4118,
   645.7372,
   602.6362,
   558.921,
   515.3469,
   472.5913,
   431.2391,
   391.7734,
   354.5705,
   319.9013,
   287.9362,
   258.7535,
   232.3507,
   208.6573,
   187.5483,
   168.8579,
   152.3922,
   137.9411,
   125.2882,
   114.2194,
   104.5295,
   96.02684,
   88.53683,
   81.90361,
   75.99074,
   70.6809,
   65.87488,
   61.49015,
   57.45905,
   53.72691,
   50.25017,
   46.99451,
   43.93321,
   41.04564,
   38.31595,
   35.73199,
   33.28439,
   30.96581,
   28.77038,
   26.69322,
   24.73012,
   22.87727,
   21.13111,
   21.13111};
   graph = new TGraph(102,sigLM_fx3,sigLM_fy3);
   graph->SetName("sigLM");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(3);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_sigLM3 = new TH1F("Graph_sigLM3","Projection of totalPdf",102,1107.019,1124.847);
   Graph_sigLM3->SetMinimum(0);
   Graph_sigLM3->SetMaximum(960.3398);
   Graph_sigLM3->SetDirectory(0);
   Graph_sigLM3->SetStats(0);
   Graph_sigLM3->SetLineWidth(2);
   Graph_sigLM3->SetMarkerStyle(20);
   Graph_sigLM3->GetXaxis()->SetNdivisions(505);
   Graph_sigLM3->GetXaxis()->SetLabelFont(132);
   Graph_sigLM3->GetXaxis()->SetLabelOffset(0.01);
   Graph_sigLM3->GetXaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetXaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetXaxis()->SetTitleOffset(0.95);
   Graph_sigLM3->GetXaxis()->SetTitleFont(132);
   Graph_sigLM3->GetYaxis()->SetLabelFont(132);
   Graph_sigLM3->GetYaxis()->SetLabelOffset(0.01);
   Graph_sigLM3->GetYaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetYaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetYaxis()->SetTitleOffset(0.95);
   Graph_sigLM3->GetYaxis()->SetTitleFont(132);
   Graph_sigLM3->GetZaxis()->SetLabelFont(132);
   Graph_sigLM3->GetZaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetZaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetZaxis()->SetTitleOffset(1.2);
   Graph_sigLM3->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_sigLM3);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.75,0.5,1,0.9,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("bkg","Background","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sigLM","#Lambda M (dbl Gaus)","l");
   entry->SetLineColor(3);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_5368230__4 = new TH1D("frame_5368230__4","A RooPlot of \"#Lambda mass\"",100,1086,1146);
   frame_5368230__4->SetBinContent(1,1012.789);
   frame_5368230__4->SetMaximum(1012.789);
   frame_5368230__4->SetEntries(1);
   frame_5368230__4->SetDirectory(0);
   frame_5368230__4->SetStats(0);
   frame_5368230__4->SetLineWidth(2);
   frame_5368230__4->SetMarkerStyle(20);
   frame_5368230__4->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5368230__4->GetXaxis()->SetNdivisions(505);
   frame_5368230__4->GetXaxis()->SetLabelFont(132);
   frame_5368230__4->GetXaxis()->SetLabelOffset(0.01);
   frame_5368230__4->GetXaxis()->SetLabelSize(0.06);
   frame_5368230__4->GetXaxis()->SetTitleSize(0.072);
   frame_5368230__4->GetXaxis()->SetTitleOffset(0.95);
   frame_5368230__4->GetXaxis()->SetTitleFont(132);
   frame_5368230__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_5368230__4->GetYaxis()->SetLabelFont(132);
   frame_5368230__4->GetYaxis()->SetLabelOffset(0.01);
   frame_5368230__4->GetYaxis()->SetLabelSize(0.06);
   frame_5368230__4->GetYaxis()->SetTitleSize(0.072);
   frame_5368230__4->GetYaxis()->SetTitleOffset(0.95);
   frame_5368230__4->GetYaxis()->SetTitleFont(132);
   frame_5368230__4->GetZaxis()->SetLabelFont(132);
   frame_5368230__4->GetZaxis()->SetLabelSize(0.06);
   frame_5368230__4->GetZaxis()->SetTitleSize(0.072);
   frame_5368230__4->GetZaxis()->SetTitleOffset(1.2);
   frame_5368230__4->GetZaxis()->SetTitleFont(132);
   frame_5368230__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Пример #2
0
//____________________________________________________________________________________
// Plot blue band (SM Higgs curve)
void blueBand( )
{

  double zerror = 4;
  double xmin = 76;

  int npoints = 31;
  double x[] = { 10.000000, 11.392849, 12.979700, 14.787576, 16.847262, 19.193831, 21.867241, 
                 24.913018, 28.383024, 32.336350, 36.840315, 41.971614, 47.817625, 54.477897,
                 62.065844, 70.710678, 76, 80.559606, 91.780341, 104.563955, 119.128133, 135.720881,
                 154.624747, 176.161637, 200.698289, 228.652526, 260.500365, 296.784127, 
                 338.121669, 385.216905, 438.871795, 500.000000 };

  double y[] = { 20.929260, 18.757168, 16.647426, 14.611732, 12.661571, 10.808107, 9.062193,
                 7.434501, 5.935701, 4.576664, 3.368675, 2.323612, 1.454084, 0.776111,
                 0.300018, 0.042673, 0.0001, 0.020469, 0.251087, 0.750519, 1.538231, 2.633789,
                 4.056692, 5.826546, 7.962673, 10.483595, 13.406320, 16.745357, 20.511276,
                 24.717583, 29.345917, 34.380810 };


  TGraph* smGraph = new TGraph( npoints, x, y );

  if ( npoints > MAXPOINTS ) {
    std::cerr << "FATAL: npoints = " << npoints << " is greater than MAXPOINTS" << std::endl;
    exit(-1);
  }
  double x1[2*MAXPOINTS], y1[2*MAXPOINTS];
  double x2[MAXPOINTS], y2[MAXPOINTS];

  // Find mH at minimum
  int i1=0; // iterator for upper curve
  int i2=0; // iterator for lower curve
  double x0,y0;
  double step = 5;
  smGraph->GetPoint( 0, x0, y0 );
  for ( int i=0; i<100; ++i )
    {
      double ix = x0+i*step;
      double iy = smGraph->Eval( ix, 0, "S" );
      double error = TMath::Log( ix/12. )*3.;
      if ( ix<=xmin-error ) { 
        x1[i1] = ix+error; y1[i1]=iy; ++i1; 
        x2[i2] = ix-error; y2[i2]=iy; ++i2;
      }
      else if ( ix>=xmin+error) { 
        x1[i1] = ix-error; y1[i1]=iy; ++i1; 
        x2[i2] = ix+error; y2[i2]=iy; ++i2;
      } else {//if ( iy>0. ) {
        x2[i2] = (ix<=xmin)?ix-error:ix+error; 
        y2[i2]=iy; 
        ++i2;
      }
      
    }
  // Merge arrays
  for ( int i=0; i<i2; ++i ) {
    x1[i+i1] = x2[i2-i-1];
    y1[i+i1] = y2[i2-i-1];
  }
  if ( doBands ) {
    TGraph* blueBand = new TGraph( i1+i2, x1, y1 );
    blueBand->SetFillColor(7);
    blueBand->SetLineColor(7);
    blueBand->Draw("LF");
    blueBand->Draw("C");
  } else {
    smGraph->SetLineWidth(5);
  }

  smGraph->SetLineColor(4);
  smGraph->Draw("C");
  double chi2limit = smGraph->Eval( LEPLIMIT, 0, "S" );
  std::cout << "Value at limit (" << LEPLIMIT << "): " << chi2limit << std::endl;

  TGraph* lowband = new TGraph( i2, x2, y2 );
  std::cout << "Value of (low) blueband at limit: " << lowband->Eval( LEPLIMIT, 0, "S" )
            << std::endl;

}
Пример #3
0
TCanvas *timeonaxis()
{

//Author:

   time_t script_time;
   script_time = time(0);
   script_time = 3600*(int)(script_time/3600);

// The time offset is the one that will be used by all graphs.
// If one changes it, it will be changed even on the graphs already defined
   gStyle->SetTimeOffset(script_time);

   TCanvas *ct = new TCanvas("ct","Time on axis",10,10,700,900);
   ct->Divide(1,3);
   ct->SetFillColor(28);

   int i;

//======= Build a signal : noisy damped sine ======
//        Time interval : 30 minutes

   gStyle->SetTitleH(0.08);
   float noise;
   TH1F *ht = new TH1F("ht","Love at first sight",3000,0.,2000.);
   for (i=1;i<3000;i++) {
      noise = gRandom->Gaus(0,120);
      if (i>700) {
         noise += 1000*sin((i-700)*6.28/30)*exp((double)(700-i)/300);
      }
      ht->SetBinContent(i,noise);
   }
   ct->cd(1);
   gPad->SetFillColor(41);
   gPad->SetFrameFillColor(33);
   ht->SetLineColor(2);
   ht->GetXaxis()->SetLabelSize(0.05);
   ht->Draw();
// Sets time on the X axis
// The time used is the one set as time offset added to the value
// of the axis. This is converted into day/month/year hour:min:sec and
// a reasonable tick interval value is chosen.
   ht->GetXaxis()->SetTimeDisplay(1);

//======= Build a simple graph beginning at a different time ======
//        Time interval : 5 seconds

   float x[100], t[100];
   for (i=0;i<100;i++) {
      x[i] = sin(i*4*3.1415926/50)*exp(-(double)i/20);
      t[i] = 6000+(double)i/20;
   }
   TGraph *gt = new TGraph(100,t,x);
   gt->SetTitle("Politics");
   ct->cd(2);
   gPad->SetFillColor(41);
   gPad->SetFrameFillColor(33);
   gt->SetFillColor(19);
   gt->SetLineColor(5);
   gt->SetLineWidth(2);
   gt->Draw("AL");
   gt->GetXaxis()->SetLabelSize(0.05);
// Sets time on the X axis
   gt->GetXaxis()->SetTimeDisplay(1);
   gPad->Modified();

//======= Build a second simple graph for a very long time interval ======
//        Time interval : a few years

   float x2[10], t2[10];
   for (i=0;i<10;i++) {
      x2[i] = gRandom->Gaus(500,100)*i;
      t2[i] = i*365*86400;
   }
   TGraph *gt2 = new TGraph(10,t2,x2);
   gt2->SetTitle("Number of monkeys on the moon");
   ct->cd(3);
   gPad->SetFillColor(41);
   gPad->SetFrameFillColor(33);
   gt2->SetFillColor(19);
   gt2->SetMarkerColor(4);
   gt2->SetMarkerStyle(29);
   gt2->SetMarkerSize(1.3);
   gt2->Draw("AP");
   gt2->GetXaxis()->SetLabelSize(0.05);
// Sets time on the X axis
   gt2->GetXaxis()->SetTimeDisplay(1);
//
// One can choose a different time format than the one chosen by default
// The time format is the same as the one of the C strftime() function
// It's a string containing the following formats :
//    for date :
//      %a abbreviated weekday name
//      %b abbreviated month name
//      %d day of the month (01-31)
//      %m month (01-12)
//      %y year without century
//      %Y year with century
//
//    for time :
//      %H hour (24-hour clock)
//      %I hour (12-hour clock)
//      %p local equivalent of AM or PM
//      %M minute (00-59)
//      %S seconds (00-61)
//      %% %
// The other characters are output as is.

   gt2->GetXaxis()->SetTimeFormat("y. %Y %F2000-01-01 00:00:00");
   gPad->Modified();
   return ct;
}
Пример #4
0
void plotMSSM(const TString& what="(ggA+bbA)*BRAZh*BRhbb"){
  const double BRZll=0.06726;
  const double fb2pb=1000;
  //TString scale(Form("*%f*%f",BRZll,fb2pb));
  TString scale("");

  TString cname(what);
  cname.ReplaceAll("*","x");
  cname.ReplaceAll("(","U");
  cname.ReplaceAll(")","U");
  cname+="_MSSM_mhmax";
  //
  TString goodName(what);
  goodName.ReplaceAll("mh","m_{h}");
  goodName.ReplaceAll("ggA","#sigma_{gg#rightarrowA}");
  goodName.ReplaceAll("bbA","#sigma_{bb#rightarrowA}");
  goodName.ReplaceAll("BRAZh","B(A#rightarrowZh)");
  goodName.ReplaceAll("BRhbb","B(h#rightarrowbb)");
  //goodName+=("*B(Z#rightarrowll)");
  //goodName+=("[pb] ");
  goodName+=("[GeV] ");
  TString goodType("MSSM m_{h}^{max}");
  //goodName=("#sigma*B(pp#rightarrowA#rightarrowZh#rightarrowllbb) [fb]");
  //goodName=("#sigma*B(pp#rightarrowA) [fb]");
  //goodName=("BR(A#rightarrowZh)");
  //goodName=("BR(h#rightarrowbb)");

  //if (m>0) mass=(Form(" * (mA==%d)",m));
  //TString ok(" * validity * stability * perturbativity * unitarity ");
  //TString ok(" * unitarity");
  TString ok("");


  TChain* ch=new TChain("TreeMSSM");

  ch->Add("lsf_working_dir_M225_20636539/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M250_20636540/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M275_20636541/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M300_20636542/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M325_20636543/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M350_20636544/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M400_20636545/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M500_20636546/parameter_MSSM.root");
  ch->Add("lsf_working_dir_M600_20636547/parameter_MSSM.root");

  //double tanbeta[30]={1,10,20,30,40,50,60,70,80,90,100,120,140,160,180,200,220,240,260,280,300,400,500,600,700,800,900,1000,1100,10000};
  //double tanbeta[51]={0,10,20,30,40,50,60,70,80,90,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,550,600,650,700,750,800,850,900,950,1000,1100,1200,1300,1400,1500,2000,3000,4000,5000,6000};
  double tanbeta[51]={0,10,20,30,40,50,60,70,80,90,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,500,550,580,600,650,700,750,800,850,900,950,1000,1100,1200,1300,1400,1500,2000,3000,4000,5000,6000};
  Double_t bin_tb[50];
  for (unsigned int i=0; i<50; i++) {
    bin_tb[i]=0.005*(tanbeta[i]+tanbeta[i+1]);
    //cout << "bin_tb[" << i << "]=" << bin_tb[i] << " " << tanbeta[i+1]/100. << endl;
  }

  double mA[11]={200,225,250,275,300,325,350,400,500,600,700};
  Double_t bin_mA[10];
  for (unsigned int i=0; i<=10; ++i) {
    bin_mA[i]=0.5*(mA[i]+mA[i+1]);
    //cout << "bin_mA["<<i<<"]="  << bin_mA[i] << endl;
  }
  bin_mA[10]=650;
  
  TH2F* hggA=new TH2F("hggA","ggA cross section vs tan#beta,m_{A}; m_{A} GeV; tan#beta",9,bin_mA,49,bin_tb);
  hggA->Sumw2();
  //hggA->Draw();
  TString cut=what+scale+ok;
  cout << "CUT: " << cut << endl;
  ch->Project("hggA","tb:mA",cut);

  TStyle *tdrStyle = gROOT->GetStyle("tdrStyle");
  // Double_t level[15]={.01,.02,.05,.1,.2,.5,1.,2.,5.,10.,20.,50.,100.,200.,500.};
  // hggA->SetContour(14,level);
  // hggA->SetMinimum(level[0]);
  //
  //Double_t level[10]={1.,5.,10.,20.,50.,100.,200.,500.,800.,1000.}; // for x-section
  //Double_t level[10]={100,105,110.,115.,120.,123,125.7,127,130.,135.}; // for mh
  Double_t level[10]={1,2,3.,4.,120.,123,125.7,127,130.,135.}; // for mh
  //Double_t level[10]={.01,.1,.2,0.5,0.6,0.65,0.7,0.75,0.8,0.9}; // for BR
  //Double_t level[10]={.01,.02,.05,.07,.1,.15,0.2,0.5,0.75,1.}; // for BR
  hggA->SetContour(9,level);
  hggA->SetMinimum(level[0]);
  
  Double_t level[7]={122.7.,123.7,125.4,126.0,127.7,128.7.,150}; // for mh
  hggA->SetContour(6,level);
  hggA->SetMinimum(90);
  Int_t colors[7] = {kWhite,kGreen,kGreen+2,kBlack,kGreen+2,kGreen,kWhite};
  tdrStyle->SetPalette((sizeof(colors)/sizeof(Int_t)), colors);

// DRAW
  tdrStyle->SetOptStat(0);
  // tdrStyle->SetPadGridX(true);
  // tdrStyle->SetPadGridY(true);
  // tdrStyle->SetPadTopMargin(0.05);
  // tdrStyle->SetPadBottomMargin(0.13);
  tdrStyle->SetTitleYOffset(1.3);
  tdrStyle->SetTitleXOffset(1.6);
  tdrStyle->SetTitleOffset(1.3,"Z");
  // tdrStyle->SetOptLogz(1);
  // tdrStyle->SetOptLogy(1);
  tdrStyle->SetPadRightMargin(0.14);
  //tdrStyle->SetPalette(1);


  tdrStyle->cd();
  gROOT->ForceStyle();

  cout << "Creating canvas " << cname << endl;
  TCanvas* c1=new TCanvas(cname,goodName,1200,600);
  cout << " done " << c1->GetName() << endl;
  c1->Divide(2);

  c1->cd(1);
  hggA->DrawCopy("lego2");
  gPad->SetLogz();
  gPad->SetLogy();
  //gPad->SetPhi(120);
  gPad->SetPhi(-150);
  //gPad->SetTheta(30);
  gPad->UseCurrentStyle();
  gPad->Update();

  TLatex tl;
  tl.SetTextSize(0.04);
  tl.SetNDC();
  tl.DrawLatex(0.1,0.95,goodName);
  tl.SetTextAlign(11);
  tl.DrawLatex(0.1,0.89,goodType);

  c1->cd(2);
 // tdrStyle->SetPadLeftMargin(0.25);

  gPad->UseCurrentStyle();
  gPad->Update();
  hggA->GetXaxis()->SetTitleOffset(1.1);
  hggA->GetYaxis()->SetTitleOffset(1.1);
  hggA->GetZaxis()->SetTitleOffset(100);
  //hggA->Smooth();
  gPad->SetLogy(kFALSE);
  hggA->DrawCopy("zcont1");
  tl.DrawLatex(0.15,0.97,goodName);
  tl.SetTextAlign(11);
  tl.DrawLatex(0.2,0.9,goodType);

  TCanvas* ctmp=new TCanvas(cname,goodName,600,600);
  hggA->GetYaxis()->SetRangeUser(0.1,10.);
  hggA->DrawCopy("zcont1");
  tl.DrawLatex(0.83,0.97,goodName);
  tl.SetTextAlign(11);
  tl.DrawLatex(0.2,0.9,goodType);
  pCan(ctmp,cname+"_Lin");

  // TH1F* test=new TH1F("test","ggA cross section vs tan#beta; tan#beta",27,bin_tb);
  // ch->Project("test","tb",what);
  // test->Draw();


  TCanvas* c2=new TCanvas(cname+"Obs",goodName,800,800);
  gPad->UseCurrentStyle();
  gPad->Update();
  hggA->GetXaxis()->SetTitleOffset(1.1);
  hggA->GetYaxis()->SetTitleOffset(1.1);
  hggA->DrawCopy("cont list");
  gPad->Update();

  //return;
  // Get Contours
   TObjArray *conts = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
   TList* contLevel = NULL;
   TGraph* curv     = NULL;
   TGraph* gc       = NULL;

   Int_t nGraphs    = 0;
   Int_t TotalConts = 0;

   if (conts == NULL){
      printf("*** No Contours Were Extracted!\n");
      TotalConts = 0;
      return;
   } else {
      TotalConts = conts->GetSize();
   }

   printf("TotalConts = %d\n", TotalConts);

   for(i = 0; i < TotalConts; i++){
      contLevel = (TList*)conts->At(i);
      printf("Contour %d has %d Graphs\n", i, contLevel->GetSize());
      nGraphs += contLevel->GetSize();
   }

   nGraphs = 0;

   TH2F *hr = new TH2F("hr", ";m_{A};tan#beta", 2, 225, 600, 2, 0.1, 100);

   hr->GetXaxis()->SetTitleOffset(1.1);
   hr->GetXaxis()->SetRangeUser(200,650);
   hr->GetYaxis()->SetTitleOffset(1.2);
   hr->GetYaxis()->SetNdivisions(110,kFALSE);
   hr->GetXaxis()->SetNdivisions(20205,kFALSE);
   hr->Draw();
   Double_t x0, y0, z0;
   TLatex l;
   l.SetTextSize(0.03);
   l.SetTextAlign(32);
   char val[20];

   for(i = 0; i < TotalConts; i++){
      contLevel = (TList*)conts->At(i);
      z0 = level[i];
      printf("Z-Level Passed in as:  Z = %f\n", z0);

      // Get first graph from list on curves on this level
      curv = (TGraph*)contLevel->First();
      for(j = 0; j < contLevel->GetSize(); j++){
        // last point
         //curv->GetPoint(curv->GetN()-1, x0, y0);
        // first point
         curv->GetPoint(2, x0, y0);

         // if (z0<0) curv->SetLineColor(kRed);
         // if (z0>0) curv->SetLineColor(kBlue);
         nGraphs ++;
         printf("\tGraph: %d  -- %d Elements\n", nGraphs,curv->GetN());

	 // Draw clones of the graphs to avoid deletions in case the 1st
	 // pad is redrawn.
         gc = (TGraph*)curv->Clone();
         gc->Draw("C");

         if (z0>=.01) sprintf(val,"%0.2f",z0);
         if (z0>=.1) sprintf(val,"%0.2f",z0);
         if (z0>=1) sprintf(val,"%0.0f",z0);
         l.DrawLatex(x0*0.99,y0,val);
         curv = (TGraph*)contLevel->After(curv); // Get Next graph
      }
   }
   gPad->SetLogy();
   gPad->SetGridx();
   gPad->SetGridy();
   gPad->SetRightMargin(0.05);
   gPad->SetTopMargin(0.10);
   c2->Update();
   printf("\n\n\tExtracted %d Contours and %d Graphs \n", TotalConts, nGraphs );



  tl.SetTextAlign(31);
  tl.DrawLatex(0.8,0.85,goodName);

  tl.SetTextAlign(31);
  tl.DrawLatex(0.8,0.77,goodType);


  pCan(c2,cname+"_BW");

   c1->cd(1);
   gPad->SetLogy();
   gPad->SetLogz();
   c1->cd(2);
   gPad->SetLogy();
   c1->Update();
  pCan(c1,cname);
}
Пример #5
0
int main (int argc, char* argv[] )
{
	cout << endl << "Really, REALLY stupid plotter for producing comparative plots between Edinburgh fit outputs." << endl;
	cout << endl << "USAGE: merge_plot Output_1.root Output_2.root \"Title 1\" \"Title 2\" " << endl;
	gStyle->SetCanvasColor(0);
	gStyle->SetFillColor(0);
	gROOT->SetStyle("Plain");
	if( argc != 5) exit(-1);
	TCanvas* c3 = new TCanvas("throw2","throw");
	TFile* input_1 = new TFile( argv[1], "READ" );
	gDirectory->ls();
	TH2D* hist_1 = (TH2D*)gDirectory->Get("pllhist");//"Graph2D");//pllhist");//Graph2D_from_nllhist");
	TGraph2D* graph_1 = (TGraph2D*)gDirectory->Get("pllhist");//"Graph2D");//pllhist");//Graph2D_from_nllhist");
	graph_1->Draw();
	c3->Update();
	TFile* input_2 = new TFile( argv[2], "READ" );
	gDirectory->ls();
	TH2D* hist_2 = (TH2D*)gDirectory->Get("pllhist");//"fcnew");//pllhist");//lr_data");
	TGraph2D* graph_2 = (TGraph2D*)gDirectory->Get("pllhist");//"fcnew");//pllhist");//lr_data");
	graph_2->Draw();
	hist_2->Draw();
	c3->Update();

	TString Plot_Title_1( argv[3] );
	TString Plot_Title_2( argv[4] );

	TCanvas* c1 = new TCanvas("Output_Plot","Output_Plot",1680,1050);
	double pllconts[3] = {1.15,2.305,3.0};//,4.61};
	//double pll2[3] = {2.3,4.61,6};//,9.62};
	//double pll2[3] = {0.68,0.9,0.95};
	double confs[3] = {68.0,90.0,95.0};//,99.0};
	TList* contLevel = NULL;
	TGraph* curv     = NULL;
	TGraph* gc    = NULL;
	//gStyle->SetCanvasColor(0);
	//gStyle->SetPalette(1);
	//gROOT->SetStyle("Plain");
	//gROOT->ForceStyle();
//	gStyle->SetFrameBorderMode(0);
//	gStyle->SetCanvasBorderMode(0);
//	gStyle->SetPadBorderMode(0);
//	gStyle->SetPadColor(0);
//	gStyle->SetCanvasColor(0);
//	gStyle->SetStatColor(0);
//	gStyle->SetTitleFillColor(0);
//	gStyle->SetFillColor(0);
//	gStyle->SetFrameFillColor(0);
	//gStyle->SetFillStyle(0);
	//gROOT->ForceStyle();

	hist_1->SetContour(3,pllconts);
	hist_1->SetLineWidth(1);
	c1->cd();
	hist_1->Draw("cont2");
//	hist_1->GetXaxis()->SetRangeUser(-3.1,2);
	hist_1->SetContour(3,pllconts);
//	c1->cd();
	hist_1->Draw("cont2");
	//	StyleTH2D(hist_2);
//	c3->cd();
	hist_2->Draw();
//	hist_2->GetXaxis()->SetRangeUser(-3.1,2);
//	hist_2->Draw();
	hist_1->Draw("cont2");
//	hist_2->Draw("SAME");//cont2");
	hist_2->SetContour(3,pllconts);//pll2);//pllconts);//pll2);
	hist_2->SetLineColor(2);
	hist_2->SetLineWidth(1);
//	c3->cd();
	c1->Update();
//	hist_2->Draw("SAMEcont2");
//	hist_2->GetXaxis()->SetRangeUser(-3.1,1);
//	hist_2->SetContour(3,pll2);//pllconts);//pll2);
//	c1->cd();
//	hist_2->Draw("SAMEcont2");
//	c1->Update();

	TCanvas* c2 = new TCanvas( "Throw","Throw" );
	hist_1->Draw("CONT LIST");
	c2->Update();

	//addLHCbLabel("NLL Scan")->Draw();
	TObjArray *contObjArr = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
	int TotalConts = contObjArr->GetSize();
	c1->cd();
	TLegend *leg = new TLegend(0.65,0.7,1.1,0.9);
	leg->SetHeader( Plot_Title_1 );
	leg->SetBorderSize(0);
	leg->SetFillStyle(0);
	for(int i = 0; i < TotalConts; i++){
		TString confname = "";
		double cl = confs[i];
		confname +=cl;
		confname += "% C.L.";
		contLevel = (TList*)contObjArr->At(i);
		for(int j =0; j<contLevel->GetSize(); j++){
			curv = (TGraph*)contLevel->At(j);
			gc = (TGraph*)curv->Clone();
			if( i!=3 ) gc->SetLineColor(Color_t(i+2));
			else gc->SetLineColor(Color_t(i+3));
			gc->Draw("L");
		}
		leg->AddEntry(gc,confname, "L");
	}
	c1->cd();
	TLegend *leg2 = new TLegend(0.13,0.7,0.5,0.9);
	leg2->SetHeader( Plot_Title_2 );
	leg2->SetBorderSize(0);
	leg2->SetFillStyle(0);

	c2->cd();
	hist_2->Draw("CONT LIST");
	c2->Update();
	contObjArr = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
	TotalConts = contObjArr->GetSize();
	for(int i = 0; i < TotalConts; i++){
		TString confname = "";
		double cl = confs[i];
		confname +=cl;
		confname += "% C.L.";
		contLevel = (TList*)contObjArr->At(i);
		for(int j =0; j<contLevel->GetSize(); j++){
			curv = (TGraph*)contLevel->At(j);
			gc = (TGraph*)curv->Clone();
			if( i!=3 ) gc->SetLineColor(Color_t(i+2));
			else gc->SetLineColor(Color_t(i+3));
			gc->SetLineStyle(Style_t(i+2));
			c1->cd();
			gc->Draw("L");
			c2->cd();
		}
		leg2->AddEntry(gc,confname, "L");

	}
//	c1->cd();

//	Double_t X_min_1 = strtod( argv[3], NULL );
//	Double_t Y_min_1 = strtod( argv[4], NULL );
//	Double_t X_min_2 = strtod( argv[5], NULL );
//	Double_t Y_min_2 = strtod( argv[6], NULL );

//	c1->cd();
//	TMarker* new_mark = new TMarker( X_min_1, Y_min_1, 20 );
//	new_mark->SetMarkerSize(1);
//	new_mark->SetMarkerColor(8);
	//new_mark->Draw("SAME");
//	TMarker* new_mark2 = new TMarker( X_min_2, Y_min_2, 20 );
//	new_mark2->SetMarkerSize(1);
//	new_mark2->SetMarkerColor(9);
	//new_mark2->Draw("SAME");
//	c1->Update();

	c1->cd();
	leg->Draw();
	leg2->Draw();
	addLHCbLabel("NLL Contours")->Draw();
	c1->Update();
	c1->Print("Output.png");
	c1->Print("Output.pdf");

	input_1->Close();
	input_2->Close();
	return 0;
}
Пример #6
0
////////////Main Code - You must add more lines if you want to run in WIS
///Modified RMS and Mean Code
////
////by Alexis Kalogeropoulos
void monplots(TString runno, TString filename, TString module)
{

	Double_t maxenerms = 1.5;
	Double_t maxpedrms = 0.8;

	TString defdir = "rfio:/castor/cern.ch/user/t/tilebeam/commissioning/";
	TString deffile = "tiletb_"+TString(runno)+TString("_MonoCis.0.root");

	if(filename == ""){
		filename = defdir+deffile;
	}

	TFile *f = TFile::Open(filename);
	TTree *t = (TTree*)f->Get("TileRec/h1000");

	Float_t efit[48], pedfit[48];
	Int_t cispar[16];

	TString vare = "Efit"+module;
	TString varp = "Pedfit"+module;
	TString varc = "Cispar";
	t->SetBranchAddress(vare, &efit);
	t->SetBranchAddress(varp, &pedfit);
	t->SetBranchAddress(varc, &cispar);

	Int_t nevt = t->GetEntries();
	Int_t i, j, k;

	t->GetEntry(i);
	Double_t charge = 2*4.096*cispar[6]*cispar[7]/1023;
	Double_t uphist = charge +20.0;
	Double_t minmean = charge - 10.0;

	TH1F *hene[48], *hped[48];
	TString nene, tene, nped, tped;

	for(j=0;j<48;j++){
		nene = "ene";
		nene += j;
		tene = "Energy ";
		tene += j;
		hene[j]=new TH1F(nene, tene, 100, 0, uphist);

		nped = "ped";
		nped += j;
		tped = "Pedestal ";
		tped += j;
		hped[j]=new TH1F(nped, tped, 100, 0, 100);
	}


	Double_t sumene[48]={0}, sqsumene[48]={0}, sumped[48]={0}, sqsumped[48]={0};
	Double_t chan[48]={0}, meanene[48]={0}, rmsene[48]={0}, meanped[48]={0}, rmsped[48]={0};
	vector<Int_t> bad;
	for(Int_t i=0;i<nevt;i++){
		t->GetEntry(i);

		for(j=0;j<48;j++){

			sumene[j] += efit[j];
			sqsumene[j] += efit[j]**2;
			sumped[j] += pedfit[j];
			sqsumped[j] += pedfit[j]**2;

		}
	}

	cout<<minmean<<"\t\t"<<maxenerms<<"\t\t"<<maxpedrms<<endl;

	for(j=0;j<48;j++){
		chan[j]=j;
		if(j !=31 && j!=32 && j!=43){   


			meanene[j]=(Double_t) sumene[j]/nevt; 
			rmsene[j]= sqrt((Double_t) sqsumene[j]/nevt-meanene[j]**2);

			meanped[j]=(Double_t) sumped[j]/nevt;
			rmsped[j]= sqrt((Double_t) sqsumped[j]/nevt-meanped[j]**2);
			cout<<j<<"\t\t"<<meanene[j]<<"\t\t"<<rmsene[j]<<"\t\t"<<rmsped[j]<<"\t\t"<<meanped[j]<<"  "<<endl;

			///Please, do not modify the next 2 lines you ll get crazy plots!!!
			////////////////////////////////////////////////////////////////
			if ((minmean > meanene[j]) || ( rmsene[j] > maxenerms) || ( rmsped[j] > maxpedrms))
				bad.push_back(j);


			/////////Lines below must change in order this code to work in the WIS interface
			////////Refer to monocis.cpp for more info/////////////
			/////// End of modifications///////////////////////////

			TLine *lmean = new TLine(0, minmean, 50, minmean);
			lmean->SetLineColor(2);
			TLine *lenerms = new TLine(0, maxenerms, 50, maxenerms);
			lenerms->SetLineColor(2);
			TLine *lpedrms = new TLine(0, maxpedrms, 50, maxpedrms);
			lpedrms->SetLineColor(2);

			TGraph *genemean = new TGraph(48, chan, meanene);
			genemean->SetMarkerStyle(21);
			genemean->SetTitle("Mean Energy");
			genemean->GetXaxis()->SetTitle("Channel");
			TGraph *generms = new TGraph(48, chan, rmsene);
			generms->SetMarkerStyle(21);
			generms->SetTitle("RMS Energy");
			generms->GetXaxis()->SetTitle("Channel");
			TGraph *gpedmean = new TGraph(48, chan, meanped);
			gpedmean->SetMarkerStyle(21);
			gpedmean->SetTitle("Mean Pedestal");
			gpedmean->GetXaxis()->SetTitle("Channel");
			TGraph *gpedrms = new TGraph(48, chan, rmsped);
			gpedrms->SetMarkerStyle(21);
			gpedrms->SetTitle("RMS Pedestal");
			gpedrms->GetXaxis()->SetTitle("Channel");
		}
	}	
	TCanvas *c1 = new TCanvas("c1", "MonoCis", 700, 500);
	c1->Divide(2,2);
	c1->cd(1);
	genemean->Draw("AP");
	lmean->Draw();
	c1->cd(2);
	generms->Draw("AP");
	lenerms->Draw();
	c1->cd(3);
	gpedmean->Draw("AP");
	c1->cd(4);
	gpedrms->Draw("AP");
	lpedrms->Draw();

	cout.precision(3);
	cout<<"Number of bad channels is "<<bad.size()<<endl;

	if(bad.size() > 0)
		cout<<"Channel"<<'\t'<<"Mean energy"<<'\t'<<"RMS energy"<<'\t'<<"RMS pedestal"<<'\t'<<"Mean pedestal "<<endl;

	for(i=0;i<bad.size();i++){
		Int_t ch = bad.at(i);
		cout<<ch<<"\t"<<meanene[i]<<"\t\t"<<rmsene[i]<<"\t\t"<<rmsped[i]<<"\t\t"<<meanped[i]<<endl;
	}

	TString filenameps = "r"+runno+"_"+module+"_MonoCis.ps";
	TString filenamepng = "r"+runno+"_"+module+"_MonoCis.png";
	c1->Print(filenameps);
	c1->Print(filenamepng);

}
void laserCalibration(
		char* filename = "frascatirun", //input file
		int filenum = 1081, 					//file number
		int channel = 3, 						//trace channel
		int flagChannel = 5, 					//laser flag channel
		Double_t entriesN = 10,					//number of entries for prcessing
		int sleep = 10,							//sleep time between 2 processed entries, helpful for viewing traces
		bool gui = true							//enable or disable trace visualization
		)
{
	caen_5742 caen;
	Int_t nbins = 1024;
	Double_t entries = entriesN;
	Int_t bin;

	TCanvas *c1 = new TCanvas("c1","frascatirun",900,700);
	c1->Divide(1,2);
	c1->cd(1);

	TGraph* g = new TGraph();
	TH1F* lmPeaks = new TH1F("lm","Peaks Ratio", 1000, 0, 5000);
    TH1F* d = new TH1F("d","",nbins,0,nbins);
    TH1F* back = new TH1F("Back","",nbins,0,nbins);

    // input file
    char fname[100]=0;
    sprintf(fname,"%s_0%i.root",filename,filenum);

    TFile* infile = new TFile(fname);
	TTree *t = (TTree*) infile->Get("t");
	t->SetBranchAddress("caen_5742", &caen.system_clock);
	t->Print();

	if(entriesN<=0)
		entries = t->GetEntries();

	//out file
    char foutname[100]=0;
    int lm=0;
    if (channel ==3)lm=1;
    if (channel ==4)lm=2;
    sprintf(foutname,"./calibration/LM%i_out_0%i.root",lm,filenum);
	outfile = new TFile(foutname,"RECREATE");
	outTree = new TTree("LM","frascatirun output");
	calibTree = new TTree("LM_cal","frascatirun output");
	outTree->Branch("LM_PX1",&fPositionX1,"PX1/D");
	outTree->Branch("LM_PX2",&fPositionX2,"PX2/D");
	outTree->Branch("LM_PY1",&fPositionY1,"PY1/D");
	outTree->Branch("LM_PY2",&fPositionY2,"PY2/D");
	//outTree->Branch("baseline",baseline,"baseline[1024]/F");
	outTree->Branch("time",&timeline,"time/D");
	outTree->Branch("LM_P2_Integral",&integralP2,"IP2/D");
	calibTree->Branch("LM_P2_Integral_mean",&integralP2_mean,"IP2_mean/D");
	calibTree->Branch("LM_P2_Integral_mean_error",&integralP2_mean_error,"IP2_mean_error/D");
	calibTree->Branch("LM_P2_Integral_sigma",&integralP2_sigma,"IP2_sigma/D");
	calibTree->Branch("LM_P2_Integral_sigma_error",&integralP2_sigma_error,"IP2_sigma_error/D");

    /**************************************
     * read entries
     **************************************
    */
	for (int j = 0; j < entries; ++j){
		gSystem->Sleep (sleep);

		t->GetEntry(j);

		//TRIGGER SELECTION
		if(caen.trace[flagChannel][400]>1000 && caen.trace[flagChannel][800]<3000){
			timeline = caen.system_clock;

			/**************************************
		     * Peaks estimation
		     **************************************
		    */
			for (int i = 0; i < nbins; ++i){
				g->SetPoint(i, i, caen.trace[channel][i]);
			}

			Double_t y_max = TMath::MaxElement(g->GetN(),g->GetY());
			Float_t * source = new Float_t[nbins];
			Float_t * dest = new Float_t[nbins];

			for (int i = 0; i < nbins; ++i){
				source[i]=y_max-caen.trace[channel][i];
				g->SetPoint(i, i, source[i]);
			}

			//Use TSpectrum to find the peak candidates
			TSpectrum *s = new TSpectrum();
		   	Int_t nfound = s->SearchHighRes(source, dest, nbins, 3, 2, kTRUE, 2, kFALSE, 5);

		    /**************************************
		     * Background estimation
		     **************************************
		    */
		    Int_t  	ssize = nbins;
		    Int_t  	numberIterations = 20;
		    Int_t  	direction = s->kBackIncreasingWindow;
		    Int_t  	filterOrder = s->kBackOrder2;
		    bool  	smoothing = kFALSE;
		    Int_t  	smoothWindow = s->kBackSmoothing3;
		    bool  	compton = kFALSE;
		    for (int i = 0; i < nbins; ++i) baseline[i] = source[i];
		    s->Background(baseline, ssize, numberIterations, direction, filterOrder, smoothing, smoothWindow, compton);

		    /**************************************
		     * Peaks and integral estimation
		     **************************************
		    */
		    Double_t px[2], py[2];
		    for (int i = 0; i < nbins; ++i) dest[i] = source[i]-baseline[i];
		    if(nfound==2){
			   bin = s->GetPositionX()[0];
			   fPositionX1 = bin;
			   fPositionY1 = dest[bin];
			   px[0] = bin;
			   py[0] = dest[bin];
			   bin = s->GetPositionX()[1];
			   fPositionX2 = bin;
			   fPositionY2 = dest[bin];
			   px[1] = bin;
			   py[1] = dest[bin];
		    }
			int posxa=6;
		    int posxb=9;
		    switch (filenum){
		    	case 1081:
		    		posxa=6;
		    		posxb=9;
		    		break;

		    	case 1082:
		    		posxa=5;
		    		posxb=7;
		    		break;

		    	case 1083:
		    		posxa=5;
		    		posxb=8;
		    		break;

		    	case 1084:
		    		posxa=5;
		    		posxb=7;
		    		break;

		    	case 1085:
		    		posxa=5;
		    		posxb=7;
		    		break;

		    	case 1086:
		    		posxa=5;
		    		posxb=5;
		    		break;

		    	case 1087:
		    		posxa=4;
		    		posxb=4;
		    		break;

		    	case 1088:
		    		posxa=3;
		    		posxb=4;
		    		break;

		    	case 1089:
		    		posxa=3;
		    		posxb=3;
		    		break;

		    	default:
		    		posxa=6;
		    		posxb=9;
}

		    integralP2 = g->Integral (fPositionX2-posxa,fPositionX2+posxb);

		    /**************************************
		     * print and update the canvas
		     **************************************
		    */
		    if(gui==true){
				TH1F* gh = g->GetHistogram();
				gh->FillN(nbins,g->GetX(),g->GetY());
				g->Draw();

				TPolyMarker* pm = (TPolyMarker*)gh->GetListOfFunctions()->FindObject("TPolyMarker");
				if (pm) {
				   gh->GetListOfFunctions()->Remove(pm);
				   delete pm;
				}
				pm = new TPolyMarker(nfound, px, py);

				gh->GetListOfFunctions()->Add(pm);
				pm->SetMarkerStyle(23);
				pm->SetMarkerColor(kBlue);
				pm->SetMarkerSize(1.3);
				for (i = 0; i < nbins; i++) d->SetBinContent(i,dest[i]);
				d->SetLineColor(kRed);
				d->Draw("SAME");

				for (i = 0; i < nbins; i++) back->SetBinContent(i,baseline[i]);
			    back->SetLineColor(kGreen);
			    back->Draw("SAME");
				c1->Update();
		    }

		    /**************************************
		     * Fill tree and peaks data Histogram
		     **************************************
		    */
			if(nfound==2)
			{
				lmPeaks->Fill(integralP2);
				outTree->Fill();
			}
	        //printf("time= %d, posx1= %d, posy1= %d\n",time, fPositionX1, fPositionY1);
			//printf("time= %d, posx2= %d, posy2= %d\n",time, fPositionX2, fPositionY2);
			//for (int i=0;i<nbins;i++) printf("time = %d\n",baseline[i]);
		}
	}

	/**************************************
     * switch to the bottom pan and Draw Histogram
     **************************************
    */
	c1->cd(2);
	//lmPeaks->SetAxisRange(TMath::MinElement(entries,binmin),TMath::MaxElement(entries,binmax)+100);
	//lmPeaks->SetAxisRange(0,3000);
	lmPeaks->Fit("gaus");
	integralP2_mean = lmPeaks->GetFunction("gaus")->GetParameter(1);
	integralP2_sigma = lmPeaks->GetFunction("gaus")->GetParameter(2);
	integralP2_mean_error = lmPeaks->GetFunction("gaus")->GetParError(1);
	integralP2_sigma_error = lmPeaks->GetFunction("gaus")->GetParError(2);
	//printf("mean = %f\n",integralP2_mean);
	//printf("sigma = %f\n",integralP2_sigma);
	calibTree->Fill();
	lmPeaks->Draw();
	c1->Update();

	outfile->cd();
	gROOT->GetList()->Write();
	outTree->Write();
	calibTree->Write();
	outfile->Close();
}
Пример #8
0
void fitWMLL3testbkg()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Sat May  7 17:06:48 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(230.8642,-26.4,724.6914,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_41aab90__1 = new TH1D("frame_41aab90__1","",100,300,700);
   frame_41aab90__1->SetBinContent(1,3.66042);
   frame_41aab90__1->SetMinimum(-8.8);
   frame_41aab90__1->SetMaximum(8.8);
   frame_41aab90__1->SetEntries(1);
   frame_41aab90__1->SetDirectory(0);
   frame_41aab90__1->SetStats(0);
   frame_41aab90__1->SetLineWidth(2);
   frame_41aab90__1->SetMarkerStyle(20);
   frame_41aab90__1->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_41aab90__1->GetXaxis()->SetNdivisions(505);
   frame_41aab90__1->GetXaxis()->SetLabelFont(132);
   frame_41aab90__1->GetXaxis()->SetLabelOffset(0.01);
   frame_41aab90__1->GetXaxis()->SetLabelSize(0.15);
   frame_41aab90__1->GetXaxis()->SetTitleSize(0.2);
   frame_41aab90__1->GetXaxis()->SetTitleOffset(1.1);
   frame_41aab90__1->GetXaxis()->SetTitleFont(132);
   frame_41aab90__1->GetYaxis()->SetTitle("Pull");
   frame_41aab90__1->GetYaxis()->CenterTitle(true);
   frame_41aab90__1->GetYaxis()->SetNdivisions(505);
   frame_41aab90__1->GetYaxis()->SetLabelFont(132);
   frame_41aab90__1->GetYaxis()->SetLabelOffset(0.01);
   frame_41aab90__1->GetYaxis()->SetLabelSize(0.15);
   frame_41aab90__1->GetYaxis()->SetTitleSize(0.15);
   frame_41aab90__1->GetYaxis()->SetTitleOffset(0.45);
   frame_41aab90__1->GetYaxis()->SetTitleFont(132);
   frame_41aab90__1->GetZaxis()->SetLabelFont(132);
   frame_41aab90__1->GetZaxis()->SetLabelSize(0.06);
   frame_41aab90__1->GetZaxis()->SetTitleSize(0.072);
   frame_41aab90__1->GetZaxis()->SetTitleOffset(1.2);
   frame_41aab90__1->GetZaxis()->SetTitleFont(132);
   frame_41aab90__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[35] = {
   322,
   326,
   330,
   334,
   338,
   342,
   346,
   350,
   354,
   358,
   362,
   366,
   370,
   374,
   378,
   382,
   386,
   390,
   394,
   398,
   402,
   406,
   410,
   414,
   418,
   422,
   426,
   430,
   434,
   438,
   442,
   446,
   450,
   454,
   458};
   Double_t pull_Hist_curvetot_fy3001[35] = {
   -4.216045,
   1.419055,
   1.630176,
   1.736171,
   1.401115,
   1.177832,
   0.6067655,
   0.3684632,
   -0.07689024,
   0.7649885,
   -0.8684489,
   -2.178691,
   -1.339307,
   -2.479915,
   -0.6142935,
   0.5270919,
   -0.1014516,
   -2.629158,
   0.2575233,
   -2.419091,
   0.2616838,
   1.094697,
   0.4024459,
   0.1552136,
   1.74456,
   0.3476207,
   -0.4683433,
   2.237731,
   0.864617,
   1.152684,
   -0.4685249,
   -1.907669,
   -2.145193,
   1.344497,
   -0.6773687};
   Double_t pull_Hist_curvetot_felx3001[35] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[35] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   Double_t pull_Hist_curvetot_fehx3001[35] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[35] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(35,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__R_WM and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__R_WM and Projection of totalPdf",100,308.4,471.6);
   Graph_pull_Hist_curvetot3001->SetMinimum(-6.061422);
   Graph_pull_Hist_curvetot3001->SetMaximum(4.083108);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_41aab90__2 = new TH1D("frame_41aab90__2","",100,300,700);
   frame_41aab90__2->SetBinContent(1,3.66042);
   frame_41aab90__2->SetMinimum(-8.8);
   frame_41aab90__2->SetMaximum(8.8);
   frame_41aab90__2->SetEntries(1);
   frame_41aab90__2->SetDirectory(0);
   frame_41aab90__2->SetStats(0);
   frame_41aab90__2->SetLineWidth(2);
   frame_41aab90__2->SetMarkerStyle(20);
   frame_41aab90__2->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_41aab90__2->GetXaxis()->SetNdivisions(505);
   frame_41aab90__2->GetXaxis()->SetLabelFont(132);
   frame_41aab90__2->GetXaxis()->SetLabelOffset(0.01);
   frame_41aab90__2->GetXaxis()->SetLabelSize(0.15);
   frame_41aab90__2->GetXaxis()->SetTitleSize(0.2);
   frame_41aab90__2->GetXaxis()->SetTitleOffset(1.1);
   frame_41aab90__2->GetXaxis()->SetTitleFont(132);
   frame_41aab90__2->GetYaxis()->SetTitle("Pull");
   frame_41aab90__2->GetYaxis()->CenterTitle(true);
   frame_41aab90__2->GetYaxis()->SetNdivisions(505);
   frame_41aab90__2->GetYaxis()->SetLabelFont(132);
   frame_41aab90__2->GetYaxis()->SetLabelOffset(0.01);
   frame_41aab90__2->GetYaxis()->SetLabelSize(0.15);
   frame_41aab90__2->GetYaxis()->SetTitleSize(0.15);
   frame_41aab90__2->GetYaxis()->SetTitleOffset(0.45);
   frame_41aab90__2->GetYaxis()->SetTitleFont(132);
   frame_41aab90__2->GetZaxis()->SetLabelFont(132);
   frame_41aab90__2->GetZaxis()->SetLabelSize(0.06);
   frame_41aab90__2->GetZaxis()->SetTitleSize(0.072);
   frame_41aab90__2->GetZaxis()->SetTitleOffset(1.2);
   frame_41aab90__2->GetZaxis()->SetTitleFont(132);
   frame_41aab90__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(230.8642,0,724.6914,299.2215);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4083450__3 = new TH1D("frame_4083450__3","A RooPlot of \"m(#pi p#rightarrow#pi)\"",100,300,700);
   frame_4083450__3->SetBinContent(1,281.2682);
   frame_4083450__3->SetMaximum(281.2682);
   frame_4083450__3->SetEntries(1);
   frame_4083450__3->SetDirectory(0);
   frame_4083450__3->SetStats(0);
   frame_4083450__3->SetLineWidth(2);
   frame_4083450__3->SetMarkerStyle(20);
   frame_4083450__3->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_4083450__3->GetXaxis()->SetNdivisions(505);
   frame_4083450__3->GetXaxis()->SetLabelFont(132);
   frame_4083450__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4083450__3->GetXaxis()->SetLabelSize(0.06);
   frame_4083450__3->GetXaxis()->SetTitleSize(0.072);
   frame_4083450__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4083450__3->GetXaxis()->SetTitleFont(132);
   frame_4083450__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4083450__3->GetYaxis()->SetLabelFont(132);
   frame_4083450__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4083450__3->GetYaxis()->SetLabelSize(0.06);
   frame_4083450__3->GetYaxis()->SetTitleSize(0.072);
   frame_4083450__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4083450__3->GetYaxis()->SetTitleFont(132);
   frame_4083450__3->GetZaxis()->SetLabelFont(132);
   frame_4083450__3->GetZaxis()->SetLabelSize(0.06);
   frame_4083450__3->GetZaxis()->SetTitleSize(0.072);
   frame_4083450__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4083450__3->GetZaxis()->SetTitleFont(132);
   frame_4083450__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   302,
   306,
   310,
   314,
   318,
   322,
   326,
   330,
   334,
   338,
   342,
   346,
   350,
   354,
   358,
   362,
   366,
   370,
   374,
   378,
   382,
   386,
   390,
   394,
   398,
   402,
   406,
   410,
   414,
   418,
   422,
   426,
   430,
   434,
   438,
   442,
   446,
   450,
   454,
   458,
   462,
   466,
   470,
   474,
   478,
   482,
   486,
   490,
   494,
   498,
   502,
   506,
   510,
   514,
   518,
   522,
   526,
   530,
   534,
   538,
   542,
   546,
   550,
   554,
   558,
   562,
   566,
   570,
   574,
   578,
   582,
   586,
   590,
   594,
   598,
   602,
   606,
   610,
   614,
   618,
   622,
   626,
   630,
   634,
   638,
   642,
   646,
   650,
   654,
   658,
   662,
   666,
   670,
   674,
   678,
   682,
   686,
   690,
   694,
   698};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   10,
   54,
   76,
   95,
   107,
   118,
   123,
   130,
   133,
   150,
   136,
   126,
   138,
   128,
   150,
   165,
   157,
   128,
   160,
   128,
   157,
   166,
   155,
   150,
   169,
   149,
   138,
   172,
   153,
   157,
   138,
   124,
   124,
   169,
   148,
   137,
   138,
   130,
   129,
   126,
   141,
   150,
   153,
   164,
   252,
   181,
   107,
   119,
   108,
   95,
   83,
   80,
   76,
   74,
   44,
   66,
   39,
   31,
   24,
   20,
   13,
   11,
   5,
   4,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   3.162278,
   7.348469,
   8.717798,
   9.746794,
   10.34408,
   10.86278,
   11.09054,
   11.40175,
   11.53256,
   12.24745,
   11.6619,
   11.22497,
   11.74734,
   11.31371,
   12.24745,
   12.84523,
   12.52996,
   11.31371,
   12.64911,
   11.31371,
   12.52996,
   12.8841,
   12.4499,
   12.24745,
   13,
   12.20656,
   11.74734,
   13.11488,
   12.36932,
   12.52996,
   11.74734,
   11.13553,
   11.13553,
   13,
   12.16553,
   11.7047,
   11.74734,
   11.40175,
   11.35782,
   11.22497,
   11.87434,
   12.24745,
   12.36932,
   12.80625,
   15.87451,
   13.45362,
   10.34408,
   10.90871,
   10.3923,
   9.746794,
   9.110434,
   8.944272,
   8.717798,
   8.602325,
   6.63325,
   8.124038,
   6.244998,
   5.567764,
   4.898979,
   4.472136,
   3.605551,
   3.316625,
   2.236068,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   3.162278,
   7.348469,
   8.717798,
   9.746794,
   10.34408,
   10.86278,
   11.09054,
   11.40175,
   11.53256,
   12.24745,
   11.6619,
   11.22497,
   11.74734,
   11.31371,
   12.24745,
   12.84523,
   12.52996,
   11.31371,
   12.64911,
   11.31371,
   12.52996,
   12.8841,
   12.4499,
   12.24745,
   13,
   12.20656,
   11.74734,
   13.11488,
   12.36932,
   12.52996,
   11.74734,
   11.13553,
   11.13553,
   13,
   12.16553,
   11.7047,
   11.74734,
   11.40175,
   11.35782,
   11.22497,
   11.87434,
   12.24745,
   12.36932,
   12.80625,
   15.87451,
   13.45362,
   10.34408,
   10.90871,
   10.3923,
   9.746794,
   9.110434,
   8.944272,
   8.717798,
   8.602325,
   6.63325,
   8.124038,
   6.244998,
   5.567764,
   4.898979,
   4.472136,
   3.605551,
   3.316625,
   2.236068,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__R_WM");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__R_WM",100,260,740);
   Graph_Hist3002->SetMinimum(0);
   Graph_Hist3002->SetMaximum(294.662);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   320,
   321.4,
   322.8,
   324.2,
   325.6,
   327,
   328.4,
   329.8,
   331.2,
   332.6,
   334,
   335.4,
   336.8,
   338.2,
   339.6,
   341,
   342.4,
   343.8,
   345.2,
   346.6,
   348,
   349.4,
   350.8,
   352.2,
   353.6,
   355,
   356.4,
   357.8,
   359.2,
   360.6,
   362,
   363.4,
   364.8,
   366.2,
   367.6,
   369,
   370.4,
   371.8,
   373.2,
   374.6,
   376,
   377.4,
   378.8,
   380.2,
   381.6,
   383,
   384.4,
   385.8,
   387.2,
   388.6,
   390,
   391.4,
   392.8,
   394.2,
   395.6,
   397,
   398.4,
   399.8,
   401.2,
   402.6,
   404,
   405.4,
   406.8,
   408.2,
   409.6,
   411,
   412.4,
   413.8,
   415.2,
   416.6,
   418,
   419.4,
   420.8,
   422.2,
   423.6,
   425,
   426.4,
   427.8,
   429.2,
   430.6,
   432,
   433.4,
   434.8,
   436.2,
   437.6,
   439,
   440.4,
   441.8,
   443.2,
   444.6,
   446,
   447.4,
   448.8,
   450.2,
   451.6,
   453,
   454.4,
   455.8,
   457.2,
   458.6,
   460,
   460};
   Double_t curvetot_fy1[102] = {
   12.45669,
   20.14825,
   27.5777,
   34.74921,
   41.66694,
   48.33508,
   54.75779,
   60.93926,
   66.88365,
   72.59514,
   78.0779,
   83.33611,
   88.37393,
   93.19555,
   97.80514,
   102.2069,
   106.4049,
   110.4034,
   114.2066,
   117.8187,
   121.2437,
   124.4859,
   127.5495,
   130.4386,
   133.1574,
   135.7101,
   138.1008,
   140.3338,
   142.4132,
   144.3431,
   146.1278,
   147.7714,
   149.2781,
   150.652,
   151.8974,
   153.0184,
   154.0192,
   154.904,
   155.6769,
   156.3421,
   156.9038,
   157.3662,
   157.7333,
   158.0095,
   158.1989,
   158.3056,
   158.3338,
   158.2878,
   158.1716,
   157.9895,
   157.7455,
   157.444,
   157.089,
   156.6848,
   156.2355,
   155.7453,
   155.2183,
   154.6588,
   154.0709,
   153.4588,
   152.8266,
   152.1786,
   151.5188,
   150.8516,
   150.181,
   149.5112,
   148.8464,
   148.1908,
   147.5485,
   146.9238,
   146.3207,
   145.7435,
   145.1964,
   144.6835,
   144.2089,
   143.777,
   143.3917,
   143.0574,
   142.7781,
   142.5582,
   142.4016,
   142.3126,
   142.2955,
   142.3542,
   142.4931,
   142.7163,
   143.028,
   143.4323,
   143.9335,
   144.5356,
   145.2429,
   146.0595,
   146.9897,
   148.0375,
   149.2073,
   150.503,
   151.929,
   153.4893,
   155.1882,
   157.0298,
   159.0183,
   159.0183};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,306,474);
   Graph_curvetot1->SetMinimum(0);
   Graph_curvetot1->SetMaximum(173.6745);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t bkg_fx2[102] = {
   320,
   321.4,
   322.8,
   324.2,
   325.6,
   327,
   328.4,
   329.8,
   331.2,
   332.6,
   334,
   335.4,
   336.8,
   338.2,
   339.6,
   341,
   342.4,
   343.8,
   345.2,
   346.6,
   348,
   349.4,
   350.8,
   352.2,
   353.6,
   355,
   356.4,
   357.8,
   359.2,
   360.6,
   362,
   363.4,
   364.8,
   366.2,
   367.6,
   369,
   370.4,
   371.8,
   373.2,
   374.6,
   376,
   377.4,
   378.8,
   380.2,
   381.6,
   383,
   384.4,
   385.8,
   387.2,
   388.6,
   390,
   391.4,
   392.8,
   394.2,
   395.6,
   397,
   398.4,
   399.8,
   401.2,
   402.6,
   404,
   405.4,
   406.8,
   408.2,
   409.6,
   411,
   412.4,
   413.8,
   415.2,
   416.6,
   418,
   419.4,
   420.8,
   422.2,
   423.6,
   425,
   426.4,
   427.8,
   429.2,
   430.6,
   432,
   433.4,
   434.8,
   436.2,
   437.6,
   439,
   440.4,
   441.8,
   443.2,
   444.6,
   446,
   447.4,
   448.8,
   450.2,
   451.6,
   453,
   454.4,
   455.8,
   457.2,
   458.6,
   460,
   460};
   Double_t bkg_fy2[102] = {
   12.45669,
   20.14825,
   27.5777,
   34.74921,
   41.66694,
   48.33508,
   54.75779,
   60.93926,
   66.88365,
   72.59514,
   78.0779,
   83.33611,
   88.37393,
   93.19555,
   97.80514,
   102.2069,
   106.4049,
   110.4034,
   114.2066,
   117.8187,
   121.2437,
   124.4859,
   127.5495,
   130.4386,
   133.1574,
   135.7101,
   138.1008,
   140.3338,
   142.4132,
   144.3431,
   146.1278,
   147.7714,
   149.2781,
   150.652,
   151.8974,
   153.0184,
   154.0192,
   154.904,
   155.6769,
   156.3421,
   156.9038,
   157.3662,
   157.7333,
   158.0095,
   158.1989,
   158.3056,
   158.3338,
   158.2878,
   158.1716,
   157.9895,
   157.7455,
   157.444,
   157.089,
   156.6848,
   156.2355,
   155.7453,
   155.2183,
   154.6588,
   154.0709,
   153.4588,
   152.8266,
   152.1786,
   151.5188,
   150.8516,
   150.181,
   149.5112,
   148.8464,
   148.1908,
   147.5485,
   146.9238,
   146.3207,
   145.7435,
   145.1964,
   144.6835,
   144.2089,
   143.777,
   143.3917,
   143.0574,
   142.7781,
   142.5582,
   142.4016,
   142.3126,
   142.2955,
   142.3542,
   142.4931,
   142.7163,
   143.028,
   143.4323,
   143.9335,
   144.5356,
   145.2429,
   146.0595,
   146.9897,
   148.0375,
   149.2073,
   150.503,
   151.929,
   153.4893,
   155.1882,
   157.0298,
   159.0183,
   159.0183};
   graph = new TGraph(102,bkg_fx2,bkg_fy2);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg2 = new TH1F("Graph_bkg2","Projection of totalPdf",102,306,474);
   Graph_bkg2->SetMinimum(0);
   Graph_bkg2->SetMaximum(173.6745);
   Graph_bkg2->SetDirectory(0);
   Graph_bkg2->SetStats(0);
   Graph_bkg2->SetLineWidth(2);
   Graph_bkg2->SetMarkerStyle(20);
   Graph_bkg2->GetXaxis()->SetNdivisions(505);
   Graph_bkg2->GetXaxis()->SetLabelFont(132);
   Graph_bkg2->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetXaxis()->SetTitleFont(132);
   Graph_bkg2->GetYaxis()->SetLabelFont(132);
   Graph_bkg2->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetYaxis()->SetTitleFont(132);
   Graph_bkg2->GetZaxis()->SetLabelFont(132);
   Graph_bkg2->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg2);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.75,0.02,1,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("bkg","Background","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4083450__4 = new TH1D("frame_4083450__4","A RooPlot of \"m(#pi p#rightarrow#pi)\"",100,300,700);
   frame_4083450__4->SetBinContent(1,281.2682);
   frame_4083450__4->SetMaximum(281.2682);
   frame_4083450__4->SetEntries(1);
   frame_4083450__4->SetDirectory(0);
   frame_4083450__4->SetStats(0);
   frame_4083450__4->SetLineWidth(2);
   frame_4083450__4->SetMarkerStyle(20);
   frame_4083450__4->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_4083450__4->GetXaxis()->SetNdivisions(505);
   frame_4083450__4->GetXaxis()->SetLabelFont(132);
   frame_4083450__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4083450__4->GetXaxis()->SetLabelSize(0.06);
   frame_4083450__4->GetXaxis()->SetTitleSize(0.072);
   frame_4083450__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4083450__4->GetXaxis()->SetTitleFont(132);
   frame_4083450__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4083450__4->GetYaxis()->SetLabelFont(132);
   frame_4083450__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4083450__4->GetYaxis()->SetLabelSize(0.06);
   frame_4083450__4->GetYaxis()->SetTitleSize(0.072);
   frame_4083450__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4083450__4->GetYaxis()->SetTitleFont(132);
   frame_4083450__4->GetZaxis()->SetLabelFont(132);
   frame_4083450__4->GetZaxis()->SetLabelSize(0.06);
   frame_4083450__4->GetZaxis()->SetTitleSize(0.072);
   frame_4083450__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4083450__4->GetZaxis()->SetTitleFont(132);
   frame_4083450__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Пример #9
0
void fit1()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Wed Mar  9 00:43:22 2016) by ROOT version6.06/00
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(3754.321,-26.4,6223.457,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_a63bf70__1 = new TH1D("frame_a63bf70__1","",100,4100,6100);
   frame_a63bf70__1->SetBinContent(1,269.9669);
   frame_a63bf70__1->SetMinimum(-8.8);
   frame_a63bf70__1->SetMaximum(8.8);
   frame_a63bf70__1->SetEntries(1);
   frame_a63bf70__1->SetDirectory(0);
   frame_a63bf70__1->SetStats(0);
   frame_a63bf70__1->SetLineWidth(2);
   frame_a63bf70__1->SetMarkerStyle(20);
   frame_a63bf70__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_a63bf70__1->GetXaxis()->SetNdivisions(505);
   frame_a63bf70__1->GetXaxis()->SetLabelFont(132);
   frame_a63bf70__1->GetXaxis()->SetLabelOffset(0.01);
   frame_a63bf70__1->GetXaxis()->SetLabelSize(0.15);
   frame_a63bf70__1->GetXaxis()->SetTitleSize(0.2);
   frame_a63bf70__1->GetXaxis()->SetTitleOffset(1.1);
   frame_a63bf70__1->GetXaxis()->SetTitleFont(132);
   frame_a63bf70__1->GetYaxis()->SetTitle("Pull");
   frame_a63bf70__1->GetYaxis()->CenterTitle(true);
   frame_a63bf70__1->GetYaxis()->SetNdivisions(505);
   frame_a63bf70__1->GetYaxis()->SetLabelFont(132);
   frame_a63bf70__1->GetYaxis()->SetLabelOffset(0.01);
   frame_a63bf70__1->GetYaxis()->SetLabelSize(0.15);
   frame_a63bf70__1->GetYaxis()->SetTitleSize(0.15);
   frame_a63bf70__1->GetYaxis()->SetTitleOffset(0.45);
   frame_a63bf70__1->GetYaxis()->SetTitleFont(132);
   frame_a63bf70__1->GetZaxis()->SetLabelFont(132);
   frame_a63bf70__1->GetZaxis()->SetLabelSize(0.06);
   frame_a63bf70__1->GetZaxis()->SetTitleSize(0.072);
   frame_a63bf70__1->GetZaxis()->SetTitleOffset(1.2);
   frame_a63bf70__1->GetZaxis()->SetTitleFont(132);
   frame_a63bf70__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[83] = {
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950};
   Double_t pull_Hist_curvetot_fy3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   256.1113,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_felx3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehx3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(83,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2)) and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2)) and Projection of totalPdf",100,4146,6114);
   Graph_pull_Hist_curvetot3001->SetMinimum(0);
   Graph_pull_Hist_curvetot3001->SetMaximum(282.8224);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_a63bf70__2 = new TH1D("frame_a63bf70__2","",100,4100,6100);
   frame_a63bf70__2->SetBinContent(1,269.9669);
   frame_a63bf70__2->SetMinimum(-8.8);
   frame_a63bf70__2->SetMaximum(8.8);
   frame_a63bf70__2->SetEntries(1);
   frame_a63bf70__2->SetDirectory(0);
   frame_a63bf70__2->SetStats(0);
   frame_a63bf70__2->SetLineWidth(2);
   frame_a63bf70__2->SetMarkerStyle(20);
   frame_a63bf70__2->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_a63bf70__2->GetXaxis()->SetNdivisions(505);
   frame_a63bf70__2->GetXaxis()->SetLabelFont(132);
   frame_a63bf70__2->GetXaxis()->SetLabelOffset(0.01);
   frame_a63bf70__2->GetXaxis()->SetLabelSize(0.15);
   frame_a63bf70__2->GetXaxis()->SetTitleSize(0.2);
   frame_a63bf70__2->GetXaxis()->SetTitleOffset(1.1);
   frame_a63bf70__2->GetXaxis()->SetTitleFont(132);
   frame_a63bf70__2->GetYaxis()->SetTitle("Pull");
   frame_a63bf70__2->GetYaxis()->CenterTitle(true);
   frame_a63bf70__2->GetYaxis()->SetNdivisions(505);
   frame_a63bf70__2->GetYaxis()->SetLabelFont(132);
   frame_a63bf70__2->GetYaxis()->SetLabelOffset(0.01);
   frame_a63bf70__2->GetYaxis()->SetLabelSize(0.15);
   frame_a63bf70__2->GetYaxis()->SetTitleSize(0.15);
   frame_a63bf70__2->GetYaxis()->SetTitleOffset(0.45);
   frame_a63bf70__2->GetYaxis()->SetTitleFont(132);
   frame_a63bf70__2->GetZaxis()->SetLabelFont(132);
   frame_a63bf70__2->GetZaxis()->SetLabelSize(0.06);
   frame_a63bf70__2->GetZaxis()->SetTitleSize(0.072);
   frame_a63bf70__2->GetZaxis()->SetTitleOffset(1.2);
   frame_a63bf70__2->GetZaxis()->SetTitleFont(132);
   frame_a63bf70__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(3754.321,0,6223.457,3.935074);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetLogy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4618880__3 = new TH1D("frame_4618880__3","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4618880__3->SetBinContent(1,69141.57);
   frame_4618880__3->SetMinimum(1);
   frame_4618880__3->SetMaximum(5000);
   frame_4618880__3->SetEntries(1);
   frame_4618880__3->SetDirectory(0);
   frame_4618880__3->SetStats(0);
   frame_4618880__3->SetLineWidth(2);
   frame_4618880__3->SetMarkerStyle(20);
   frame_4618880__3->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4618880__3->GetXaxis()->SetNdivisions(505);
   frame_4618880__3->GetXaxis()->SetLabelFont(132);
   frame_4618880__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4618880__3->GetXaxis()->SetLabelSize(0.06);
   frame_4618880__3->GetXaxis()->SetTitleSize(0.072);
   frame_4618880__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4618880__3->GetXaxis()->SetTitleFont(132);
   frame_4618880__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4618880__3->GetYaxis()->SetLabelFont(132);
   frame_4618880__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4618880__3->GetYaxis()->SetLabelSize(0.06);
   frame_4618880__3->GetYaxis()->SetTitleSize(0.072);
   frame_4618880__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4618880__3->GetYaxis()->SetTitleFont(132);
   frame_4618880__3->GetZaxis()->SetLabelFont(132);
   frame_4618880__3->GetZaxis()->SetLabelSize(0.06);
   frame_4618880__3->GetZaxis()->SetTitleSize(0.072);
   frame_4618880__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4618880__3->GetZaxis()->SetTitleFont(132);
   frame_4618880__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   4110,
   4130,
   4150,
   4170,
   4190,
   4210,
   4230,
   4250,
   4270,
   4290,
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030,
   6050,
   6070,
   6090};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   65593,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   256.1113,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   256.1113,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2))");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2))",100,3900,6300);
   Graph_Hist3002->SetMinimum(72.43402);
   Graph_Hist3002->SetMaximum(72434.02);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   4300,
   4316.5,
   4333,
   4349.5,
   4366,
   4382.5,
   4399,
   4415.5,
   4432,
   4448.5,
   4465,
   4481.5,
   4498,
   4514.5,
   4531,
   4547.5,
   4564,
   4580.5,
   4597,
   4613.5,
   4630,
   4646.5,
   4663,
   4679.5,
   4696,
   4712.5,
   4729,
   4745.5,
   4762,
   4778.5,
   4795,
   4811.5,
   4828,
   4844.5,
   4861,
   4877.5,
   4894,
   4910.5,
   4927,
   4943.5,
   4960,
   4976.5,
   4993,
   5009.5,
   5026,
   5042.5,
   5059,
   5075.5,
   5092,
   5108.5,
   5125,
   5141.5,
   5158,
   5174.5,
   5191,
   5207.5,
   5224,
   5240.5,
   5257,
   5273.5,
   5290,
   5306.5,
   5323,
   5339.5,
   5356,
   5372.5,
   5389,
   5405.5,
   5422,
   5438.5,
   5455,
   5471.5,
   5488,
   5504.5,
   5521,
   5537.5,
   5554,
   5570.5,
   5587,
   5603.5,
   5620,
   5636.5,
   5653,
   5669.5,
   5686,
   5702.5,
   5719,
   5735.5,
   5752,
   5768.5,
   5785,
   5801.5,
   5818,
   5834.5,
   5851,
   5867.5,
   5884,
   5900.5,
   5917,
   5933.5,
   5950,
   5950};
   Double_t curvetot_fy1[102] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,4135,6115);
   Graph_curvetot1->SetMinimum(0.0011);
   Graph_curvetot1->SetMaximum(1.1);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t CBLst1405_fx2[102] = {
   4300,
   4316.5,
   4333,
   4349.5,
   4366,
   4382.5,
   4399,
   4415.5,
   4432,
   4448.5,
   4465,
   4481.5,
   4498,
   4514.5,
   4531,
   4547.5,
   4564,
   4580.5,
   4597,
   4613.5,
   4630,
   4646.5,
   4663,
   4679.5,
   4696,
   4712.5,
   4729,
   4745.5,
   4762,
   4778.5,
   4795,
   4811.5,
   4828,
   4844.5,
   4861,
   4877.5,
   4894,
   4910.5,
   4927,
   4943.5,
   4960,
   4976.5,
   4993,
   5009.5,
   5026,
   5042.5,
   5059,
   5075.5,
   5092,
   5108.5,
   5125,
   5141.5,
   5158,
   5174.5,
   5191,
   5207.5,
   5224,
   5240.5,
   5257,
   5273.5,
   5290,
   5306.5,
   5323,
   5339.5,
   5356,
   5372.5,
   5389,
   5405.5,
   5422,
   5438.5,
   5455,
   5471.5,
   5488,
   5504.5,
   5521,
   5537.5,
   5554,
   5570.5,
   5587,
   5603.5,
   5620,
   5636.5,
   5653,
   5669.5,
   5686,
   5702.5,
   5719,
   5735.5,
   5752,
   5768.5,
   5785,
   5801.5,
   5818,
   5834.5,
   5851,
   5867.5,
   5884,
   5900.5,
   5917,
   5933.5,
   5950,
   5950};
   Double_t CBLst1405_fy2[102] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   graph = new TGraph(102,CBLst1405_fx2,CBLst1405_fy2);
   graph->SetName("CBLst1405");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_CBLst14052 = new TH1F("Graph_CBLst14052","Projection of totalPdf",102,4135,6115);
   Graph_CBLst14052->SetMinimum(0.0011);
   Graph_CBLst14052->SetMaximum(1.1);
   Graph_CBLst14052->SetDirectory(0);
   Graph_CBLst14052->SetStats(0);
   Graph_CBLst14052->SetLineWidth(2);
   Graph_CBLst14052->SetMarkerStyle(20);
   Graph_CBLst14052->GetXaxis()->SetNdivisions(505);
   Graph_CBLst14052->GetXaxis()->SetLabelFont(132);
   Graph_CBLst14052->GetXaxis()->SetLabelOffset(0.01);
   Graph_CBLst14052->GetXaxis()->SetLabelSize(0.06);
   Graph_CBLst14052->GetXaxis()->SetTitleSize(0.072);
   Graph_CBLst14052->GetXaxis()->SetTitleOffset(0.95);
   Graph_CBLst14052->GetXaxis()->SetTitleFont(132);
   Graph_CBLst14052->GetYaxis()->SetLabelFont(132);
   Graph_CBLst14052->GetYaxis()->SetLabelOffset(0.01);
   Graph_CBLst14052->GetYaxis()->SetLabelSize(0.06);
   Graph_CBLst14052->GetYaxis()->SetTitleSize(0.072);
   Graph_CBLst14052->GetYaxis()->SetTitleOffset(0.95);
   Graph_CBLst14052->GetYaxis()->SetTitleFont(132);
   Graph_CBLst14052->GetZaxis()->SetLabelFont(132);
   Graph_CBLst14052->GetZaxis()->SetLabelSize(0.06);
   Graph_CBLst14052->GetZaxis()->SetTitleSize(0.072);
   Graph_CBLst14052->GetZaxis()->SetTitleOffset(1.2);
   Graph_CBLst14052->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_CBLst14052);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("CBLst1405","#Lambda*(1405), CB","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4618880__4 = new TH1D("frame_4618880__4","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4618880__4->SetBinContent(1,69141.57);
   frame_4618880__4->SetMinimum(1);
   frame_4618880__4->SetMaximum(5000);
   frame_4618880__4->SetEntries(1);
   frame_4618880__4->SetDirectory(0);
   frame_4618880__4->SetStats(0);
   frame_4618880__4->SetLineWidth(2);
   frame_4618880__4->SetMarkerStyle(20);
   frame_4618880__4->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4618880__4->GetXaxis()->SetNdivisions(505);
   frame_4618880__4->GetXaxis()->SetLabelFont(132);
   frame_4618880__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4618880__4->GetXaxis()->SetLabelSize(0.06);
   frame_4618880__4->GetXaxis()->SetTitleSize(0.072);
   frame_4618880__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4618880__4->GetXaxis()->SetTitleFont(132);
   frame_4618880__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4618880__4->GetYaxis()->SetLabelFont(132);
   frame_4618880__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4618880__4->GetYaxis()->SetLabelSize(0.06);
   frame_4618880__4->GetYaxis()->SetTitleSize(0.072);
   frame_4618880__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4618880__4->GetYaxis()->SetTitleFont(132);
   frame_4618880__4->GetZaxis()->SetLabelFont(132);
   frame_4618880__4->GetZaxis()->SetLabelSize(0.06);
   frame_4618880__4->GetZaxis()->SetTitleSize(0.072);
   frame_4618880__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4618880__4->GetZaxis()->SetTitleFont(132);
   frame_4618880__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
void fitLMC_c070116_LL1_floathypparamsfixmusigma_nobkg()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Wed Jul  6 21:29:11 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(3754.321,-26.4,6223.457,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_3705430__1 = new TH1D("frame_3705430__1","",100,4100,6100);
   frame_3705430__1->SetBinContent(1,11.2676);
   frame_3705430__1->SetMinimum(-8.8);
   frame_3705430__1->SetMaximum(8.8);
   frame_3705430__1->SetEntries(1);
   frame_3705430__1->SetDirectory(0);
   frame_3705430__1->SetStats(0);
   frame_3705430__1->SetLineWidth(2);
   frame_3705430__1->SetMarkerStyle(20);
   frame_3705430__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_3705430__1->GetXaxis()->SetNdivisions(505);
   frame_3705430__1->GetXaxis()->SetLabelFont(132);
   frame_3705430__1->GetXaxis()->SetLabelOffset(0.01);
   frame_3705430__1->GetXaxis()->SetLabelSize(0.15);
   frame_3705430__1->GetXaxis()->SetTitleSize(0.2);
   frame_3705430__1->GetXaxis()->SetTitleOffset(1.1);
   frame_3705430__1->GetXaxis()->SetTitleFont(132);
   frame_3705430__1->GetYaxis()->SetTitle("Pull");
   frame_3705430__1->GetYaxis()->CenterTitle(true);
   frame_3705430__1->GetYaxis()->SetNdivisions(505);
   frame_3705430__1->GetYaxis()->SetLabelFont(132);
   frame_3705430__1->GetYaxis()->SetLabelOffset(0.01);
   frame_3705430__1->GetYaxis()->SetLabelSize(0.15);
   frame_3705430__1->GetYaxis()->SetTitleSize(0.15);
   frame_3705430__1->GetYaxis()->SetTitleOffset(0.45);
   frame_3705430__1->GetYaxis()->SetTitleFont(132);
   frame_3705430__1->GetZaxis()->SetLabelFont(132);
   frame_3705430__1->GetZaxis()->SetLabelSize(0.06);
   frame_3705430__1->GetZaxis()->SetTitleSize(0.072);
   frame_3705430__1->GetZaxis()->SetTitleOffset(1.2);
   frame_3705430__1->GetZaxis()->SetTitleFont(132);
   frame_3705430__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[87] = {
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030};
   Double_t pull_Hist_curvetot_fy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0.6090808,
   1.134866,
   -0.2785807,
   9.080708,
   9.670166,
   0.777574,
   0.8226909,
   0.8521652,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_felx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(87,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf",100,4138,6202);
   Graph_pull_Hist_curvetot3001->SetMinimum(-2.473455);
   Graph_pull_Hist_curvetot3001->SetMaximum(11.86504);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_3705430__2 = new TH1D("frame_3705430__2","",100,4100,6100);
   frame_3705430__2->SetBinContent(1,11.2676);
   frame_3705430__2->SetMinimum(-8.8);
   frame_3705430__2->SetMaximum(8.8);
   frame_3705430__2->SetEntries(1);
   frame_3705430__2->SetDirectory(0);
   frame_3705430__2->SetStats(0);
   frame_3705430__2->SetLineWidth(2);
   frame_3705430__2->SetMarkerStyle(20);
   frame_3705430__2->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_3705430__2->GetXaxis()->SetNdivisions(505);
   frame_3705430__2->GetXaxis()->SetLabelFont(132);
   frame_3705430__2->GetXaxis()->SetLabelOffset(0.01);
   frame_3705430__2->GetXaxis()->SetLabelSize(0.15);
   frame_3705430__2->GetXaxis()->SetTitleSize(0.2);
   frame_3705430__2->GetXaxis()->SetTitleOffset(1.1);
   frame_3705430__2->GetXaxis()->SetTitleFont(132);
   frame_3705430__2->GetYaxis()->SetTitle("Pull");
   frame_3705430__2->GetYaxis()->CenterTitle(true);
   frame_3705430__2->GetYaxis()->SetNdivisions(505);
   frame_3705430__2->GetYaxis()->SetLabelFont(132);
   frame_3705430__2->GetYaxis()->SetLabelOffset(0.01);
   frame_3705430__2->GetYaxis()->SetLabelSize(0.15);
   frame_3705430__2->GetYaxis()->SetTitleSize(0.15);
   frame_3705430__2->GetYaxis()->SetTitleOffset(0.45);
   frame_3705430__2->GetYaxis()->SetTitleFont(132);
   frame_3705430__2->GetZaxis()->SetLabelFont(132);
   frame_3705430__2->GetZaxis()->SetLabelSize(0.06);
   frame_3705430__2->GetZaxis()->SetTitleSize(0.072);
   frame_3705430__2->GetZaxis()->SetTitleOffset(1.2);
   frame_3705430__2->GetZaxis()->SetTitleFont(132);
   frame_3705430__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(0,0,1,1);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetLogy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_359de30__3 = new TH1D("frame_359de30__3","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_359de30__3->SetBinContent(1,3307.075);
   frame_359de30__3->SetMinimum(0);
   frame_359de30__3->SetMaximum(7500);
   frame_359de30__3->SetEntries(2);
   frame_359de30__3->SetDirectory(0);
   frame_359de30__3->SetStats(0);
   frame_359de30__3->SetLineWidth(2);
   frame_359de30__3->SetMarkerStyle(20);
   frame_359de30__3->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_359de30__3->GetXaxis()->SetNdivisions(505);
   frame_359de30__3->GetXaxis()->SetLabelFont(132);
   frame_359de30__3->GetXaxis()->SetLabelOffset(0.01);
   frame_359de30__3->GetXaxis()->SetLabelSize(0.06);
   frame_359de30__3->GetXaxis()->SetTitleSize(0.072);
   frame_359de30__3->GetXaxis()->SetTitleOffset(0.95);
   frame_359de30__3->GetXaxis()->SetTitleFont(132);
   frame_359de30__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_359de30__3->GetYaxis()->SetLabelFont(132);
   frame_359de30__3->GetYaxis()->SetLabelOffset(0.01);
   frame_359de30__3->GetYaxis()->SetLabelSize(0.06);
   frame_359de30__3->GetYaxis()->SetTitleSize(0.072);
   frame_359de30__3->GetYaxis()->SetTitleOffset(0.95);
   frame_359de30__3->GetYaxis()->SetTitleFont(132);
   frame_359de30__3->GetZaxis()->SetLabelFont(132);
   frame_359de30__3->GetZaxis()->SetLabelSize(0.06);
   frame_359de30__3->GetZaxis()->SetTitleSize(0.072);
   frame_359de30__3->GetZaxis()->SetTitleOffset(1.2);
   frame_359de30__3->GetZaxis()->SetTitleFont(132);
   frame_359de30__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   4110,
   4130,
   4150,
   4170,
   4190,
   4210,
   4230,
   4250,
   4270,
   4290,
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030,
   6050,
   6070,
   6090};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   5,
   30,
   1308,
   1283,
   36,
   7,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr",100,3900,6300);
   Graph_Hist3002->SetMinimum(1.478583);
   Graph_Hist3002->SetMaximum(1478.583);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t curvetot_fy1[128] = {
   5.097734e-11,
   5.706404e-11,
   6.397227e-11,
   7.182607e-11,
   8.077026e-11,
   9.097421e-11,
   1.026365e-10,
   1.159906e-10,
   1.313112e-10,
   1.489226e-10,
   1.692087e-10,
   1.926245e-10,
   2.197112e-10,
   2.511141e-10,
   2.876045e-10,
   3.301067e-10,
   3.797322e-10,
   4.378209e-10,
   5.059931e-10,
   5.862146e-10,
   6.808781e-10,
   7.92905e-10,
   9.25876e-10,
   1.084194e-09,
   1.273296e-09,
   1.499917e-09,
   1.772438e-09,
   2.101333e-09,
   2.49974e-09,
   2.984225e-09,
   3.575764e-09,
   4.30105e-09,
   5.194231e-09,
   6.299211e-09,
   7.672763e-09,
   9.388721e-09,
   1.154369e-08,
   1.426487e-08,
   1.772088e-08,
   2.213677e-08,
   2.781515e-08,
   3.516607e-08,
   4.474967e-08,
   5.733771e-08,
   7.400324e-08,
   9.625251e-08,
   1.262215e-07,
   1.66972e-07,
   2.229438e-07,
   3.006535e-07,
   4.097927e-07,
   5.649775e-07,
   7.885849e-07,
   1.115432e-06,
   1.600645e-06,
   2.333173e-06,
   3.459516e-06,
   5.226424e-06,
   8.059798e-06,
   1.271484e-05,
   2.057112e-05,
   3.423339e-05,
   5.880467e-05,
   0.0001047063,
   0.000194246,
   0.0003778152,
   0.0007765404,
   0.001703496,
   0.004040552,
   0.01054291,
   0.03098829,
   0.1061303,
   0.4455362,
   2.485815,
   6.801185,
   21.23333,
   39.88852,
   55.66596,
   78.72316,
   112.9447,
   164.5968,
   243.9531,
   367.2852,
   558.9441,
   851.7984,
   1279.391,
   1848.229,
   2484.678,
   2996.656,
   3149.596,
   2860.214,
   2281.036,
   1651.136,
   1125.016,
   743.8519,
   487.6576,
   321.3096,
   214.42,
   145.4929,
   100.5415,
   70.77508,
   50.72557,
   36.98257,
   20.60332,
   12.13127,
   2.197087,
   0.6127486,
   0.2221579,
   0.0958892,
   0.0468419,
   0.02509342,
   0.01443649,
   0.008790563,
   0.005605979,
   0.003714951,
   0.002542779,
   0.001789259,
   0.001289489,
   0.0009489036,
   0.0007112191,
   0.000541828,
   0.0004188321,
   0.000328018,
   0.0002599479,
   0.0002082251,
   0.0001684331,
   0.000137471,
   0.000137471};
   TGraph *graph = new TGraph(128,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",128,4126,6214);
   Graph_curvetot1->SetMinimum(4.58796e-11);
   Graph_curvetot1->SetMaximum(3464.555);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t sigL_fx2[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t sigL_fy2[128] = {
   5.097734e-11,
   5.706404e-11,
   6.397227e-11,
   7.182607e-11,
   8.077026e-11,
   9.097421e-11,
   1.026365e-10,
   1.159906e-10,
   1.313112e-10,
   1.489226e-10,
   1.692087e-10,
   1.926245e-10,
   2.197112e-10,
   2.511141e-10,
   2.876045e-10,
   3.301067e-10,
   3.797322e-10,
   4.378209e-10,
   5.059931e-10,
   5.862146e-10,
   6.808781e-10,
   7.92905e-10,
   9.25876e-10,
   1.084194e-09,
   1.273296e-09,
   1.499917e-09,
   1.772438e-09,
   2.101333e-09,
   2.49974e-09,
   2.984225e-09,
   3.575764e-09,
   4.30105e-09,
   5.194231e-09,
   6.299211e-09,
   7.672763e-09,
   9.388721e-09,
   1.154369e-08,
   1.426487e-08,
   1.772088e-08,
   2.213677e-08,
   2.781515e-08,
   3.516607e-08,
   4.474967e-08,
   5.733771e-08,
   7.400324e-08,
   9.625251e-08,
   1.262215e-07,
   1.66972e-07,
   2.229438e-07,
   3.006535e-07,
   4.097927e-07,
   5.649775e-07,
   7.885849e-07,
   1.115432e-06,
   1.600645e-06,
   2.333173e-06,
   3.459516e-06,
   5.226424e-06,
   8.059798e-06,
   1.271484e-05,
   2.057112e-05,
   3.423339e-05,
   5.880467e-05,
   0.0001047063,
   0.000194246,
   0.0003778152,
   0.0007765404,
   0.001703496,
   0.004040552,
   0.01054291,
   0.03098829,
   0.1061303,
   0.4455362,
   2.485815,
   6.801185,
   21.23333,
   39.88852,
   55.66596,
   78.72316,
   112.9447,
   164.5968,
   243.9531,
   367.2852,
   558.9441,
   851.7984,
   1279.391,
   1848.229,
   2484.678,
   2996.656,
   3149.596,
   2860.214,
   2281.036,
   1651.136,
   1125.016,
   743.8519,
   487.6576,
   321.3096,
   214.42,
   145.4929,
   100.5415,
   70.77508,
   50.72557,
   36.98257,
   20.60332,
   12.13127,
   2.197087,
   0.6127486,
   0.2221579,
   0.0958892,
   0.0468419,
   0.02509342,
   0.01443649,
   0.008790563,
   0.005605979,
   0.003714951,
   0.002542779,
   0.001789259,
   0.001289489,
   0.0009489036,
   0.0007112191,
   0.000541828,
   0.0004188321,
   0.000328018,
   0.0002599479,
   0.0002082251,
   0.0001684331,
   0.000137471,
   0.000137471};
   graph = new TGraph(128,sigL_fx2,sigL_fy2);
   graph->SetName("sigL");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_sigL2 = new TH1F("Graph_sigL2","Projection of totalPdf",128,4126,6214);
   Graph_sigL2->SetMinimum(4.58796e-11);
   Graph_sigL2->SetMaximum(3464.555);
   Graph_sigL2->SetDirectory(0);
   Graph_sigL2->SetStats(0);
   Graph_sigL2->SetLineWidth(2);
   Graph_sigL2->SetMarkerStyle(20);
   Graph_sigL2->GetXaxis()->SetNdivisions(505);
   Graph_sigL2->GetXaxis()->SetLabelFont(132);
   Graph_sigL2->GetXaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetXaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetXaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetXaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetXaxis()->SetTitleFont(132);
   Graph_sigL2->GetYaxis()->SetLabelFont(132);
   Graph_sigL2->GetYaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetYaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetYaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetYaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetYaxis()->SetTitleFont(132);
   Graph_sigL2->GetZaxis()->SetLabelFont(132);
   Graph_sigL2->GetZaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetZaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetZaxis()->SetTitleOffset(1.2);
   Graph_sigL2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_sigL2);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sigL","#Lambda signal (hypatia)","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_359de30__4 = new TH1D("frame_359de30__4","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_359de30__4->SetBinContent(1,3307.075);
   frame_359de30__4->SetMinimum(0);
   frame_359de30__4->SetMaximum(7500);
   frame_359de30__4->SetEntries(2);
   frame_359de30__4->SetDirectory(0);
   frame_359de30__4->SetStats(0);
   frame_359de30__4->SetLineWidth(2);
   frame_359de30__4->SetMarkerStyle(20);
   frame_359de30__4->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_359de30__4->GetXaxis()->SetNdivisions(505);
   frame_359de30__4->GetXaxis()->SetLabelFont(132);
   frame_359de30__4->GetXaxis()->SetLabelOffset(0.01);
   frame_359de30__4->GetXaxis()->SetLabelSize(0.06);
   frame_359de30__4->GetXaxis()->SetTitleSize(0.072);
   frame_359de30__4->GetXaxis()->SetTitleOffset(0.95);
   frame_359de30__4->GetXaxis()->SetTitleFont(132);
   frame_359de30__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_359de30__4->GetYaxis()->SetLabelFont(132);
   frame_359de30__4->GetYaxis()->SetLabelOffset(0.01);
   frame_359de30__4->GetYaxis()->SetLabelSize(0.06);
   frame_359de30__4->GetYaxis()->SetTitleSize(0.072);
   frame_359de30__4->GetYaxis()->SetTitleOffset(0.95);
   frame_359de30__4->GetYaxis()->SetTitleFont(132);
   frame_359de30__4->GetZaxis()->SetLabelFont(132);
   frame_359de30__4->GetZaxis()->SetLabelSize(0.06);
   frame_359de30__4->GetZaxis()->SetTitleSize(0.072);
   frame_359de30__4->GetZaxis()->SetTitleOffset(1.2);
   frame_359de30__4->GetZaxis()->SetTitleFont(132);
   frame_359de30__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Пример #11
0
void bToDRawYield()
{
	gStyle->SetTextSize(0.05);
	gStyle->SetTextFont(42);
	gStyle->SetPadRightMargin(0.04);
	gStyle->SetPadLeftMargin(0.14);
	gStyle->SetPadTopMargin(0.1);
	gStyle->SetPadBottomMargin(0.14);
	gStyle->SetTitleX(.0f);
	gStyle->SetOptFit(1111);
	gStyle->SetOptStat(0);
	gStyle->SetOptTitle(0);

	TCanvas* c4 = new TCanvas("c4","",800,600);
	c4->Divide(2,2);

	TCanvas* c2 = new TCanvas("c2","",400,600);
	c2->Divide(1,2);

	TCanvas* c1 = new TCanvas();

	TCanvas* c15 = new TCanvas("c15","",810,1000);
	c15->Divide(3,5);

	TFile* fPbPb = new TFile("bFeedDownPbPb.hist.root");
	TFile* fPbPbMB = new TFile("bFeedDownPbPbMB.hist.root");
	TFile* fPbPbMC = new TFile("bFeedDownPbPbMC.hist.root");
	TFile* fPbPbMBMC = new TFile("bFeedDownPbPbMBMC.hist.root");

	TH3D* hDataPbPb = (TH3D*)fPbPb->Get("hData");
	TH3D* hSidebandPbPb = (TH3D*)fPbPb->Get("hSideband");
	TH3D* hDataPbPbMB = (TH3D*)fPbPbMB->Get("hData");
	TH3D* hSidebandPbPbMB = (TH3D*)fPbPbMB->Get("hSideband");
	TH3D* hPtMD0DcaPbPb = (TH3D*)fPbPb->Get("hPtMD0Dca");
	TH3D* hPtMD0DcaPbPbMB = (TH3D*)fPbPbMB->Get("hPtMD0Dca");

	TH3D* hMCPSignalPbPb = (TH3D*)fPbPbMC->Get("hMCPSignal");
	TH3D* hMCNPSignalPbPb = (TH3D*)fPbPbMC->Get("hMCNPSignal");
	TH3D* hMCPSignalPbPbMB = (TH3D*)fPbPbMBMC->Get("hMCPSignal");
	TH3D* hMCNPSignalPbPbMB = (TH3D*)fPbPbMBMC->Get("hMCNPSignal");
	TH3D* hPtMD0DcaMCPSignalPbPb = (TH3D*)fPbPbMC->Get("hPtMD0DcaMCPSignal");
	TH3D* hPtMD0DcaMCPSwappedPbPb = (TH3D*)fPbPbMC->Get("hPtMD0DcaMCPSwapped");
	TH3D* hPtMD0DcaMCPSignalPbPbMB =(TH3D*)fPbPbMBMC->Get("hPtMD0DcaMCPSignal");
	TH3D* hPtMD0DcaMCPSwappedPbPbMB = (TH3D*)fPbPbMBMC->Get("hPtMD0DcaMCPSwapped");

	TH3D* hData = (TH3D*)hDataPbPb->Clone("hData");
	hData->Sumw2();
	hData->Add(hDataPbPbMB);

	TH3D* hSideband = (TH3D*)hSidebandPbPb->Clone("hSideband");
	hSideband->Sumw2();
	hSideband->Add(hSidebandPbPbMB);

	TH3D* hPtMD0Dca = (TH3D*)hPtMD0DcaPbPb->Clone("hPtMD0Dca");
	hPtMD0Dca->Sumw2();
	hPtMD0Dca->Add(hPtMD0DcaPbPbMB);

	TH3D* hMCPSignal = (TH3D*)hMCPSignalPbPb->Clone("hMCPSignal");
	hMCPSignal->Sumw2();
	hMCPSignal->Add(hMCPSignalPbPbMB);

	TH3D* hMCNPSignal = (TH3D*)hMCNPSignalPbPb->Clone("hMCNPSignal");
	hMCNPSignal->Sumw2();
	hMCNPSignal->Add(hMCNPSignalPbPbMB);

	TH3D* hPtMD0DcaMCPSignal = (TH3D*)hPtMD0DcaMCPSignalPbPb->Clone("hPtMD0DcaMCPSignal");
	hPtMD0DcaMCPSignal->Sumw2();
	hPtMD0DcaMCPSignal->Add(hPtMD0DcaMCPSignalPbPbMB);

	TH3D* hPtMD0DcaMCPSwapped =(TH3D*)hPtMD0DcaMCPSwappedPbPb->Clone("hPtMD0DcaMCPSwapped");
	hPtMD0DcaMCPSwapped->Sumw2();
	hPtMD0DcaMCPSwapped->Add(hPtMD0DcaMCPSwappedPbPbMB);

	TLatex* texCms = new TLatex(0.18,0.93, "#scale[1.25]{CMS} Preliminary");
	texCms->SetNDC();
	texCms->SetTextAlign(12);
	texCms->SetTextSize(0.06);
	texCms->SetTextFont(42);

	TLatex* texCol = new TLatex(0.96,0.93, "PbPb #sqrt{s_{NN}} = 5.02 TeV");
	texCol->SetNDC();
	texCol->SetTextAlign(32);
	texCol->SetTextSize(0.06);
	texCol->SetTextFont(42);

	const int nPtBins = 14;
	float ptBins[nPtBins+1] = {2.,3.,4.,5.,6.,8.,10.,12.5,15.0,20.,25.,30.,40.,60.,100};

	float pts[nPtBins];
	float ptErrors[nPtBins];
	float promptFraction[nPtBins];
	float totalYield[nPtBins];
	float totalYieldInvMassFit[nPtBins];
	float totalYieldInvMassFitError[nPtBins];
	float bToDYield[nPtBins];
	float bToDYieldError[nPtBins];
	float bToDYieldErrorDataOnly[nPtBins];
	float promptDYield[nPtBins];
	float promptDYieldError[nPtBins];
	float promptDYieldErrorDataOnly[nPtBins];

	const int nBinY = 14;
	Float_t binsY[nBinY+1];
	float firstBinYWidth = 0.001;
	float binYWidthRatio = 1.27;
	binsY[0]=0;
	for(int i=1; i<=nBinY; i++)
		binsY[i] = binsY[i-1]+firstBinYWidth*pow(binYWidthRatio,i-1);
	cout<<"last y bin: "<<binsY[nBinY]<<endl;

	//  for(int i=1; i<=nPtBins; i++)
	for(int i =7; i<=7; i++)
	{
		pts[i-1] = 0.5*(ptBins[i-1]+ptBins[i]);
		ptErrors[i-1] = 0.5*(ptBins[i]-ptBins[i-1]);
		float ptLow = ptBins[i-1];
		float ptHigh = ptBins[i];
		cout<<endl<<"======================================="<<endl;
		cout<<"pT range: "<<ptLow<<" "<<ptHigh<<endl;

		TLatex* texPtY = new TLatex(0.32,0.82,Form("%.1f < p_{T} < %.1f GeV/c      |y| < 1.0",ptLow,ptHigh));
		texPtY->SetNDC();
		texPtY->SetTextFont(42);
		texPtY->SetTextSize(0.06);
		texPtY->SetLineWidth(2);

		TLatex* texPt = new TLatex(0.18,0.82,Form("%.1f < p_{T} < %.1f GeV/c",ptLow,ptHigh));
		texPt->SetNDC();
		texPt->SetTextFont(42);
		texPt->SetTextSize(0.06);
		texPt->SetLineWidth(2);

		TLatex* texY = new TLatex(0.18,0.74,Form("|y| < 1.0"));
		texY->SetNDC();
		texY->SetTextFont(42);
		texY->SetTextSize(0.06);
		texY->SetLineWidth(2);

		c2->cd(1);

		hPtMD0Dca->GetZaxis()->SetRange(1,100);
		hPtMD0Dca->GetXaxis()->SetRangeUser(ptLow+0.001,ptHigh-0.001);
		hPtMD0DcaMCPSignal->GetXaxis()->SetRangeUser(ptLow+0.001,ptHigh-0.001);
		hPtMD0DcaMCPSwapped->GetXaxis()->SetRangeUser(ptLow+0.001,ptHigh-0.001);
		TH1D* hMData = (TH1D*)hPtMD0Dca->Project3D("y")->Clone(Form("hM_%1.1f_%1.1f", ptLow, ptHigh));
		TH1D* hMMCSignal = (TH1D*)hPtMD0DcaMCPSignal->Project3D("y");
		TH1D* hMMCSwapped = (TH1D*)hPtMD0DcaMCPSwapped->Project3D("y");

		setColorTitleLabel(hMData);
		setColorTitleLabel(hMMCSignal);
		setColorTitleLabel(hMMCSwapped);

		TF1* fMass = fitMass(hMData, hMMCSignal, hMMCSwapped);

		texCms->Draw();
		texCol->Draw();
		texPt->Draw();
		texY->Draw();

		TF1* fSignalAndSwapped = new TF1("fSignalAndSwapped","[0]*([3]*([5]*Gaus(x,[1],[2]*(1+[7]))/(sqrt(2*3.1415927)*[2]*(1+[7]))+(1-[5])*Gaus(x,[1],[6]*(1+[7]))/(sqrt(2*3.1415927)*[6]*(1+[7])))+(1-[3])*Gaus(x,[1],[4]*(1+[7]))/(sqrt(2*3.1415927)*[4]*(1+[7])))", 1.7, 2.0);      
		fSignalAndSwapped->SetParameter(0,fMass->GetParameter(0));
		fSignalAndSwapped->SetParameter(1,fMass->GetParameter(1));
		fSignalAndSwapped->SetParameter(2,fMass->GetParameter(2));
		fSignalAndSwapped->SetParameter(3,fMass->GetParameter(7));
		fSignalAndSwapped->SetParameter(4,fMass->GetParameter(8));
		fSignalAndSwapped->SetParameter(5,fMass->GetParameter(9));
		fSignalAndSwapped->SetParameter(6,fMass->GetParameter(10));
		fSignalAndSwapped->SetParameter(7,fMass->GetParameter(11));

		TF1* background = new TF1("fBackground","[0]+[1]*x+[2]*x*x+[3]*x*x*x");
		background->SetParameter(0,fMass->GetParameter(3));
		background->SetParameter(1,fMass->GetParameter(4));
		background->SetParameter(2,fMass->GetParameter(5));
		background->SetParameter(3,fMass->GetParameter(6));

		cout<<"MC signal width: "<<fMass->GetParameter(2)<<"   "<<fMass->GetParameter(10)<<endl;
		cout<<"MC swapped width: "<<fMass->GetParameter(8)<<endl;

		float massD = 1.8649;
		float massSignal1 = massD-0.025;
		float massSignal2 = massD+0.025;
		float massSideBand1 = massD-0.1;
		float massSideBand2 = massD-0.075;
		float massSideBand3 = massD+0.075;
		float massSideBand4 = massD+0.1;

		float scaleSideBandBackground = background->Integral(massSignal1, massSignal2)/(background->Integral(massSideBand1, massSideBand2)+background->Integral(massSideBand3, massSideBand4));
		cout<<"scaleSideBandBackground: "<<scaleSideBandBackground<<endl;
		totalYieldInvMassFit[i-1] = fMass->GetParameter(0)*fMass->GetParameter(7)/hMData->GetBinWidth(1);
		totalYieldInvMassFitError[i-1] = fMass->GetParError(0)*fMass->GetParameter(7)/hMData->GetBinWidth(1);
		cout<<"totalYieldInvMassFit: "<<totalYieldInvMassFit[i-1]<<" +- "<<totalYieldInvMassFitError[i-1]<<endl;
		float scaleSideBandMethodSignal = fSignalAndSwapped->GetParameter(0)*fSignalAndSwapped->GetParameter(3) / (fSignalAndSwapped->Integral(massSignal1, massSignal2)-fSignalAndSwapped->Integral(massSideBand1, massSideBand2)-fSignalAndSwapped->Integral(massSideBand3, massSideBand4));
		cout<<"scaleSideBandMethodSignal: "<<scaleSideBandMethodSignal<<endl;

		TLatex* texScale = new TLatex(0.18,0.66,Form("side band bg scale: %1.3f", scaleSideBandBackground));
		texScale->SetNDC();
		texScale->SetTextFont(42);
		texScale->SetTextSize(0.06);
		texScale->SetLineWidth(2);
		texScale->Draw();

		TLine* lineSignal1 = new TLine(massSignal1, 0, massSignal1, hMData->GetMaximum()*0.5);
		TLine* lineSignal2 = new TLine(massSignal2, 0, massSignal2, hMData->GetMaximum()*0.5);
		TLine* lineSideBand1 = new TLine(massSideBand1, 0, massSideBand1, hMData->GetMaximum()*0.5);
		TLine* lineSideBand2 = new TLine(massSideBand2, 0, massSideBand2, hMData->GetMaximum()*0.5);
		TLine* lineSideBand3 = new TLine(massSideBand3, 0, massSideBand3, hMData->GetMaximum()*0.5);
		TLine* lineSideBand4 = new TLine(massSideBand4, 0, massSideBand4, hMData->GetMaximum()*0.5);
		lineSignal1->Draw();
		lineSignal2->Draw();
		lineSideBand1->Draw();
		lineSideBand2->Draw();
		lineSideBand3->Draw();
		lineSideBand4->Draw();

		c2->cd(2);
		gPad->SetLogy();

		hData->GetXaxis()->SetRangeUser(ptLow+0.001,ptHigh-0.001);
		hSideband->GetXaxis()->SetRangeUser(ptLow+0.001,ptHigh-0.001);
		hMCPSignal->GetXaxis()->SetRangeUser(ptLow+0.001,ptHigh-0.001);
		hMCNPSignal->GetXaxis()->SetRangeUser(ptLow+0.001,ptHigh-0.001);

		TH1D* hD0DcaData0 = (TH1D*)hData->Project3D("y")->Clone("hD0DcaData0");
		TH1D* hD0DcaSideband = (TH1D*)hSideband->Project3D("y")->Clone("hD0DcaSideband");
		TH1D* hD0DcaMCPSignal0 = (TH1D*)hMCPSignal->Project3D("y")->Clone("hD0DcaMCPSignal0");
		TH1D* hD0DcaMCNPSignal0 = (TH1D*)hMCNPSignal->Project3D("y")->Clone("hD0DcaMCNPSignal0");

		float integralRawYieldMCP = hD0DcaMCPSignal0->Integral();
		float integralRawYieldMCNP = hD0DcaMCNPSignal0->Integral();
		cout<<"integralRawYieldMCP: "<<integralRawYieldMCP<<endl;
		cout<<"integralRawYieldMCNP: "<<integralRawYieldMCNP<<endl;

		hD0DcaMCPSignal = hD0DcaMCPSignal0;
		hD0DcaMCNPSignal = hD0DcaMCNPSignal0;

		divideBinWidth(hD0DcaData0);
		divideBinWidth(hD0DcaSideband);
		setColorTitleLabel(hD0DcaData0, 1);
		hD0DcaData0->GetXaxis()->SetRangeUser(0,0.07);
		hD0DcaData0->GetYaxis()->SetTitle("counts per cm");

		TH1D* hD0DcaSideband0 = (TH1D*)hD0DcaSideband->Clone("hD0DcaSideband0");
		hD0DcaSideband->Scale(scaleSideBandBackground);

		TH1D* hD0DcaDataSubSideBand = (TH1D*)hD0DcaData0->Clone("hD0DcaDataSubSideBand");
		hD0DcaDataSubSideBand->Add(hD0DcaSideband,-1);
		hD0DcaDataSubSideBand->Scale(scaleSideBandMethodSignal);

		hD0DcaData0->SetMarkerSize(0.6);
		hD0DcaData0->Draw();
		hD0DcaSideband->Draw("hsame");
		hD0DcaSideband0->SetLineStyle(2);
		hD0DcaSideband0->Draw("hsame");

		TLegend* leg1 = new TLegend(0.44,0.6,0.90,0.76,NULL,"brNDC");
		leg1->SetBorderSize(0);
		leg1->SetTextSize(0.06);
		leg1->SetTextFont(42);
		leg1->SetFillStyle(0);
		leg1->AddEntry(hD0DcaData0,"D^{0} candidate","pl");
		leg1->AddEntry(hD0DcaSideband,"side band","l");
		leg1->AddEntry(hD0DcaSideband0,"side band unscaled","l");
		leg1->Draw("same");

		texCms->Draw();
		texCol->Draw();
		texPtY->Draw();

		c2->SaveAs(Form("plots/PbPb_%.0f_%.0f_sideBand.pdf",ptLow,ptHigh));

		c2->cd(1);
		hMMCSignal->Draw();
		texCms->Draw();
		texCol->Draw();
		texPt->Draw();
		texY->Draw();

		c2->cd(2);
		gPad->SetLogy(0);
		hMMCSwapped->Draw();
		texCms->Draw();
		texCol->Draw();
		texPt->Draw();
		texY->Draw();

		c2->SaveAs(Form("plots/PbPb_%.0f_%.0f_McInvMassFit.pdf",ptLow,ptHigh));

		c15->cd(1);

		fitMass(hMData, hMMCSignal, hMMCSwapped);

		texPt->Draw();
		texY->Draw();

		TH1D* hD0DcaDataFit = new TH1D("hD0DcaDataFit", ";D^{0} DCA (cm);dN / d(D^{0} DCA) (cm^{-1})", nBinY, binsY);

		for(int j=1; j<=14; j++)
		{
			c15->cd(j+1);
			hPtMD0Dca->GetZaxis()->SetRange(j,j);
			float D0DcaLow = hPtMD0Dca->GetZaxis()->GetBinLowEdge(j);
			float D0DcaHigh = hPtMD0Dca->GetZaxis()->GetBinUpEdge(j);
			TH1D* hMData_D0Dca = (TH1D*)hPtMD0Dca->Project3D("y")->Clone(Form("hM_pt_%1.1f_%1.1f_D0Dca_%1.4f_%1.4f", ptLow, ptHigh, D0DcaLow, D0DcaHigh));
			setColorTitleLabel(hMData_D0Dca);
			fMass = fitMass(hMData_D0Dca, hMMCSignal, hMMCSwapped);

			float yield = fMass->GetParameter(0)*fMass->GetParameter(7)/hMData_D0Dca->GetBinWidth(1);
			float yieldError = fMass->GetParError(0)*fMass->GetParameter(7)/hMData_D0Dca->GetBinWidth(1);

			hD0DcaDataFit->SetBinContent(j, yield);
			hD0DcaDataFit->SetBinError(j, yieldError);

			TLatex* texD0Dca = new TLatex(0.18,0.82,Form("D^{0} DCA: %1.4f - %1.4f",D0DcaLow,D0DcaHigh));
			texD0Dca->SetNDC();
			texD0Dca->SetTextFont(42);
			texD0Dca->SetTextSize(0.06);
			texD0Dca->SetLineWidth(2);
			texD0Dca->Draw();

			TLatex* texYield = new TLatex(0.18,0.74,Form("D^{0} yield: %1.0f #pm %1.0f",yield,yieldError));
			texYield->SetNDC();
			texYield->SetTextFont(42);
			texYield->SetTextSize(0.06);
			texYield->SetLineWidth(2);
			texYield->Draw();
		}

		c15->SaveAs(Form("plots/PbPb_%.0f_%.0f_invMassFit.pdf",ptLow,ptHigh));

		divideBinWidth(hD0DcaDataFit);

		c4->cd(1);
		gPad->SetLogy();

		normalize(hD0DcaMCPSignal);
		setColorTitleLabel(hD0DcaMCPSignal, 2);
		hD0DcaMCPSignal->GetXaxis()->SetRangeUser(0,0.07);

		normalize(hD0DcaMCNPSignal);
		setColorTitleLabel(hD0DcaMCNPSignal, 4);
		hD0DcaMCNPSignal->GetXaxis()->SetRangeUser(0,0.07);
		hD0DcaMCNPSignal->GetYaxis()->SetTitle("dN / d(D^{0} DCA) (cm^{-1})");
		hD0DcaMCNPSignal->GetXaxis()->SetTitle("D^{0} DCA (cm)");
		hD0DcaMCNPSignal->SetMaximum(hD0DcaMCPSignal->GetMaximum()*3.);

		hD0DcaMCNPSignal->Draw("");
		hD0DcaMCPSignal->Draw("same");

		TLegend* leg2 = new TLegend(0.54,0.72,0.90,0.88,NULL,"brNDC");
		leg2->SetBorderSize(0);
		leg2->SetTextSize(0.06);
		leg2->SetTextFont(42);
		leg2->SetFillStyle(0);
		leg2->AddEntry(hD0DcaMCPSignal,"MC Prompt D^{0}","pl");
		leg2->AddEntry(hD0DcaMCNPSignal,"MC Non-prompt D^{0}","pl");
		leg2->Draw("same");

		c4->cd(2);
		gPad->SetLogy();

		TH1D* hD0DcaData = hD0DcaDataFit;
		if(pts[i-1]>20) hD0DcaData = hD0DcaDataSubSideBand;

		setColorTitleLabel(hD0DcaData, 1);

		double integralTotalYield = hD0DcaData->Integral(1,hD0DcaData->GetXaxis()->GetNbins(),"width");
		cout<<"integralTotalYield: "<<integralTotalYield<<endl;

		TF1* fMix = new TF1("fMix",&funMix, 0., 0.5, 2);
		fMix->SetParameters(0.5*integralTotalYield,0.5*integralTotalYield);
		fMix->SetParLimits(0,0,2*integralTotalYield);
		fMix->SetParLimits(1,0,2*integralTotalYield);

		fMix->SetLineColor(2);
		fMix->SetFillColor(kRed-9);
		fMix->SetFillStyle(1001);

		float fitRangeL = 0;
		float fitRangeH = 0.08;

		hD0DcaData->GetXaxis()->SetRangeUser(0,0.07);
		hD0DcaData->Draw();
		int fitStatus = 1;
		TFitResultPtr fitResult;
		double fitPrecision = 1.e-6;
		while(fitStatus)
		{
			TFitter::SetPrecision(fitPrecision);
			fMix->SetParameters(0.5*integralTotalYield,0.5*integralTotalYield);
			fMix->SetParError(0,0.1*integralTotalYield);
			fMix->SetParError(1,0.1*integralTotalYield);
			fitResult = hD0DcaData->Fit("fMix","E SNQ0", "", fitRangeL, fitRangeH);
			fitStatus = fitResult->Status();
			cout<<"fit precision: "<<TFitter::GetPrecision()<<"   status: "<<fitStatus<<endl;
			if(fitStatus)
				fitPrecision *= 10;
		}
		cout<<"============== do main fit ============"<<endl;
		fMix->SetParameters(integralTotalYield,0.9);
		fMix->SetParError(0,0.1*integralTotalYield);
		fMix->SetParError(1,0.1);
		fMix->SetNpx(10000);
		fitResult = hD0DcaData->Fit("fMix","E S0", "", fitRangeL, fitRangeH);
		hD0DcaData->GetFunction("fMix")->Draw("flsame");
		fitStatus = fitResult->Status();
		cout<<"fit precision: "<<TFitter::GetPrecision()<<"   status: "<<fitStatus<<endl;

		TF1* fNP = new TF1("fNP",&funNonPrompt, 0., 0.5, 2);
		fNP->SetParameters(fMix->GetParameter(0),fMix->GetParameter(1));
		fNP->SetRange(fitRangeL,fitRangeH);
		fNP->SetLineColor(4);
		fNP->SetFillStyle(1001);
		fNP->SetFillColor(kBlue-9);
		fNP->SetNpx(10000);
		fNP->Draw("same");  

		hD0DcaData->Draw("same");

		promptDYield[i-1] = fMix->GetParameter(0);
		promptDYieldErrorDataOnly[i-1] = fMix->GetParError(0);
		bToDYield[i-1] = fMix->GetParameter(1);
		bToDYieldErrorDataOnly[i-1] = fMix->GetParError(1);
		totalYield[i-1] = promptDYield[i-1]+bToDYield[i-1];
		promptFraction[i-1] = promptDYield[i-1]/totalYield[i-1];

		cout<<"chi2 / NDF: "<<fitResult->Chi2()<<" / "<<fitResult->Ndf()<<endl;

		texCms->Draw();
		texCol->Draw();
		texPtY->Draw();

		TLatex* texPrompt = new TLatex(0.4,0.73,Form("Prompt D^{0} yield : %.0f #pm %.0f",fMix->GetParameter(0),fMix->GetParError(0)));
		texPrompt->SetNDC();
		texPrompt->SetTextFont(42);
		texPrompt->SetTextSize(0.06);
		texPrompt->SetLineWidth(2);
		texPrompt->Draw();

		TLatex* texNonPrompt = new TLatex(0.4,0.65,Form("B to D^{0} yield : %.0f #pm %.0f",fMix->GetParameter(1),fMix->GetParError(1)));
		texNonPrompt->SetNDC();
		texNonPrompt->SetTextFont(42);
		texNonPrompt->SetTextSize(0.06);
		texNonPrompt->SetLineWidth(2);
		texNonPrompt->Draw();

		TLegend* leg4 = new TLegend(0.56,0.38,0.90,0.62);
		leg4->SetBorderSize(0);
		leg4->SetTextSize(0.06);
		leg4->SetTextFont(42);
		leg4->SetFillStyle(0);
		leg4->AddEntry(hD0DcaData,"Data","pl");
		leg4->AddEntry(fMix,"Prompt D^{0}","f");
		leg4->AddEntry(fNP,"B to D^{0}","f");
		leg4->Draw("same");

		//smear MC smaple with the error, to simulate the MC statistic error effect.
		c4->cd(3);

		hD0DcaMCPSignal = (TH1D*)hD0DcaMCPSignal0->Clone("hMCPSignal");
		hD0DcaMCNPSignal = (TH1D*)hD0DcaMCNPSignal0->Clone("hMCNPSignal");

		TH1D* hNPYield = new TH1D("hNPYield", ";hNPYield", 100, 0., 1.1*(fMix->GetParameter(0)+fMix->GetParameter(1)));
		TH1D* hPYield = new TH1D("hPYield", ";hPYield", 100, 0., 1.1*(fMix->GetParameter(0)+fMix->GetParameter(1)));
		setColorTitleLabel(hNPYield, 1);
		setColorTitleLabel(hPYield, 1);

		int nSmear = 1000;

		for(int j=0; j<nSmear; j++)
		{
			RandomSmear(hD0DcaMCPSignal0, hD0DcaMCPSignal);
			RandomSmear(hD0DcaMCNPSignal0, hD0DcaMCNPSignal);
			fMix->SetParameters(0.5*integralTotalYield,0.5*integralTotalYield);
			fMix->SetParError(0,0.1*integralTotalYield);
			fMix->SetParError(1,0.1*integralTotalYield);

			hD0DcaData->Fit("fMix","E QN0");

			hPYield->Fill(fMix->GetParameter(0));
			hNPYield->Fill(fMix->GetParameter(1));
		}

		hPYield->GetXaxis()->SetTitle("prompt D^{0} yield");
		hPYield->GetYaxis()->SetTitle("counts");
		hPYield->GetYaxis()->SetRangeUser(0.5, 1.4*hPYield->GetMaximum());
		hPYield->SetMarkerStyle(20);
		hPYield->SetStats(0);
		hPYield->Draw("e");
		hPYield->Fit("gaus");

		TLatex* texGaussMeanSigmaP = new TLatex(0.27,0.83,Form("#mu: %.0f              #sigma: %.0f",hPYield->GetFunction("gaus")->GetParameter(1),hPYield->GetFunction("gaus")->GetParameter(2)));
		texGaussMeanSigmaP->SetNDC();
		texGaussMeanSigmaP->SetTextFont(42);
		texGaussMeanSigmaP->SetTextSize(0.06);
		texGaussMeanSigmaP->SetLineWidth(2);
		texGaussMeanSigmaP->Draw();

		float promptYieldErrorMc = hPYield->GetFunction("gaus")->GetParameter(2);
		promptDYieldError[i-1] = sqrt(pow(promptDYieldErrorDataOnly[i-1],2)+pow(promptYieldErrorMc,2));

		c4->cd(4);

		hNPYield->GetXaxis()->SetTitle("B to D^{0} yield");
		hNPYield->GetYaxis()->SetTitle("counts");
		hNPYield->GetYaxis()->SetRangeUser(0.5, 1.4*hNPYield->GetMaximum());
		hNPYield->SetMarkerStyle(20);
		hNPYield->SetStats(0);
		hNPYield->Draw("e");
		hNPYield->Fit("gaus");

		TLatex* texGaussMeanSigmaNP = new TLatex(0.27,0.83,Form("#mu: %.0f              #sigma: %.0f",hNPYield->GetFunction("gaus")->GetParameter(1),hNPYield->GetFunction("gaus")->GetParameter(2)));
		texGaussMeanSigmaNP->SetNDC();
		texGaussMeanSigmaNP->SetTextFont(42);
		texGaussMeanSigmaNP->SetTextSize(0.06);
		texGaussMeanSigmaNP->SetLineWidth(2);
		texGaussMeanSigmaNP->Draw();

		float bToDYieldErrorMc = hNPYield->GetFunction("gaus")->GetParameter(2);
		bToDYieldError[i-1] = sqrt(pow(bToDYieldErrorDataOnly[i-1],2)+pow(bToDYieldErrorMc,2));

		cout<<"prompt D yield: "<<promptDYield[i-1]<<" +- "<<promptDYieldError[i-1]<<" (+- "<<promptDYieldErrorDataOnly[i-1]<<" +- "<<promptYieldErrorMc<<" )"<<endl;
		cout<<"B to D yield: "<<bToDYield[i-1]<<" +- "<<bToDYieldError[i-1]<<" (+- "<<bToDYieldErrorDataOnly[i-1]<<" +- "<<bToDYieldErrorMc<<" )"<<endl;
		cout<<"total yield: "<<totalYield[i-1]<<endl;
		cout<<"prompt fraction: "<<promptFraction[i-1]<<endl;

		float promptMCScale = promptDYield[i-1]/integralRawYieldMCP;
		float nonPromptMCScale = bToDYield[i-1]/integralRawYieldMCNP;

		cout<<"promptMCScale: "<<promptMCScale<<endl;
		cout<<"nonPromptMCScale: "<<nonPromptMCScale<<endl;

		//restore original unsmeared histograms before saving plots
		delete hD0DcaMCPSignal;
		delete hD0DcaMCNPSignal;
		hD0DcaMCPSignal = hD0DcaMCPSignal0;
		hD0DcaMCNPSignal = hD0DcaMCNPSignal0;
		hD0DcaData->Fit("fMix","E QN0");

		c4->SaveAs(Form("plots/PbPb_%.0f_%.0f_fit.pdf",ptLow,ptHigh));

		c1->cd();

		TH1D* hD0DcaDataOverFit = (TH1D*)hD0DcaData->Clone("hD0DcaDataOverFit");
		hD0DcaDataOverFit->Divide(fMix);
		hD0DcaDataOverFit->GetYaxis()->SetTitle("data / fit");
		hD0DcaDataOverFit->GetYaxis()->SetRangeUser(0,5);
		hD0DcaDataOverFit->GetXaxis()->SetRangeUser(0,0.07);
		setColorTitleLabel(hD0DcaDataOverFit, 1);
		hD0DcaDataOverFit->Draw("e");

		TF1* fLine1 = new TF1("fLine1", "1", 0,1);
		fLine1->Draw("same");
		hD0DcaDataOverFit->Draw("esame");

		c1->SaveAs(Form("plots/dataOverFit_%.0f_%.0f_fit.pdf",ptLow,ptHigh));

		delete hD0DcaMCPSignal;
		delete hD0DcaMCNPSignal;

	} // end for i ptbins
	c1->cd();

	TH1D* hStupidJie = new TH1D("hStupidJie", "", 100, 0, 100);
	hStupidJie->GetYaxis()->SetRangeUser(0,1);
	hStupidJie->GetXaxis()->SetTitle("p_{T} (GeV/c)");
	hStupidJie->GetYaxis()->SetTitle("prompt fraction");
	hStupidJie->SetStats(0);
	hStupidJie->Draw();
	TGraph* grFraction = new TGraph(nPtBins, pts, promptFraction);
	grFraction->SetName("grPromptFraction");
	grFraction->SetMarkerStyle(20);
	grFraction->Draw("psame");

	c1->SaveAs("promptFraction.pdf");

	c1->SetLogy();

	TH1D* hBtoDRawYield = new TH1D("hBtoDRawYield", ";p_{T} (GeV/c);dN/dp_{T} ((GeV/c)^{-1})", nPtBins, ptBins);
	for(int i=1; i<=nPtBins; i++)
	{
		if(bToDYield[i-1] <= 0) continue;
		hBtoDRawYield->SetBinContent(i, bToDYield[i-1]);
		hBtoDRawYield->SetBinError(i, bToDYieldError[i-1]);
	}
	divideBinWidth(hBtoDRawYield);
	setColorTitleLabel(hBtoDRawYield, 1);
	c1->SetBottomMargin(0.14);
	hBtoDRawYield->Draw("p");
	c1->SaveAs("BtoD.pdf");

	TH1D* hPromptDRawYield = new TH1D("hPromptDRawYield", ";p_{T} (GeV/c);dN/dp_{T} ((GeV/c)^{-1})", nPtBins, ptBins);
	for(int i=1; i<=nPtBins; i++)
	{
		if(promptDYield[i-1] <= 0) continue;
		hPromptDRawYield->SetBinContent(i, promptDYield[i-1]);
		hPromptDRawYield->SetBinError(i, promptDYieldError[i-1]);
	}
	divideBinWidth(hPromptDRawYield);
	setColorTitleLabel(hPromptDRawYield, 1);
	c1->SetBottomMargin(0.14);
	hPromptDRawYield->Draw("p");
	c1->SaveAs("promptD.pdf");

	TH1D* hTotalDYieldInvMassFit = new TH1D("hTotalDYieldInvMassFit", ";p_{T} (GeV/c);dN/dp_{T} ((GeV/c)^{-1})", nPtBins, ptBins);
	for(int i=1; i<=nPtBins; i++)
	{
		if(totalYieldInvMassFit[i-1] <= 0) continue;
		hTotalDYieldInvMassFit->SetBinContent(i, totalYieldInvMassFit[i-1]);
		hTotalDYieldInvMassFit->SetBinError(i, totalYieldInvMassFitError[i-1]);
	}
	divideBinWidth(hTotalDYieldInvMassFit);
	setColorTitleLabel(hTotalDYieldInvMassFit, 1);
	hTotalDYieldInvMassFit->Draw("p");
	c1->SaveAs("totalDInvMassFit.pdf");

	TFile* fOut = new TFile("bFeedDownResult.root", "recreate");
	fOut->WriteTObject(grFraction);
	fOut->WriteTObject(hBtoDRawYield);
	fOut->WriteTObject(hPromptDRawYield);
	fOut->WriteTObject(hTotalDYieldInvMassFit);
	fOut->Write();
	fOut->Close();
}
Пример #12
0
//______________________________________________________________________________
void CheckPulsers(const Char_t* loc)
{
    // Some old pedestal checking method.

    Char_t t[256];

    // number of runs
    Int_t nRuns = gFiles->GetSize();

    // number of channels
    Int_t nCh = gReadAR->GetNelements();

    // create arrays
    Double_t** pedPos = new Double_t*[nCh];
    Double_t* runNumbersD = new Double_t[nRuns];
    for (Int_t i = 0; i < nCh; i++) pedPos[i] = new Double_t[nRuns];

    // open the output files
    TFile* fROOTout = new TFile("/tmp/pulser.root", "RECREATE");

    // create directories
    for (Int_t i = 0; i < nCh; i++)
    {
        sprintf(t, "%03d_%s", i, gReadAR->GetElement(i)->GetTDC());
        fROOTout->mkdir(t);
    }
    
    TF1* func = new TF1("gausfunc", "gaus", 0 , 200);

    // loop over runs
    for (Int_t i = 0; i < nRuns; i++)
    {   
        // get the file
        TFile* f = (TFile*) gFiles->At(i);

        // extract run number
        Int_t runNumber;
        sprintf(t, "%s/ARHistograms_CB_%%d.root", loc);
        sscanf(f->GetName(), t, &runNumber);
        runNumbersD[i] = (Double_t)runNumber;

        printf("Processing run %d (%d/%d)\n", runNumber, i+1, nRuns);

        fROOTout->cd();

        // loop over TDCs
        for (Int_t j = 0; j < nCh; j++)
        {
            // load histogram
            sprintf(t, "%03d_%s", j, gReadAR->GetElement(j)->GetTDC());
            fROOTout->cd(t);
            sprintf(t, "ADC%s", gReadAR->GetElement(j)->GetTDC());
            TH1D* h = (TH1D*) f->Get(t);
            
            // fit gaussian to pulser
            Double_t maxPos = h->GetXaxis()->GetBinCenter(h->GetMaximumBin());
            func->SetParameters(1, maxPos, 0.1);
            func->SetRange(maxPos - 2, maxPos + 2);
            h->Fit(func, "RBQ");
            maxPos = func->GetParameter(1);
            
            // save position in file and memory
            pedPos[j][i] = maxPos;

            sprintf(t, "Run_%d", runNumber);
            TCanvas* c = new TCanvas(t, t);
            h->Draw();
            
            TLine* tline = new TLine(maxPos, 0, maxPos, 10000);
            tline->SetLineColor(kRed);
            tline->SetLineWidth(2);
            tline->Draw();
            
            c->Write(c->GetName(), TObject::kOverwrite);
    
            delete h;
            delete c;
            delete tline;
        }
    }
    
    // create pedestal evolution graphs
    fROOTout->cd();
    
    // loop over channels
    for (Int_t j = 0; j < nCh; j++)
    {
        printf("Creating pedestal graph for channel %d\n", j);
        
        TGraph* g = new TGraph(nRuns, runNumbersD, pedPos[j]);
        sprintf(t, "Overview_%03d_%s", j, gReadAR->GetElement(j)->GetTDC());
        g->SetName(t);
        g->SetTitle(t);
        //g->GetYaxis()->SetRangeUser(1200, 1300);
        g->Write(g->GetName(), TObject::kOverwrite);
        
        delete g;
    }

    printf("Saving output file\n");
    
    delete fROOTout;

    // cleanup
    for (Int_t i = 0; i < nCh; i++) delete [] pedPos[i];
    delete [] pedPos;
    delete [] runNumbersD;
}
void fitLMC_c070116_LL1_floatsigmalfixmu_nobkg()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Wed Jul  6 19:50:47 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(3754.321,-26.4,6223.457,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_47a6360__1 = new TH1D("frame_47a6360__1","",100,4100,6100);
   frame_47a6360__1->SetBinContent(1,11.22376);
   frame_47a6360__1->SetMinimum(-8.8);
   frame_47a6360__1->SetMaximum(8.8);
   frame_47a6360__1->SetEntries(1);
   frame_47a6360__1->SetDirectory(0);
   frame_47a6360__1->SetStats(0);
   frame_47a6360__1->SetLineWidth(2);
   frame_47a6360__1->SetMarkerStyle(20);
   frame_47a6360__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_47a6360__1->GetXaxis()->SetNdivisions(505);
   frame_47a6360__1->GetXaxis()->SetLabelFont(132);
   frame_47a6360__1->GetXaxis()->SetLabelOffset(0.01);
   frame_47a6360__1->GetXaxis()->SetLabelSize(0.15);
   frame_47a6360__1->GetXaxis()->SetTitleSize(0.2);
   frame_47a6360__1->GetXaxis()->SetTitleOffset(1.1);
   frame_47a6360__1->GetXaxis()->SetTitleFont(132);
   frame_47a6360__1->GetYaxis()->SetTitle("Pull");
   frame_47a6360__1->GetYaxis()->CenterTitle(true);
   frame_47a6360__1->GetYaxis()->SetNdivisions(505);
   frame_47a6360__1->GetYaxis()->SetLabelFont(132);
   frame_47a6360__1->GetYaxis()->SetLabelOffset(0.01);
   frame_47a6360__1->GetYaxis()->SetLabelSize(0.15);
   frame_47a6360__1->GetYaxis()->SetTitleSize(0.15);
   frame_47a6360__1->GetYaxis()->SetTitleOffset(0.45);
   frame_47a6360__1->GetYaxis()->SetTitleFont(132);
   frame_47a6360__1->GetZaxis()->SetLabelFont(132);
   frame_47a6360__1->GetZaxis()->SetLabelSize(0.06);
   frame_47a6360__1->GetZaxis()->SetTitleSize(0.072);
   frame_47a6360__1->GetZaxis()->SetTitleOffset(1.2);
   frame_47a6360__1->GetZaxis()->SetTitleFont(132);
   frame_47a6360__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[87] = {
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030};
   Double_t pull_Hist_curvetot_fy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0.7803311,
   1.427949,
   0.06505515,
   9.054404,
   9.644772,
   0.7725062,
   0.8209224,
   0.8516202,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_felx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(87,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf",100,4138,6202);
   Graph_pull_Hist_curvetot3001->SetMinimum(-2.092917);
   Graph_pull_Hist_curvetot3001->SetMaximum(11.80274);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_47a6360__2 = new TH1D("frame_47a6360__2","",100,4100,6100);
   frame_47a6360__2->SetBinContent(1,11.22376);
   frame_47a6360__2->SetMinimum(-8.8);
   frame_47a6360__2->SetMaximum(8.8);
   frame_47a6360__2->SetEntries(1);
   frame_47a6360__2->SetDirectory(0);
   frame_47a6360__2->SetStats(0);
   frame_47a6360__2->SetLineWidth(2);
   frame_47a6360__2->SetMarkerStyle(20);
   frame_47a6360__2->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_47a6360__2->GetXaxis()->SetNdivisions(505);
   frame_47a6360__2->GetXaxis()->SetLabelFont(132);
   frame_47a6360__2->GetXaxis()->SetLabelOffset(0.01);
   frame_47a6360__2->GetXaxis()->SetLabelSize(0.15);
   frame_47a6360__2->GetXaxis()->SetTitleSize(0.2);
   frame_47a6360__2->GetXaxis()->SetTitleOffset(1.1);
   frame_47a6360__2->GetXaxis()->SetTitleFont(132);
   frame_47a6360__2->GetYaxis()->SetTitle("Pull");
   frame_47a6360__2->GetYaxis()->CenterTitle(true);
   frame_47a6360__2->GetYaxis()->SetNdivisions(505);
   frame_47a6360__2->GetYaxis()->SetLabelFont(132);
   frame_47a6360__2->GetYaxis()->SetLabelOffset(0.01);
   frame_47a6360__2->GetYaxis()->SetLabelSize(0.15);
   frame_47a6360__2->GetYaxis()->SetTitleSize(0.15);
   frame_47a6360__2->GetYaxis()->SetTitleOffset(0.45);
   frame_47a6360__2->GetYaxis()->SetTitleFont(132);
   frame_47a6360__2->GetZaxis()->SetLabelFont(132);
   frame_47a6360__2->GetZaxis()->SetLabelSize(0.06);
   frame_47a6360__2->GetZaxis()->SetTitleSize(0.072);
   frame_47a6360__2->GetZaxis()->SetTitleOffset(1.2);
   frame_47a6360__2->GetZaxis()->SetTitleFont(132);
   frame_47a6360__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(0,0,1,1);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetLogy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4645af0__3 = new TH1D("frame_4645af0__3","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4645af0__3->SetBinContent(1,3310.288);
   frame_4645af0__3->SetMinimum(0);
   frame_4645af0__3->SetMaximum(7500);
   frame_4645af0__3->SetEntries(2);
   frame_4645af0__3->SetDirectory(0);
   frame_4645af0__3->SetStats(0);
   frame_4645af0__3->SetLineWidth(2);
   frame_4645af0__3->SetMarkerStyle(20);
   frame_4645af0__3->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4645af0__3->GetXaxis()->SetNdivisions(505);
   frame_4645af0__3->GetXaxis()->SetLabelFont(132);
   frame_4645af0__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4645af0__3->GetXaxis()->SetLabelSize(0.06);
   frame_4645af0__3->GetXaxis()->SetTitleSize(0.072);
   frame_4645af0__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4645af0__3->GetXaxis()->SetTitleFont(132);
   frame_4645af0__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4645af0__3->GetYaxis()->SetLabelFont(132);
   frame_4645af0__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4645af0__3->GetYaxis()->SetLabelSize(0.06);
   frame_4645af0__3->GetYaxis()->SetTitleSize(0.072);
   frame_4645af0__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4645af0__3->GetYaxis()->SetTitleFont(132);
   frame_4645af0__3->GetZaxis()->SetLabelFont(132);
   frame_4645af0__3->GetZaxis()->SetLabelSize(0.06);
   frame_4645af0__3->GetZaxis()->SetTitleSize(0.072);
   frame_4645af0__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4645af0__3->GetZaxis()->SetTitleFont(132);
   frame_4645af0__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   4110,
   4130,
   4150,
   4170,
   4190,
   4210,
   4230,
   4250,
   4270,
   4290,
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030,
   6050,
   6070,
   6090};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   5,
   30,
   1308,
   1283,
   36,
   7,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr",100,3900,6300);
   Graph_Hist3002->SetMinimum(1.478583);
   Graph_Hist3002->SetMaximum(1478.583);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t curvetot_fy1[128] = {
   2.641671e-14,
   3.083583e-14,
   3.606647e-14,
   4.22713e-14,
   4.964839e-14,
   5.843959e-14,
   6.894096e-14,
   8.151596e-14,
   9.661198e-14,
   1.147814e-13,
   1.367083e-13,
   1.632422e-13,
   1.954419e-13,
   2.34631e-13,
   2.824697e-13,
   3.410475e-13,
   4.130042e-13,
   5.016864e-13,
   6.113531e-13,
   7.474463e-13,
   9.169469e-13,
   1.128848e-12,
   1.394785e-12,
   1.72988e-12,
   2.153878e-12,
   2.692683e-12,
   3.380449e-12,
   4.262445e-12,
   5.398991e-12,
   6.870912e-12,
   8.787139e-12,
   1.129537e-11,
   1.459713e-11,
   1.896921e-11,
   2.479432e-11,
   3.260552e-11,
   4.315072e-11,
   5.748756e-11,
   7.712394e-11,
   1.042282e-10,
   1.419463e-10,
   1.948863e-10,
   2.698652e-10,
   3.770732e-10,
   5.319131e-10,
   7.57939e-10,
   1.091619e-09,
   1.590156e-09,
   2.34454e-09,
   3.501654e-09,
   5.30238e-09,
   8.14847e-09,
   1.272218e-08,
   2.020476e-08,
   3.268456e-08,
   5.393757e-08,
   9.095971e-08,
   1.570604e-07,
   2.783015e-07,
   5.073559e-07,
   9.544428e-07,
   1.85923e-06,
   3.765582e-06,
   7.96795e-06,
   1.771712e-05,
   4.168914e-05,
   0.0001047096,
   0.000283768,
   0.0008411969,
   0.002776511,
   0.0104477,
   0.04629297,
   0.252919,
   1.825081,
   5.617464,
   19.40548,
   37.96221,
   53.87247,
   77.25328,
   112.0161,
   164.3475,
   244.1745,
   367.6418,
   559.4869,
   852.6256,
   1280.633,
   1850.024,
   2487.092,
   2999.567,
   3152.655,
   2862.992,
   2283.252,
   1652.74,
   1126.108,
   744.5742,
   488.1311,
   321.6216,
   214.6282,
   145.6341,
   100.639,
   70.84377,
   50.7748,
   37.01846,
   20.62332,
   12.14304,
   2.199217,
   0.6133427,
   0.2223733,
   0.09598214,
   0.04688729,
   0.02511773,
   0.01445048,
   0.008799079,
   0.005611409,
   0.003718549,
   0.002545241,
   0.001790992,
   0.001290737,
   0.0009498223,
   0.0007119077,
   0.0005423525,
   0.0004192375,
   0.0003283356,
   0.0002601995,
   0.0002084266,
   0.0001685961,
   0.0001376041,
   0.0001376041};
   TGraph *graph = new TGraph(128,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",128,4126,6214);
   Graph_curvetot1->SetMinimum(2.377504e-14);
   Graph_curvetot1->SetMaximum(3467.921);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t sigL_fx2[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t sigL_fy2[128] = {
   2.641671e-14,
   3.083583e-14,
   3.606647e-14,
   4.22713e-14,
   4.964839e-14,
   5.843959e-14,
   6.894096e-14,
   8.151596e-14,
   9.661198e-14,
   1.147814e-13,
   1.367083e-13,
   1.632422e-13,
   1.954419e-13,
   2.34631e-13,
   2.824697e-13,
   3.410475e-13,
   4.130042e-13,
   5.016864e-13,
   6.113531e-13,
   7.474463e-13,
   9.169469e-13,
   1.128848e-12,
   1.394785e-12,
   1.72988e-12,
   2.153878e-12,
   2.692683e-12,
   3.380449e-12,
   4.262445e-12,
   5.398991e-12,
   6.870912e-12,
   8.787139e-12,
   1.129537e-11,
   1.459713e-11,
   1.896921e-11,
   2.479432e-11,
   3.260552e-11,
   4.315072e-11,
   5.748756e-11,
   7.712394e-11,
   1.042282e-10,
   1.419463e-10,
   1.948863e-10,
   2.698652e-10,
   3.770732e-10,
   5.319131e-10,
   7.57939e-10,
   1.091619e-09,
   1.590156e-09,
   2.34454e-09,
   3.501654e-09,
   5.30238e-09,
   8.14847e-09,
   1.272218e-08,
   2.020476e-08,
   3.268456e-08,
   5.393757e-08,
   9.095971e-08,
   1.570604e-07,
   2.783015e-07,
   5.073559e-07,
   9.544428e-07,
   1.85923e-06,
   3.765582e-06,
   7.96795e-06,
   1.771712e-05,
   4.168914e-05,
   0.0001047096,
   0.000283768,
   0.0008411969,
   0.002776511,
   0.0104477,
   0.04629297,
   0.252919,
   1.825081,
   5.617464,
   19.40548,
   37.96221,
   53.87247,
   77.25328,
   112.0161,
   164.3475,
   244.1745,
   367.6418,
   559.4869,
   852.6256,
   1280.633,
   1850.024,
   2487.092,
   2999.567,
   3152.655,
   2862.992,
   2283.252,
   1652.74,
   1126.108,
   744.5742,
   488.1311,
   321.6216,
   214.6282,
   145.6341,
   100.639,
   70.84377,
   50.7748,
   37.01846,
   20.62332,
   12.14304,
   2.199217,
   0.6133427,
   0.2223733,
   0.09598214,
   0.04688729,
   0.02511773,
   0.01445048,
   0.008799079,
   0.005611409,
   0.003718549,
   0.002545241,
   0.001790992,
   0.001290737,
   0.0009498223,
   0.0007119077,
   0.0005423525,
   0.0004192375,
   0.0003283356,
   0.0002601995,
   0.0002084266,
   0.0001685961,
   0.0001376041,
   0.0001376041};
   graph = new TGraph(128,sigL_fx2,sigL_fy2);
   graph->SetName("sigL");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_sigL2 = new TH1F("Graph_sigL2","Projection of totalPdf",128,4126,6214);
   Graph_sigL2->SetMinimum(2.377504e-14);
   Graph_sigL2->SetMaximum(3467.921);
   Graph_sigL2->SetDirectory(0);
   Graph_sigL2->SetStats(0);
   Graph_sigL2->SetLineWidth(2);
   Graph_sigL2->SetMarkerStyle(20);
   Graph_sigL2->GetXaxis()->SetNdivisions(505);
   Graph_sigL2->GetXaxis()->SetLabelFont(132);
   Graph_sigL2->GetXaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetXaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetXaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetXaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetXaxis()->SetTitleFont(132);
   Graph_sigL2->GetYaxis()->SetLabelFont(132);
   Graph_sigL2->GetYaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetYaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetYaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetYaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetYaxis()->SetTitleFont(132);
   Graph_sigL2->GetZaxis()->SetLabelFont(132);
   Graph_sigL2->GetZaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetZaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetZaxis()->SetTitleOffset(1.2);
   Graph_sigL2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_sigL2);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sigL","#Lambda signal (hypatia)","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4645af0__4 = new TH1D("frame_4645af0__4","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4645af0__4->SetBinContent(1,3310.288);
   frame_4645af0__4->SetMinimum(0);
   frame_4645af0__4->SetMaximum(7500);
   frame_4645af0__4->SetEntries(2);
   frame_4645af0__4->SetDirectory(0);
   frame_4645af0__4->SetStats(0);
   frame_4645af0__4->SetLineWidth(2);
   frame_4645af0__4->SetMarkerStyle(20);
   frame_4645af0__4->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4645af0__4->GetXaxis()->SetNdivisions(505);
   frame_4645af0__4->GetXaxis()->SetLabelFont(132);
   frame_4645af0__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4645af0__4->GetXaxis()->SetLabelSize(0.06);
   frame_4645af0__4->GetXaxis()->SetTitleSize(0.072);
   frame_4645af0__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4645af0__4->GetXaxis()->SetTitleFont(132);
   frame_4645af0__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4645af0__4->GetYaxis()->SetLabelFont(132);
   frame_4645af0__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4645af0__4->GetYaxis()->SetLabelSize(0.06);
   frame_4645af0__4->GetYaxis()->SetTitleSize(0.072);
   frame_4645af0__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4645af0__4->GetYaxis()->SetTitleFont(132);
   frame_4645af0__4->GetZaxis()->SetLabelFont(132);
   frame_4645af0__4->GetZaxis()->SetLabelSize(0.06);
   frame_4645af0__4->GetZaxis()->SetTitleSize(0.072);
   frame_4645af0__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4645af0__4->GetZaxis()->SetTitleFont(132);
   frame_4645af0__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Пример #14
0
TGraph * gr2contour(RooSplineND *spline, RooRealVar &ldu, RooRealVar &lVu, RooRealVar &kuu, int type, double level, double minNLL, double best_x, double best_y, double step_r, double step_th)
{

	TGraph *points = new TGraph();
	int pcounter = 0;

   	double Vldu, VlVu, Vkuu; // holders for the values

        // Define 0 as the +ve Y-axis
	std::cout << " Centered at (type) " << best_x << ", " << best_y << ", " << type << std::endl;
	std::cout << " Minimum assumed to be " << minNLL << std::endl;
	TGraph *thepoints = new TGraph();
	int pointcounter =0 ;

	//for (double th=0; th<2*TMath::Pi();th+=step_th){
	for (double th=0.001; th<=10;th+=step_th){
	//for (double th=5.; th<6.;th+=0.2){	

		double r_pre_level=-1;
		double val_pre_level=-1;

		bool iscontained=true;
		//double r=0.05;
		double r=-0.99;

		bool invertLogic=false;
		while (iscontained){

		 double x = get_x(r,th,best_x);
		 double y = get_y(r,th,best_y);

		 if (x > 1 || y > 10 || x < -1 || y < 0.0001 ){
			iscontained=false;
			break;
		 }

   		 // x = cos(b-a) and y=tanb
		 if (type==1)type1(x, y, &Vldu, &VlVu, &Vkuu);
		 if (type==2)type2(x, y, &Vldu, &VlVu, &Vkuu);
		 double val = 1000;
		 if ( Vldu < ldu.getMax() && Vldu > ldu.getMin() && VlVu < lVu.getMax() && VlVu > lVu.getMin() && Vkuu < kuu.getMax() && Vkuu > kuu.getMin() ){

          	   ldu.setVal(Vldu);
          	   lVu.setVal(VlVu);
          	   kuu.setVal(Vkuu);

	  	   val = 2*spline->getVal() - minNLL;
		 }

		 if ( (invertLogic && val<level) || ( (!invertLogic) && val>level) ){
			double ave_r = interp(r,val,r_pre_level,val_pre_level,level);  // Do a better interpolation later
			if (get_x(ave_r,th,best_x) > -0.89 && get_x(ave_r,th,best_x) < 0.89 && y>0.05 && y < 11){
			  points->SetPoint(pcounter,get_x(ave_r,th,best_x),get_y(ave_r,th,best_y));
			  pcounter++;
			  //break;
			  //std::cout << " Oh I found a cheeky point!  x, y=" << get_x(ave_r,th,best_x) << ", " << get_y(ave_r,th,best_y) << ", (ave_r,th, r,r_pre=)" << ave_r << ", " << th << " avarage from " << r << ", " <<  r_pre_level << " (value,val_pre) == " << val << ", " << val_pre_level <<  std::endl;
			}
			invertLogic=(!invertLogic);
		 //} else {
		 }
		 r_pre_level = r;
		 val_pre_level = val;
		 //}
		 thepoints->SetPoint(pointcounter,get_x(r,th,best_x),get_y(r,th,best_y));
		 pointcounter++;

		 r+=step_r;
		}
	}

	points->SetMarkerStyle(20);
	points->SetMarkerSize(0.5);

        thepoints->SetMarkerColor(kRed);
	//thepoints->Draw("AP");
	//points->Draw("apL");

	return points;
}
Пример #15
0
void get_results(){
  
  gROOT->SetStyle("Plain");
  
  printf("\n");
  printf(" ---------------------------------------------------------------------------\n");
  printf("                Sensitivity vs. nSig and Sigma in Fit\n");
  printf(" ---------------------------------------------------------------------------\n");
  printf(" nSig / SigFit--> |    0.1   |   0.2   |   0.3   |   0.4   |  W. Avg  (val) \n");
  printf(" ---------------------------------------------------------------------------\n");

  
  Double_t p1x, p1y;
  Double_t p2x, p2y;
  Double_t ix, iy;
  
  TObjArray *a1 = new TObjArray(0);
  
  TGraph *graph0130 = new TGraph(5);
  graph0130->SetTitle("Sensitivity vs. Sig-fit");
  graph0130->SetName("graph0130");
  
  TGraph *graph1 = new TGraph(5);
  graph1->SetTitle("Sensitivity vs. Sig-fit");
  graph1->SetName("graph1");
  
  TGraph *graph0196 = new TGraph(5);
  graph0196->SetTitle("Sensitivity vs. Sig-fit");
  graph0196->SetName("graph0196");
  
  TCanvas *can1 = new TCanvas("can1", "varfits1", 1500, 900);
  can1->Divide(5,3);
  
  /***************************************************************************
     nSig = 0.130							      
   ****************************************************************************/
  
  // =================== nsig=0.130, tSig=0.1 Sig-fit=0.1 ==================
  can1->cd(1);
  gPad->SetGrid();
  
  TFile lhns("varsig0130_1.root");
  TGraph *gs130_1 = (TGraph*)lhns.Get("DilErrvsdm");
  gs130_1->SetTitle("nSig=0.130, tSig=0.1, Sig-fit=0.1");
  gs130_1->SetName("gs130_1");
  gs130_1->GetXaxis()->SetTitle("dm");
  gs130_1->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs130_1->Draw("AP*");
  
  gs130_1->GetPoint(16, p1x, p1y);
  gs130_1->GetPoint(17, p2x, p2y);
  
  Double_t vs130_1 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);
  
  graph0130->SetPoint(0,0.1,vs130_1);
  
  a1.Add(gs130_1);
  
  // =================== nsig=0.130, tSig=0.1 Sig-fit=0.2 ==================
  can1->cd(2);
  gPad->SetGrid();
  
  TFile lhns("varsig0130_2.root");
  TGraph *gs130_2 = (TGraph*)lhns.Get("DilErrvsdm");
  gs130_2->SetTitle("nSig=0.130, tSig=0.1, Sig-fit=0.2");
  gs130_2->SetName("gs130_2");
  gs130_2->GetXaxis()->SetTitle("dm");
  gs130_2->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs130_2->Draw("AP*");
  
  gs130_2->GetPoint(14, p1x, p1y);
  gs130_2->GetPoint(15, p2x, p2y);
  
  Double_t vs130_2 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);
  
  graph0130->SetPoint(1,0.2,vs130_2);
  
  a1.Add(gs130_2);
  
  // =================== nsig=0.130, tSig=0.1 Sig-fit=0.3 ====================
  can1->cd(3);
  gPad->SetGrid();
  
  TFile lhns("varsig0130_3.root");
  TGraph *gs130_3 = (TGraph*)lhns.Get("DilErrvsdm");
  gs130_3->SetTitle("nSig=0.130, tSig=0.1, Sig-fit=0.3");
  gs130_3->SetName("gs130_3");
  gs130_3->GetXaxis()->SetTitle("dm");
  gs130_3->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs130_3->Draw("AP*");
  
  gs130_3->GetPoint(10, p1x, p1y);
  gs130_3->GetPoint(11, p2x, p2y);
  
  Double_t vs130_3 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);
  
  graph0130->SetPoint(2,0.3,vs130_3);
  
  a1.Add(gs130_3);
  
  // =================== nsig=0.130, tSig=0.1 Sig-fit=0.4 ====================
  can1->cd(4);
  gPad->SetGrid();
  
  TFile lhns("varsig0130_4.root");
  TGraph *gs130_4 = (TGraph*)lhns.Get("DilErrvsdm");
  gs130_4->SetTitle("nSig=0.130, tSig=0.1, Sig-fit=0.4");
  gs130_4->SetName("gs130_4");
  gs130_4->GetXaxis()->SetTitle("dm");
  gs130_4->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs130_4->Draw("AP*");
  
  gs130_4->GetPoint(13, p1x, p1y);
  gs130_4->GetPoint(14, p2x, p2y);
  
  Double_t vs130_4 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);
  
  graph0130->SetPoint(3,0.4,vs130_4);
  
  a1.Add(gs130_4);
  
  // =================== nsig=0.130, tSig=0.1 Sig-fit=Avg =====================
  can1->cd(5);
  gPad->SetGrid();
  
  TFile lhns("varsig0130_a.root");
  TGraph *gs130_a = (TGraph*)lhns.Get("DilErrvsdm");
  gs130_a->SetTitle("nSig=0.130, tSig=0.1, Sig-fit=Avg");
  gs130_a->SetName("gs130_a");
  gs130_a->GetXaxis()->SetTitle("dm");
  gs130_a->GetYaxis()->SetTitle("95% CL");

  TGraph *gs130_sf = (TGraph*)lhns.Get("SigFit");
  gs130_sf->SetTitle("Sigma_Avg in Fit vs. dm , nSig=0.130");
  gs130_sf->SetName("gs130_sf");
  gs130_sf->GetXaxis()->SetTitle("dm");
  gs130_sf->GetYaxis()->SetTitle("Sigma in Fit");
  
  lhns.Close();
  
  gs130_a->Draw("AP*");
  
  gs130_a->GetPoint(12, p1x, p1y);
  gs130_a->GetPoint(13, p2x, p2y);
  
  Double_t vs130_a = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph0130->SetPoint(4,0.270111,vs130_a);

  a1.Add(gs130_a);
  a1.Add(gs130_sf);

  printf("       0.130      |  %5.3f  |  %5.3f  |  %5.3f  |  %5.3f  |  %5.3f (0.270) \n",vs130_1,vs130_2,vs130_3,vs130_4,vs130_a);

   //----------- plot the sig-fit vs. dm; histogram sig-fit  ----- 
  TCanvas *c0130sf = new TCanvas("Sigfit_vs_dm_0130", "graph0130sf", 800, 400);
  c0130sf->Divide(2,1);
  c0130sf->cd(1);
  gPad->SetGrid();
  gs130_sf->Draw("AP*");
  
  c0130sf->cd(2);
  TH1F *hs0130_sf = new TH1F("hs0130_sf", "SigFit spread, nSig=0.130", 10, 0.26, 0.28);
  for (Int_t i=0.; i<20.; i++){
    gs130_sf->GetPoint(i,ix,iy);
    //cout << i << ", "<< ix << ", "<< iy <<endl;
    hs0130_sf->Fill(iy);
  }
  gPad->SetGrid();
  hs0130_sf->Draw();

  a1.Add(hs0130_sf);
  a1.Add(c0130sf);
  //--------------- plot the sensitivity vs sig-fit -----------
  TCanvas *c0130 = new TCanvas("Sens_vs_sigfit_0130", "graph0130", 400, 400);
  c0130->SetGrid();
  graph0130->GetXaxis()->SetTitle("Sigma in fit");
  graph0130->GetYaxis()->SetTitle("Sensitivity");
  graph0130->Draw("AP*");

  a1.Add(graph0130);
  a1.Add(c0130);

 
  /***************************************************************************
	nSig = 0.163								      
   **************************************************************************/

  //  ================== nsig=0.163, tSig=0.1 Sig-fit=0.1 ==================
  can1->cd(6);
  gPad->SetGrid();
  
  TFile lhns("varsigma_1.root");
  TGraph *gs1 = (TGraph*)lhns.Get("DilErrvsdm");
  gs1->SetTitle("nSig=0.163, tSig=0.1, Sig-fit=0.1");
  gs1->SetName("gs1");
  gs1->GetXaxis()->SetTitle("dm");
  gs1->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs1->Draw("AP*");
 
  gs1->GetPoint(16, p1x, p1y);
  gs1->GetPoint(17, p2x, p2y);

  Double_t vs1 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph1->SetPoint(0,0.1,vs1);
 
  a1.Add(gs1);
 
  //  ================== nsig=0.163, tSig=0.1 Sig-fit=0.2 ==================
  can1->cd(7);
  gPad->SetGrid();
  
  TFile lhns("varsigma_2.root");
  TGraph *gs2 = (TGraph*)lhns.Get("DilErrvsdm");
  gs2->SetTitle("nSig=0.163, tSig=0.1, Sig-fit=0.2");
  gs2->SetName("gs2");
  gs2->GetXaxis()->SetTitle("dm");
  gs2->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs2->Draw("AP*");
 
  gs2->GetPoint(14, p1x, p1y);
  gs2->GetPoint(15, p2x, p2y);

  Double_t vs2 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph1->SetPoint(1,0.2,vs2);

  a1.Add(gs2);
 
  //  ================== nsig=0.163, tSig=0.1 Sig-fit=0.3 ==================
  can1->cd(8);
  gPad->SetGrid();
  
  TFile lhns("varsigma_3.root");
  TGraph *gs3 = (TGraph*)lhns.Get("DilErrvsdm");
  gs3->SetTitle("nSig=0.163, tSig=0.1, Sig-fit=0.3");
  gs3->SetName("gs3");
  gs3->GetXaxis()->SetTitle("dm");
  gs3->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs3->Draw("AP*");
 
  gs3->GetPoint(10, p1x, p1y);
  gs3->GetPoint(11, p2x, p2y);

  Double_t vs3 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph1->SetPoint(2,0.3,vs3);
  
   a1.Add(gs3);

  // ================== nsig=0.163, tSig=0.1 Sig-fit=0.4 ==================
  can1->cd(9);
  gPad->SetGrid();
  
  TFile lhns("varsigma_4.root");
  TGraph *gs4 = (TGraph*)lhns.Get("DilErrvsdm");
  gs4->SetTitle("nSig=0.163, tSig=0.1, Sig-fit=0.4");
  gs4->SetName("gs4");
  gs4->GetXaxis()->SetTitle("dm");
  gs4->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs4->Draw("AP*");
 
  gs4->GetPoint(13, p1x, p1y);
  gs4->GetPoint(14, p2x, p2y);

  Double_t vs4 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph1->SetPoint(3,0.4,vs4);
  
  a1.Add(gs4);

  // ================== nsig=0.163, tSig=0.1 Sig-fit=Avg ==================
  can1->cd(10);
  gPad->SetGrid();
  
  TFile lhns("varsigma_a.root");
  TGraph *gsa = (TGraph*)lhns.Get("DilErrvsdm");
  gsa->SetTitle("nSig=0.163, tSig=0.1, Sig-fit=Avg");
  gsa->SetName("gsa");
  gsa->GetXaxis()->SetTitle("dm");
  gsa->GetYaxis()->SetTitle("95% CL");

  TGraph *gs_sf = (TGraph*)lhns.Get("SigFit");
  gs_sf->SetTitle("Sigma_Avg in Fit vs. dm , nSig=0.163");
  gs_sf->SetName("gs_sf");
  gs_sf->GetXaxis()->SetTitle("dm");
  gs_sf->GetYaxis()->SetTitle("Sigma in Fit");

  lhns.Close();
  
  gsa->Draw("AP*");
 
  gsa->GetPoint(11, p1x, p1y);
  gsa->GetPoint(12, p2x, p2y);

  Double_t vsa = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph1->SetPoint(4,0.313349,vsa);
 
   a1.Add(gsa);
   a1.Add(gs_sf);

  printf("       0.163      |  %5.3f  |  %5.3f  |  %5.3f  |  %5.3f  |  %5.3f (0.313) \n",vs1,vs2,vs3,vs4,vsa);

   //----------- plot the sig-fit vs. dm; histogram sig-fit  ----- 
  TCanvas *csf = new TCanvas("Sigfit_vs_dm_0163", "graphsf", 800, 400);
  csf->Divide(2,1);
  csf->cd(1);
  gPad->SetGrid();
  gs_sf->Draw("AP*");
  
  csf->cd(2);
  TH1F *hs_sf = new TH1F("hs_sf", "SigFit spread, nSig=0.163", 10, 0.3, 0.325);
  for (Int_t i=0.; i<20.; i++){
    gs_sf->GetPoint(i,ix,iy);
    //cout << i << ", "<< ix << ", "<< iy <<endl;
    hs_sf->Fill(iy);
  }
  gPad->SetGrid();
  hs_sf->Draw();

  a1.Add(hs_sf);
  a1.Add(csf);

  //--------------- plot the sensitivity vs sig-fit -----------
  TCanvas *can2 = new TCanvas("Sens_vs_sigfit_0163", "graph1", 400, 400);
  can2->SetGrid();
  graph1->GetXaxis()->SetTitle("Sigma in fit");
  graph1->GetYaxis()->SetTitle("Sensitivity");
  graph1->Draw("AP*");

   a1.Add(graph1);
   a1.Add(can2);

  /***************************************************************************
	nSig = 0.196								      
   **************************************************************************/

  //  ================== nsig=0.196, tSig=0.1 Sig-fit=0.1 ==================
  can1->cd(11);
  gPad->SetGrid();
  
  TFile lhns("varsig0196_1.root");
  TGraph *gs196_1 = (TGraph*)lhns.Get("DilErrvsdm");
  gs196_1->SetTitle("nSig=0.196, tSig=0.1, Sig-fit=0.1");
  gs196_1->SetName("gs196_1");
  gs196_1->GetXaxis()->SetTitle("dm");
  gs196_1->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs196_1->Draw("AP*");
 
  gs196_1->GetPoint(16, p1x, p1y);
  gs196_1->GetPoint(17, p2x, p2y);

  Double_t vs196_1 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph0196->SetPoint(0,0.1,vs196_1);

  a1.Add(gs196_1);

  // ================== nsig=0.196, tSig=0.1 Sig-fit=0.2 ====================
  can1->cd(12);
  gPad->SetGrid();
  
  TFile lhns("varsig0196_2.root");
  TGraph *gs196_2 = (TGraph*)lhns.Get("DilErrvsdm");
  gs196_2->SetTitle("nSig=0.196, tSig=0.1, Sig-fit=0.2");
  gs196_2->SetName("gs196_2");
  gs196_2->GetXaxis()->SetTitle("dm");
  gs196_2->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs196_2->Draw("AP*");
 
  gs196_2->GetPoint(14, p1x, p1y);
  gs196_2->GetPoint(15, p2x, p2y);

  Double_t vs196_2 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph0196->SetPoint(1,0.2,vs196_2);

  a1.Add(gs196_2);

  // ================== nsig=0.196, tSig=0.1 Sig-fit=0.3 ==================
  can1->cd(13);
  gPad->SetGrid();
  
  TFile lhns("varsig0196_3.root");
  TGraph *gs196_3 = (TGraph*)lhns.Get("DilErrvsdm");
  gs196_3->SetTitle("nSig=0.196, tSig=0.1, Sig-fit=0.3");
  gs196_3->SetName("gs196_3");
  gs196_3->GetXaxis()->SetTitle("dm");
  gs196_3->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs196_3->Draw("AP*");
 
  gs196_3->GetPoint(10, p1x, p1y);
  gs196_3->GetPoint(11, p2x, p2y);

  Double_t vs196_3 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph0196->SetPoint(2,0.3,vs196_3);

  a1.Add(gs196_3);

  // ================== nsig=0.196, tSig=0.1 Sig-fit=0.4 ==================
  can1->cd(14);
  gPad->SetGrid();
  
  TFile lhns("varsig0196_4.root");
  TGraph *gs196_4 = (TGraph*)lhns.Get("DilErrvsdm");
  gs196_4->SetTitle("nSig=0.196, tSig=0.1, Sig-fit=0.4");
  gs196_4->SetName("gs196_4");
  gs196_4->GetXaxis()->SetTitle("dm");
  gs196_4->GetYaxis()->SetTitle("95% CL");
  lhns.Close();
  
  gs196_4->Draw("AP*");
 
  gs196_4->GetPoint(13, p1x, p1y);
  gs196_4->GetPoint(14, p2x, p2y);

  Double_t vs196_4 = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph0196->SetPoint(3,0.4,vs196_4);

  a1.Add(gs196_4);

  // ================== nsig=0.196, tSig=0.1 Sig-fit=Avg ==================
  can1->cd(15);
  gPad->SetGrid();
  
  TFile lhns("varsig0196_a.root");
  TGraph *gs196_a = (TGraph*)lhns.Get("DilErrvsdm");
  gs196_a->SetTitle("nSig=0.196, tSig=0.1, Sig-fit=Avg");
  gs196_a->SetName("gs196_a");
  gs196_a->GetXaxis()->SetTitle("dm");
  gs196_a->GetYaxis()->SetTitle("95% CL");

  TGraph *gs196_sf = (TGraph*)lhns.Get("SigFit");
  gs196_sf->SetTitle("Sigma(Avg) in Fit vs. dm (nSig=0.196)");
  gs196_sf->SetName("gs196_sf");
  gs196_sf->GetXaxis()->SetTitle("dm");
  gs196_sf->GetYaxis()->SetTitle("Sigma in Fit");
  lhns.Close();
  
  gs196_a->Draw("AP*");
 
  gs196_a->GetPoint(10, p1x, p1y);
  gs196_a->GetPoint(11, p2x, p2y);

  Double_t vs196_a = (((1-p1y)/(1-p2y))*p2x - p1x)/(((1-p1y)/(1-p2y))-1);

  graph0196->SetPoint(4,0.356301,vs196_a);

  a1.Add(gs196_a);
  a1.Add(gs196_sf);

  printf("       0.196      |  %5.3f  |  %5.3f  |  %5.3f  |  %5.3f  |  %5.3f (0.270) \n",vs196_1,vs196_2,vs196_3,vs196_4,vs196_a);

   //----------- plot the sig-fit vs. dm; histogram sig-fit  ----- 
  TCanvas *c0196sf = new TCanvas("Sigfit_vs_dm_0196", "graph0196sf", 800, 400);
  c0196sf->Divide(2,1);
  c0196sf->cd(1);
  gPad->SetGrid();
  gs196_sf->Draw("AP*");
  
  c0196sf->cd(2);
  TH1F *hs0196_sf = new TH1F("hs0196_sf", "SigFit spread, nSig=0.196", 10, 0.34, 0.37);
  for (Int_t i=0.; i<20.; i++){
    gs196_sf->GetPoint(i,ix,iy);
    //cout << i << ", "<< ix << ", "<< iy <<endl;
    hs0196_sf->Fill(iy);
  }
  gPad->SetGrid();
  hs0196_sf->Draw();

  a1.Add(hs0196_sf);
  a1.Add(c0196sf);

  //--------------- plot the sensitivity vs sig-fit -----------
  TCanvas *c0196 = new TCanvas("Sens_vs_sigfit_0196", "graph0196", 400, 400);
  c0196->SetGrid();
  graph0196->GetXaxis()->SetTitle("Sigma in fit");
  graph0196->GetYaxis()->SetTitle("Sensitivity");
  graph0196->Draw("AP*");

  a1.Add(graph0196);
  a1.Add(c0196);

  a1.Add(can1);
  //can1->Close();

  /***************************************************************************
   **************************************************************************/

  printf(" ---------------------------------------------------------------------------\n");
  printf("\n");

  TCanvas *combined = new TCanvas("Sens_vs_dm_combined", "combined", 400, 400);
  combined->SetGrid();
  graph0130->SetMarkerColor(4);
  graph0130->SetMarkerStyle(4);
  graph0130->Draw("AP");
  graph1->SetMarkerColor(2);
  graph1->SetMarkerStyle(22);
  graph1->Draw("P");
  graph0196->SetMarkerColor(8);
  graph0196->SetMarkerStyle(28);
  graph0196->Draw("P");

  a1.Add(combined);

  TFile file1("get_results.root", "recreate");
  a1.Write();
  file1.Close();

  }
void Final_av_Lambda_VarCoupling_40Percent()
{
//=========Macro generated from canvas: c/c
//=========  (Sat Feb 27 17:06:04 2016) by ROOT version6.04/06
   TCanvas *c = new TCanvas("c", "c",0,0,800,700);
   c->SetHighLightColor(2);
   c->Range(-0.4813593,1.36281,3.148656,6.672724);
   c->SetFillColor(0);
   c->SetBorderMode(0);
   c->SetBorderSize(2);
   c->SetLogx();
   c->SetLogy();
   c->SetTickx(1);
   c->SetTicky(1);
   c->SetLeftMargin(0.12);
   c->SetRightMargin(0.04);
   c->SetTopMargin(0.07);
   c->SetBottomMargin(0.12);
   c->SetFrameBorderMode(0);
   c->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx1[12] = {
   1,
   10,
   100,
   400,
   700,
   1000,
   1000,
   700,
   400,
   100,
   10,
   1};
   Double_t Graph_fy1[12] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777,
   382.832,
   584.437,
   826.374,
   1079.16,
   1110.85,
   1092.23};
   TGraph *graph = new TGraph(12,Graph_fx1,Graph_fy1);
   graph->SetName("Graph");
   graph->SetTitle("");

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#ffcc00");
   graph->SetFillColor(ci);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph1 = new TH1F("Graph_Graph1","",100,0.9,1099.9);
   Graph_Graph1->SetMinimum(228.5697);
   Graph_Graph1->SetMaximum(1191.057);
   Graph_Graph1->SetDirectory(0);
   Graph_Graph1->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1->SetLineColor(ci);
   Graph_Graph1->GetXaxis()->SetLabelFont(42);
   Graph_Graph1->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleFont(42);
   Graph_Graph1->GetYaxis()->SetLabelFont(42);
   Graph_Graph1->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleFont(42);
   Graph_Graph1->GetZaxis()->SetLabelFont(42);
   Graph_Graph1->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph1);
   
   multigraph->Add(graph,"");
   multigraph->Draw("af");
   multigraph->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   multigraph->GetXaxis()->SetRange(0,96);
   multigraph->GetXaxis()->SetLabelFont(42);
   multigraph->GetXaxis()->SetTitleSize(0.05);
   multigraph->GetXaxis()->SetTitleOffset(1.1);
   multigraph->GetXaxis()->SetTitleFont(42);
   multigraph->GetYaxis()->SetTitle("#Lambda (GeV)");
   multigraph->GetYaxis()->SetLabelFont(42);
   multigraph->GetYaxis()->SetTitleSize(0.05);
   multigraph->GetYaxis()->SetTitleOffset(1.05);
   multigraph->GetYaxis()->SetTitleFont(42);
   
   multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx2[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy2[6] = {
   1092.23,
   1110.85,
   1079.16,
   826.374,
   584.437,
   382.832};
   graph = new TGraph(6,Graph_fx2,Graph_fy2);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph2 = new TH1F("Graph_Graph2","Graph",100,0.9,1099.9);
   Graph_Graph2->SetMinimum(310.0302);
   Graph_Graph2->SetMaximum(1183.652);
   Graph_Graph2->SetDirectory(0);
   Graph_Graph2->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph2->SetLineColor(ci);
   Graph_Graph2->GetXaxis()->SetLabelFont(42);
   Graph_Graph2->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleFont(42);
   Graph_Graph2->GetYaxis()->SetLabelFont(42);
   Graph_Graph2->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleFont(42);
   Graph_Graph2->GetZaxis()->SetLabelFont(42);
   Graph_Graph2->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph2);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx3[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy3[6] = {
   980.038,
   996.742,
   968.943,
   742.067,
   524.44,
   343.371};
   graph = new TGraph(6,Graph_fx3,Graph_fy3);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph3 = new TH1F("Graph_Graph3","Graph",100,0.9,1099.9);
   Graph_Graph3->SetMinimum(278.0339);
   Graph_Graph3->SetMaximum(1062.079);
   Graph_Graph3->SetDirectory(0);
   Graph_Graph3->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph3->SetLineColor(ci);
   Graph_Graph3->GetXaxis()->SetLabelFont(42);
   Graph_Graph3->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleFont(42);
   Graph_Graph3->GetYaxis()->SetLabelFont(42);
   Graph_Graph3->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleFont(42);
   Graph_Graph3->GetZaxis()->SetLabelFont(42);
   Graph_Graph3->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph3);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx4[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy4[6] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777};
   graph = new TGraph(6,Graph_fx4,Graph_fy4);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph4 = new TH1F("Graph_Graph4","Graph",100,0.9,1099.9);
   Graph_Graph4->SetMinimum(249.9998);
   Graph_Graph4->SetMaximum(955.3262);
   Graph_Graph4->SetDirectory(0);
   Graph_Graph4->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph4->SetLineColor(ci);
   Graph_Graph4->GetXaxis()->SetLabelFont(42);
   Graph_Graph4->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleFont(42);
   Graph_Graph4->GetYaxis()->SetLabelFont(42);
   Graph_Graph4->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleFont(42);
   Graph_Graph4->GetZaxis()->SetLabelFont(42);
   Graph_Graph4->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph4);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx5[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy5[6] = {
   1028.6,
   1012.32,
   1016.7,
   751.989,
   524.44,
   360.443};
   graph = new TGraph(6,Graph_fx5,Graph_fy5);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph5 = new TH1F("Graph_Graph5","Graph",100,0.9,1099.9);
   Graph_Graph5->SetMinimum(293.6273);
   Graph_Graph5->SetMaximum(1095.416);
   Graph_Graph5->SetDirectory(0);
   Graph_Graph5->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph5->SetLineColor(ci);
   Graph_Graph5->GetXaxis()->SetLabelFont(42);
   Graph_Graph5->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleFont(42);
   Graph_Graph5->GetYaxis()->SetLabelFont(42);
   Graph_Graph5->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleFont(42);
   Graph_Graph5->GetZaxis()->SetLabelFont(42);
   Graph_Graph5->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph5);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx6[35] = {
   3.981,
   4.365,
   4.786,
   5.248,
   5.754,
   6.31,
   6.918,
   7.586,
   8.318,
   9.12,
   10,
   10.965,
   12.023,
   13.183,
   14.454,
   15.849,
   17.378,
   19.055,
   20.893,
   22.909,
   25.119,
   31.623,
   39.811,
   50.119,
   63.096,
   79.433,
   100,
   125.893,
   158.489,
   199.526,
   251.189,
   316.228,
   1000,
   3162.278,
   10000};
   Double_t Graph_fy6[35] = {
   19.76533,
   32.58338,
   47.96959,
   63.10164,
   79.00995,
   95.55754,
   111.9766,
   129.0118,
   146.2376,
   163.5577,
   179.3658,
   194.9584,
   209.5672,
   223.2999,
   236.0683,
   247.7404,
   258.366,
   268.0662,
   277.1383,
   285.1146,
   292.3901,
   306.3527,
   314.441,
   317.1059,
   314.8684,
   308.9039,
   300.2537,
   289.8022,
   278.2241,
   266.1082,
   253.7422,
   241.4337,
   184.6404,
   139.2985,
   104.656};
   graph = new TGraph(35,Graph_fx6,Graph_fy6);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#6666ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph6 = new TH1F("Graph_Graph6","Graph",100,3.5829,10999.6);
   Graph_Graph6->SetMinimum(17.78879);
   Graph_Graph6->SetMaximum(346.84);
   Graph_Graph6->SetDirectory(0);
   Graph_Graph6->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph6->SetLineColor(ci);
   Graph_Graph6->GetXaxis()->SetLabelFont(42);
   Graph_Graph6->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleFont(42);
   Graph_Graph6->GetYaxis()->SetLabelFont(42);
   Graph_Graph6->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleFont(42);
   Graph_Graph6->GetZaxis()->SetLabelFont(42);
   Graph_Graph6->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph6);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx7[33] = {
   5.050109,
   5.570498,
   6.092375,
   6.79836,
   7.629504,
   8.933253,
   10.64203,
   12.05014,
   13.68495,
   14.93901,
   17.1131,
   19.54765,
   22.0792,
   25.65551,
   29.39341,
   34.84152,
   41.41884,
   48.68491,
   59.2071,
   75.34994,
   97.26741,
   131.0246,
   163.9459,
   202.8261,
   243.2248,
   309.5828,
   383.0166,
   473.8718,
   622.2993,
   833.6,
   1028.448,
   1283.339,
   2026.806};
   Double_t Graph_fy7[33] = {
   71.77067,
   88.82209,
   110.1401,
   130.7052,
   154.2557,
   185.7482,
   213.1504,
   232.735,
   248.5277,
   258.1632,
   268.4587,
   280.1818,
   286.5229,
   293.3758,
   296.7995,
   299.6924,
   299.6947,
   297.0875,
   293.2892,
   285.6511,
   275.8293,
   262.4571,
   252.7364,
   243.3346,
   234.001,
   222.0121,
   212.1495,
   202.5032,
   189.9106,
   177.908,
   168.9168,
   159.7122,
   142.9221};
   graph = new TGraph(33,Graph_fx7,Graph_fy7);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff9900");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph7 = new TH1F("Graph_Graph7","Graph",100,4.545098,2228.982);
   Graph_Graph7->SetMinimum(48.97827);
   Graph_Graph7->SetMaximum(322.4871);
   Graph_Graph7->SetDirectory(0);
   Graph_Graph7->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph7->SetLineColor(ci);
   Graph_Graph7->GetXaxis()->SetLabelFont(42);
   Graph_Graph7->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleFont(42);
   Graph_Graph7->GetYaxis()->SetLabelFont(42);
   Graph_Graph7->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleFont(42);
   Graph_Graph7->GetZaxis()->SetLabelFont(42);
   Graph_Graph7->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph7);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx8[90] = {
   18.74425,
   19.90368,
   20.73627,
   21.82644,
   23.00752,
   24.07546,
   25.0827,
   25.71454,
   26.71212,
   27.99356,
   28.53122,
   29.59491,
   30.69819,
   31.93543,
   33.71249,
   35.53626,
   36.69926,
   39.48566,
   41.74415,
   44.52103,
   47.27444,
   49.54151,
   51.99283,
   54.56543,
   56.59926,
   59.57426,
   61.97591,
   64.94736,
   67.7638,
   72.165,
   77.52983,
   78.67276,
   79.25885,
   79.50015,
   79.8577,
   79.98559,
   80.10781,
   80.93361,
   82.97299,
   85.0636,
   87.3346,
   89.6657,
   93.68976,
   97.60831,
   101.0972,
   103.4923,
   107.3498,
   111.0254,
   114.4909,
   118.2376,
   120.3333,
   131.3772,
   140.9375,
   145.9754,
   148.1289,
   150.9739,
   154.3249,
   158.6761,
   165.3121,
   170.7206,
   172.2259,
   173.4824,
   174.2374,
   175.2489,
   175.7591,
   179.6599,
   186.3538,
   196.4347,
   207.6675,
   217.3037,
   228.0541,
   241.4457,
   256.7473,
   271.0309,
   292.4573,
   319.2919,
   352.6953,
   387.3116,
   421.6106,
   459.6163,
   505.4719,
   563.2603,
   635.9718,
   692.2802,
   745.897,
   789.6904,
   831.1771,
   886.4295,
   950.901,
   983.4362};
   Double_t Graph_fy8[90] = {
   190.042,
   192.3104,
   192.9376,
   195.179,
   197.2136,
   198.0799,
   199.3876,
   199.4802,
   201.01,
   204.4632,
   204.529,
   206.7971,
   208.8441,
   208.9712,
   209.8662,
   210.2649,
   211.3333,
   212.7612,
   214.3898,
   216.0449,
   217.1898,
   218.8107,
   219.1693,
   219.524,
   220.873,
   221.9988,
   223.3628,
   223.7069,
   225.3419,
   225.4478,
   225.5616,
   225.584,
   239.8787,
   256.2561,
   271.2293,
   293.7999,
   304.8973,
   307.0445,
   308.5203,
   309.6434,
   310.7722,
   310.8221,
   310.5429,
   310.2559,
   309.9569,
   309.996,
   311.8566,
   313.3588,
   314.1336,
   315.2763,
   316.7668,
   317.2607,
   317.3559,
   317.4016,
   319.264,
   319.2881,
   319.6855,
   319.7195,
   318.6591,
   318.3273,
   317.9688,
   309.2591,
   300.7849,
   289.5104,
   286.1793,
   286.2011,
   285.5743,
   285.6238,
   285.3433,
   284.0635,
   283.1184,
   281.2031,
   278.656,
   277.7288,
   275.8579,
   273.0541,
   270.9095,
   265.6796,
   261.7535,
   256.9895,
   253.7797,
   247.4406,
   240.1473,
   234.4071,
   229.3303,
   226.7081,
   224.3734,
   220.2731,
   215.7486,
   213.7682};
   graph = new TGraph(90,Graph_fx8,Graph_fy8);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#cc33ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph8 = new TH1F("Graph_Graph8","Graph",100,16.86982,1079.905);
   Graph_Graph8->SetMinimum(177.0742);
   Graph_Graph8->SetMaximum(332.6873);
   Graph_Graph8->SetDirectory(0);
   Graph_Graph8->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph8->SetLineColor(ci);
   Graph_Graph8->GetXaxis()->SetLabelFont(42);
   Graph_Graph8->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleFont(42);
   Graph_Graph8->GetYaxis()->SetLabelFont(42);
   Graph_Graph8->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleFont(42);
   Graph_Graph8->GetZaxis()->SetLabelFont(42);
   Graph_Graph8->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph8);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx9[5] = {
   250,
   500,
   1000,
   3000,
   5000};
   Double_t Graph_fy9[5] = {
   597.2217,
   587.5585,
   450.4588,
   245.3363,
   177.6733};
   graph = new TGraph(5,Graph_fx9,Graph_fy9);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#3399ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(4);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph9 = new TH1F("Graph_Graph9","Graph",100,225,5475);
   Graph_Graph9->SetMinimum(135.7185);
   Graph_Graph9->SetMaximum(639.1765);
   Graph_Graph9->SetDirectory(0);
   Graph_Graph9->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph9->SetLineColor(ci);
   Graph_Graph9->GetXaxis()->SetLabelFont(42);
   Graph_Graph9->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleFont(42);
   Graph_Graph9->GetYaxis()->SetLabelFont(42);
   Graph_Graph9->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleFont(42);
   Graph_Graph9->GetZaxis()->SetLabelFont(42);
   Graph_Graph9->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph9);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx10[518] = {
   6.04,
   6.04,
   6.04,
   6.04,
   6.05,
   6.08,
   6.11,
   6.12,
   6.12,
   6.13,
   6.16,
   6.16,
   6.16,
   6.19,
   6.2,
   6.2,
   6.2,
   6.21,
   6.24,
   6.27,
   6.28,
   6.28,
   6.28,
   6.28,
   6.28,
   6.29,
   6.34,
   6.37,
   6.37,
   6.37,
   6.37,
   6.37,
   6.38,
   6.43,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.46,
   6.53,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.64,
   6.69,
   6.71,
   6.71,
   6.71,
   6.71,
   6.71,
   6.72,
   6.78,
   6.8,
   6.8,
   6.8,
   6.8,
   6.8,
   6.81,
   6.87,
   6.89,
   6.89,
   6.89,
   6.89,
   6.89,
   6.91,
   6.94,
   6.97,
   6.98,
   6.98,
   7,
   7.05,
   7.08,
   7.09,
   7.15,
   7.17,
   7.19,
   7.24,
   7.27,
   7.28,
   7.34,
   7.37,
   7.37,
   7.45,
   7.46,
   7.47,
   7.55,
   7.56,
   7.57,
   7.65,
   7.66,
   7.67,
   7.76,
   7.77,
   7.77,
   7.86,
   7.88,
   7.95,
   7.99,
   8.05,
   8.1,
   8.15,
   8.19,
   8.24,
   8.27,
   8.31,
   8.38,
   8.43,
   8.48,
   8.52,
   8.58,
   8.61,
   8.65,
   8.71,
   8.75,
   8.81,
   8.84,
   8.88,
   8.93,
   8.97,
   9,
   9.05,
   9.12,
   9.17,
   9.24,
   9.29,
   9.36,
   9.42,
   9.49,
   9.54,
   9.62,
   9.67,
   9.74,
   9.8,
   9.87,
   9.93,
   10,
   10.2,
   10.3,
   10.5,
   10.6,
   10.8,
   10.9,
   10.9,
   11,
   11.2,
   11.2,
   11.3,
   11.5,
   11.6,
   11.8,
   11.9,
   12.1,
   12.2,
   12.4,
   12.6,
   12.7,
   12.9,
   13.1,
   13.3,
   13.5,
   13.5,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.5,
   14.5,
   14.8,
   15,
   15.2,
   15.3,
   15.3,
   15.6,
   15.8,
   15.9,
   16,
   16.2,
   16.5,
   16.6,
   16.9,
   17.2,
   17.3,
   17.6,
   17.9,
   18,
   18.3,
   18.6,
   18.7,
   19,
   19.3,
   19.4,
   19.5,
   19.8,
   20.6,
   21.4,
   21.8,
   22,
   22.2,
   22.6,
   22.9,
   23.2,
   23.5,
   23.8,
   24.1,
   24.5,
   24.8,
   25.1,
   25.5,
   25.8,
   26.1,
   26.5,
   26.8,
   27.2,
   27.6,
   28.1,
   28.7,
   29.1,
   29.4,
   29.8,
   30.8,
   31.7,
   32.4,
   32.9,
   34.2,
   35.3,
   35.8,
   36.4,
   36.9,
   37.4,
   38.3,
   38.9,
   39.4,
   40.4,
   41,
   41.6,
   42.6,
   43.2,
   43.8,
   44.4,
   45,
   45.6,
   46.2,
   46.8,
   47.5,
   48.1,
   48.7,
   49.4,
   50.1,
   50.7,
   51.4,
   52.1,
   53.3,
   54.8,
   55.7,
   56.4,
   57.2,
   57.9,
   58.7,
   59.5,
   60.3,
   61.1,
   61.9,
   62.7,
   63.5,
   64.4,
   65.3,
   66.3,
   67.6,
   68.8,
   69.7,
   70.7,
   71.6,
   72.8,
   74.2,
   75.5,
   76.5,
   77.5,
   78.8,
   80.3,
   81.8,
   82.8,
   84,
   85.1,
   86.4,
   88.2,
   89.7,
   90.9,
   92.1,
   93.6,
   95.5,
   97.1,
   98.4,
   100,
   102,
   104,
   105,
   108,
   110,
   112,
   114,
   115,
   118,
   120,
   122,
   124,
   127,
   130,
   132,
   134,
   137,
   139,
   142,
   145,
   147,
   150,
   152,
   155,
   157,
   161,
   164,
   167,
   170,
   173,
   176,
   179,
   182,
   187,
   190,
   194,
   197,
   200,
   205,
   208,
   213,
   216,
   222,
   225,
   231,
   234,
   240,
   244,
   253,
   262,
   267,
   272,
   278,
   283,
   289,
   295,
   301,
   307,
   312,
   317,
   323,
   329,
   334,
   341,
   347,
   353,
   358,
   367,
   374,
   381,
   387,
   395,
   403,
   411,
   419,
   427,
   436,
   445,
   454,
   463,
   475,
   485,
   494,
   504,
   514,
   528,
   545,
   564,
   583,
   603,
   615,
   628,
   639,
   649,
   662,
   675,
   689,
   701,
   712,
   726,
   741,
   756,
   771,
   786,
   802,
   818,
   833,
   846,
   863,
   878,
   892,
   910,
   935,
   964,
   992,
   1030,
   1050,
   1070,
   1090,
   1110,
   1150,
   1190,
   1210,
   1230,
   1260,
   1280,
   1310,
   1340,
   1370,
   1400,
   1430,
   1460,
   1490,
   1520,
   1550,
   1600,
   1650,
   1690,
   1720,
   1750,
   1790,
   1850,
   1910,
   1950,
   1990,
   2030,
   2070,
   2130,
   2170,
   2210,
   2260,
   2300,
   2370,
   2410,
   2460,
   2540,
   2630,
   2680,
   2730,
   2820,
   2920,
   3020,
   3120,
   3190,
   3240,
   3320,
   3370,
   3490,
   3610,
   3690,
   3750,
   3880,
   4020,
   4100,
   4180,
   4270,
   4350,
   4440,
   4530,
   4620,
   4690,
   4810,
   4880,
   5000,
   5080,
   5200,
   5310,
   5420,
   5520,
   5640,
   5750,
   5860,
   5980,
   6100,
   6220,
   6330,
   6440,
   6560,
   6700,
   6830,
   7050,
   7300,
   7450,
   7590,
   7840,
   8110,
   8380,
   8670,
   8850,
   8990,
   9210,
   9390,
   9610};
   Double_t Graph_fy10[518] = {
   10.38676,
   10.50231,
   10.59957,
   10.7015,
   10.89364,
   11.07546,
   11.20647,
   11.30821,
   11.41342,
   11.62109,
   11.82995,
   11.96215,
   12.07818,
   12.17911,
   12.30743,
   12.414,
   12.52534,
   12.76538,
   12.97118,
   13.12865,
   13.25128,
   13.37442,
   13.49524,
   13.62174,
   13.74534,
   13.99711,
   14.24146,
   14.40622,
   14.54013,
   14.67427,
   14.8083,
   14.94868,
   15.22224,
   15.47959,
   15.6669,
   15.80805,
   15.95581,
   16.10083,
   16.2527,
   16.40114,
   16.65049,
   17.00656,
   17.18103,
   17.34867,
   17.50979,
   17.663,
   17.82315,
   18.09534,
   18.48112,
   18.68225,
   18.85134,
   19.02836,
   19.21403,
   19.38419,
   19.72512,
   20.07365,
   20.32073,
   20.51337,
   20.68111,
   20.89181,
   21.0759,
   21.47197,
   21.82747,
   22.10836,
   22.30316,
   22.50687,
   22.72023,
   22.88709,
   23.32871,
   23.73763,
   24.00677,
   24.23435,
   24.45738,
   24.68282,
   24.91041,
   25.36578,
   25.78503,
   26.09729,
   26.34398,
   26.58842,
   27.06598,
   27.53896,
   27.86668,
   28.37133,
   28.86478,
   29.20029,
   29.71859,
   30.24769,
   30.60227,
   31.15273,
   31.68307,
   32.06927,
   32.5362,
   33.23597,
   33.60661,
   34.0793,
   34.82676,
   35.19988,
   35.69491,
   36.46783,
   36.87798,
   37.44003,
   38.20997,
   38.65276,
   39.20006,
   40.07932,
   40.8414,
   41.55343,
   42.4036,
   43.14178,
   44.02907,
   44.76045,
   45.25133,
   46.05417,
   46.59723,
   47.07559,
   47.84267,
   48.80958,
   49.64402,
   50.16063,
   51.06094,
   51.65136,
   52.17979,
   52.98822,
   53.58735,
   54.51024,
   55.15295,
   55.7454,
   56.61769,
   57.29215,
   57.83828,
   58.59123,
   59.58957,
   60.25911,
   61.2608,
   61.9507,
   63.01658,
   63.72388,
   64.8542,
   65.56339,
   66.64773,
   67.45883,
   68.57788,
   69.38042,
   70.52167,
   71.44279,
   73.10832,
   74.86664,
   76.70132,
   78.48531,
   80.39639,
   82.27539,
   83.96915,
   84.81317,
   86.19446,
   88.02168,
   88.90821,
   90.11315,
   92.12023,
   94.32802,
   96.50886,
   98.84577,
   100.8332,
   102.8086,
   104.7116,
   106.793,
   108.8109,
   110.7898,
   112.9515,
   115.1677,
   117.0762,
   118.1521,
   119.1161,
   120.7506,
   122.937,
   125.5722,
   127.4196,
   128.5312,
   129.6638,
   131.542,
   134.0308,
   136.1693,
   137.3979,
   138.4952,
   140.691,
   142.7079,
   144.0108,
   145.2215,
   146.8251,
   149.5702,
   150.7827,
   152.4733,
   155.2857,
   156.5944,
   158.387,
   161.2726,
   162.6707,
   164.4505,
   167.5191,
   168.8856,
   170.7937,
   172.6887,
   174.1507,
   175.4199,
   177.3078,
   182.9573,
   187.7626,
   189.8365,
   190.4369,
   191.0454,
   193.294,
   195.0114,
   196.8028,
   198.6746,
   200.6337,
   202.4317,
   204.8624,
   205.4538,
   206.0518,
   208.4005,
   210.5569,
   212.4997,
   214.5452,
   216.3183,
   218.547,
   220.4993,
   222.5493,
   224.7033,
   226.9325,
   229.2592,
   231.2259,
   233.3437,
   236.0739,
   236.692,
   237.8515,
   240.2765,
   242.669,
   242.8986,
   243.7,
   244.4396,
   245.1237,
   245.324,
   246.1552,
   246.9239,
   247.738,
   248.6028,
   249.34,
   250.183,
   251.0113,
   251.7779,
   252.4054,
   252.4402,
   252.4741,
   252.5072,
   252.5394,
   252.576,
   252.6065,
   251.8236,
   251.565,
   251.5977,
   251.9175,
   252.7618,
   252.7922,
   253.0667,
   254.0334,
   254.1442,
   254.1704,
   254.1995,
   254.2243,
   254.2519,
   254.2788,
   254.305,
   254.3305,
   254.3554,
   254.3796,
   254.4032,
   254.4291,
   254.4543,
   254.2526,
   253.4561,
   253.3367,
   253.3588,
   252.5675,
   252.295,
   252.1031,
   251.2675,
   251.223,
   250.3929,
   250.0624,
   249.8782,
   249.0786,
   249.0366,
   248.174,
   247.9263,
   247.944,
   247.6981,
   246.9351,
   246.8915,
   246.9084,
   246.0196,
   245.5296,
   244.7362,
   244.6935,
   243.8445,
   243.6187,
   242.4377,
   241.8683,
   241.295,
   240.1783,
   239.0772,
   238.001,
   237.4805,
   236.957,
   236.4553,
   236.9969,
   237.012,
   234.4527,
   232.994,
   232.0529,
   231.124,
   230.6725,
   229.7764,
   228.8918,
   227.5962,
   226.7575,
   226.3463,
   225.53,
   224.7235,
   224.3345,
   223.5489,
   222.4,
   221.6514,
   220.9151,
   220.5568,
   219.4781,
   218.4252,
   218.4349,
   217.4066,
   216.4078,
   215.7535,
   214.7888,
   214.4764,
   213.537,
   212.6227,
   211.7229,
   210.5545,
   209.6973,
   208.5851,
   207.767,
   206.7044,
   205.9222,
   204.9054,
   204.1581,
   202.7048,
   200.6119,
   199.4946,
   198.6241,
   197.7734,
   196.9394,
   195.9209,
   195.126,
   194.1531,
   193.393,
   192.6467,
   192.2811,
   191.5566,
   190.8456,
   190.4965,
   189.8054,
   189.1259,
   188.7928,
   187.9657,
   186.9986,
   186.3681,
   185.748,
   185.29,
   184.688,
   183.8008,
   183.0782,
   182.0883,
   181.3984,
   180.4531,
   179.6626,
   178.8891,
   178.132,
   176.4223,
   175.5989,
   174.7941,
   174.0077,
   173.2387,
   171.644,
   170.3208,
   168.5686,
   167.267,
   165.4898,
   164.7208,
   163.9695,
   163.8889,
   163.1556,
   162.5181,
   161.6606,
   160.976,
   160.9779,
   160.2332,
   159.5059,
   158.7245,
   158.0995,
   157.2843,
   156.6211,
   155.8431,
   155.2095,
   155.1483,
   154.4668,
   153.8004,
   153.7418,
   153.0319,
   152.3957,
   150.9962,
   149.8166,
   148.4291,
   146.8649,
   146.1595,
   145.5618,
   144.8424,
   144.2273,
   143.077,
   141.5716,
   140.9059,
   140.2935,
   139.6204,
   138.999,
   138.3208,
   137.7278,
   136.5779,
   135.9239,
   135.2852,
   134.6612,
   134.0513,
   133.455,
   132.8717,
   131.7421,
   130.3946,
   129.6185,
   129.1138,
   128.6188,
   127.8935,
   126.9576,
   125.6149,
   124.9697,
   124.5488,
   123.9302,
   123.3267,
   122.1621,
   121.6,
   121.0507,
   120.5136,
   119.9882,
   118.9705,
   118.3154,
   117.8359,
   116.905,
   115.7187,
   115.1476,
   114.5904,
   113.7792,
   112.4881,
   111.6267,
   110.4508,
   109.8856,
   109.4437,
   108.7971,
   108.3764,
   107.6595,
   106.4832,
   106.0117,
   105.4593,
   104.657,
   103.6329,
   103.0581,
   102.6571,
   102.1086,
   101.7257,
   101.2013,
   100.7625,
   100.2622,
   99.77413,
   99.29779,
   98.89833,
   98.37802,
   97.9966,
   97.43805,
   97.13459,
   96.65859,
   96.25151,
   95.79658,
   95.35219,
   94.91791,
   94.49337,
   94.02686,
   93.6217,
   93.27425,
   93.07861,
   92.78892,
   92.31587,
   91.94598,
   91.2278,
   90.24254,
   89.78968,
   89.42747,
   88.72436,
   87.79184,
   87.11485,
   86.19591,
   85.77034,
   85.35504,
   84.91885,
   84.61402,
   84.25532};
   graph = new TGraph(518,Graph_fx10,Graph_fy10);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66ccff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(5);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph10 = new TH1F("Graph_Graph10","Graph",518,5.436,10570.4);
   Graph_Graph10->SetMinimum(9.348083);
   Graph_Graph10->SetMaximum(278.861);
   Graph_Graph10->SetDirectory(0);
   Graph_Graph10->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph10->SetLineColor(ci);
   Graph_Graph10->GetXaxis()->SetLabelFont(42);
   Graph_Graph10->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleFont(42);
   Graph_Graph10->GetYaxis()->SetLabelFont(42);
   Graph_Graph10->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleFont(42);
   Graph_Graph10->GetZaxis()->SetLabelFont(42);
   Graph_Graph10->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph10);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx11[35] = {
   3.98,
   4.37,
   4.79,
   5.25,
   5.75,
   6.31,
   6.92,
   7.59,
   8.32,
   9.12,
   10,
   10.96,
   12.02,
   13.18,
   14.45,
   15.85,
   17.38,
   19.05,
   20.89,
   22.91,
   25.12,
   31.62,
   39.81,
   50.12,
   63.1,
   79.43,
   100,
   125.89,
   158.49,
   199.53,
   251.19,
   316.23,
   1000,
   3162.3,
   10000};
   Double_t Graph_fy11[35] = {
   64.47703,
   92.96188,
   120.9916,
   144.7661,
   171.1873,
   194.8983,
   219.9867,
   244.5213,
   267.5613,
   289.6608,
   311.7509,
   330.2783,
   345.9273,
   362.605,
   376.5173,
   387.5872,
   398.0475,
   406.9399,
   414.3522,
   421.5604,
   426.3119,
   433.1181,
   435.0014,
   429.503,
   421.4079,
   411.5566,
   398.3919,
   383.7713,
   369.2768,
   352.1727,
   335.9504,
   319.8066,
   245.9105,
   185.1913,
   139.1868};
   graph = new TGraph(35,Graph_fx11,Graph_fy11);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66cc66");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph11 = new TH1F("Graph_Graph11","Graph",100,3.582,10999.6);
   Graph_Graph11->SetMinimum(27.4246);
   Graph_Graph11->SetMaximum(472.0538);
   Graph_Graph11->SetDirectory(0);
   Graph_Graph11->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph11->SetLineColor(ci);
   Graph_Graph11->GetXaxis()->SetLabelFont(42);
   Graph_Graph11->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleFont(42);
   Graph_Graph11->GetYaxis()->SetLabelFont(42);
   Graph_Graph11->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleFont(42);
   Graph_Graph11->GetZaxis()->SetLabelFont(42);
   Graph_Graph11->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph11);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx12[35] = {
   4,
   5,
   6,
   7,
   8,
   9,
   10,
   12,
   14,
   16,
   18,
   20,
   24,
   28,
   32,
   36,
   40,
   44,
   48,
   52,
   56,
   60,
   65,
   70,
   75,
   80,
   85,
   90,
   95,
   100,
   150,
   200,
   300,
   400,
   500};
   Double_t Graph_fy12[35] = {
   91.75045,
   115.9467,
   132.4599,
   144.0692,
   152.856,
   159.9043,
   165.4462,
   172.653,
   177.2831,
   179.5654,
   180.8904,
   181.5836,
   181.5776,
   181.2419,
   178.737,
   176.8406,
   175.2212,
   173.4303,
   171.2294,
   169.3498,
   167.5194,
   165.3283,
   163.1921,
   161.2337,
   159.198,
   157.2876,
   155.7156,
   153.813,
   152.3262,
   150.9621,
   138.5165,
   129.9907,
   118.4184,
   110.7202,
   104.9163};
   graph = new TGraph(35,Graph_fx12,Graph_fy12);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#333399");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph12 = new TH1F("Graph_Graph12","Graph",100,3.6,549.6);
   Graph_Graph12->SetMinimum(82.76714);
   Graph_Graph12->SetMaximum(190.5669);
   Graph_Graph12->SetDirectory(0);
   Graph_Graph12->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph12->SetLineColor(ci);
   Graph_Graph12->GetXaxis()->SetLabelFont(42);
   Graph_Graph12->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleFont(42);
   Graph_Graph12->GetYaxis()->SetLabelFont(42);
   Graph_Graph12->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleFont(42);
   Graph_Graph12->GetZaxis()->SetLabelFont(42);
   Graph_Graph12->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph12);
   
   multigraph->Add(graph,"");
   multigraph->Draw("L");
   
   TLegend *leg = new TLegend(0.16,0.61,0.5,0.85,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","Razor-0#mu 90% CL limit: AV EFT operator","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Expected limit, with uncertainty","lf");

   ci = TColor::GetColor("#ffcc00");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);

   ci = TColor::GetColor("#ff6666");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Observed limit","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   leg = new TLegend(0.67,0.61,0.92,0.9,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("Graph","IceCube W^{+}W^{-}","l");

   ci = TColor::GetColor("#3399ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(4);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","COUPP 2012","l");

   ci = TColor::GetColor("#6666ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","SIMPLE 2012","l");

   ci = TColor::GetColor("#ff9900");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Super-K W^{+}W^{-}","l");

   ci = TColor::GetColor("#cc33ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","XENON 100","l");

   ci = TColor::GetColor("#66ccff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(5);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICO","l");

   ci = TColor::GetColor("#66cc66");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICASSO","l");

   ci = TColor::GetColor("#333399");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   TLatex *   tex = new TLatex(0.955,0.945,"18.8 fb^{-1} (8 TeV)");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(42);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.245,0.865,"CMS");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(61);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
   
   TH1F *_copy__1 = new TH1F("_copy__1","",100,0.9,1049.95);
   _copy__1->SetMinimum(100);
   _copy__1->SetMaximum(2000000);
   _copy__1->SetDirectory(0);
   _copy__1->SetStats(0);

   ci = TColor::GetColor("#000099");
   _copy__1->SetLineColor(ci);
   _copy__1->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   _copy__1->GetXaxis()->SetRange(0,96);
   _copy__1->GetXaxis()->SetLabelFont(42);
   _copy__1->GetXaxis()->SetTitleSize(0.05);
   _copy__1->GetXaxis()->SetTitleOffset(1.1);
   _copy__1->GetXaxis()->SetTitleFont(42);
   _copy__1->GetYaxis()->SetTitle("#Lambda (GeV)");
   _copy__1->GetYaxis()->SetLabelFont(42);
   _copy__1->GetYaxis()->SetTitleSize(0.05);
   _copy__1->GetYaxis()->SetTitleOffset(1.05);
   _copy__1->GetYaxis()->SetTitleFont(42);
   _copy__1->GetZaxis()->SetLabelFont(42);
   _copy__1->GetZaxis()->SetLabelSize(0.035);
   _copy__1->GetZaxis()->SetTitleSize(0.035);
   _copy__1->GetZaxis()->SetTitleFont(42);
   _copy__1->Draw("sameaxis");
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
Пример #17
0
TGraph* autoefficiency(TH1 *hist,TNucleus *nuc) {    //Display The fits on a TPad  

   if(!hist || !nuc)
      return 0;

   Double_t par[40];

   nuc->SetSourceData();

 //  if(nuc->GetA() == 152) {
 //     return autogain152(hist);
 //  }

// Search
   hist->GetXaxis()->SetRangeUser(0,16000);

   nuc->TransitionList.Sort();

   std::vector<float> engvec;
   TIter iter(&(nuc->TransitionList));
   TObject* obj;
   while(obj = iter.Next()) {
      if(!obj->InheritsFrom("TGRSITransition"))
         continue;
      TGRSITransition *tran = (TGRSITransition*)obj;

      engvec.push_back(static_cast<float>(tran->energy));
   }

 

   std::vector<Float_t> areavec;
   std::vector<Float_t> area_uncertainty;
   std::vector<Float_t> goodenergy;

   Float_t integral, sigma; 
   Double_t binWidth = hist->GetXaxis()->GetBinWidth(10000);

   std::cout << "bin width is " << binWidth << std::endl;
  for (int p=0;p<engvec.size();p++) {
     Float_t xp = engvec.at(p)/binWidth;
     std::cout << "Trying to fit " << xp << " keV" <<std::endl; 

     Int_t bin = hist->GetXaxis()->FindBin(xp);
     Float_t yp = hist->GetBinContent(bin);
     par[0] = yp;  //height
     par[1] = xp;  //centroid
     par[2] = 2;   //sigma
     par[3] = 5;   //beta
     par[4] = 0;   //R
     par[5] = 1.0;//stp
     par[6] = hist->GetBinContent(bin+30);  //A
     par[7] = -0.2;//B
     par[8] = 0;   //C
     par[9] = xp;  //bg offset
     bool goodfit = FitPeak(par,hist,integral, sigma);
     if(goodfit){
     	areavec.push_back(integral);
     	area_uncertainty.push_back(sigma);
        goodenergy.push_back(engvec.at(p));
     }
  //   fitlist->Add(f);
   }

   std::cout << "or made it here" << std::endl;

   Float_t *area = &(areavec[0]);
   Float_t *energies = &(engvec[0]);
   Float_t *goodenergy = &(goodenergy[0]);

   TGraph *slopefit = new TGraph(engvec.size(),area,energies ); 

   printf("Now fitting: Be patient\n");
 //  slopefit->Fit("pol1");
   slopefit->Draw("AC*");

   return slopefit;

}
Пример #18
0
TGraph* getGraph(TGraph* gin , int ndiv = 10 , bool verbose = false ){

  const unsigned int n = gin->GetN();

  if( verbose ) cout << "npoints " << n << endl;

  float x[n];
  float y[n];

  Double_t thisx;
  Double_t thisy;

  for(int i = 0 ; i < n ; ++i){
    gin->GetPoint(i,thisx,thisy);
    x[i] = thisx;
    y[i] = thisy;
  }

  if( verbose ){
    cout << endl << "Original points" << endl;
    for( int i = 0 ; i < n ; i++ ){
      cout << i << " " << x[i] << " " << y[i] << endl;
    }
  }

  const unsigned int nnew = ndiv * (n-1);

  float xnew[nnew];
  float ynew[nnew];

  if( verbose ) cout << endl << "New points" << endl;
  for( int i = 0 ; i < n-1 ; ++i){

    float xgraph = x[i];
    float ygraph = y[i];

    float slope = (y[i+1]-y[i])/(x[i+1]-x[i]);

    if( verbose ) cout << i << " " << xgraph << " " << ygraph << " " << slope << endl;

    for( int j = 0 ; j < ndiv ; ++j ){

      //cout << "counter " << i*10+j << endl;
      xnew[i*ndiv+j] = xgraph;
      ynew[i*ndiv+j] = ygraph;

      xgraph += 20.0 / (float)ndiv;
      ygraph += (20.0/(float)ndiv)*slope;
    }
  }

  if( verbose ){
    cout << endl << "New graph points" << endl;
    for( int i = 0 ; i < nnew ; i++ ){
      cout << i << " " << xnew[i] << " " << ynew[i] << endl;
    }
  }

  TGraph *gout = new TGraph(nnew,xnew,ynew);

  gout->SetLineColor(gin->GetLineColor());
  gout->SetLineWidth(gin->GetLineWidth());
  gout->SetLineStyle(gin->GetLineStyle());
  //gout->SetMarkerColor(gin->GetLineColor());

  return gout;


}
Пример #19
0
void fit(){
  int range = 1e4;

  TFile *f = new TFile("hgrroot.root");
  TCanvas *ca = new TCanvas("ca","ca",0,0,1400,900);
  ca->Divide(4,4);
  TH1F* h[7][4];
  TF1* fu[7][4][2];
  TF1* fus[7][4][2][3];
  double res[7*4];
  double det[7*4];
  double slope[7*4];
  double offset[7*4];
  double resolution =5;
  TEnv* output = new TEnv("corecal.dat");

  for(int d=0;d<7;d++){
    for(int c=0;c<4;c++){
      h[d][c] = (TH1F*)f->Get(Form("htraceen_b%d_c%d_cr%d_d%d",0,9,c,d+1));
      ca->cd(1+c*4);
      //h[d][c]->GetXaxis()->SetRangeUser(100,4000);
      TSpectrum *sp = new TSpectrum(2,resolution);
      sp->SetResolution(resolution);
      Int_t nfound = 0;
      nfound = sp->Search(h[d][c],resolution,"nobackground",0.5);
      Float_t *xpeaks = sp->GetPositionX();
      Float_t *ypeaks = sp->GetPositionY();
//       for(int p=0;p<nfound;p++){
// 	cout << xpeaks[p] << "\t" << ypeaks[p] << endl;
//       }
      if(nfound!=2){
	cout << "Found " << nfound << " peaks in spectrum, too many, aborting" << endl;
	continue;
      }
      h[d][c]->DrawCopy();
      //check if first peak is lower in energy, otherwise swap them
      if(xpeaks[0]>xpeaks[1]){
	Float_t temp = xpeaks[1];
	xpeaks[1] = xpeaks[0];
	xpeaks[0] = temp;
	temp = ypeaks[1];
	ypeaks[1] = ypeaks[0];
	ypeaks[0] = temp;
	
      }

      for(int p=0;p<nfound;p++){
	ca->cd(1+c*4+1+p);
	h[d][c]->GetXaxis()->SetRangeUser(xpeaks[p]-range,xpeaks[p]+range);
	h[d][c]->DrawCopy();
	fu[d][c][p] = new TF1(Form("fcore_d%d_c%d_p%d",d,c,p),fgammagaussbg,xpeaks[p]-range,xpeaks[p]+range,6);
	fu[d][c][p]->SetLineColor(3);
	fu[d][c][p]->SetLineWidth(1);
	fu[d][c][p]->SetParameter(0,0);//bg const
	fu[d][c][p]->SetParameter(1,0);//bg slope
	fu[d][c][p]->SetParameter(2,h[d][c]->Integral(xpeaks[p]-range,xpeaks[p]+range));//norm
	fu[d][c][p]->SetParameter(3,xpeaks[p]);//mean
	fu[d][c][p]->SetParLimits(3,xpeaks[p]-500,xpeaks[p]+500);//mean
	fu[d][c][p]->SetParameter(4,100);//sigma
	fu[d][c][p]->SetParLimits(4,0.001,1000);//sigma
	fu[d][c][p]->SetParameter(5,h[d][c]->GetBinContent(h[d][c]->FindBin(xpeaks[p]-range)));//step
	
	h[d][c]->Fit(fu[d][c][p],"Rqn");
	fu[d][c][p]->Draw("same");


	fus[d][c][p][0] = new TF1(Form("fcore_d%d_c%d_p%d_bg",d,c,p),fgammabg,xpeaks[p]-range,xpeaks[p]+range,6);
	fus[d][c][p][1] = new TF1(Form("fcore_d%d_c%d_p%d_st",d,c,p),fgammastep,xpeaks[p]-range,xpeaks[p]+range,6);
	fus[d][c][p][2] = new TF1(Form("fcore_d%d_c%d_p%d_ga",d,c,p),fgammagaus,xpeaks[p]-range,xpeaks[p]+range,6);
	

	fus[d][c][p][0]->SetLineColor(5);
	fus[d][c][p][1]->SetLineColor(4);
	fus[d][c][p][2]->SetLineColor(2);
	for(int k=0;k<3;k++){
	  fus[d][c][p][k]->SetLineWidth(1);
	  for(int l=0;l<6;l++)
	    fus[d][c][p][k]->SetParameter(l,fu[d][c][p]->GetParameter(l));
	  fus[d][c][p][k]->Draw("same");
	}

      }//peaks
      //res[d*4+c] = 2.35*fu[d][c][1]->GetParameter(4)*(1332.492-1173.228)/(fu[d][c][1]->GetParameter(3)-fu[d][c][0]->GetParameter(3));

      slope[d*4+c] = (1332.492-1173.228)/(fu[d][c][1]->GetParameter(3)-fu[d][c][0]->GetParameter(3));
      offset[d*4+c] = (1332.492+1173.228)-slope[d*4+c]*(fu[d][c][1]->GetParameter(3)+fu[d][c][0]->GetParameter(3));
      offset[d*4+c]*=0.5;
      
      //cout << fu[d][c][0]->GetParameter(3)*slope[d*4+c] + offset[d*4+c] << "\t" << fu[d][c][1]->GetParameter(3)*slope[d*4+c] + offset[d*4+c] << endl;
      
      res[d*4+c] = fu[d][c][1]->GetParameter(2);
      det[d*4+c] = d*5+c;

      output->SetValue(Form("Slope.d%d.c%d",d,c),slope[d*4+c]);
      output->SetValue(Form("Offset.d%d.c%d",d,c),offset[d*4+c]);


      //cout << det[d*4+c] <<"\t" << res[d*4+c] << endl;
      //cout << fu[d][c][0]->GetParameter(4) <<"\t" << fu[d][c][1]->GetParameter(4) << endl;
      //ca->cd(1+c*4+3);
      TPad *p1 = (TPad *)(ca->cd(1+c*4+3)); 
      p1->SetLogy();
      h[d][c]->GetXaxis()->SetRangeUser((int)xpeaks[0]-range,(int)xpeaks[1]+range);
      h[d][c]->DrawCopy();
      for(int p=0;p<nfound;p++){
	fu[d][c][p]->Draw("same");
	for(int k=0;k<3;k++){
	  fus[d][c][p][k]->Draw("same");
	}
      }

    }//crystals
    if(d==0)
      ca->SaveAs("corefits.ps(");
    else
      ca->SaveAs("corefits.ps");
  }//detectors
  output->SaveLevel(kEnvLocal);

  //TGraph *gres = new TGraph(7*4,det,res);
  TGraph *gres = new TGraph(7*4,slope,offset);
  TCanvas *ca2 = new TCanvas("ca2","ca2",0,0,1400,900);
  ca2->cd();
  gres->Draw("AP");
  gres->SetMarkerStyle(20);
  ca2->SaveAs("corefits.ps)");
}
Пример #20
0
void makeGMSBPlot( bool printplots = false ){

  //getUncertainties();
  /*
  // VZ+MET exclusion
  TFile *f       = TFile::Open("/tas/benhoob/home/LandS/VZMet_LandS/fullShapeAnalysis/cards/V00-02-08/observed_limit.root");
  TGraph* gul    = (TGraph*) f->Get("grobs");
  TGraph* gulexp = (TGraph*) f->Get("grexp");

  // Rutgers exclusion
  //TFile *frutgers = TFile::Open("20120411_UCSD_GMSB_datacard/observed_limit.root ");
  //TFile *frutgers = TFile::Open("20120419_UCSD_GMSB_datacard/observed_limit.root ");
  TFile *frutgers = TFile::Open("/tas/benhoob/home/LandS/VZMet_LandS/fullShapeAnalysis/cards/20120420_UCSD_GMSB_datacard/observed_limit.root ");
  TGraph* gul2    = (TGraph*) frutgers->Get("grobs");
  TGraph* gul2exp = (TGraph*) frutgers->Get("grexp");
*/

  // VZ+MET exclusion
  TFile *fc       = TFile::Open("/tas/benhoob/home/LandS_t3-06-00/VZMet_LandS_2012/fullShapeAnalysis/cards/V00-00-03/observed_limit.root");

  TGraph* gulc      = (TGraph*) fc->Get("grobs");
  TGraph* gulcexp   = (TGraph*) fc->Get("grexp");
  TGraph* gulcexpp1 = (TGraph*) fc->Get("grexpp1");
  TGraph* gulcexpm1 = (TGraph*) fc->Get("grexpm1");
  TGraph* gulcband  = uncertaintyBand( gulcexpp1 , gulcexpm1 );

  /*
  Double_t xp;
  Double_t yp;

  Double_t xp2;
  Double_t yp2;

  Double_t xpc;
  Double_t ypc;

  cout << setw(15) << "mass"        << setw(4) << "&"
       << setw(15) << "\\wzzmet"    << setw(4) << "&"
       << setw(15) << "mult-lepton" << setw(4) << "&"
       << setw(15) << "combined"    << setw(4) << "&"
       << setw(15) << "asdf"        << setw(4) << "\\\\" << endl;

  for( int i = 0 ; i < 15 ; ++i ){

    gulexp->GetPoint ((Int_t) i,xp,yp);
    gul2exp->GetPoint((Int_t) i,xp2,yp2);
    gulcexp->GetPoint((Int_t) i,xpc,ypc);
    float exp = 1.0 / sqrt( 1.0/(yp*yp) + 1.0/(yp2*yp2) ); 

    // gul->GetPoint ((Int_t) i,xp,yp);
    // gul2->GetPoint((Int_t) i,xp2,yp2);
    // gulc->GetPoint((Int_t) i,xpc,ypc);
    // float exp = 1.0 / sqrt( 1.0/(yp*yp) + 1.0/(yp2*yp2) ); 


    // gul->GetPoint ((Int_t) i,xp,yp);
    // gul2->GetPoint((Int_t) i,xp2,yp2);
    // gulc->GetPoint((Int_t) i,xpc,ypc);

    cout << setw(15) << xp               << setw(4) << "&"
	 << setw(15) << Form("%.0f",yp)  << setw(4) << "&"
	 << setw(15) << Form("%.0f",yp2) << setw(4) << "&"
	 << setw(15) << Form("%.0f",ypc) << setw(4) << "&"
	 << setw(15) << Form("%.0f",exp) << setw(4) << "\\\\" << endl;
    

    // cout << "mass    " << Form("%.0f",xp) << endl;
    // cout << "VZ+MET  " << Form("%.0f",yp) << endl;
    // cout << "4l      " << Form("%.0f",yp2) << endl;
    // cout << "combo   " << Form("%.0f",ypc) << endl;
    // cout << "exp     " << Form("%.0f",exp) << endl << endl;    
  }
  */

  const unsigned int n = 15;
  float x[n];
  float y[n];
  float yup[n];
  float ydn[n];

  float xerr[n];
  float yerr[n];

  float xband[30];
  float yband[30];

  float systerr = 0.06;

  x[0]  = 130;   y[0]  = 3.7640;   yerr[0]  = systerr * y[0];
  x[1]  = 150;   y[1]  = 2.1410;   yerr[1]  = systerr * y[1];
  x[2]  = 170;   y[2]  = 1.3040;   yerr[2]  = systerr * y[2];
  x[3]  = 190;   y[3]  = 0.8370;   yerr[3]  = systerr * y[3];
  x[4]  = 210;   y[4]  = 0.5580;   yerr[4]  = systerr * y[4];
  x[5]  = 230;   y[5]  = 0.3820;   yerr[5]  = systerr * y[5];
  x[6]  = 250;   y[6]  = 0.2710;   yerr[6]  = systerr * y[6];
  x[7]  = 270;   y[7]  = 0.1950;   yerr[7]  = systerr * y[7];
  x[8]  = 290;   y[8]  = 0.1420;   yerr[8]  = systerr * y[8];
  x[9]  = 310;   y[9]  = 0.1060;   yerr[9]  = systerr * y[9];
  x[10] = 330;   y[10] = 0.0798;   yerr[10] = systerr * y[10];
  x[11] = 350;   y[11] = 0.0608;   yerr[11] = systerr * y[11];   
  x[12] = 370;   y[12] = 0.0468;   yerr[12] = systerr * y[12];   
  x[13] = 390;   y[13] = 0.0366;   yerr[13] = systerr * y[13];   
  x[14] = 410;   y[14] = 0.0287;   yerr[14] = systerr * y[14];   

  for( int i = 0 ; i < 15; ++i ){
    xerr[i] = 0.0;
    yup[i]  = y[i] + yerr[i];
    ydn[i]  = y[i] - yerr[i];
  }

  for( int i = 0 ; i < 15; ++i ){
    xband[i] = x[i];
    yband[i] = y[i] + yerr[i];
  }

  for( int i = 0 ; i < 15; ++i ){
    xband[i+15] = x[14-i];
    yband[i+15] = y[14-i] - yerr[14-i];
  }
  
  // cout << endl << endl;
  // for( int i = 0 ; i < 30 ; ++i ){
  //   cout << xband[i] << " " << yband[i] << endl;
  // }
  // cout << endl << endl;

  TGraph* g     = new TGraph(n,x,y);
  TGraph* gup   = new TGraph(n,x,yup);
  TGraph* gdn   = new TGraph(n,x,ydn);
  TGraph* gband = new TGraph(30,xband,yband);

  // UP:   248
  // DOWN: 148

  //TGraphErrors* g  = new TGraphErrors(n,x,y,xerr,yerr);

  TCanvas *c1 = new TCanvas("c1","",600,600);
  gPad->SetTopMargin(0.1);
  gPad->SetRightMargin(0.05);
  //gPad->SetGridx();
  //gPad->SetGridy();

  float ymin = 0;
  if( logplot ) ymin = 0.03;

  //TH2F* hdummy = new TH2F("hdummy","",100,130,300,100,ymin,3000);
  TH2F* hdummy = new TH2F("hdummy","",100,130,400,100,ymin,5);
  hdummy->Draw();

  c1->cd();
  if( logplot ) gPad->SetLogy();

  g->SetLineColor(2);
  g->SetLineWidth(3);
  g->SetFillColor(5);
  gup->SetLineColor(2);
  gdn->SetLineColor(2);
  gup->SetLineStyle(2);
  gdn->SetLineStyle(2);
  gband->SetFillColor(5);

  /*
  //2l2j observed
  gul->SetLineColor(6);
  gul->SetLineWidth(3);
  gul->SetLineStyle(4);

  //2l2j expected
  gulexp->SetLineColor(2);
  gulexp->SetLineWidth(3);
  gulexp->SetLineStyle(2);

  //4l observed
  gul2->SetLineWidth(3);
  gul2->SetLineStyle(4);
  gul2->SetLineColor(kGreen+2);

  //4l expected
  gul2exp->SetLineWidth(3);
  gul2exp->SetLineStyle(2);
  */

  //combined observed
  gulc->SetLineWidth(5);
  gulc->SetLineColor(1);

  //combined expected
  gulcexp->SetLineWidth(5);
  gulcexp->SetLineColor(4);
  gulcexp->SetLineStyle(2);

  //clone TGraphs, with more points
  TGraph* gulc_line       = getGraph(gulc,10);
  TGraph* gulcexp_line    = getGraph(gulcexp,20);
  //TGraph* gul_line        = getGraph(gul,20);
  //TGraph* gul2_line       = getGraph(gul2,20);
  TGraph* gulcexpp1_line  = getGraph(gulcexpp1,20);
  TGraph* gulcexpm1_line  = getGraph(gulcexpm1,20);
  //TGraph* g_line          = getGraph(g,20);
  TGraph* gulcband_line   = uncertaintyBand( gulcexpp1_line , gulcexpm1_line );

  // gulexp->SetLineWidth(2);
  // gulexp->SetLineStyle(2);
  // gulexp->SetLineColor(2);  
  // gul2exp->SetLineWidth(2);
  // gul2exp->SetLineStyle(2);


  hdummy->GetXaxis()->SetTitle("#mu [GeV]");
  hdummy->GetYaxis()->SetTitle("#sigma [pb]");
  hdummy->GetYaxis()->SetLabelSize(0.04);
  hdummy->GetXaxis()->SetLabelSize(0.04);
  hdummy->GetYaxis()->SetTitleSize(0.05);
  hdummy->GetXaxis()->SetTitleSize(0.05);
  hdummy->GetXaxis()->SetTitleOffset(1.12);
  hdummy->GetYaxis()->SetTitleOffset(1.5);

  /*
  TBox* box = new TBox();
  //box->SetBorderStyle(2);
  //box->SetBorderSize(1);
  //box->SetFillColor(5);
  //box->SetFillStyle(3002);
  box->DrawBox(169,0,230,5000);
  TLine line;
  line.DrawLine(169,0,169,5000);
  line.DrawLine(230,0,230,5000);
  hdummy->Draw("axissame");
  */

  gband->Draw("samef");
  g->Draw("samel");

  // gulcband->SetFillStyle(3002);
  // gulcband->Draw("samef");

  gulcband_line->SetFillStyle(3002);
  gulcband_line->Draw("samef");

  gband->Draw("samef");
  g->Draw("samel");

  if( plotObserved ){
    if( !logInterpolate ){
      //gul->Draw("samel");
      //gul2->Draw("samel");
      gulc->Draw("samel");
      gulcexp->Draw("samel");
      //gulcexpp1->Draw("samel");
      //gulcexpm1->Draw("samel");
    }

    else{
      //gul_line->Draw("samel");
      //gul2_line->Draw("samel");
      gulc_line->Draw("samel");
      gulcexp_line->Draw("samel");
      //gulcexpp1_line->Draw("samel");
      //gulcexpm1_line->Draw("samel");
    }
  }

  // gulc_line->SetLineColor(2);
  // gulc_line->SetLineWidth(1);
  // gulc_line->SetMarkerColor(2);
  // gulc_line->Draw("samelp");

  if( plotExpected ){
    //gulexp->Draw("samel");
    //gul2exp->Draw("samel");
    gulcexp->Draw("samel");
  }




  //gband->Draw("samef");
  //g->Draw("samel");
  //gup->Draw("samel");
  //gdn->Draw("samel");

  //gulexp->Draw("samel");
  //gul2exp->Draw("samel");

  // g1->SetMinimum(0);
  // g1->SetMaximum(5000);
  // g1->Draw("samel");
  // g2->Draw("samel");

  //g1->Draw("Al");
  //g2->Draw("samel");
  
  float xmin = 165;
  float xmax = 239;

  TBox* box = new TBox();
  //box->SetBorderStyle(2);
  //box->SetBorderSize(1);
  //box->SetFillColor(5);
  //box->SetFillStyle(3002);
  //box->DrawBox(xmin,0,xmax,5000);

  TLine line;
  //line.DrawLine(xmin,0,xmin,5000);
  //line.DrawLine(xmax,0,xmax,5000);

  hdummy->Draw("axissame");
  // g->SetMinimum(0);
  // g->SetMaximum(3000);
  // g->Draw("samec");
  // gul->Draw("samel");
  // gul2->Draw("samel");

  //TLegend *leg = new TLegend(0.4,0.6,0.9,0.8);

  TH1F* hgexp = new TH1F("hgexp","",1,0,1);
  hgexp->SetLineColor(4);
  hgexp->SetLineWidth(5);
  hgexp->SetLineStyle(2);
  hgexp->SetFillColor(7);
  hgexp->SetFillStyle(3002);



  TLegend *leg = new TLegend(0.45,0.7,0.9,0.88);
  if( plotObserved ){
    leg->AddEntry(gulc    ,"Observed UL","l");
    //leg->AddEntry(gulc    ,"Combined observed UL","l");
    //leg->AddEntry(gulcexp ,"combined median expected UL","l");
    leg->AddEntry(hgexp   ,"Median expected UL (#pm1#sigma)","lf");
    //leg->AddEntry(gul     ,"2#font[12]{l}2j observed UL","l");
    //leg->AddEntry(gul2    ,"4#font[12]{l} observed UL","l");

  }
  if( plotExpected ){
    //leg->AddEntry(gulexp  ,"expected UL (VZ+E_{T}^{miss})","l");
    //leg->AddEntry(gul2exp ,"expected UL (multi-lepton)","l");
    //leg->AddEntry(gulcexp ,"expected UL (combined)","l");
    //leg->AddEntry(gulcexp ,"Expected UL","l");
  }



  TH1F* hg = new TH1F("h","",1,0,1);
  hg->SetLineColor(2);
  hg->SetLineWidth(3);
  hg->SetFillColor(5);

  //leg->AddEntry(g,  "theory","l");
  leg->AddEntry(hg,  "#sigma^{NLO} theory (#pm1#sigma)","lf");

  //leg->AddEntry(box,"excluded region","f");
  leg->SetBorderSize(0);
  leg->SetFillColor(0);
  leg->SetTextSize(0.03);
  leg->Draw();

  TLatex *t = new TLatex();
  t->SetNDC();								
  t->SetTextSize(0.04);
  //t->DrawLatex(0.18,0.92,"CMS Preliminary       #sqrt{s} = 7 TeV, #scale[0.6]{#int}Ldt = 4.98 fb^{-1}");
  //t->DrawLatex(0.18,0.93,"CMS Preliminary,  #sqrt{s}=7 TeV,  L_{int}=4.98 fb^{-1}");
  cmsPrelim(9.2,isPreliminary);
  t->SetTextSize(0.04);
  //t->DrawLatex(0.47,0.45,"");
  t->DrawLatex(0.57,0.63,"GMSB  ZZ + E_{T}^{miss}");

  t->DrawLatex(0.2,0.25,"tan #beta = 2");
  t->DrawLatex(0.2,0.2,"M_{1} = M_{2} = 1 TeV");

  if( printplots ){
    if( isPreliminary) c1->Print("GMSB_Fig12_prelim.pdf");
    else               c1->Print("GMSB_Fig12.pdf");

    c1->Print("Figure11.pdf");
    c1->Print("Figure11.png");

    // c1->Print("GMSB.png");
    // c1->Print("GMSB.eps");
    // gROOT->ProcessLine(".! ps2pdf GMSB.eps GMSB_ppt.pdf");
  }	   
}
Пример #21
0
void monplots(TString runno, TString filename, TString module, TWISMacroResult & results)
{

  Double_t maxenerms = 1.5;
  Double_t maxpedrms = 0.8;

  TString defdir = "castor/cern.ch/user/t/tilebeam/commissioning/";
  TString deffile = "tiletb_"+runno+"_MonoCis.0.root";

  if(filename == ""){
    filename = defdir+deffile;
  }


  TFile *f = TFile::Open(filename);
  TTree *t = (TTree*)f->Get("TileRec/h1000");

  Float_t efit[48], pedfit[48];
  Int_t cispar[16];

  TString vare = "Efit"+module;
  TString varp = "Pedfit"+module;
  TString varc = "Cispar";
  t->SetBranchAddress(vare, &efit);
  t->SetBranchAddress(varp, &pedfit);
  t->SetBranchAddress(varc, &cispar);

  Int_t nevt = t->GetEntries();
  Int_t nevt_for_2D = (nevt>MAXEVT_FOR_2D) ? MAXEVT_FOR_2D : nevt;
  Int_t i, j;

  /********** MonExpert **********/
  Int_t samp[48][9];
  TString var = "Sample"+module;
  t->SetBranchAddress(var, &samp);

  TH1F *h[48];
  TH2F *c[48];
  TString hname, htitle;
  TString cname, ctitle;
  /*******************************/


  t->GetEntry(100);
  Double_t charge = 2*4.096*cispar[6]*cispar[7]/1023;
  Double_t uphist = charge +20;
  Double_t minmean = charge - 10;

  TH1F *hene[48], *hped[48];
  TString nene, tene, nped, tped;

  for(j=0;j<48;j++){
    nene = "ene";
    nene += j;
    tene = "Energy ";
    tene += j;
    hene[j]=new TH1F(nene, tene, 100, 0, uphist);

    nped = "ped";
    nped += j;
    tped = "Pedestal ";
    tped += j;
    hped[j]=new TH1F(nped, tped, 100, 0, 100);

    /********** MonExpert **********/
    hname = "Amp";
    hname += j;
    htitle="Sample 3, ch";
    htitle += j;
    h[j]=new TH1F(hname, htitle, 100, 0, 200);

    cname = "amptime";
    cname += j;
    ctitle="Sample3vsTime,ch";
    ctitle += j;
    c[j]=new TH2F(cname, ctitle, nevt_for_2D/10, 0, nevt_for_2D, 100, 0, 200);
    /*******************************/
  }

  for(Int_t i=0;i<nevt;i++)
  {
    t->GetEntry(i);

    for(j=0;j<48;j++)
    {
      hene[j]->Fill(efit[j]);
      hped[j]->Fill(pedfit[j]);

      /********** MonExpert **********/
      if (i % 20 == 0 && i < MAXEVT_FOR_2D)
      {
        h[j]->Fill(samp[j][3]);
        c[j]->Fill(i, samp[j][3]);
      }
      /*******************************/
    }
  }

  Double_t chan[48], meanene[48], rmsene[48], meanped[48], rmsped[48];
  vector<Int_t> bad;

  Double_t badMeanEneX[48], badRMSEneX[48], badPedRMSX[48];
  Double_t badMeanEneY[48], badRMSEneY[48], badPedRMSY[48];
  Int_t NbadMeanEne = 0, NbadRMSEne = 0, NbadPedRMS = 0;

  for(j=0;j<48;j++){
    chan[j]=j;

    if(j != 31 && j!=32 && j!=43){
      meanene[j]=hene[j]->GetMean();
      if (meanene[j] < minmean)
      {
      	badMeanEneX[NbadMeanEne] = j;
      	badMeanEneY[NbadMeanEne] = meanene[j];
      	NbadMeanEne++;
      }
      
      rmsene[j]=hene[j]->GetRMS();
      if (rmsene[j] > maxenerms)
      {
      	badRMSEneX[NbadRMSEne] = j;
      	badRMSEneY[NbadRMSEne] = rmsene[j];
      	NbadRMSEne++;
      }
      
      meanped[j]=hped[j]->GetMean();
      
      rmsped[j]=hped[j]->GetRMS();
      if (rmsped[j] > maxpedrms)
      {
      	badPedRMSX[NbadPedRMS] = j;
      	badPedRMSY[NbadPedRMS] = rmsped[j];
      	NbadPedRMS++;
      }

      if(meanene[j] < minmean || rmsene[j] > maxenerms || rmsped[j] > maxpedrms)
        bad.push_back(j);
    }
    else {
      meanene[j]=0.0;
      rmsene[j]=0.0;
      
      meanped[j]=0.0;
      rmsped[j]=0.0;
    }
  }

  TLine *lmean = new TLine(0, minmean, 50, minmean);
  lmean->SetLineColor(2);
  TLine *lenerms = new TLine(0, maxenerms, 50, maxenerms);
  lenerms->SetLineColor(2);
  TLine *lpedrms = new TLine(0, maxpedrms, 50, maxpedrms);
  lpedrms->SetLineColor(2);


  TPolyMarker *badMeanEne = new TPolyMarker(NbadMeanEne, badMeanEneX, badMeanEneY, "p");
  badMeanEne->SetMarkerColor(2);
  badMeanEne->SetMarkerStyle(21);

  TPolyMarker *badRMSEne = new TPolyMarker(NbadRMSEne, badRMSEneX, badRMSEneY, "p");
  badRMSEne->SetMarkerColor(2);
  badRMSEne->SetMarkerStyle(21);

  TPolyMarker *badPedRMS = new TPolyMarker(NbadPedRMS, badPedRMSX, badPedRMSY, "p");
  badPedRMS->SetMarkerColor(2);
  badPedRMS->SetMarkerStyle(21);


  TGraph *genemean = new TGraph(48, chan, meanene);
  genemean->SetMarkerStyle(21);
  genemean->SetTitle("Mean Energy");
  genemean->GetXaxis()->SetTitle("Channel");
  TGraph *generms = new TGraph(48, chan, rmsene);
  generms->SetMarkerStyle(21);
  generms->SetTitle("RMS Energy");
  generms->GetXaxis()->SetTitle("Channel");
  TGraph *gpedmean = new TGraph(48, chan, meanped);
  gpedmean->SetMarkerStyle(21);
  gpedmean->SetTitle("Mean Pedestal");
  gpedmean->GetXaxis()->SetTitle("Channel");
  TGraph *gpedrms = new TGraph(48, chan, rmsped);
  gpedrms->SetMarkerStyle(21);
  gpedrms->SetTitle("RMS Pedestal");
  gpedrms->GetXaxis()->SetTitle("Channel");

  TCanvas *cmon= new TCanvas("cmon", "MonoCis", 700, 500);
  cmon->Divide(2,2);
  cmon->cd(1);
  genemean->Draw("AP");
  lmean->Draw();
  badMeanEne->Draw();
  cmon->cd(2);
  generms->Draw("AP");
  lenerms->Draw();
  badRMSEne->Draw();
  cmon->cd(3);
  gpedmean->Draw("AP");
  cmon->cd(4);
  gpedrms->Draw("AP");
  lpedrms->Draw();
  badPedRMS->Draw();

  cout.precision(3);
  //cout<<"Number of bad channels is "<<bad.size()<<"<br />"<<endl;
  results.addValue("Number of bad channels", bad.size());

  if(bad.size() > 0)
  {
    //cout<<"Channel"<<'\t'<<"Mean energy"<<'\t'<<"RMS energy"<<'\t'<<"RMS Monocis"<<"<br />"<<endl;
    TString table;
    table  = "<table class=\"main\" xmlns=\"http://www.w3.org/1999/xhtml\">\n";
    table += "<tr><th>Channel</th><th>Mean energy</th><th>RMS energy</th><th>RMS Monocis</th></tr>\n";

    for(i=0;i<bad.size();i++)
    {
      Int_t ch = bad.at(i);
      //cout<<ch<<"\t"<<meanene[i]<<"\t\t"<<rmsene[i]<<"\t\t"<<rmsped[i]<<"<br />"<<endl;
      table += "<tr><td>"; table += ch; table += "</td><td>"; table += meanene[i]; table += "</td><td>";
      table += rmsene[i]; table +="</td><td>"; table += rmsped[i]; table +="</td></tr>\n";
    }
    
    table += "</table>\n";
    results.addTable("Bad channels", table);
  }

  TString moduleDir = "LB" + module + "/";
  
  TString filenameps = outputDir + moduleDir +"r"+runno+"_"+module+"_MonoCis.ps";
  TString filenamepng = outputDir + moduleDir +"r"+runno+"_"+module+"_MonoCis.png";
  cmon->Print(filenameps);
  cmon->Print(filenamepng);

  TString plotFilename = outputWebDir + moduleDir + "r"+runno+"_"+module+"_MonoCis.png";
  TString plotPsFilename = outputWebDir + moduleDir + "r"+runno+"_"+module+"_MonoCis.ps";

  TString completeModuleName = "LB" + module;
  wis2Tilecomm(runno.Data(), completeModuleName.Data(), plotFilename.Data(), results);
  wis2Tilecomm(runno.Data(), completeModuleName.Data(), plotPsFilename.Data(), results);

  TString linkTitle = "Send results to QC Sheet";
  TString linkHref = "http://atlasmonitor.web.cern.ch/atlasmonitor/saveValuesExample.jsp?module=";
  linkHref += "LB" + module + "&run=" + runno + "&badChannels=";
  linkHref += bad.size();
  //results.addLink(linkTitle, linkHref);
  
  results.addPlot("", plotFilename);

  
  /********** MonExpert **********/
  
  TCanvas *c1 = new TCanvas("c1", "Amp,1-24", 900, 900);
  c1->Divide(4,6);
  TCanvas *c5 = new TCanvas("c5", "Amp,25-48", 900, 900);
  c5->Divide(4,6);

  TCanvas *c3 = new TCanvas("c3", "AmpTime,1-24", 900, 900);
  c3->Divide(4,6);
  TCanvas *c7 = new TCanvas("c7", "AmpTime,25-48",900,900);
  c7->Divide(4,6);

  for(j = 0; j < 24; j++)
  {
    c1->cd(j+1);
    gPad->SetLogy();
    h[j]->Draw();
    c5->cd(j+1);
    gPad->SetLogy();
    h[j+24]->Draw();

    c3->cd(j+1);
    c[j]->Draw();
    c7->cd(j+1);
    c[j+24]->Draw();

  }

  // Saving plots to disk
  filenamepng = outputDir + "expert/" + moduleDir + "r" + runno + "_" + module + "_MonoCis_Expert_Amp1-24.png";
  c1->Print(filenamepng);
  filenamepng = outputDir + "expert/" + moduleDir + "r" + runno + "_" + module + "_MonoCis_Expert_Amp25-48.png";
  c5->Print(filenamepng);
  filenamepng = outputDir + "expert/" + moduleDir + "r" + runno + "_" + module + "_MonoCis_Expert_AmpTime1-24.png";
  c3->Print(filenamepng);
  filenamepng = outputDir + "expert/" + moduleDir + "r" + runno + "_" + module + "_MonoCis_Expert_AmpTime25-48.png";
  c7->Print(filenamepng);

  completeModuleName = "LB" + module;

  // Saving plots to Results Database (TileComm Analysis)
  TString plot1 = outputWebDir + "expert/" + moduleDir + "r"+runno+"_"+module+"_MonoCis_Expert_Amp1-24.png";
  wis2Tilecomm(runno.Data(), completeModuleName.Data(), plot1.Data(), results);

  TString plot2 = outputWebDir + "expert/" + moduleDir + "r"+runno+"_"+module+"_MonoCis_Expert_Amp25-48.png";
  wis2Tilecomm(runno.Data(), completeModuleName.Data(), plot2.Data(), results);

  TString plot3 = outputWebDir + "expert/" + moduleDir + "r"+runno+"_"+module+"_MonoCis_Expert_AmpTime1-24.png";
  wis2Tilecomm(runno.Data(), completeModuleName.Data(), plot3.Data(), results);

  TString plot4 = outputWebDir + "expert/" + moduleDir + "r"+runno+"_"+module+"_MonoCis_Expert_AmpTime25-48.png";
  wis2Tilecomm(runno.Data(), completeModuleName.Data(), plot4.Data(), results);

  
  // Showing links in macro results page
  results.addValue("MonoCis Expert Plots", "");
  results.addLink("Amp Channels 1-24", plot1);
  results.addLink("Amp Channels 25-48", plot2);
  results.addLink("AmpTime Channels 1-24", plot3);
  results.addLink("AmpTime Channels 25-48", plot4);

  /*******************************/

}
Пример #22
0
/**
The purpose of this function is to conveniently plot an event. Each event is plotted on a TCanvas. Divided into as many pads as there are panels. Each pad is a TMultiGraph with a TLegend, and shows the channels of the digitizer connected to the lines of that panel. The grouping into pads must not necessarily be according to panels, but in any other prefered way.

@param a_channels - a vector of a vector of samples, containing all 32 channels
@ param a_channelsToPadsAssociation - a map from std::string, which is the name of the panel (or group of channels) to be assigned to each pad to a vector if integers, which is the list of channels indices corresponding to indices of channels in the paramater a_channels to associate to a pad
@param sEventTitle - a string containing the title of the event (for example, the time stamp)
*/
void RangePlotter::PlotRanges(Channels_t& a_channels, Range_t& a_channelsToPadsAssociation, std::string sEventTitle)
{	
//	printf("Plotting\n");
	//m_pCanvas->Clear();
	m_pCanvas->SetTitle(sEventTitle.c_str());
	
	
	int iPadCounter = 0;
	if(0 == m_vpMultiGraph.size())
	{
		MakePads(a_channelsToPadsAssociation.size());	
		for (auto& rangeIt: a_channelsToPadsAssociation)
		{	
			TMultiGraph* pMg = new TMultiGraph();	
			m_vpMultiGraph.push_back(std::unique_ptr<TMultiGraph>(pMg));

	//		m_pCanvas->cd(iPadCounter + 1);
			ChangePad(iPadCounter);
			int i = 0;

			auto legend = new TLegend(0.8,0.8,1,1, "Channels");
			m_vpLegends.push_back(std::unique_ptr<TLegend>(legend));
			printf("printing panel %s\n", rangeIt.first.c_str());
			for (auto& chanIt: rangeIt.second)
			{
				int iNumOfSamples = a_channels[chanIt].size();
				TGraph* pGr = new TGraph(iNumOfSamples);
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					pGr->SetPoint(counter, vTimeSeq[counter], TransformToVoltage(a_channels[chanIt][counter]));
				}

				m_vpGraph[chanIt] = pGr;
				pGr->SetLineColor(m_colors[i%(sizeof(m_colors)/sizeof(int))]);
				pGr->SetName((m_sInstanceName + std::string("Pan_") + rangeIt.first + std::string("chan_") + std::to_string(chanIt)).c_str());
				std::string sGraphTitle = std::string("Channel ") + std::to_string(chanIt);
				pGr->SetTitle(sGraphTitle.c_str());
				legend->AddEntry(pGr,std::to_string(chanIt).c_str(), "l");
		
				pMg->Add(pGr);
				i++;
			}

			if(Configuration::Instance().ShowTriggerInWaveformsStep())
			{
				int iNumOfSamples = a_channels[a_channels.size() - 1].size();
				m_vpGraphPrecisionTrigger = new TGraph(iNumOfSamples);
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					m_vpGraphPrecisionTrigger->SetPoint(counter, vTimeSeq[counter], TransformToVoltage(a_channels[a_channels.size() - 1][counter]));
				}
				
				m_vpGraphPrecisionTrigger->SetName((m_sInstanceName + std::string("Pan_") + rangeIt.first + "_Trig").c_str());	
				m_vpGraphPrecisionTrigger->SetTitle("Trigger");
				legend->AddEntry(m_vpGraphPrecisionTrigger,"Trigger", "l");
				pMg->Add(m_vpGraphPrecisionTrigger);
			}
			
			std::string sMultiGraphTitle = std::string("Panel ") + rangeIt.first;
			pMg->SetTitle(sMultiGraphTitle.c_str());

			pMg->Draw("AL");
			pMg->GetXaxis()->SetTitle("Time [nanoseconds]");
			pMg->GetXaxis()->CenterTitle();
			pMg->GetYaxis()->SetTitle("Voltage [volts]");
			pMg->GetYaxis()->CenterTitle();

			gPad->Modified();

			pMg->SetMinimum(m_fMinVoltage);
			pMg->SetMaximum(m_fMaxVoltage);
			legend->Draw();
			iPadCounter++;
		}
		m_pCanvas->Update();
	}
	else
	{
//		printf("Plottin again\n");
		for (auto& rangeIt: a_channelsToPadsAssociation)
		{
			printf("Panel %s\n", rangeIt.first.c_str());
			m_pCanvas->cd(iPadCounter + 1);
			for (auto& chanIt: rangeIt.second)
			{
//				printf("Chanenl %d\n", chanIt);
				//TODO: num of samples is constant per run at least!
				m_vpGraph[chanIt]->SetLineWidth(1);
				int iNumOfSamples = a_channels[chanIt].size();	
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);	
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					(m_vpGraph[chanIt]->GetY())[counter] = TransformToVoltage(a_channels[chanIt][counter]);
				}

				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					(m_vpGraphPrecisionTrigger->GetY())[counter] = TransformToVoltage(a_channels[a_channels.size() - 1][counter]);
				}
	
				gPad->Modified();
			}

			m_vpMultiGraph[iPadCounter]->Draw("AC");
			m_vpLegends[iPadCounter]->Draw();
			iPadCounter++;
		}
		printf("Updating\n");
		m_pCanvas->Update();
		printf("After updating\n");
	}
	printf("done\n");
}
Пример #23
0
void RoutePlot(){
gStyle->SetTitleX(0.21);
gStyle->SetTitleY(0.98);

  const int minIteration=0;
  const int Iteration=10;
  int nParticles=20;
  
  TGraph* emptygraph = new TGraph(1);
  emptygraph->SetPoint(0,1000,0.005);
  
  std::vector< std::vector<TGraph*> > graphs;
  std::vector<TPolyLine*> lines;
  std::vector<TGraph*> FirstPoints;
  std::vector<TGraph*> LastPoints;
  std::vector< std::vector<TArrow*> > arrows;
  

  //get max an min ROC
  Int_t bestPartIteration[Iteration];
  Double_t bestROCIteration[Iteration];
  for(int o=0;o<Iteration;o++){bestROCIteration[o]=0.0;}
  Double_t maxROC=0.0;
  Double_t minROC=1.0;
  Double_t bestROCGlobal=0.0;
  for(int i=0;i<nParticles;i++){
//      if(!(i==1 or i==13 or i==5 or i==6 or i==8 or i==4 or i==14 or i==18))continue;

//     std::cout<<i<<std::endl;
    std::string buffer="";
    std::stringstream buffer2;
    buffer2<<i;
//     std::cout<<buffer2.str()<<" "<<buffer2.str()<<std::endl;
//     buffer2>>buffer;
    std::string filename="../Particles_long/Particle";
    filename+=buffer2.str();
    filename+="/ParticleRoute.txt";
//     std::cout<<filename.c_str()<<std::endl;
    std::ifstream inputfile(filename.c_str());
//     std::ifstream inputfile("Particles_long/Particle1/ParticleRoute.txt");

    int k=0;
    double nTrees=0.0;
    double shrinkage=0.0;
    double bagging=0.0;
    double cuts=0.0;
    double ROC=0.0;
    double KS=0.0;
    double depth=0.0;
    bool readline=true;
    while(readline){
      inputfile>>ROC;
      inputfile>>KS;
      inputfile>>nTrees;
      inputfile>>shrinkage;
      inputfile>>bagging;
      inputfile>>cuts;
//       inputfile>>depth;
      std::string dump="";
      int j=0;
      do{
        inputfile>>dump;
//         std::cout<<dump<<std::endl;
        j++;
//         if(dump=="--Next--")std::cout<<"here"<<std::endl;
//         if(dump=="--Next--\n")std::cout<<"too"<<std::endl;
//         if(dump=="")std::cout<<"never"<<std::endl;

      }while(dump!="--Next--" and dump!="--Next--\n" and dump!="");
//       std::cout<<"Data "<<nTrees<<" "<<shrinkage<<" "<<ROC<<std::endl;
      if(dump!="" and k>=minIteration){
        if(ROC>maxROC)maxROC=ROC;
        if(ROC<minROC and ROC!=0)minROC=ROC;
      
      }
      k++;
//      inputfile>>dump;
      if(inputfile.eof() or dump=="" or k==Iteration)readline=false;
    }

    inputfile.close();
    std::cout<<"NPoints: "<<k<<std::endl;
  }
  std::cout<<"ROC range "<<minROC<<"  "<<maxROC<<std::endl;
  
  //get marker scaling;
  Double_t maxSize=2.4;
  Double_t minSize=0.3;
  minROC=0.74;
  Double_t m = (maxSize-minSize)/(maxROC-minROC);
  Double_t abschnitt = maxSize-m*maxROC;
  std::cout<<m<<" "<<abschnitt<<std::endl;
  std::cout<<minSize<<" "<<maxSize<<std::endl;

      
  //read points
  for(int i=0;i<nParticles;i++){
      if(!(i==1 or i==2 or i==4 or i==10 or i==13 or i==14 or i==17))continue;

    std::cout<<i<<std::endl;
    std::string buffer="";
    std::stringstream buffer2;
    buffer2<<i;
//     std::cout<<buffer2.str()<<" "<<buffer2.str()<<std::endl;
//     buffer2>>buffer;
    std::string filename="../Particles_long/Particle";
    filename+=buffer2.str();
    filename+="/ParticleRoute.txt";
    std::cout<<filename.c_str()<<std::endl;
    std::ifstream inputfile(filename.c_str());
//     std::ifstream inputfile("Particles_long/Particle1/ParticleRoute.txt");

    std::vector< TGraph*> buffgraph;
    graphs.push_back( buffgraph);
    lines.push_back(new TPolyLine);
    FirstPoints.push_back(new TGraph);
    LastPoints.push_back(new TGraph);
    std::vector< TArrow*> buffarrow;
    arrows.push_back(buffarrow);


    int k=0;
    int kk=0;
    double nTrees=0.0;
    double shrinkage=0.0;
    double bagging=0.0;
    double cuts=0.0;
    double ROC=0.0;
    double KS=0.0;
    double depth=0.0;
    
    bool readline=true;
    while(readline){
      inputfile>>ROC;
      inputfile>>KS;
      inputfile>>nTrees;
      inputfile>>shrinkage;
      inputfile>>bagging;
      inputfile>>cuts;
//       inputfile>>depth;
      std::string dump="";
      int j=0;
      do{
        inputfile>>dump;
//         std::cout<<dump<<std::endl;
        j++;
//         if(dump=="--Next--")std::cout<<"here"<<std::endl;
//         if(dump=="--Next--\n")std::cout<<"too"<<std::endl;
//         if(dump=="")std::cout<<"never"<<std::endl;

      }while(dump!="--Next--" and dump!="--Next--\n" and dump!="");
//       std::cout<<"Data "<<nTrees<<" "<<shrinkage<<" "<<ROC<<std::endl;
      if(dump!="" and k>=minIteration){
        kk++;
        graphs.back().push_back(new TGraph);
        graphs.back().back()->SetPoint(0,nTrees,shrinkage);
        if(ROC==0)graphs.back().back()->SetMarkerStyle(3);
        else{
          graphs.back().back()->SetMarkerStyle(8);
//           std::cout<<TMath::Exp(ROC)<<std::endl;
          Double_t size=m*ROC+abschnitt;
          graphs.back().back()->SetMarkerSize(size); 
          std::cout<<j<<" "<<ROC<<" "<<size<<std::endl;

        }
        if(k==minIteration)graphs.back().back()->SetMarkerStyle(34);
        if(k>=minIteration)lines.back()->SetPoint(kk-1,nTrees,shrinkage);
        
        
           
          
          //if(k==0)FirstPoints.back()->SetPoint(0,nTrees,shrinkage);
      
      }
      if(ROC>=bestROCIteration[k]){
      bestROCIteration[k]=ROC;
      bestPartIteration[k]=i;
//       if(ROC>=bestROCGlobal)bestROCGlobal=ROC;
//       if(bestROCGlobal>=bestROCIteration[k])bestROCIteration[k]=bestROCGlobal;
      }
      
      k++;
//      inputfile>>dump;
      if(inputfile.eof() or dump=="" or k==Iteration)readline=false;
    }
    
//     LastPoints.back()->SetPoint(0,nTrees,bagging);

    inputfile.close();
    std::cout<<"NPoints: "<<k<<std::endl;
    
    //get velocities
    for(size_t l=1;l<graphs.back().size()-1;l++){
//       std::cout<<graphs.size()<<std::endl;
      Double_t PrevTrees=0.001;
      Double_t PrevShrinkage=0.001;
      graphs.back().at(l-1)->GetPoint(0,PrevTrees,PrevShrinkage);
//       std::cout<<PrevTrees<<" "<<PrevShrinkage<<std::endl;
      Double_t CurrTrees;
      Double_t CurrShrinkage;
      graphs.back().at(l)->GetPoint(0,CurrTrees,CurrShrinkage);
      Double_t NextTrees;
      Double_t NextShrinkage;
      graphs.back().at(l+1)->GetPoint(0,NextTrees,NextShrinkage);
      Double_t velTree=CurrTrees-PrevTrees;
      Double_t velShrinkage=CurrShrinkage-PrevShrinkage;
      Double_t nvelTree=NextTrees-CurrTrees;
      Double_t nvelShrinkage=NextShrinkage-CurrShrinkage;
      Double_t forceTrees=nvelTree-0.73*velTree;
      Double_t forceShrinkage=nvelShrinkage-0.73*velShrinkage;
      arrows.back().push_back(new TArrow(CurrTrees,CurrShrinkage,CurrTrees+forceTrees,CurrShrinkage+forceShrinkage,0.02,">"));
      
    }
    
  }//end input loop
    
    //Get velocities
    
    
    TCanvas* c = new TCanvas("c","c",1024,768);
    TLegend* leg= new TLegend(0.5,0.75,0.7,0.95);
    leg->SetFillColor(0);
    leg->SetTextFont(42);
    std::vector<TGraph*> leggraphs;

    for(size_t i=0;i<graphs.size();i++){
      leggraphs.push_back(new TGraph);
      leggraphs.back()->SetMarkerColor(1+i);
      leggraphs.back()->SetMarkerStyle(8);
      leggraphs.back()->SetMarkerSize(1);
      if(i==2)leggraphs.back()->SetMarkerColor(9);
      leg->AddEntry(leggraphs.back(), Form("particle %i",i+1),"p");
    }
    TLegend* legMarker= new TLegend(0.7,0.65,0.9,0.95);
    legMarker->SetFillColor(0);
    legMarker->SetFillStyle(0);
    legMarker->SetTextFont(42);
    TLegend* legCMS= new TLegend(0.07,0.85,0.39,0.95);
    legCMS->SetFillColor(0);
    legCMS->SetFillStyle(0);
    legCMS->SetBorderSize(0);
    legCMS->SetTextFont(42);
    legCMS->AddEntry((TObject*)0,"CMS private work","");
    TPaveText* legExplain= new TPaveText(0.23,0.84,0.73,0.94,"NDC");
    legExplain->SetFillColor(3);
    legExplain->SetFillStyle(0);
    legExplain->SetBorderSize(0);
    legExplain->AddText("BDTs trained and tested with t#bar{t}H, H#rightarrowb#bar{b} and t#bar{t} MC-Samples");
    legExplain->SetTextFont(42);
    
    TGraph* initMarker = new TGraph();
    initMarker->SetMarkerStyle(34);
    initMarker->SetMarkerSize(1.5);
    TGraph* zeroKSMarker = new TGraph();
    zeroKSMarker->SetMarkerStyle(3);
    zeroKSMarker->SetMarkerSize(1.5);
    legMarker->AddEntry(initMarker,"init. pos.","p");
    
    TArrow* legArrow = new TArrow(100,0.01,200,0.02,0.02,">");
    TArrow* legArrow2 = new TArrow(1270,0.0453,1320,0.0453,0.02,">");
    
    legArrow->SetLineColor(0);
    legArrow->SetFillColor(0);
    legArrow2->SetLineWidth(2);
    legArrow2->SetAngle(40);
    legMarker->AddEntry(legArrow,"#Delta#vec{v}","");
//         legMarker->AddEntry((TObject*)0,"","");
    legMarker->AddEntry(zeroKSMarker,"KS < min KS","p");

    TGraph* sizegraph1 = new TGraph();
    sizegraph1->SetMarkerStyle(8);
    Double_t size2=m*0.74+abschnitt;
    sizegraph1->SetMarkerSize(size2);
    legMarker->AddEntry(sizegraph1, "A_{ROC} = 0.74","p");
    TGraph* sizegraph2 = new TGraph();
    sizegraph2->SetMarkerStyle(8);
    size2=m*0.76+abschnitt;
    sizegraph2->SetMarkerSize(size2);
    legMarker->AddEntry(sizegraph2, "A_{ROC} = 0.76","p");
    TGraph* sizegraph3 = new TGraph();
    sizegraph3->SetMarkerStyle(8);
    size2=m*0.78+abschnitt;
    sizegraph3->SetMarkerSize(size2);
    legMarker->AddEntry(sizegraph3, "A_{ROC} = 0.78","p");
    
    
    
    for(size_t i=0;i<graphs.size();i++){

      if(i==0){
        c->cd();
        
        
        emptygraph->Draw("AP");
        c->Update();
        emptygraph->GetXaxis()->SetLimits(200,1600);
        emptygraph->GetXaxis()->SetRangeUser(200,1600);

        emptygraph->GetYaxis()->SetLimits(0.0,0.05);
        emptygraph->GetYaxis()->SetRangeUser(0.0,0.05);
        //emptygraph->SetTitle("particle paths in the n_{Trees} - shrinkage plane");
        emptygraph->SetTitle("");
        emptygraph->GetXaxis()->SetTitle("n_{Trees}");
        emptygraph->GetYaxis()->SetTitle("shrinkage");
        emptygraph->GetYaxis()->SetTitleOffset(1.5);
        emptygraph->GetXaxis()->SetTitleOffset(1.2);
       std::cout<<emptygraph->GetXaxis()->GetTitleFont()<<std::endl;

	c->SetTopMargin(0.05);
        c->Update();
        for(size_t j=0;j<graphs.at(i).size();j++){
//           graphs.at(i).at(j)->SetMarkerStyle(3);
          graphs.at(i).at(j)->SetMarkerColor(1+i);
          graphs.at(i).at(j)->SetLineColor(1+i);
//         graphs.at(i)->GetXaxis()->SetLimits(200.0,2500.0);
//         graphs.at(i)->GetYaxis()->SetLimits(0.1,0.9);
//         graphs.at(i)->GetZaxis()->SetRangeUser(0.0,1.0);
          graphs.at(i).at(j)->Draw("P SAME");
        c->Update();
        }
        for(size_t j=0;j<arrows.at(i).size();j++){
          arrows.at(i).at(j)->SetLineColor(1+i);
          arrows.at(i).at(j)->SetFillColor(1+i);
          arrows.at(i).at(j)->SetAngle(40);
          arrows.at(i).at(j)->SetLineWidth(1.9);
          arrows.at(i).at(j)->Draw("");
          c->Update();
        }
        lines.at(i)->SetLineColor(1+i);
        lines.at(i)->SetLineStyle(7);
        lines.at(i)->Draw();
        c->Update();
        
//         FirstPoints.at(i)->SetMarkerStyle(20);
//         FirstPoints.at(i)->SetMarkerColor(1+i);
//         FirstPoints.at(i)->Draw("P SAME");
//         LastPoints.at(i)->SetMarkerStyle(21);
//         LastPoints.at(i)->SetMarkerColor(1+i);
//         LastPoints.at(i)->Draw("P SAME");
//         c->Update();
//         LastPoints.at(i)->GetXaxis()->SetRangeUser(200.0,2500.0);
//         LastPoints.at(i)->GetYaxis()->SetRangeUser(0.0001,0.05);
//         LastPoints.at(i)->GetZaxis()->SetRangeUser(0.0,1.0);
//         LastPoints.at(i)->Draw("P SAME");

//         graphs.at(i)->Draw("P SAME");
        c->Update();
//         TObject* view = c->GetView3D();
//         TAxis3D *axis = TAxis3D::GetPadAxis();
//         std::cout<<view<<std::endl;
//         TAxis3D::ToggleRulers();     // To pop axice down
//         axis->SetLabelColor(kBlue); // Paint the axice labels with blue color
//         axis->SetAxisColor(kRed);   // Paint the axice itself with blue color
//         TAxis3D::ToggleRulers(); 
//         axis->Paint();// To pop axice up
//         c->Update();
        
      }
      else{
        c->cd();
        for(size_t j=0;j<graphs.at(i).size();j++){
//           graphs.at(i).at(j)->SetMarkerStyle(3);
          graphs.at(i).at(j)->SetMarkerColor(1+i);
          graphs.at(i).at(j)->SetLineColor(1+i);
          if(i==2){
          graphs.at(i).at(j)->SetMarkerColor(9);
          graphs.at(i).at(j)->SetLineColor(9);
          }
//         graphs.at(i)->GetXaxis()->SetRangeUser(200.0,2500.0);
//         graphs.at(i)->GetYaxis()->SetRangeUser(0.0001,0.05);
//         graphs.at(i)->GetZaxis()->SetRangeUser(0.0,1.0);
          graphs.at(i).at(j)->Draw("SAME P");
        c->Update();
        }
        for(size_t j=0;j<arrows.at(i).size();j++){
        arrows.at(i).at(j)->SetLineColor(1+i);
        arrows.at(i).at(j)->SetFillColor(1+i);
        if(i==2){
        arrows.at(i).at(j)->SetLineColor(9);
        arrows.at(i).at(j)->SetFillColor(9);
        }
        arrows.at(i).at(j)->SetAngle(40);
        arrows.at(i).at(j)->SetLineWidth(1.9);


        arrows.at(i).at(j)->Draw("");
        c->Update();
        }
        lines.at(i)->SetLineColor(1+i);
        lines.at(i)->SetLineStyle(7);
        if(i==2)lines.at(i)->SetLineColor(9);

        lines.at(i)->Draw();
        c->Update();
        
// d        FirstPoints.at(i)->SetMarkerStyle(20);
//     d    FirstPoints.at(i)->SetMarkerColor(1+i);
//         FirstPoints.at(i)->Draw("P Same");
//         LastPoints.at(i)->SetMarkerStyle(21);
//         LastPoints.at(i)->SetMarkerColor(1+i);
//         LastPoints.at(i)->Draw("P Same");
        c->Update();
      }
      
    }
    legArrow2->Draw("");
    leg->Draw();
    legMarker->Draw();
    legCMS->Draw();
    //legExplain->Draw();
    c->Update();
    TString outfile="ParticleRoute_";
    outfile+=Iteration;
    outfile+="eng.eps";
    c->SaveAs(outfile);
    
    
    for(int p=0;p<Iteration;p++){
    if(p>0 and bestROCIteration[p-1]>bestROCIteration[p])bestROCIteration[p]=bestROCIteration[p-1];

    std::cout<<p<<" "<<bestROCIteration[p]<<" "<<bestPartIteration[p]<<std::endl;
    
    }
}
Пример #24
0
void buildFakeAngTree(const Char_t* outtag,
                      const Float_t timereso,     // ns
                      const UInt_t  simevts=1,
                      const Float_t thetaOpt=400, // deg
                      const Float_t phiOpt=400,   // deg
                      const Float_t coneOpt=400,  // deg
                      const UInt_t  rseed=23192,
                      const Float_t norm=100.0,   // mV
                      const Float_t noise=20.0,   // mV
                      const Char_t* outdir="/data/users/cjreed/work/simEvts",
                      const Char_t* infn="/w2/arianna/jtatar/nt.sigtemps.root",
                      const Char_t* geofn="/data/users/cjreed/work/"
                                          "BounceStudy/Stn10/"
                                          "CampSiteGeometry.root") {
   // if any of the angles (thetaOpt, phiOpt, coneOpt) > 360, a random
   // value will be used instead
   //
   // expect angles in the Templates tree to be in degrees
   //
   // expect the waveforms in the Templates tree to have amplitude 1
   
   TRandom3 rnd(rseed);
   
   
   geof = TFile::Open(geofn);
   gg = dynamic_cast<TGeoManager*>(geof->Get("CampSite2013"));
   site = dynamic_cast<const TSnGeoStnSite*>(gg->GetTopVolume());
   
   
   TVector3 pos[NSnConstants::kNchans], nvec[NSnConstants::kNchans];
   for (UChar_t ch=0; ch<NSnConstants::kNchans; ++ch) {
      site->SetLPDAPosition(ch, pos[ch]);
      site->SetLPDANormalVec(ch, nvec[ch]);
      Printf("pos ch%d:",ch);
      pos[ch].Print();
      Printf("normal ch%d:",ch);
      nvec[ch].Print();
   }
   
   TArrayD zeros(6);
   
   
   inf = TFile::Open(infn);
   nnt = dynamic_cast<TTree*>(inf->Get("Templates"));
   
   TString infns(infn);
   TString indir;
   Int_t fl(0);
   if (infns.Contains('/')) {
      fl = infns.Last('/') + 1;
      indir = infns(0, fl-1);
   }
   TString plaininfn = infns(fl, infns.Length()-fl);
   TString outfn = Form("%s/FakeEvts.%s.%s", outdir, outtag,
                        plaininfn.Data());
   outf = TFile::Open(outfn.Data(),"recreate");
   outf->cd();
   TParameter<Float_t> trp("TimeResolution", timereso);
   trp.Write();
   TParameter<Float_t> nmp("Normalization", norm);
   nmp.Write();
   TParameter<Float_t> nop("NoiseRMS", noise);
   nop.Write();
   TParameter<UInt_t> rsp("RandomSeed", rseed);
   rsp.Write();
   
   
   TSnCalWvData* wave = new TSnCalWvData;
   Float_t eang(0), hang(0), hpf(0), limiter(0), coneang(0);
   Bool_t bice(kFALSE);
   nnt->SetBranchAddress("wave.",&wave);
   nnt->SetBranchAddress("EAng",&eang);
   nnt->SetBranchAddress("HAng",&hang);
   nnt->SetBranchAddress("hpf",&hpf);
   nnt->SetBranchAddress("limiter",&limiter);
   nnt->SetBranchAddress("coneAng",&coneang);
   nnt->SetBranchAddress("bIce",&bice);
   // to look up waveform for EAng, HAng
   nnt->BuildIndex("EAng + (1000*HAng)","coneAng");
   // find the max angles
   Printf("finding allowed angles...");
   std::set<Float_t> Eangs, Hangs, Cangs;
   const Long64_t nnents = nnt->GetEntries();
   for (Long64_t i=0; i<nnents; ++i) {
      nnt->GetEntry(i);
      Eangs.insert(eang);
      Hangs.insert(hang);
      Cangs.insert(coneang);
   }
#ifdef DEBUG
   std::set<Float_t>::const_iterator ang, end = Eangs.end();
   Printf("EAngs:");
   for (ang=Eangs.begin(); ang!=end; ++ang) {
      Printf("%g",*ang);
   }
   Printf("HAngs:");
   for (ang=Hangs.begin(), end=Hangs.end(); ang!=end; ++ang) {
      Printf("%g",*ang);
   }
   Printf("ConeAngs:");
   for (ang=Cangs.begin(), end=Cangs.end(); ang!=end; ++ang) {
      Printf("%g",*ang);
   }
#endif
   
   Float_t theta(0), phi(0), cone(0);
   Float_t EAng[NSnConstants::kNchans], 
           HAng[NSnConstants::kNchans];
   Float_t CAng(0);
   TSnCalWvData* evdat = new TSnCalWvData;
   TSnEventMetadata* meta = new TSnEventMetadata;
   TSnEventHeader* hdr = new TSnEventHeader;
   //ot = nnt->CloneTree(0);
   //ot->SetName("SimTemplEvts");
   ot = new TTree("SimTemplEvts","simulated events from templates",1);
   ot->SetDirectory(outf);
   ot->Branch("EventMetadata.",&meta);
   ot->Branch("EventHeader.",&hdr);
   ot->Branch("EAng",&(EAng[0]),Form("EAng[%hhu]/F",NSnConstants::kNchans));
   ot->Branch("HAng",&(HAng[0]),Form("HAng[%hhu]/F",NSnConstants::kNchans));
   ot->Branch("CAng",&CAng,"CAng/F");
   ot->Branch("theta",&theta,"theta/F");
   ot->Branch("phi",&phi,"phi/F");
   ot->Branch("NuData.",&evdat);
   // some useful aliases
   TString an;
   for (UChar_t ch=0; ch<NSnConstants::kNchans; ++ch) {
      // to use as a cut for a particular channel:
      an = Form("Ch%d",ch);
      ot->SetAlias(an.Data(),
                   Form("(Iteration$>=(%hhu*%hhu)) && (Iteration$<(%hhu*%hhu))",
                        NSnConstants::kNsamps, ch,
                        NSnConstants::kNsamps,
                        static_cast<UChar_t>(ch+1)));
      // to use as a variable showing the sample number [0,127] for any chan
      an = Form("SmpCh%d",ch);
      ot->SetAlias(an.Data(),
                   Form("Iteration$-%u", static_cast<UInt_t>(ch)
                        *static_cast<UInt_t>(NSnConstants::kNsamps)));
      // e.g. Draw("RawData.fData:SmpCh2","EventHeader.fNum==21 && Ch2","l")
   }

   Printf("generating events...");
   TStopwatch timer;
   timer.Start();
   
   for (UInt_t i=0; i<simevts; ++i) {
      
      if ( (i%1000)==0 ) {
         fprintf(stderr,"Processing %u/%u ...            \r",i,simevts);
      }
      
      // choose angles
      theta = (thetaOpt>360.) ? TMath::ACos( rnd.Uniform(-1.0, 0.0) ) 
                              : thetaOpt * TMath::DegToRad();
      phi   = (phiOpt>360.) ? rnd.Uniform(0.0, TMath::TwoPi())
                            : phiOpt * TMath::DegToRad();
      cone  = (coneOpt>360.) 
         ? rnd.Uniform(*(Cangs.begin()), *(Cangs.rbegin()))
         : coneOpt; // leave this one in degrees (as in the tree)
      CAng = findNearestAllowedAngle(Cangs, cone);
      
#ifdef DEBUG
      Printf("--- theta=%g, phi=%g, cone=%g",
             theta*TMath::RadToDeg(), phi*TMath::RadToDeg(), cone);
#endif
      
      // calculate channel shifts
      TArrayD pwdt = NSnChanCorl::GetPlaneWaveOffsets(theta,
                                                      phi,
                                                      zeros,
                                                      pos,
                                                      kNgTopFirn);
      TVector3 dir;
      dir.SetMagThetaPhi(1.0, theta, phi);
      
#ifdef DEBUG
      TObjArray graphs;
      graphs.SetOwner(kTRUE);
      TCanvas* c1 = new TCanvas("c1","c1",800,700);
      c1->Divide(2,2);
#endif
      
      for (UChar_t ch=0; ch<NSnConstants::kNchans; ++ch) {
         
         // look up the EAng, fhang for this antenna
         Float_t feang(0), fhang(0);
         findEangHang(nvec[ch], dir, feang, fhang);
         feang  = TMath::Abs(TVector2::Phi_mpi_pi(feang));
         fhang  = TMath::Abs(TVector2::Phi_mpi_pi(fhang));
         feang *= TMath::RadToDeg();
         fhang *= TMath::RadToDeg();
         // find closest allowed angle
         EAng[ch] = findNearestAllowedAngle(Eangs, feang);
         HAng[ch] = findNearestAllowedAngle(Hangs, fhang);
         const Long64_t ni = 
            nnt->GetEntryNumberWithIndex(EAng[ch] + (1000*HAng[ch]), CAng);
#ifdef DEBUG
         Printf("EAng=%g (%g), HAng=%g (%g), CAng=%g, ni=%lld",
                EAng[ch],feang,HAng[ch],fhang,CAng,ni);
#endif
         if (ni>-1) {
            nnt->GetEntry(ni);
#ifdef DEBUG
            c1->cd(ch+1);
            TGraph* och = wave->NewGraphForChan(0, kTRUE);
            const Int_t ochnp = och->GetN();
            Double_t* ochy = och->GetY();
            for (Int_t k=0; k<ochnp; ++k, ++ochy) {
               *ochy *= norm;
            }
            graphs.Add(och);
            och->SetLineColor(kBlack);
            och->SetMarkerColor(kBlack);
            och->SetMarkerStyle(7);
            och->Draw("apl");
#endif
            
            // first calculate the shift between chans due to the angle
            // ch0 is always unshifted; other chans shifted w.r.t. ch0
            // jitter the shift by the specified timing resolution
            const Double_t shift = 
               rnd.Gaus( (ch==0) ? 0.0
                            : -pwdt.At( TSnRecoChanOffsets::IndexFor(ch, 0) ),
                         timereso);
            // get a graph of the waveform
            // data only in channel 0 of the template
            TGraph* gch = wave->NewGraphForChan(0, kTRUE);
            // "fit" the graph with an spline interpolation
            TSpline3* gsp = new TSpline3("stmp", gch);
            // evaluate the spline at the new sample positions
            // (shifted, but NOT wrapped)
            // and save that into the event data waveform
            Float_t* d = evdat->GetData(ch);
            const Float_t tstep = 1.0 / NSnConstants::kSampRate;
            const Float_t tlast = static_cast<Float_t>(NSnConstants::kNsamps-1)
               / NSnConstants::kSampRate;
            Float_t xloc = shift;
            for (UChar_t s=0; s<NSnConstants::kNsamps; ++s, ++d, xloc+=tstep) {
               if ( (xloc<0.0) || (xloc>=tlast) ) {
                  *d = 0.0;
               } else {
                  *d = gsp->Eval( xloc );
               }
            }
#ifdef DEBUG
            Printf("ch%hhu: shift=%g, dt=%g", ch, shift,
                   (ch==0) ? 0.0
                   : pwdt.At( TSnRecoChanOffsets::IndexFor(ch, 0) ));
            
            TGraph* fch = evdat->NewGraphForChan(ch, kTRUE);
            Double_t* y = gch->GetY();
            Double_t* fy = fch->GetY();
            for (UChar_t s=0; s<NSnConstants::kNsamps; ++s, ++y, ++fy) {
               *y *= norm;
               *fy *= norm;
            }
            
            gch->SetLineColor(kRed+1);
            gch->SetMarkerColor(kRed+1);
            gch->SetMarkerStyle(7);
            gch->Draw("pl");
            
            delete gsp;
            gsp = new TSpline3("stmp",gch);
            gsp->SetLineColor(kAzure-6);
            gsp->SetMarkerColor(kAzure-6);
            gsp->SetMarkerStyle(7);
            gsp->Draw("pl same");
            
            graphs.Add(fch);
            fch->SetLineColor(kOrange+7);
            fch->SetMarkerColor(kOrange+7);
            fch->SetMarkerStyle(7);
            fch->Draw("pl");
#endif


            d = evdat->GetData(ch);
            // finally add noise to the waveform
            for (UChar_t s=0; s<NSnConstants::kNsamps; ++s, ++d) {
               *d = rnd.Gaus( (*d) * norm, noise );
            }
            
#ifdef DEBUG
            TGraph* nch = evdat->NewGraphForChan(ch, kTRUE);
            graphs.Add(nch);
            nch->SetLineColor(kGreen+2);
            nch->SetMarkerColor(kGreen+2);
            nch->SetMarkerStyle(7);
            nch->Draw("pl");
#endif
            
            // cleanup
#ifdef DEBUG
            graphs.Add(gch);
            graphs.Add(gsp);
#else
            delete gch;
            delete gsp;
#endif
         }

      } // end channel loop

#ifdef DEBUG
      TObject* o(0);
      while ( (o=c1->WaitPrimitive())!=0 ) {
         gSystem->ProcessEvents();
      }
      delete c1;
#endif
         
         // save this event
         ot->Fill();
         
   } // end event loop

   fprintf(stderr,"\n");

   timer.Stop();
   Printf("Finished generating events in:");
   timer.Print();
   
   outf->Write();
   
   Printf("Wrote [%s]",outf->GetName());
   
   delete outf; outf=0; // close file
}
Пример #25
0
int main(int argc, char** argv)
{
  setTDRStyle();
  gStyle -> SetOptFit(0000);
  
  int nFib = 64;
  int nCryst = 9;
  
  std::string inFileName(argv[1]);
  
  
  //----------
  // open file
  
  TFile* inFile = TFile::Open(Form("ntuples/tot_capture_%s.root",inFileName.c_str()));
  TTree* tree = (TTree*)( inFile->Get("tree") );
  
  
  //---------------------
  // set branch addresses
  
  std::map<int,std::vector<int>*> t_waveform;
  std::map<int,std::vector<int>*> t_crystWaveform;
  
  for(int fibIt = 0; fibIt < nFib; ++fibIt)
  {
    t_waveform[fibIt] = new std::vector<int>;
    tree -> SetBranchAddress(Form("fib%02d_waveform",fibIt),&t_waveform[fibIt]);
  }
  for(int crystIt = 0; crystIt < nCryst; ++crystIt)
  {
    t_crystWaveform[crystIt] = new std::vector<int>;
    tree -> SetBranchAddress(Form("cryst%01d_waveform",crystIt),&t_crystWaveform[crystIt]);
  }
  
  
  
  //-------------
  // define plots
  
  std::map<int,int> n_waveform_fib;
  TGraph** g_waveform_fib = new TGraph*[nFib];
  
  std::map<int,int> n_waveform_cut_fib;
  TGraph** g_waveform_cut_fib = new TGraph*[nFib];
  
  TH1F** h_ped_fib = new TH1F*[nFib];
  TH1F* h_ped_fib_all = new TH1F("h_ped_fib_all","",100,80.,120.);
  
  TH1F** h_maximum_fib = new TH1F*[nFib];
  TH1F* h_maximum_fib_all = new TH1F("h_maximum_fib_all","",1000,0.,2500.);
  
  for(int fibIt = 0; fibIt < nFib; ++fibIt)
  {
    g_waveform_fib[fibIt] = new TGraph();
    g_waveform_cut_fib[fibIt] = new TGraph();
    
    h_ped_fib[fibIt] = new TH1F(Form("h_ped_fib%02d",fibIt),"",100,80.,120.);
    h_maximum_fib[fibIt] = new TH1F(Form("h_maximum_fib%02d",fibIt),"",1000,0.,2500.);
  }
  
  TProfile2D* p_fibAveInt = new TProfile2D("p_fibAveInt","",17,-0.5,16.5,18,-0.5,17.5);
  TProfile2D* p_fibAveMax = new TProfile2D("p_fibAveMax","",17,-0.5,16.5,18,-0.5,17.5);
  TProfile2D* p_crystAveMax = new TProfile2D("p_crystAveMax","",3,-0.5,2.5,3,-0.5,2.5);
  
  TH1F* h_tot_integral = new TH1F("h_tot_integral","",1000,0.,100000.);
  TH1F* h_tot_maximum  = new TH1F("h_tot_maximum", "",1000,0.,1000.);
  
  
  //------------------
  // loop over entries
  
  for(int entry = 0; entry < tree->GetEntries(); ++entry)
  {
    std::cout << ">>> reading entry " << entry << " / " << tree->GetEntries() << "\r" << std::flush;
    tree -> GetEntry(entry);
    
    float tot_integral = 0.;
    float tot_maximum = 0.;
    
    for(int fibIt = 0; fibIt < nFib; ++fibIt)
    {
      ++n_waveform_fib[fibIt];
      AddWaveform(g_waveform_fib[fibIt],t_waveform[fibIt]);
      
      float ped, integral, maximum;
      CalculateAmplitude(t_waveform[fibIt],ped,integral,maximum);
      
      h_ped_fib[fibIt] -> Fill(ped);
      h_ped_fib_all -> Fill(ped);
      h_maximum_fib[fibIt] -> Fill(maximum);
      h_maximum_fib_all -> Fill(maximum);
      
      int x = 16-2*int(fibIt/8);
      int y = (x/2)%2 == 0 ? 16-2*(fibIt%8) : 16-2*(fibIt%8)-1;
      p_fibAveInt -> Fill(x,y,integral);
      p_fibAveMax -> Fill(x,y,maximum);
      
      if( maximum+ped > 120. )
      {
        tot_integral += integral;
        tot_maximum += maximum;
        
        ++n_waveform_cut_fib[fibIt];
        AddWaveform(g_waveform_cut_fib[fibIt],t_waveform[fibIt]);
      }
    }
    
    for(int crystIt = 0; crystIt < nCryst; ++crystIt)
    {
      float ped, integral, maximum;
      CalculateAmplitude(t_waveform[crystIt],ped,integral,maximum);
      p_crystAveMax -> Fill(crystIt%3,2-crystIt/3,maximum);
    }
    
    h_tot_integral -> Fill(tot_integral);
    h_tot_maximum -> Fill(tot_maximum);
  }
  
  
  
  TCanvas* c_waveform_fib_all = new TCanvas();
  
  int plotIt = 0;
  float min = +999999.;
  float max = -999999.;
  
  for(int fibIt = 0; fibIt < nFib; ++fibIt)
  {
    TGraph* g = g_waveform_fib[fibIt];
    if( g->GetN() == 0 ) continue;
    
    NormalizeGraph(g,n_waveform_fib[fibIt]);
    
    if( GetMinimum(g) < min ) min = GetMinimum(g);
    if( GetMaximum(g) > max ) max = GetMaximum(g);
  }
  
  for(int fibIt = 0; fibIt < nFib; ++fibIt)
  {
    TGraph* g = g_waveform_fib[fibIt];
    if( g->GetN() == 0 ) continue;
    
    TCanvas* c_waveform_fib = new TCanvas();
    
    g -> SetMinimum(min-0.05*fabs(max-min));
    g -> SetMaximum(max+0.05*fabs(max-min));
    g -> SetLineWidth(2);
    g -> SetLineColor(fibIt+1);
    g -> SetMarkerSize(0.2);
    g -> GetXaxis() -> SetTitle("sample time (ns)");
    g -> Draw("APL");
    
    c_waveform_fib -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/plotsPerFib/waveform_fib%02d.png",inFileName.c_str(),fibIt),"png");
    
    c_waveform_fib_all -> cd();
    
    if( plotIt == 0 ) g -> Draw("APL");
    else              g -> Draw("PL,same");
    
    ++plotIt;
  }
  
  c_waveform_fib_all -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/waveform_fib_all.png",inFileName.c_str()),"png");
  
  
  
  TCanvas* c_waveform_cut_fib_all = new TCanvas();
  
  plotIt = 0;
  min = +999999.;
  max = -999999.;
  
  for(int fibIt = 0; fibIt < nFib; ++fibIt)
  {
    TGraph* g = g_waveform_cut_fib[fibIt];
    if( g->GetN() == 0 ) continue;
    
    NormalizeGraph(g,n_waveform_cut_fib[fibIt]);
    
    if( GetMinimum(g) < min ) min = GetMinimum(g);
    if( GetMaximum(g) > max ) max = GetMaximum(g);
  }
  
  for(int fibIt = 0; fibIt < nFib; ++fibIt)
  {
    TGraph* g = g_waveform_cut_fib[fibIt];
    if( g->GetN() == 0 ) continue;
    
    //g -> SetMinimum(min-0.05*fabs(max-min));
    //g -> SetMaximum(max+0.05*fabs(max-min));
    g -> SetLineWidth(2);
    g -> SetLineColor(fibIt+1);
    g -> SetMarkerSize(0.2);
    g -> GetXaxis() -> SetTitle("sample time (ns)");
    g -> Draw("APL");
    
    c_waveform_cut_fib_all -> cd();
    
    if( plotIt == 0 ) g -> Draw("APL");
    else              g -> Draw("PL,same");
    
    ++plotIt;
  }
  
  c_waveform_cut_fib_all -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/waveform_cut_fib_all.png",inFileName.c_str()),"png");
  
  
  
  for(int fibIt = 0; fibIt < nFib; ++fibIt)
  {
    TH1F* h = h_ped_fib[fibIt];
    
    TCanvas* c_ped_fib = new TCanvas();
    c_ped_fib -> SetLogy();
    
    h -> SetLineWidth(2);
    h -> GetXaxis() -> SetTitle("max sample");
    h -> Draw();
    h -> Fit("gaus","Q");
    
    TLatex* latex1 = new TLatex(0.60,0.90,Form("RMS = %.1f",h->GetRMS()));
    latex1 -> SetNDC();
    latex1 -> SetTextFont(42);
    latex1 -> SetTextSize(0.04);
    latex1 -> Draw("same");
    
    TLatex* latex2 = new TLatex(0.60,0.85,Form("#sigma = %.1f",h->GetFunction("gaus")->GetParameter(2)));
    latex2 -> SetNDC();
    latex2 -> SetTextFont(42);
    latex2 -> SetTextSize(0.04);
    latex2 -> Draw("same");
    
    c_ped_fib -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/plotsPerFib/ped_fib%02d.png",inFileName.c_str(),fibIt),"png");
    
    h = h_maximum_fib[fibIt];
    
    TCanvas* c_maximum_fib = new TCanvas();
    c_maximum_fib -> SetLogy();
    
    h -> SetLineWidth(2);
    h -> GetXaxis() -> SetTitle("max sample");
    h -> Draw();
    
    c_maximum_fib -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/plotsPerFib/maximum_fib%02d.png",inFileName.c_str(),fibIt),"png");
  }
  
  TCanvas* c_ped_fib_all = new TCanvas();
  c_ped_fib_all -> SetLogy();
  
  h_ped_fib_all -> SetLineWidth(2);
  h_ped_fib_all -> GetXaxis() -> SetTitle("pedestal");
  h_ped_fib_all -> Draw();
  h_ped_fib_all -> Fit("gaus","Q");
  
  TLatex* latex1 = new TLatex(0.60,0.90,Form("RMS = %.1f",h_ped_fib_all->GetRMS()));
  latex1 -> SetNDC();
  latex1 -> SetTextFont(42);
  latex1 -> SetTextSize(0.04);
  latex1 -> Draw("same");
  
  TLatex* latex2 = new TLatex(0.60,0.85,Form("#sigma = %.1f",h_ped_fib_all->GetFunction("gaus")->GetParameter(2)));
  latex2 -> SetNDC();
  latex2 -> SetTextFont(42);
  latex2 -> SetTextSize(0.04);
  latex2 -> Draw("same");
  c_ped_fib_all -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/ped_fib_all.png",inFileName.c_str()),"png");
  
  TCanvas* c_maximum_fib_all = new TCanvas();
  c_maximum_fib_all -> SetLogy();
  
  h_maximum_fib_all -> SetLineWidth(2);
  h_maximum_fib_all -> GetXaxis() -> SetTitle("max sample");
  h_maximum_fib_all -> Draw();
  
  c_maximum_fib_all -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/maximum_fib_all.png",inFileName.c_str()),"png");
  
  
  
  TCanvas* c_fibAveInt = new TCanvas();
  
  p_fibAveInt -> Draw("COLZ");
  c_fibAveInt -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/fibAveInt.png",inFileName.c_str()),"png");
  
  TCanvas* c_fibAveMax = new TCanvas();
  
  p_fibAveMax -> Draw("COLZ");
  c_fibAveMax -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/fibAveMax.png",inFileName.c_str()),"png");
  
  
  TCanvas* c_crystAveMax = new TCanvas();
  
  p_crystAveMax -> Draw("COLZ");
  c_crystAveMax -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/crystAveMax.png",inFileName.c_str()),"png");
  
  
  
  TCanvas* c_tot_integral = new TCanvas();
  c_tot_integral -> SetLogy();
  
  h_tot_integral -> Draw();
  c_tot_integral -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/tot_integral.png",inFileName.c_str()),"png");
  
  TCanvas* c_tot_maximum = new TCanvas();
  c_tot_maximum -> SetLogy();
  
  h_tot_maximum -> Draw();
  c_tot_maximum -> Print(Form("/afs/cern.ch/user/a/abenagli/www/TBatFNAL/%s/tot_maximum.png",inFileName.c_str()),"png");
}
Пример #26
0
void pointsed(TString filename = "btagpatanalyzerpy.root", TString check="") {
	TString cmssw;
	// 167
	
	cmssw = "$3.1.0_pre9$";
	
	TFile *f = TFile::Open(filename);
/////////////////////////////////////////////////////////////////////////////////////////
	std::vector< TString > checks;
	checks.push_back("");
	checks.push_back("Corr30_");
	checks.push_back("Corr30t0_");
	checks.push_back("Corr30t1_");
	checks.push_back("Corr30t2_");
	checks.push_back("Corr30t0_nConstituent_");
	checks.push_back("Corr30t1_nConstituent_");
	checks.push_back("Corr30t2_nConstituent_");
	checks.push_back("Uncor10_");
	checks.push_back("Uncor10t0_");
	checks.push_back("Uncor10t1_");
	checks.push_back("Uncor10t2_");
	checks.push_back("Uncor10t0_nConstituent_");
	checks.push_back("Uncor10t1_nConstituent_");
	checks.push_back("Uncor10t2_nConstituent_");
/////////////////////////////////////////////////////////////////////////////////////////
	std::vector< TString > taggers;
	std::vector< TString > labeltag;
        std::vector< int> colorlines;
	taggers.push_back( "TC2" );colorlines.push_back( 1 );labeltag.push_back( "TCHE");
	taggers.push_back( "TC3" );colorlines.push_back( 2 );labeltag.push_back( "TCHP");
	taggers.push_back( "TP"  );colorlines.push_back( 3 );labeltag.push_back( "JP");
	taggers.push_back( "SSV" );colorlines.push_back( 4 );labeltag.push_back( "SSV");
	taggers.push_back( "CSV" );colorlines.push_back( 5 );labeltag.push_back( "CSV");
	taggers.push_back( "MSV" );colorlines.push_back( 6 );labeltag.push_back( "CSVMVAB");
	taggers.push_back( "SMT" );colorlines.push_back( 8 );labeltag.push_back( "SMT");
	taggers.push_back( "BTP" );colorlines.push_back( 9 );labeltag.push_back( "JBP");
	taggers.push_back( "SMTbyIP3d" );colorlines.push_back( 11 );labeltag.push_back( "SMTByIP3d");
	taggers.push_back( "SMTbyPt" );colorlines.push_back( 12 );labeltag.push_back( "SMTByPt");
	taggers.push_back( "SETbyIP3d" );colorlines.push_back( 13 );labeltag.push_back( "SETByIP3d");
	taggers.push_back( "SETbyPt" );colorlines.push_back( 14 );labeltag.push_back( "SETByPt");
//	taggers.push_back( "IPM" );colorlines.push_back( 11 );labeltag.push_back( "IPMVAB");
//	taggers.push_back( "SMNIPT" );colorlines.push_back( 12 );labeltag.push_back( "SMTNoIP");

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
//ed	for ( size_t ichks = 0; ichks < checks.size(); ++ichks ) {
//ed		TString check = checks[ichks];
	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
        TString PerfTitle= check;
        if (check == "") PerfTitle="uncorr pt>30";
	if (check == "Corr30_") PerfTitle="pt>30";
	if (check == "Corr30t0_") PerfTitle="pt>30, #tracks > 0";
	if (check == "Corr30t1_") PerfTitle="pt>30, #tracks > 1";
	if (check == "Corr30t2_") PerfTitle="pt>30, #tracks > 2";
	if (check == "Corr30t0_nConstituent_") PerfTitle="pt>30, #tracks > 0 & nConstituents >1";
	if (check == "Corr30t1_nConstituent_") PerfTitle="pt>30, #tracks > 1 & nConstituents >1";
	if (check == "Corr30t2_nConstituent_") PerfTitle="pt>30, #tracks > 2 & nConstituents >1";
	if (check == "Uncor10_") PerfTitle="uncorr pt>10";
	if (check == "Uncor10t0_") PerfTitle="uncorr pt>10 #tracks > 0";
	if (check == "Uncor10t1_") PerfTitle="uncorr pt>10 #tracks > 1";
	if (check == "Uncor10t2_") PerfTitle="uncorr pt>10 #tracks > 2";
	if (check == "Uncor10t0_nConstituent_") PerfTitle="uncorr pt>10 #tracks > 0 & nConstituents >1";
	if (check == "Uncor10t1_nConstituent_") PerfTitle="uncorr pt>10 #tracks > 1 & nConstituents >1";
	if (check == "Uncor10t2_nConstituent_") PerfTitle="uncorr pt>10 #tracks > 2 & nConstituents >1";

	std::vector< TString > discriminators;
        for ( size_t itagger = 0; itagger < taggers.size(); ++itagger ) {
  		discriminators.push_back( check+"disc"+taggers[itagger]+"_udsg" );
	}
//	discriminators.push_back( "discTC3_udsg" );
//	discriminators.push_back( "discTP_udsg" );

	TCanvas *cv = new TCanvas("cv","cv",900,900);
	TMultiGraph *mg =new TMultiGraph();
	TLegend *legend0 = new TLegend(0.68,0.12,0.88,0.32);
        // inverted axis
	TMultiGraph *mginv =new TMultiGraph();
	TLegend *legend1 = new TLegend(0.65,0.18,0.85,0.48);
	std::ofstream salida("BTagPATop3"+check+".txt");
	
	for ( size_t itagger = 0; itagger < taggers.size(); ++itagger ) {

		TString tag    = check+"g"+taggers[itagger]+"_udsg";
		TGraphErrors *agraph = (TGraphErrors*) gDirectory->Get("BTagPATAnalyzer"+taggers[itagger]+"/"+taggers[itagger]+"/"+tag);

		
		TGraph *dgraph = (TGraph*) gDirectory->Get("BTagPATAnalyzer"+taggers[itagger]+"/"+taggers[itagger]+"/"+discriminators[itagger]);
//		TGraph *udsgvsdgraph = new TGraph(dgraph->GetN(),dgraph->GetY(),dgraph->GetX());
		dgraph->Sort();
//		udsgvsdgraph->Sort();

		TGraphErrors *g = new TGraphErrors(agraph->GetN(),agraph->GetY(),agraph->GetX(),agraph->GetEY(),agraph->GetEX());
		g->Sort();
		g->SetLineColor(itagger+1);
                legend0 -> AddEntry(g,taggers[itagger],"l");
		mg->Add(g);

                //inverted axis
		TGraphErrors *ginv = new TGraphErrors(agraph->GetN(),agraph->GetX(),agraph->GetY(),agraph->GetEX(),agraph->GetEY());
		ginv->Sort();
		ginv->SetLineColor(colorlines[itagger]);
		ginv->SetMarkerStyle(8);
		ginv->SetMarkerColor(colorlines[itagger]);
                legend1 -> AddEntry(ginv,labeltag[itagger],"l");
		mginv->Add(ginv);

		std::cout << " Tagger: " << tag << std::endl;
		std::cout << " Loose(10%): " << " cut > " << std::setprecision(4) << dgraph->Eval(0.1) << " b-eff = " << g->Eval(0.1) << std::endl;
		std::cout << " Medium(1%):  " << " cut > " << std::setprecision(4) << dgraph->Eval(0.01) << " b-eff = " << g->Eval(0.01) << std::endl;
		std::cout << " Tight(0.1%) = " << " cut > " << std::setprecision(4) << dgraph->Eval(0.001) << " b-eff = " << g->Eval(0.001) << std::endl;
                salida << " " << taggers[itagger] << endl;
	        salida << " #bin \t b-eff  \t err-beff \t  non-beff \t err-non-b"<< endl;
        	for ( size_t i=0;i< agraph->GetN();i++){ 
			salida	<< "  " << (i+1) << " \t "
				<< agraph->GetX()[i] <<" \t " 
				<< agraph->GetEX()[i]<<" \t "
				<< agraph->GetY()[i] <<" \t "
				<< agraph->GetEY()[i]
                       		<< " "<< endl;
		}

	}
//	cv->SetLogx();
	mg->Draw("ALP");
	mg->GetYaxis()->SetTitle("b-eff");
	mg->GetXaxis()->SetTitle("udsg-mistagging");
	legend0 -> Draw();
        cv-> SetGrid();
	cv-> Print ("BTagPATop"+check+".eps");
	cv-> Print ("BTagPATop"+check+".png");
	cv->cd(0);
	cv->SetLogx();
	mg->Draw("ALP");
	legend0 -> Draw();
	cv-> Print ("BTagPATop1"+check+".eps");
	cv-> Print ("BTagPATop1"+check+".png");
        //inverted axis
	TCanvas *cvinv = new TCanvas("cvinv","cvinv",700,700);
        cvinv->SetLogy(0);
	mginv->Draw("ALP");
	mginv->GetXaxis()->SetTitle("b-eff");
	mginv->GetYaxis()->SetTitle("udsg-mistagging");
	legend1 -> Draw();
        cvinv->SetGrid();
	cvinv-> Print ("BTagPATop2"+check+".eps");
	cvinv-> Print ("BTagPATop2"+check+".png");
	cvinv->cd(0);
//	cvinv->Update();
//	cvinv->SetLogx();
//	mginv->SetXmin(10^-4);
//      axis range using a histogram helper
    TH2D*hpx = new TH2D("hpx",PerfTitle,200,0.0,1.005,200,0.00002,1.05);
        hpx->SetStats(kFALSE);
		hpx->Draw();
	hpx->GetXaxis()->SetTitle("b-eff");
	hpx->GetYaxis()->SetTitle("udsg-mistagging");
	cvinv->SetLogy(1);
	mginv->Draw("AP");
	legend1 -> Draw();
	cvinv-> Print ("BTagPATop3"+check+".eps");
	cvinv-> Print ("BTagPATop3"+check+".png");
	//ed}
}
Пример #27
0
TGraph* cdftanb5(){

  Float_t x[20];
  Float_t y[20];
  x[0]=1850;
  x[1]=1815;
  x[2]=x[1]-222;
  x[3]=x[2]-273;
  x[4]=x[3]-6; 
  x[5]=x[4]-116;
  x[6]=x[5]-104;
  x[7]=x[6]-12;
  x[8]=x[7]-140;
  x[9]=x[8]-25;
  x[10]=x[9]-155;
  x[11]=x[10]-67 ;
  x[12]=x[11]-44 ;
  x[13]=x[12]-20 ;
  x[14]=x[13]-60 ;
  x[15]=x[14]-79 ;
  x[16]=x[15]-265;
  x[17]=x[16]-151;
  x[18]=x[17]-76 ;
  x[19]=-30 ;

  y[0]=-40;
  y[1]=443;
  y[2]=y[1]-0;
  y[3]=y[2]+23;
  y[4]=y[3]+2;
  y[5]=y[4]+33;
  y[6]=y[5]+10; 
  y[7]=y[6]+4 ;
  y[8]=y[7]+47;
  y[9]=y[8]+6 ;
  y[10]=y[9]+25;
  y[11]=y[10]+15;
  y[12]=y[11]+35;
  y[13]=y[12]+12;
  y[14]=y[13]+47;
  y[15]=y[14]+32;
  y[16]=y[15]+60;
  y[17]=y[16]-12;
  y[18]=y[17]-24;
  y[19]=-40;
  Float_t scaleX = 600./1815;
  Float_t scaleY = 300./1404;

  for (int i=0;i<20;i++) x[i]=x[i]*scaleX;
  for (int i=0;i<20;i++) y[i]=y[i]*scaleY;
  TGraph* graph = new TGraph(20,x,y);
   // gr->Draw("a*");

  graph->SetLineColor(CombinationGlob::c_DarkGray);
  graph->SetLineWidth(1);

  graph->SetFillColor(CombinationGlob::c_DarkOrange);

/*
   TH1F *nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3 = new TH1F("nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3","Projection of nllWithCons",100,-10,610);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetMinimum(0);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetMaximum(250);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetDirectory(0);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetStats(0);
   graph->SetHistogram(nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3);
*/
   
//   graph->Draw("l");
  graph->Draw("FSAME");
  graph->Draw("LSAME");

  gPad->RedrawAxis();

  return graph;

}
Пример #28
0
// Function for the computation of channeling efficiency at various incoming angle
Int_t AnalyseChannelingEfficiency(TTree *fTree,Float_t fChannelingMinimum = 35., Float_t fChannelingMaximum = 70.){
    //**//Channeling Gaussian Fit Function
    TF1 *vChanneling = new TF1("vChanneling","gaus",fChannelingMinimum,fChannelingMaximum);
    vChanneling->SetParNames("Const","Mean","Sigma");
    vChanneling->SetLineColor(4);
    vChanneling->SetLineStyle(2);

    TH2D *hChannelingPlot = new TH2D("hChannelingPlot","Deflection Angle vs. Incoming Angle;Horizontal Incoming Angle [#murad];Horizontal Deflection Angle [#murad]",21,-10.5,10.5,256,-127.5,128.5);
    
    TH1F *hChannelingEfficiency = new TH1F("hChannelingEfficiency","G4Channeling;Horizontal Incoming Angle [#murad];Efficiency [%]",21,-10.5,10.5);

    fTree->Draw("-(angXout-angXin):-angXin>>hChannelingPlot");
    
    Double_t vNormalizationToAmorphous = 0.965; // Normalization for channeling efficiency, see PRSTAB 11, 063501 (2008)
    
    for(int i=2;i<=21;i++){
        TH1D* h1 = hChannelingPlot->ProjectionY("h1",i,i);
        h1->Fit(vChanneling,"QR");
        Double_t *vChannelingParameters;
        vChannelingParameters = vChanneling->GetParameters();
        hChannelingEfficiency->SetBinContent(i,ComputeEfficiency(h1,vChannelingParameters)/vNormalizationToAmorphous);
        h1->Delete();
    }
    hChannelingEfficiency->SetLineColor(3);
    hChannelingEfficiency->SetLineStyle(4);
    hChannelingEfficiency->SetMarkerColor(3);
    hChannelingEfficiency->SetFillStyle(0);
    hChannelingEfficiency->SetMarkerStyle(20);
    hChannelingEfficiency->Draw("PL");

    TGraph* gRoughExperimentalData = new TGraph(11);
    gRoughExperimentalData->SetPoint(	0	,	-10	,	20	);
    gRoughExperimentalData->SetPoint(	1	,	-8	,	38	);
    gRoughExperimentalData->SetPoint(	2	,	-6	,	56	);
    gRoughExperimentalData->SetPoint(	3	,	-4	,	72	);
    gRoughExperimentalData->SetPoint(	4	,	-2	,	80	);
    gRoughExperimentalData->SetPoint(	5	,	0	,	84	);
    gRoughExperimentalData->SetPoint(	6	,	2	,	82	);
    gRoughExperimentalData->SetPoint(	7	,	4	,	78	);
    gRoughExperimentalData->SetPoint(	8	,	6	,	66	);
    gRoughExperimentalData->SetPoint(	9	,	8	,	52	);
    gRoughExperimentalData->SetPoint(	10	,	10	,	37	);

    gRoughExperimentalData->SetLineColor(4);
    gRoughExperimentalData->SetLineStyle(3);
    gRoughExperimentalData->SetFillStyle(0);
    gRoughExperimentalData->SetFillColor(0);
    gRoughExperimentalData->SetMarkerColor(4);
    gRoughExperimentalData->SetMarkerStyle(21);
    gRoughExperimentalData->SetTitle("Phys. Lett. B 680, 129");

    gRoughExperimentalData->Draw("sameCP");

    TLegend *aLegend = new TLegend(0.30,0.15,0.55,0.3);
    aLegend->AddEntry(hChannelingEfficiency);
    aLegend->AddEntry(gRoughExperimentalData);
    aLegend->SetFillStyle(0);
    aLegend->SetLineColor(0);
    aLegend->Draw();

    return 0;
}
Пример #29
0
void DeltaPlot::viewGMstar (Char_t const* title)
{
	FFactor GMS(12);
	GMS.LoadParameters(parametersFile);
	GMS.CheckParameters();
	//GMS.PrintParameters();

	const int nPoints = 2500;
	double qMin;
	double qMax;
	double qStep;
	double qA;

	double DX[nPoints], DY[nPoints], RY[nPoints];
	qMin = 0.004;
	qMax = 3.0;
	qStep = (qMax-qMin)/nPoints;
	qA = qMin;

	for (int i = 0; i < nPoints; i++) {
		qA = qMin + i*qStep;
		double qA2 = qA*qA;
		double gen = GMS.AbsGEN(-qA2);
		double gmn = GMS.AbsGMN(-qA2);
		double msq = massDi*massDi - massNucl*massNucl - qA2;
		double abq = sqrt((qA2 + msq*msq)/(4.*massDi*massDi));
		double jsc = (massDi+massNucl)/2./massNucl*(1.-qA2/4./massDi/massDi)*(1.-qA2/4./massNucl/massNucl);
		DX[i] = qA2;
		double mDip = 1. + qA2/0.71;
		double gD = 1./mDip/mDip;
		double gDmn = gD*(-muN);
		DY[i] = sqrt(2.)*2./3.*gDmn*jsc;
		double masst = qA2/(4.*massNucl*massNucl);
		double gmo = (GMS.ScalarOne(-qA2)-GMS.VectorOne(-qA2))/qA2+(GMS.ScalarTwo(-qA2)-GMS.VectorTwo(-qA2))/massN/massN/4.;
		RY[i] = sqrt(2.)*2./3.*gmn*jsc;
	}	
	
	c[k] = new TCanvas (uName("c",k), uName("Graph_",k), x0+k*s, y0+k*s, w, h);
	//c[k]->SetLogy(); // logarithmic scale

	TGraphErrors *g[5];
	TMultiGraph *mg = new TMultiGraph();
	Double_t EX0[100] = {0};

	// 1999-PRL-82-45_Frolov
	Double_t X1[] = {2.8, 4.0};
	Double_t Y1[] = {0.0859, 0.0402};
	Double_t U1[] = {0.0035, 0.0019};
	Double_t D1[] = {0.0035, 0.0019};
	g[1] = new TGraphErrors (2, X1, Y1, EX0, D1);
	g[1]->SetTitle("JLab/Hall C");
	g[1]->SetMarkerColor(2);
	g[1]->SetMarkerStyle(21);
	mg->Add(g[1]);

	// 2006-PRL-97-112003_Ungaro
	Double_t X2[] = {3.0, 3.5, 4.2, 5.0, 6.0};
	Double_t Y2[] = {0.0697, 0.0524, 0.0346, 0.0242, 0.0134};
	Double_t U2[] = {0.0010, 0.0011, 0.0012, 0.0014, 0.0014};
	Double_t D2[] = {0.0010, 0.0011, 0.0012, 0.0014, 0.0014};
	g[2] = new TGraphErrors (5, X2, Y2, EX0, D2);
	g[2]->SetTitle("JLaB/CLAS");
	g[2]->SetMarkerColor(4);
	g[2]->SetMarkerStyle(21);
	mg->Add(g[2]);

	// 1968-PL-28-148B_Bartel
	Double_t X3[] = {0.20, 0.30, 0.40, 0.47, 0.48, 0.50, 0.60, 0.63, 0.63, 0.77, 0.78, 0.79, 0.97, 0.98, 1.15, 1.34, 1.57, 2.34};
	Double_t Y3[] = {1.7700, 1.3800, 1.1700, 0.9780, 0.9610, 0.9640, 0.7660, 0.7350, 0.7190, 0.5700, 0.5720, 0.5530, 0.4460, 0.4460, 0.3260, 0.2690, 0.2090, 0.1020};
	Double_t U3[] = {0.0620, 0.0483, 0.0351, 0.0293, 0.0336, 0.0289, 0.0268, 0.0221, 0.0252, 0.0200, 0.0172, 0.0194, 0.0156, 0.0156, 0.0147, 0.0121, 0.0115, 0.0082};
	Double_t D3[] = {0.0620, 0.0483, 0.0351, 0.0293, 0.0336, 0.0289, 0.0268, 0.0221, 0.0252, 0.0200, 0.0172, 0.0194, 0.0156, 0.0156, 0.0147, 0.0121, 0.0115, 0.0082};
	g[3] = new TGraphErrors (18, X3, Y3, EX0, D3);
	g[3]->SetTitle("DESY");
	g[3]->SetMarkerColor(6);
	g[3]->SetMarkerStyle(22);
	mg->Add(g[3]);

	// 1975-PR-D12-1884_Stein
	Double_t X4[] = {0.09, 0.22, 0.46, 0.78, 1.17, 1.48, 1.82};
	Double_t Y4[] = {2.2448, 1.5824, 0.9147, 0.5007, 0.2708, 0.1728, 0.1122};
	Double_t U4[] = {0.0709, 0.0332, 0.0243, 0.0136, 0.0116, 0.0095, 0.0064};
	Double_t D4[] = {0.0709, 0.0332, 0.0243, 0.0136, 0.0116, 0.0095, 0.0064};
	g[4] = new TGraphErrors (7, X4, Y4, EX0, D4);
	g[4]->SetTitle("SLAC");
	g[4]->SetMarkerColor(4);
	g[4]->SetMarkerStyle(23);
	mg->Add(g[4]);

	for (int i=0; i<4; ++i)
	{
		g[i+1]->SetFillColor(0);
		//g[i+1]->SetLineColor(4);
		g[i+1]->SetMarkerSize(1.2);
	}

	// Formula D
	TGraph *gD = new TGraph (nPoints, DX, DY);
	gD->SetTitle("Dipole formulae");
	gD->SetFillColor(0);
	gD->SetLineWidth(3);
	gD->SetMarkerSize(0.3);
	gD->SetMarkerStyle(21);
	gD->SetMarkerColor(4);
	gD->SetLineColor(4);
	mg->Add(gD);
	
	// Formula A
	TGraph *gA = new TGraph (nPoints, DX, RY);
	gA->SetTitle("Our result");
	gA->SetFillColor(0);
	gA->SetLineWidth(3);
	gA->SetMarkerSize(0.3);
	gA->SetMarkerStyle(21);
	//gA->SetLineColor(3);
	mg->Add(gA);

	mg->Draw("AP");

	//TF1 *fg = new TF1 ("fg", "[1]*x + [0]");
	//mg->Fit("poly5","Fit"); // fg

	TAxis *aX = mg->GetXaxis();
	aX->SetTitle("Q^{2} [GeV^{2}]");
	//aX->SetLimits(0.,10.);
	aX->SetRangeUser(-0.01,7.0);
	aX->SetTitleOffset(1.2);
	aX->CenterTitle();

	TAxis *aY = mg->GetYaxis();
	aY->SetTitle("G_{M}^{*}");
	//aY->SetRangeUser(0.6,1.8);
	aY->SetTitleOffset(1.2);
	aY->CenterTitle();

	gPad->SetFillColor(kWhite);
	
	TLegend *leg = c[k]->BuildLegend();
	leg->SetFillStyle(0);

	c[k]->Modified();

	c[k]->SaveAs("imgGMstar.pdf");
	
	++k;	
}
Пример #30
0
void start(const char *basename, const double offset = 0.0)
{

  TFile *file1 = TFile::Open(Form("Data/ROOT/%s_VMIN_SIPM1_meanHistSub_projections.root",basename));
  TFile *file2 = TFile::Open(Form("Data/ROOT/%s_VMIN_SIPM2_meanHistSub_projections.root",basename));

  if(file1==NULL) {cout<<"cannot find file1"<<endl;return;}
  if(file2==NULL) {cout<<"cannot find file2"<<endl;return;}

  calc(file1,file2,basename,0);
  calc(file1,file2,basename,1);
  calc(file1,file2,basename,2);
  calc(file1,file2,basename,3);
  calc(file1,file2,basename,4);
  calc(file1,file2,basename,5);
  calc(file1,file2,basename,6);
  calc(file1,file2,basename,7);
  calc(file1,file2,basename,8);

  ofstream fout(Form("Data/Text/%s_Asymmetries.txt"));
  double pn[9];
  for(int i=0; i<9; i++)
    {
      fout<<frac1[i]<<" "
	  <<frac2[i]<<" "
	  <<fracAv[i]<<" "
	  <<fracAs[i]<<" "
	  <<endl;
      //pn[i] = i+0.5; // projection number
      pn[i] = -2.0 + i/2.0; // distance
      pn[i] += offset;
    }

  TGraph *tg1 = new TGraph(9,pn,frac1);
  TGraph *tg2 = new TGraph(9,pn,frac2);
  TGraph *tgAv = new TGraph(9,pn,fracAv);
  TGraph *tgAs = new TGraph(9,pn,fracAs);
  tg1->SetMarkerStyle(kFullCircle);
  tg2->SetMarkerStyle(kFullCircle);
  tgAv->SetMarkerStyle(kOpenCircle);
  tgAs->SetMarkerStyle(kFullSquare);
  tg1->SetMarkerColor(kBlue);
  tg2->SetMarkerColor(kRed);
  tgAv->SetMarkerColor(kBlack);
  tgAs->SetMarkerColor(kBlack);
  TMultiGraph *tmg = new TMultiGraph();
  tmg->Add(tgAs);
  tmg->Add(tg1);
  tmg->Add(tg2);
  tmg->Add(tgAv);
  tmg->Draw("ap");
  tmg->SetMaximum(1.0);
  tmg->SetMinimum(0.0);
  tmg->GetXaxis()->SetLimits(-2.25+offset,2.25+offset);
  //tmg->GetXaxis()->SetLimits(0.0,9.0); // projection number
  tmg->GetXaxis()->SetTitle("Distance from fiber (cm)");
  tmg->GetYaxis()->SetTitle("f_{core} from different methods");
  TLegend *leg1 = new TLegend(0.18,0.18,0.28,0.38);
  leg1->AddEntry(tg1,"SiPM1","p");
  leg1->AddEntry(tg2,"SiPM2","p");
  leg1->AddEntry(tgAv,"Average SiPM1+SiPM2","p");
  leg1->AddEntry(tgAs,"Asymmetry","p");
  leg1->SetFillStyle(0);
  leg1->SetTextSize(0.05);
  leg1->Draw();

  c1->Print(Form("Figures/%s_AsymmetryComparison.png",basename));
  c1->Print(Form("Figures/%s_AsymmetryComparison.pdf",basename));

}