22 Int_t nbinsx = hist->GetNbinsX();
28 std::vector<double> temp_HistoContents(nbins);
30 for (
int ix = 1; ix <= nbinsx; ix++) {
31 float binval = hist->GetBinContent(ix);
34 double fraction = binval / hist->Integral();
35 if (TMath::Abs(fraction) > 1e-5) {
37 << hist->GetName() <<
" : " << hist->GetTitle()
38 <<
" binval=" << binval <<
" " << fraction * 100
39 <<
"% of integral=" << hist->Integral()
40 <<
". Forcing bin to 0.");
49 ATH_MSG_ERROR(
"histogram " << hist->GetName() <<
" : " << hist->GetTitle()
50 <<
" integral=" <<
integral <<
" is <=0");
56 for (
int ix = 1; ix <= nbinsx; ix++)
60 for (ibin = 0; ibin < nbins; ++ibin) {
97 if (hist ==
nullptr) {
99 hist =
new TH1D(
"test1D",
"test1D", nbinsx, 0, 1);
101 for (
int ix = 1; ix <= nbinsx; ++ix) {
102 double val = (0.5 + gRandom->Rndm()) * (nbinsx + ix);
103 if (gRandom->Rndm() < 0.1)
105 hist->SetBinContent(ix, val);
106 hist->SetBinError(ix, 0);
110 nbinsx = hist->GetNbinsX();
115 for (
rnd[0] = 0;
rnd[0] < 0.9999;
rnd[0] += 0.25) {
120 TH1 *hist_val = (TH1 *)hist->Clone(
"hist_val");
121 hist_val->SetTitle(
"difference");
124 double weight = hist->Integral() / nrnd;
126 for (
int i = 0; i < nrnd; ++i) {
127 rnd[0] = gRandom->Rndm();
129 hist_val->Fill(value[0], weight);
131 hist_val->Add(hist, -1);
133 TH1F *hist_pull =
new TH1F(
"pull",
"pull", 200, -10, 10);
134 for (
int ix = 1; ix <= nbinsx; ++ix) {
135 float val = hist_val->GetBinContent(ix);
136 float err = hist_val->GetBinError(ix);
138 hist_pull->Fill(val / err);
144#if defined(__FastCaloSimStandAlone__)
145 new TCanvas(
"input",
"Input");
148 new TCanvas(
"validation",
"Validation");
151 new TCanvas(
"pull",
"Pull");