ATLAS Offline Software
Loading...
Searching...
No Matches
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 (columnar::MuonId muon, int &bin) const =0
 Function that changes from Implementation to implementation.
virtual int nBins () const =0
 Return the total number of bins in the histogram -> (GetNbins() +2)**n.
virtual int nOverFlowBins () const =0
 Return the number of overflow bins.
virtual bool isOverFlowBin (int b) const =0
 States whether a bin is overflow or not.
virtual std::string GetBinName (unsigned int bin) const =0
 Translates the bin number into the borders and return them as name.
virtual ~HistHandler ()

Protected Member Functions

 HistHandler (columnar::ColumnarTool<> *parent, TH1 *Hist)
 HistHandler (const HistHandler &other)=delete
HistHandleroperator= (const HistHandler &other)=delete

Private Attributes

std::unique_ptr< TH1 > m_H

Detailed Description

Definition at line 42 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 ( columnar::ColumnarTool<> * parent,
TH1 * Hist )
protected

Definition at line 122 of file HistHandler.cxx.

122 :
123 m_H(clone(Hist)) {
124
125 }
std::unique_ptr< TH1 > m_H
Definition HistHandler.h:86
std::unique_ptr< TH1 > clone(TH1 *H)
Clones a TH1 and handles the ownership then to a unique_ptr.

◆ HistHandler() [2/2]

CP::HistHandler::HistHandler ( const HistHandler & other)
protecteddelete

Member Function Documentation

◆ FindBin()

virtual CorrectionCode CP::HistHandler::FindBin ( columnar::MuonId muon,
int & bin ) const
pure virtual

Function that changes from Implementation to implementation.

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

◆ GetBinContent()

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

Definition at line 51 of file HistHandler.h.

51 {
52 if (!m_H) return DBL_MAX;
53 return m_H->GetBinContent(bin);
54 }

◆ GetBinError()

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

Definition at line 58 of file HistHandler.h.

58 {
59 if (!m_H) return DBL_MAX;
60 return m_H->GetBinError(bin);
61 }

◆ 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_TH1, CP::HistHandler_TH2, CP::HistHandler_TH2Poly, and CP::HistHandler_TH3.

◆ GetHist()

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

Definition at line 63 of file HistHandler.h.

63 {
64 return m_H.get();
65 }

◆ isOverFlowBin()

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

States whether a bin is overflow or not.

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

◆ 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_TH1, CP::HistHandler_TH2, CP::HistHandler_TH2Poly, and CP::HistHandler_TH3.

◆ nOverFlowBins()

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

Return the number of overflow bins.

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

◆ operator=()

HistHandler & CP::HistHandler::operator= ( const HistHandler & other)
protecteddelete

◆ 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 86 of file HistHandler.h.


The documentation for this class was generated from the following files: