441 "name1",
"title1",100,-10.0,80.0,50,10.0,1230.0);
444 "name1",
"",100,0.0,17.0,50,10.0,1230.0);
447 "",
"title3",100,0.0,17.0,50,10.0,1230.0);
450 "",
"",100,0.0,17.0,50,10.0,1230.0);
452 std::cout <<
" ---> Quick basic test completed"<<std::endl;
454 fillInVariousWays<T1,T2>(trigger_conversion_all, 100,0.0,100.0,100,0.0,100.0);
455 std::cout <<
" ---> Various filling tests completed"<<std::endl;
457 const bool do_systematic_tests =
true;
458 if (do_systematic_tests) {
459 std::vector<unsigned> sys_ibin;
460 std::vector<double> sys_x;
461 const unsigned nbins=3;
462 const double xmin(0.0);
463 const double xmax(3.0);
464 sys_ibin.push_back(0);sys_x.push_back(
xmin-10.0);
465 sys_ibin.push_back(2);sys_x.push_back(1.5);
466 #ifdef LW_STRICT_ROOT_BEHAVIOUR
467 sys_ibin.push_back(
nbins+1);sys_x.push_back(
xmax+10.0);
468 sys_ibin.push_back(
nbins+USHRT_MAX+100);sys_x.push_back(std::numeric_limits<float>::quiet_NaN());
470 unsigned npoints=sys_ibin.size();
472 std::vector<double> sys_args;
473 sys_args.push_back(0.0);
475 sys_args.push_back(-17.0);
476 sys_args.push_back(17.0);
478 const bool expecterror(
false);
479 double x,
y,
a;
unsigned ibinx, ibiny, itest(0);
480 for (
unsigned ix = 0;ix<
npoints;++ix)
481 for (
unsigned iy = 0;iy<
npoints;++iy)
482 for (
unsigned iarg = 0;iarg<sys_args.size();++iarg)
483 for (
unsigned doFillX_1 = 0;doFillX_1<=1;++doFillX_1)
484 for (
unsigned doFillXW_1 = 0;doFillXW_1<=1;++doFillXW_1)
485 for (
unsigned doSetBinContent_1 = 0;doSetBinContent_1<=1;++doSetBinContent_1)
486 for (
unsigned doSetBinError_1 = 0;doSetBinError_1<=1;++doSetBinError_1)
489 SYSTEST(
"------------> 2D Test number "<<itest)
492 h.setCompareBinContentsOnEachFill(expecterror);
494 ibinx=sys_ibin.at(ix);
x=sys_x.at(ix);
495 ibiny=sys_ibin.at(ix);
y=sys_x.at(ix);
497 if (doFillX_1) {
SYSTEST(
"Fill("<<
x<<
", "<<
y<<
")");
h.fill(
x,
y); }
498 if (doFillXW_1) {
SYSTEST(
"Fill("<<
x<<
", "<<
y<<
", "<<
a<<
")");
h.fill(
x,
y,
a); }
499 if (doSetBinContent_1) {
SYSTEST(
"setBinContent("<<ibinx<<
", "<<ibiny<<
", "<<
a<<
")");
h.setBinContent(ibinx,ibiny,
a); }
500 if (doSetBinError_1) {
SYSTEST(
"setBinError("<<ibinx<<
", "<<ibiny<<
", "<<
a<<
")");
h.setBinError(ibinx,ibiny,
a); }
502 std::cout <<
" ---> Systematic tests ("<<itest<<
") completed"<<std::endl;
504 float *
xbins =
new float[5];
510 double * xbinsd =
new double[5];
516 float *
ybins =
new float[3];
520 double * ybinsd =
new double[3];
527 "name7",
"title7",4,xbinsd,2,ybinsd);
529 "name8",
"title8",4,xbinsd,2,-20.0,100.0);
531 "name9",
"title9",4,0.0,10.0,2,ybinsd);
537 const double eps=1
e-5;
539 h6.fill(2.6,1.0);h6.compareAll();
540 h6.fill(2.7,1.0);h6.compareAll();
541 h6.fill(0.0,1.0);h6.compareAll();
542 h6.fill(10.0,1.2,1.0);h6.compareAll();
543 h6.fill(-20.0,1.0);h6.compareAll();
544 h6.fill(12.0,1.0);h6.compareAll();
545 h6.fill(5.0,1.0);h6.compareAll();
546 h6.fill(1.2,1.0);h6.compareAll();
548 h7.fill(2.6,1.0);h7.compareAll();
549 h7.fill(2.7+eps,1.0);h7.compareAll();
550 h7.fill(0.0,1.0);h7.compareAll();
551 h7.fill(10.0,1.2,1.0);h7.compareAll();
552 h7.fill(-20.0,1.0);h7.compareAll();
553 h7.fill(12.0,1.0);h7.compareAll();
554 h7.fill(5.0,1.0);h7.compareAll();
555 h7.fill(1.2,1.0);h7.compareAll();
557 h8.fill(2.6,1.0);h8.compareAll();
558 h8.fill(2.7+eps,1.0);h8.compareAll();
559 h8.fill(0.0,1.0);h8.compareAll();
560 h8.fill(10.0,1.2,1.0);h8.compareAll();
561 h8.fill(-20.0,1.0);h8.compareAll();
562 h8.fill(12.0,1.0);h8.compareAll();
563 h8.fill(5.0,1.0);h8.compareAll();
564 h8.fill(1.2,1.0);h8.compareAll();
566 h9.fill(2.6,1.0);h9.compareAll();
567 h9.fill(2.7,1.0);h9.compareAll();
568 h9.fill(0.0,1.0);h9.compareAll();
569 h9.fill(10.0,1.2,1.0);h9.compareAll();
570 h9.fill(-20.0,1.0);h9.compareAll();
571 h9.fill(12.0,1.0);h9.compareAll();
572 h9.fill(5.0,1.0);h9.compareAll();
573 h9.fill(1.2,1.0);h9.compareAll();
575 std::cout <<
" ---> Variable binning tests completed"<<std::endl;