34 inline Double_t
g1(
const Double_t x)
36 return TMath::Gaus(x, 0.0, 1.0, kTRUE);
46 inline Double_t
G1(
const Double_t x)
48 return 0.5 * (1.0 + TMath::Erf(sqrt(0.5)*x));
58 inline Double_t g2(
const Double_t x,
const Double_t y)
71 inline Double_t G2(
const Double_t x,
const Double_t y)
84 int main(
int argc,
char **argv)
97 JParser<> zap(
"Example program to test 2D histogram.");
108 catch(
const exception &error) {
109 FATAL(error.what() << endl);
113 if (numberOfEvents <= 0) {
114 FATAL(
"No events." << endl);
119 const Int_t nx = 1000;
120 const Double_t xmin = -3.0;
121 const Double_t xmax = +3.0;
124 JMapList<JHistogramMap_t> > JHistogram2D_t;
126 JHistogram2D_t histogram;
139 for (
int i = 0; i != numberOfEvents; ++i) {
141 const double x = gRandom->Gaus(0.0, 1.0);
142 const double y = gRandom->Gaus(0.0, 1.0);
144 histogram.fill(x, y, 1.0);
148 histogram.div((
double) numberOfEvents);
153 JMultiPDF<JPolint2Function1D_t,
154 JMapList<JPolint2FunctionalMap> > f2(histogram);
161 JMultiFunction<JPolint3Function1H_t,
162 JMapList<JPolint3FunctionalMapH> > F2;
171 TH2D h0(
"h0", NULL, nx, xmin, xmax, nx, xmin, xmax);
172 TH2D h1(
"h1", NULL, nx, xmin, xmax, nx, xmin, xmax);
173 TH2D h2(
"h2", NULL, nx, xmin, xmax, nx, xmin, xmax);
176 for (
int i = 1; i <= h0.GetXaxis()->GetNbins(); ++i) {
177 for (
int j = 1;
j <= h0.GetYaxis()->GetNbins(); ++
j) {
179 const Double_t x = h0.GetXaxis()->GetBinCenter(i);
180 const Double_t y = h0.GetYaxis()->GetBinCenter(
j);
182 h0.SetBinContent(i,
j, g2(x,y));
185 h1.SetBinContent(i,
j, F2(x,y).fp.fp);
186 h2.SetBinContent(i,
j, f2(x,y));
188 catch(
const exception& error) {