84 TAxis* Xaxis=h2->GetXaxis();
85 TAxis* Yaxis=h2->GetYaxis();
87 int bx =Xaxis->GetLast();
88 int by =Yaxis->GetLast();
90 double x1 =Xaxis->GetBinLowEdge(1);
91 double y1 =Yaxis->GetBinLowEdge(1);
92 double x2 =Xaxis->GetBinUpEdge(bx);
93 double y2 =Yaxis->GetBinUpEdge(by);
94 std::cout<<
"N_x, x_low, x_up; N_y, y_low, y_up "
95 <<bx<<
" "<<x1<<
" "<<x2<<
" "<<by<<
" "<<y1<<
" "<<y2<<std::endl;
103 HDATA = (TH2F*)dataf.Get(htitle);
105 double ndata=HDATA->Integral();
106 std::cout<<
"Number events in HDATA= "<<ndata<<std::endl;
108 TAxis* Xaxis=HDATA->GetXaxis();
109 TAxis* Yaxis=HDATA->GetYaxis();
111 BINSx =Xaxis->GetLast();
112 BINSy =Yaxis->GetLast();
114 xlow=Xaxis->GetBinLowEdge(1);
115 ylow=Yaxis->GetBinLowEdge(1);
116 xup =Xaxis->GetBinUpEdge(BINSx);
117 yup =Yaxis->GetBinUpEdge(BINSy);
119 std::cout<<
"BINSx,xlow,xup,BINSy,ylow,yup: "<<BINSx<<
" ,"<<xlow<<
", "<<xup<<
", "<<BINSy<<
", "<<ylow<<
", "<<yup<<std::endl;
120 HMC =
new TH2F(
"myHMC",
"",BINSx,xlow,xup,BINSy,ylow,yup);
121 HWT =
new TH2F(
"myHWT",
"",BINSx,xlow,xup,BINSy,ylow,yup);
122 HMC ->SetDirectory(0);
123 HWT ->SetDirectory(0);
124 HDATA->SetDirectory(0);
153 TAxis* Xaxis=h2->GetXaxis();
154 TAxis* Yaxis=h2->GetYaxis();
155 BINSx =Xaxis->GetLast();
156 BINSy =Yaxis->GetLast();
157 xlow=Xaxis->GetBinLowEdge(1);
158 ylow=Yaxis->GetBinLowEdge(1);
159 xup =Xaxis->GetBinUpEdge(BINSx);
160 yup =Yaxis->GetBinUpEdge(BINSy);
223 if(xmass2<xlow || xmass2>xup || ymass2<ylow || ymass2>yup) {
return accept;}
224 int xbin = h2->GetXaxis()->FindBin(xmass2);
225 int ybin = h2->GetYaxis()->FindBin(ymass2);
226 int xybin= h2->GetBin(xbin,ybin);
227 double zvalue=h2->GetBinContent(xybin);
229 double ratio=zvalue/zmax;
232 if(ratio > rndm){accept=
true;}
else {accept=
false;}