Belle II Software  release-08-01-10
HistObject Class Reference

Class to keep track of delta histograms. More...

#include <HistObject.h>

Public Member Functions

 HistObject (void)
 Constructor.
 
bool update (TH1 *hist)
 Check if update of histogram is necessary. More...
 
void resetBeforeEvent (void)
 Reset histogram and update flag, not the entries.
 
bool isUpdated (void)
 Check if hist was updated. More...
 
TH1 * getHist (void)
 Get hist pointer. More...
 

Public Attributes

TH1 * m_hist {}
 Pointer to histogram.
 
bool m_updated = false
 flag if update since last event
 
double m_entries = -1
 entries in previous/current for update check
 

Detailed Description

Class to keep track of delta histograms.

Definition at line 21 of file HistObject.h.

Member Function Documentation

◆ getHist()

TH1* getHist ( void  )
inline

Get hist pointer.

Returns
hist ptr

Definition at line 50 of file HistObject.h.

50 { return m_hist;};
TH1 * m_hist
Pointer to histogram.
Definition: HistObject.h:23

◆ isUpdated()

bool isUpdated ( void  )
inline

Check if hist was updated.

Returns
it was updated

Definition at line 45 of file HistObject.h.

◆ update()

bool update ( TH1 *  hist)

Check if update of histogram is necessary.

Parameters
histpointer to histogram
Returns
histogram was updated flag (return m_updated)

Definition at line 12 of file HistObject.cc.

13 {
14  if (hist) {
15  // usual check for nullptr
16  m_updated |= hist->GetEntries() != m_entries;
17  m_entries = hist->GetEntries();
18  }
19  m_hist = hist; // even if it is nullptr
20  return m_updated;
21 }
double m_entries
entries in previous/current for update check
Definition: HistObject.h:25
bool m_updated
flag if update since last event
Definition: HistObject.h:24

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