Belle II Software development
|
Class to keep track of delta histograms. More...
#include <HistDelta.h>
Public Types | |
enum | EDeltaType { c_Disabled = 0 , c_Entries = 1 , c_Underflow = 2 , c_Events = 3 } |
enum definition for delta algo Disabled: nothing Entries: use nr histogram entries Underflow: use entries in histogram underflow bin Events: use nr processed events from framework (but: unreliable for normalization as the number of events for this specific histogram may differ) More... | |
Public Member Functions | |
HistDelta (EDeltaType t=c_Disabled, int p=0, unsigned int a=0) | |
Constructor. | |
~HistDelta () | |
Destructor. | |
void | set (EDeltaType t, int p, unsigned int a) |
Parameter setter. | |
void | setNotUpdated (void) |
Set not-updated yet status. | |
void | update (const TH1 *hist) |
Check if update of delta histogram is necessary. | |
void | reset (void) |
Reset histogram and deltas, not the parameters. | |
TH1 * | getDelta (unsigned int n=0, bool onlyIfUpdated=true) const |
Get Delta Histogram. | |
Public Attributes | |
EDeltaType | m_type {c_Disabled} |
type of delta algo | |
int | m_parameter {0} |
parameter depending on algo, e.g. | |
unsigned int | m_amountDeltas {} |
amount of past histograms, at least 1 | |
std::unique_ptr< TH1 > | m_lastHist {nullptr} |
Pointer to last histogram state for check. | |
int | m_lastValue {0} |
last value for comparison, depending on type | |
std::vector< std::unique_ptr< TH1 > > | m_deltaHists |
vector of histograms (max m_amountDeltas) | |
bool | m_updated {false} |
if any delta was updated in this event | |
Class to keep track of delta histograms.
Definition at line 23 of file HistDelta.h.
enum EDeltaType |
enum definition for delta algo Disabled: nothing Entries: use nr histogram entries Underflow: use entries in histogram underflow bin Events: use nr processed events from framework (but: unreliable for normalization as the number of events for this specific histogram may differ)
Definition at line 32 of file HistDelta.h.
HistDelta | ( | EDeltaType | t = c_Disabled , |
int | p = 0 , |
||
unsigned int | a = 0 |
||
) |
Constructor.
t | type |
p | parameter for type |
a | amount of deletas in the past |
Definition at line 15 of file HistDelta.cc.
~HistDelta | ( | ) |
Destructor.
Definition at line 24 of file HistDelta.cc.
TH1 * getDelta | ( | unsigned int | n = 0 , |
bool | onlyIfUpdated = true |
||
) | const |
Get Delta Histogram.
n | number of delta into the past, 0 is most recent one |
onlyIfUpdated | req only updated deltas, return nullptr otherwise |
Definition at line 107 of file HistDelta.cc.
void reset | ( | void | ) |
Reset histogram and deltas, not the parameters.
Definition at line 100 of file HistDelta.cc.
void set | ( | EDeltaType | t, |
int | p, | ||
unsigned int | a | ||
) |
Parameter setter.
t | type |
p | parameter for type |
a | amount of deltas in the past |
Definition at line 30 of file HistDelta.cc.
|
inline |
void update | ( | const TH1 * | hist | ) |
Check if update of delta histogram is necessary.
hist | pointer to histogram |
else { not (yet) enough data for update special case of initial sampling is not covered in this code -> leave it up to the user code e.g. if getDelta(0) returns a nullptr, the user code writer should decide if it is useful to use the basic histogram }
Definition at line 40 of file HistDelta.cc.
unsigned int m_amountDeltas {} |
amount of past histograms, at least 1
Definition at line 35 of file HistDelta.h.
std::vector<std::unique_ptr<TH1> > m_deltaHists |
vector of histograms (max m_amountDeltas)
Definition at line 38 of file HistDelta.h.
std::unique_ptr<TH1> m_lastHist {nullptr} |
Pointer to last histogram state for check.
Definition at line 36 of file HistDelta.h.
int m_lastValue {0} |
last value for comparison, depending on type
Definition at line 37 of file HistDelta.h.
int m_parameter {0} |
parameter depending on algo, e.g.
nr of entries or events
Definition at line 34 of file HistDelta.h.
EDeltaType m_type {c_Disabled} |
type of delta algo
Definition at line 33 of file HistDelta.h.
bool m_updated {false} |
if any delta was updated in this event
Definition at line 39 of file HistDelta.h.