CMS 3D CMS Logo

List of all members | Public Member Functions
HistoShifter Class Reference

#include <HistoShifter.h>

Public Member Functions

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

Detailed Description

Definition at line 6 of file HistoShifter.h.

Constructor & Destructor Documentation

◆ HistoShifter()

HistoShifter::HistoShifter ( )
inline

Definition at line 8 of file HistoShifter.h.

8 {}

◆ ~HistoShifter()

HistoShifter::~HistoShifter ( )
inline

Definition at line 9 of file HistoShifter.h.

9 {}

Member Function Documentation

◆ insertAndShift() [1/2]

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

Definition at line 5 of file HistoShifter.cc.

5  {
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 }

References mps_fire::i, recoMuon::in, and seedmultiplicitymonitor_newtracking_cfi::nBins.

Referenced by insertAndShift().

◆ insertAndShift() [2/2]

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

Definition at line 17 of file HistoShifter.cc.

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

References relativeConstraints::error, recoMuon::in, insertAndShift(), and convertSQLiteXML::ok.

mps_fire.i
i
Definition: mps_fire.py:428
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
relativeConstraints.error
error
Definition: relativeConstraints.py:53
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
HistoShifter::insertAndShift
bool insertAndShift(TH1F *in, const float &value)
Definition: HistoShifter.cc:5
recoMuon::in
Definition: RecoMuonEnumerators.h:6
value
Definition: value.py:1