File indexing completed on 2024-04-06 12:09:48
0001 #include "DQMOffline/RecoB/interface/HistoShifter.h"
0002
0003 #include "TH1F.h"
0004
0005 bool HistoShifter::insertAndShift(TH1F* in, const float& value) {
0006 const int& nBins = in->GetNbinsX();
0007
0008 for (int i = 2; i < nBins; ++i) {
0009 in->SetBinContent(i - 1, in->GetBinContent(i));
0010 in->SetBinError(i - 1, in->GetBinError(i));
0011 }
0012 in->SetBinContent(nBins, value);
0013
0014 return true;
0015 }
0016
0017 bool HistoShifter::insertAndShift(TH1F* in, const float& value, const float& error) {
0018 const bool& ok = insertAndShift(in, value);
0019 in->SetBinError(in->GetNbinsX(), error);
0020 return ok;
0021 }