Belle II Software  release-08-01-10
HistObject.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <TH1.h>
11 
12 namespace Belle2 {
21  class HistObject {
22  public:
23  TH1* m_hist{};
24  bool m_updated = false;
25  double m_entries = -1;
26  public:
27 
30  HistObject(void) : m_hist(nullptr), m_updated(false), m_entries(-1) {};
31 
36  bool update(TH1* hist);
37 
40  void resetBeforeEvent(void);
41 
45  bool isUpdated(void) { return m_updated;};
46 
50  TH1* getHist(void) { return m_hist;};
51 
52  };
54 }
Class to keep track of delta histograms.
Definition: HistObject.h:21
double m_entries
entries in previous/current for update check
Definition: HistObject.h:25
TH1 * m_hist
Pointer to histogram.
Definition: HistObject.h:23
bool isUpdated(void)
Check if hist was updated.
Definition: HistObject.h:45
bool update(TH1 *hist)
Check if update of histogram is necessary.
Definition: HistObject.cc:12
void resetBeforeEvent(void)
Reset histogram and update flag, not the entries.
Definition: HistObject.cc:23
HistObject(void)
Constructor.
Definition: HistObject.h:30
TH1 * getHist(void)
Get hist pointer.
Definition: HistObject.h:50
bool m_updated
flag if update since last event
Definition: HistObject.h:24
Abstract base class for different kinds of events.