ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CP::HistHandler Class Referenceabstract

#include <HistHandler.h>

Inheritance diagram for CP::HistHandler:
Collaboration diagram for CP::HistHandler:

Public Member Functions

double GetBinContent (int bin) const
 
void SetBinContent (int bin, float val)
 
double GetBinError (int bin) const
 
TH1 * GetHist () const
 
void SetBinError (int bin, float val)
 
virtual CorrectionCode FindBin (const xAOD::Muon &muon, int &bin) const =0
 Function that changes from Implementation to implementation. More...
 
virtual int nBins () const =0
 Return the total number of bins in the histogram -> (GetNbins() +2)**n. More...
 
virtual int nOverFlowBins () const =0
 Return the number of overflow bins. More...
 
virtual bool isOverFlowBin (int b) const =0
 States whether a bin is overflow or not. More...
 
virtual std::string GetBinName (unsigned int bin) const =0
 Translates the bin number into the borders and return them as name. More...
 
virtual ~HistHandler ()
 

Protected Member Functions

 HistHandler (TH1 *Hist)
 
 HistHandler (const HistHandler &other)
 
void Copy (const HistHandler &other)
 

Private Attributes

std::unique_ptr< TH1 > m_H
 

Detailed Description

Definition at line 37 of file HistHandler.h.

Constructor & Destructor Documentation

◆ ~HistHandler()

HistHandler::~HistHandler ( )
virtual

Definition at line 138 of file HistHandler.cxx.

138  {
139  }

◆ HistHandler() [1/2]

HistHandler::HistHandler ( TH1 *  Hist)
protected

Definition at line 122 of file HistHandler.cxx.

122  :
123  m_H(clone(Hist)) {
124 
125  }

◆ HistHandler() [2/2]

HistHandler::HistHandler ( const HistHandler other)
protected

Definition at line 134 of file HistHandler.cxx.

134  :
135  m_H() {
136  Copy(other);
137  }

Member Function Documentation

◆ Copy()

void HistHandler::Copy ( const HistHandler other)
protected

Definition at line 126 of file HistHandler.cxx.

126  {
127  if (this == &other) {
128  return;
129  }
130  if (other.m_H) {
131  m_H = clone(other.GetHist());
132  }
133  }

◆ FindBin()

virtual CorrectionCode CP::HistHandler::FindBin ( const xAOD::Muon muon,
int &  bin 
) const
pure virtual

Function that changes from Implementation to implementation.

Implemented in CP::HistHandler_TH2Poly, CP::HistHandler_TH3, CP::HistHandler_TH2, and CP::HistHandler_TH1.

◆ GetBinContent()

double CP::HistHandler::GetBinContent ( int  bin) const
inline

Definition at line 46 of file HistHandler.h.

46  {
47  if (!m_H) return DBL_MAX;
48  return m_H->GetBinContent(bin);
49  }

◆ GetBinError()

double CP::HistHandler::GetBinError ( int  bin) const
inline

Definition at line 53 of file HistHandler.h.

53  {
54  if (!m_H) return DBL_MAX;
55  return m_H->GetBinError(bin);
56  }

◆ GetBinName()

virtual std::string CP::HistHandler::GetBinName ( unsigned int  bin) const
pure virtual

Translates the bin number into the borders and return them as name.

Implemented in CP::HistHandler_TH2Poly, CP::HistHandler_TH3, CP::HistHandler_TH2, and CP::HistHandler_TH1.

◆ GetHist()

TH1* CP::HistHandler::GetHist ( ) const
inline

Definition at line 58 of file HistHandler.h.

58  {
59  return m_H.get();
60  }

◆ isOverFlowBin()

virtual bool CP::HistHandler::isOverFlowBin ( int  b) const
pure virtual

States whether a bin is overflow or not.

Implemented in CP::HistHandler_TH2Poly, CP::HistHandler_TH3, CP::HistHandler_TH2, and CP::HistHandler_TH1.

◆ nBins()

virtual int CP::HistHandler::nBins ( ) const
pure virtual

Return the total number of bins in the histogram -> (GetNbins() +2)**n.

Implemented in CP::HistHandler_TH2Poly, CP::HistHandler_TH3, CP::HistHandler_TH2, and CP::HistHandler_TH1.

◆ nOverFlowBins()

virtual int CP::HistHandler::nOverFlowBins ( ) const
pure virtual

Return the number of overflow bins.

Implemented in CP::HistHandler_TH2Poly, CP::HistHandler_TH3, CP::HistHandler_TH2, and CP::HistHandler_TH1.

◆ SetBinContent()

void HistHandler::SetBinContent ( int  bin,
float  val 
)

Definition at line 140 of file HistHandler.cxx.

140  {
141  if (m_H) {
142  m_H->SetBinContent(bin, val);
143  }
144  }

◆ SetBinError()

void HistHandler::SetBinError ( int  bin,
float  val 
)

Definition at line 145 of file HistHandler.cxx.

145  {
146  if (m_H) {
147  m_H->SetBinError(bin, val);
148  }
149  }

Member Data Documentation

◆ m_H

std::unique_ptr<TH1> CP::HistHandler::m_H
private

Definition at line 81 of file HistHandler.h.


The documentation for this class was generated from the following files:
CP::HistHandler::Copy
void Copy(const HistHandler &other)
Definition: HistHandler.cxx:126
bin
Definition: BinsDiffFromStripMedian.h:43
CP::clone
std::unique_ptr< TH1 > clone(TH1 *H)
Clones a TH1 and handles the ownership then to a unique_ptr.
Definition: PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/Root/UtilFunctions.cxx:43
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
CP::HistHandler::m_H
std::unique_ptr< TH1 > m_H
Definition: HistHandler.h:81