Belle II Software development
HistObject.cc
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#include "dqm/analysis/HistObject.h"
9
10using namespace Belle2;
11
13{
14}
15
16bool HistObject::update(TH1* hist)
17{
18 if (hist) {
19 // usual check for nullptr
20 m_updated |= hist->GetEntries() != m_entries;
21 m_entries = hist->GetEntries();
22 }
23 m_hist = std::unique_ptr<TH1>(hist); // even if it is nullptr
24 return m_updated;
25}
26
28{
29 m_hist = nullptr;
30 m_updated = false;
31}
double m_entries
entries in previous/current for update check
Definition: HistObject.h:25
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
~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.