CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HistoShifter.cc
Go to the documentation of this file.
2 
3 #include "TH1F.h"
4 
5 bool HistoShifter::insertAndShift(TH1F* in, const float& value){
6  const int& nBins = in->GetNbinsX();
7 
8  for (int i=2; i<nBins; ++i){
9  in->SetBinContent(i-1,in->GetBinContent(i));
10  in->SetBinError(i-1,in->GetBinError(i));
11  }
12  in->SetBinContent(nBins,value);
13 
14  return true;
15 }
16 
17 bool HistoShifter::insertAndShift(TH1F* in, const float& value, const float& error){
18  const bool& ok = insertAndShift(in, value);
19  in->SetBinError(in->GetNbinsX(),error);
20  return ok;
21 }
int i
Definition: DBlmapReader.cc:9
bool insertAndShift(TH1F *in, const float &value)
Definition: HistoShifter.cc:5