CMS 3D CMS Logo

Public Member Functions

HistoShifter Class Reference

#include <HistoShifter.h>

List of all members.

Public Member Functions

 HistoShifter ()
bool insertAndShift (TH1F *in, const float &value, const float &error)
bool insertAndShift (TH1F *in, const float &value)
 ~HistoShifter ()

Detailed Description

Definition at line 6 of file HistoShifter.h.


Constructor & Destructor Documentation

HistoShifter::HistoShifter ( ) [inline]

Definition at line 8 of file HistoShifter.h.

{}
HistoShifter::~HistoShifter ( ) [inline]

Definition at line 9 of file HistoShifter.h.

{}

Member Function Documentation

bool HistoShifter::insertAndShift ( TH1F *  in,
const float &  value 
)

Definition at line 5 of file HistoShifter.cc.

References i.

Referenced by insertAndShift().

                                                             {
  const int& nBins = in->GetNbinsX();
  
  for (int i=2; i<nBins; ++i){
    in->SetBinContent(i-1,in->GetBinContent(i));
    in->SetBinError(i-1,in->GetBinError(i));
  }
  in->SetBinContent(nBins,value);
    
  return true;
}
bool HistoShifter::insertAndShift ( TH1F *  in,
const float &  value,
const float &  error 
)

Definition at line 17 of file HistoShifter.cc.

References error, insertAndShift(), and convertSQLiteXML::ok.

                                                                                 {
  const bool& ok = insertAndShift(in, value);
  in->SetBinError(in->GetNbinsX(),error);
  return ok;
}