75 TAxis* Xaxis = h2->GetXaxis();
76 TAxis* Yaxis = h2->GetYaxis();
78 int bx = Xaxis->GetLast();
79 int by = Yaxis->GetLast();
81 double x1 = Xaxis->GetBinLowEdge( 1 );
82 double y1 = Yaxis->GetBinLowEdge( 1 );
83 double x2 = Xaxis->GetBinUpEdge( bx );
84 double y2 = Yaxis->GetBinUpEdge( by );
85 std::cout <<
"N_x, x_low, x_up; N_y, y_low, y_up " << bx <<
" " << x1 <<
" " << x2 <<
" "
86 << by <<
" " << y1 <<
" " << y2 << std::endl;
93 TFile dataf( dtfile );
94 HDATA = (TH2F*)dataf.Get( htitle );
96 double ndata = HDATA->Integral();
97 std::cout <<
"Number events in HDATA= " << ndata << std::endl;
99 TAxis* Xaxis = HDATA->GetXaxis();
100 TAxis* Yaxis = HDATA->GetYaxis();
102 BINSx = Xaxis->GetLast();
103 BINSy = Yaxis->GetLast();
105 xlow = Xaxis->GetBinLowEdge( 1 );
106 ylow = Yaxis->GetBinLowEdge( 1 );
107 xup = Xaxis->GetBinUpEdge( BINSx );
108 yup = Yaxis->GetBinUpEdge( BINSy );
110 std::cout <<
"BINSx,xlow,xup,BINSy,ylow,yup: " << BINSx <<
" ," << xlow <<
", " << xup
111 <<
", " << BINSy <<
", " << ylow <<
", " << yup << std::endl;
112 HMC =
new TH2F(
"myHMC",
"", BINSx, xlow, xup, BINSy, ylow, yup );
113 HWT =
new TH2F(
"myHWT",
"", BINSx, xlow, xup, BINSy, ylow, yup );
114 HMC->SetDirectory( 0 );
115 HWT->SetDirectory( 0 );
116 HDATA->SetDirectory( 0 );
145 TAxis* Xaxis = h2->GetXaxis();
146 TAxis* Yaxis = h2->GetYaxis();
147 BINSx = Xaxis->GetLast();
148 BINSy = Yaxis->GetLast();
149 xlow = Xaxis->GetBinLowEdge( 1 );
150 ylow = Yaxis->GetBinLowEdge( 1 );
151 xup = Xaxis->GetBinUpEdge( BINSx );
152 yup = Yaxis->GetBinUpEdge( BINSy );
158 for (
int dx = 1; dx <= BINSx; dx++ )
160 for (
int dy = 1; dy <= BINSy; dy++ )
162 int nxy = hwt->GetBin( dx, dy );
163 double ncell = hwt->GetBinContent( nxy );
164 if ( ncell <= 0 )
continue;
165 if ( ncell > ymax ) { ymax = ncell; }
175 for (
int dx = 1; dx <= BINSx; dx++ )
177 for (
int dy = 1; dy <= BINSy; dy++ )
179 int nxy = HWT->GetBin( dx, dy );
180 double ncell = HWT->GetBinContent( nxy );
181 if ( ncell <= 0 )
continue;
182 if ( ncell > ymax ) { ymax = ncell; }
219 if ( xmass2 < xlow || xmass2 > xup || ymass2 < ylow || ymass2 > yup ) {
return accept; }
220 int xbin = h2->GetXaxis()->FindBin( xmass2 );
221 int ybin = h2->GetYaxis()->FindBin( ymass2 );
222 int xybin = h2->GetBin( xbin, ybin );
223 double zvalue = h2->GetBinContent( xybin );
225 double ratio = zvalue / zmax;
228 if ( ratio > rndm ) { accept =
true; }
229 else { accept =
false; }