ra4_draw  4bd0201e3d922d42bd545d4b045ed44db33454a4
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
Hist1D::SingleHist1D Class Referencefinal

Container for a TH1D associated with a single Process. More...

#include <hist1d.hpp>

Inheritance diagram for Hist1D::SingleHist1D:
Figure::FigureComponent

Public Member Functions

 SingleHist1D (const Hist1D &stack, const std::shared_ptr< Process > &process, const TH1D &hist)
 Standard constructor. More...
 
 ~SingleHist1D ()=default
 
void RecordEvent (const Baby &baby) final
 
double GetMax (double max_bound=std::numeric_limits< double >::infinity(), bool include_error_bar=false, bool include_overflow=false) const
 
double GetMin (double max_bound=0., bool include_error_bar=false, bool include_overflow=false) const
 
- Public Member Functions inherited from Figure::FigureComponent
 FigureComponent (const Figure &figure, const std::shared_ptr< Process > &process)
 
virtual ~FigureComponent ()=default
 

Public Attributes

TH1D raw_hist_
 Histogram storing distribution before stacking and luminosity weighting. More...
 
TH1D scaled_hist_
 Kludge. Mutable storage of scaled and stacked histogram. More...
 
- Public Attributes inherited from Figure::FigureComponent
const Figurefigure_
 Reference to figure containing this component. More...
 
std::shared_ptr< Processprocess_
 Process associated to this part of the figure. More...
 
std::mutex mutex_
 

Private Member Functions

 SingleHist1D ()=delete
 
 SingleHist1D (const SingleHist1D &)=delete
 
SingleHist1Doperator= (const SingleHist1D &)=delete
 
 SingleHist1D (SingleHist1D &&)=delete
 
SingleHist1Doperator= (SingleHist1D &&)=delete
 

Private Attributes

NamedFunc proc_and_hist_cut_
 
NamedFunc::VectorType cut_vector_
 
NamedFunc::VectorType wgt_vector_
 
NamedFunc::VectorType val_vector_
 

Detailed Description

Container for a TH1D associated with a single Process.

Hist1D::SingleHist1D is mostly a "dumb" container used by Hist1D for convenience. It contains a pointer to a single Process and a TH1D.

Until I have a more elegant solution, it also contains a second TH1D which is (ab)used by Hist1D to draw the stacked and luminosity scaled histogram without disturbing the data in the main TH1D.

Definition at line 25 of file hist1d.hpp.

Constructor & Destructor Documentation

Hist1D::SingleHist1D::SingleHist1D ( const Hist1D figure,
const std::shared_ptr< Process > &  process,
const TH1D &  hist 
)

Standard constructor.

Parameters
[in]processProcess used to fill histogram
[in]histA fully styled, and typically unfilled histogram to start from

Definition at line 138 of file hist1d.cpp.

References raw_hist_, and scaled_hist_.

Hist1D::SingleHist1D::~SingleHist1D ( )
default
Hist1D::SingleHist1D::SingleHist1D ( )
privatedelete
Hist1D::SingleHist1D::SingleHist1D ( const SingleHist1D )
privatedelete
Hist1D::SingleHist1D::SingleHist1D ( SingleHist1D &&  )
privatedelete

Member Function Documentation

double Hist1D::SingleHist1D::GetMax ( double  max_bound = std::numeric_limits<double>::infinity(),
bool  include_error_bar = false,
bool  include_overflow = false 
) const

Get the maximum of the histogram

Parameters
[in]max_boundReturns the highest bin content c satisfying c<max_bound. Usually infinity.
[in]include_error_barIf true, use bin content+error instead of just content
[in]include_overflowIf true, also check height of underflow and overflow bins
Returns
Histogram maximum

Definition at line 215 of file hist1d.cpp.

References scaled_hist_.

double Hist1D::SingleHist1D::GetMin ( double  min_bound = 0.,
bool  include_error_bar = false,
bool  include_overflow = false 
) const

Get the minimum of the histogram

Parameters
[in]min_boundReturns the lowest bin content c satisfying c>min_bound. Usually zero.
[in]include_error_barIf true, use bin content-error instead of just content
[in]include_overflowIf true, also check height of underflow and overflow bins
Returns
Histogram minimum

Definition at line 246 of file hist1d.cpp.

References scaled_hist_.

SingleHist1D& Hist1D::SingleHist1D::operator= ( const SingleHist1D )
privatedelete
SingleHist1D& Hist1D::SingleHist1D::operator= ( SingleHist1D &&  )
privatedelete
void Hist1D::SingleHist1D::RecordEvent ( const Baby baby)
finalvirtual

Member Data Documentation

NamedFunc::VectorType Hist1D::SingleHist1D::cut_vector_
private

Definition at line 52 of file hist1d.hpp.

Referenced by RecordEvent().

NamedFunc Hist1D::SingleHist1D::proc_and_hist_cut_
private

Definition at line 51 of file hist1d.hpp.

Referenced by RecordEvent().

TH1D Hist1D::SingleHist1D::raw_hist_

Histogram storing distribution before stacking and luminosity weighting.

Definition at line 32 of file hist1d.hpp.

Referenced by Hist1D::Hist1D(), RecordEvent(), and SingleHist1D().

TH1D Hist1D::SingleHist1D::scaled_hist_
mutable

Kludge. Mutable storage of scaled and stacked histogram.

Definition at line 33 of file hist1d.hpp.

Referenced by GetMax(), GetMin(), and SingleHist1D().

NamedFunc::VectorType Hist1D::SingleHist1D::val_vector_
private

Definition at line 52 of file hist1d.hpp.

Referenced by RecordEvent().

NamedFunc::VectorType Hist1D::SingleHist1D::wgt_vector_
private

Definition at line 52 of file hist1d.hpp.

Referenced by RecordEvent().


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