Belle II Software development
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
12namespace Belle2 {
17
23 class HistObject {
24 public:
25 std::unique_ptr <TH1> m_hist;
26 bool m_updated = false;
27 double m_entries = -1;
28 public:
29
32 HistObject(void) : m_hist(nullptr), m_updated(false), m_entries(-1) {};
33
36 ~HistObject(void);
37
42 bool update(TH1* hist);
43
46 void resetBeforeEvent(void);
47
51 bool isUpdated(void) { return m_updated;};
52
56 TH1* getHist(void) { return m_hist.get();};
57
58 };
59
60}
double m_entries
entries in previous/current for update check
Definition HistObject.h:27
bool isUpdated(void)
Check if histogram was updated.
Definition HistObject.h:51
bool update(TH1 *hist)
Check if update of histogram is necessary.
Definition HistObject.cc:16
void resetBeforeEvent(void)
Reset histogram and update flag, not the entries.
Definition HistObject.cc:27
TH1 * getHist(void)
Get histogram pointer.
Definition HistObject.h:56
HistObject(void)
Constructor.
Definition HistObject.h:32
~HistObject(void)
Destructor.
Definition HistObject.cc:12
bool m_updated
flag if update since last event
Definition HistObject.h:26
std::unique_ptr< TH1 > m_hist
Pointer to histogram.
Definition HistObject.h:25
Abstract base class for different kinds of events.