5 #ifndef AthenaMonitoringKernel_HistogramFiller_LiveHistogramProvider_h
6 #define AthenaMonitoringKernel_HistogramFiller_LiveHistogramProvider_h
36 std::shared_ptr<HistogramFactory> factory,
74 TH1* totalNew = eNew->GetCopyTotalHisto();
75 TH1* passedNew = eNew->GetCopyPassedHisto();
78 eNew->SetTotalHistogram(*totalNew,
"");
79 eNew->SetPassedHistogram(*passedNew,
"");
128 int offset = hNew->GetXaxis()->GetXmax() - hOld->GetXaxis()->GetXmax();
130 bool sumw2Filled = (hOld->GetSumw2N()>0);
133 for (
int oldBin=0; oldBin < hOld->GetNcells(); oldBin++) {
135 int oldBinX, oldBinY, oldBinZ;
136 hOld->GetBinXYZ(oldBin, oldBinX, oldBinY, oldBinZ);
137 if ((oldBinX-
offset < 1) || hOld->IsBinUnderflow(oldBin, 1) || hOld->IsBinOverflow(oldBin, 1)) {
142 int newBin = hNew->GetBin(oldBinX-
offset, oldBinY, oldBinZ);
143 if (hOld->GetBinContent(oldBin)) hNew->SetBinContent(newBin, hOld->GetBinContent(oldBin));
145 hNew->SetBinError(newBin, hOld->GetBinError(oldBin));
146 nNewEntries+=(*hOld->GetSumw2())[oldBin];
151 if (sumw2Filled) hNew->SetEntries(nNewEntries);
152 else hNew->SetEntries(hOld->GetEntries());
156 int offset = hNew->GetXaxis()->GetXmax() - hOld->GetXaxis()->GetXmax();
158 bool sumw2Filled = (hOld->GetSumw2N()>0);
161 for (
int oldBin=0; oldBin < hOld->GetNcells(); oldBin++) {
163 int oldBinX, oldBinY, oldBinZ;
164 hOld->GetBinXYZ(oldBin, oldBinX, oldBinY, oldBinZ);
165 if ((oldBinX-
offset < 1) || hOld->IsBinUnderflow(oldBin, 1) || hOld->IsBinOverflow(oldBin, 1)) {
170 int newBin = hNew->GetBin(oldBinX-
offset, oldBinY, oldBinZ);
171 int oldBinEntries = hOld->GetBinEntries(oldBin);
172 if (oldBinEntries>0) {
173 nNewEntries += oldBinEntries;
174 hNew->SetBinEntries(newBin, oldBinEntries);
175 (*hNew)[newBin] = (*hOld)[oldBin];
176 (*hNew->GetSumw2())[newBin] = (*hOld->GetSumw2())[oldBin];
181 if (sumw2Filled) hNew->SetEntries(nNewEntries);
182 else hNew->SetEntries(hOld->GetEntries());