LauCalcChiSq.cc File Reference File containing implementation of LauCalcChiSq class. More... #include "LauCalcChiSq.hh" #include "TAxis.h" #include "TCanvas.h" #include "TColor.h" #include "TFile.h" #include "TMath.h" #include "TStyle.h" #include "TSystem.h" #include "TTree.h" #include <cmath> #include <cstdlib> #include <fstream> #include <iostream> Go to the source code of this file. Detailed DescriptionFile containing implementation of LauCalcChiSq class. Code to produce an adaptive binning scheme and calculate the 2D chi-square between two datasets (e.g. low-stat data and high-stat toyMC). Note that the low and high stat histograms must have the same bin axes ranges and number of bins. It works by using the low stat (first) histogram to find a binning scheme such that the total number of entries in each bin is >= Min_bin_content. The number of entries in the histogram is divided by the desired minimum bin content to give a target number of bins. The largest number of bins that can be expressed as a product of powers of 4, 9, 25, 49 and 121 that does not exceed the target value is chosen. The histogram is the recursively subdivided in 2x2, 3x3, 5x5, 7x7 or 11x11 bins. For each stage of the subdivision, each bin is first divided into equally populated bins in x then each of these is further divded into equally popiulated bins in y. The (Pearson) chi-squared is then the sum of the chi-squared contributions of all bins: (low_stat_number - high_stat_number)^2/(high_stat_number) The nDof = number of bins - number of free params - 1 Definition in file LauCalcChiSq.cc. Generated by 1.8.18 |