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 {
21 class HistObject {
22 public:
23 std::unique_ptr <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
34 ~HistObject(void);
35
40 bool update(TH1* hist);
41
44 void resetBeforeEvent(void);
45
49 bool isUpdated(void) { return m_updated;};
50
54 TH1* getHist(void) { return m_hist.get();};
55
56 };
58}
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
bool isUpdated(void)
Check if hist was updated.
Definition: HistObject.h:49
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 hist pointer.
Definition: HistObject.h:54
HistObject(void)
Constructor.
Definition: HistObject.h:30
~HistObject(void)
Destructor.
Definition: HistObject.cc:12
bool m_updated
flag if update since last event
Definition: HistObject.h:24
std::unique_ptr< TH1 > m_hist
Pointer to histogram.
Definition: HistObject.h:23
Abstract base class for different kinds of events.