Belle II Software
release-08-01-10
|
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) | |
Public Member Functions | |
HistDelta (EDeltaType t=c_Disabled, int p=0, unsigned int a=0) | |
Construktor. More... | |
void | set (EDeltaType t, int p, unsigned int a) |
Parameter setter. More... | |
void | setNotUpdated (void) |
Set not-updated yet status. | |
void | update (TH1 *hist) |
Check if update of delta histogram is necessary. More... | |
void | reset (void) |
Reset histogram and deltas, not the parameters. | |
TH1 * | getDelta (unsigned int n=0, bool onlyIfUpdated=true) |
Get Delta Histogram. More... | |
Public Attributes | |
EDeltaType | m_type {} |
type of delta algo | |
int | m_parameter {} |
parameter depending on algo, e.g. More... | |
unsigned int | m_amountDeltas {} |
amount of past histograms, at least 1 | |
TH1 * | m_lastHist {} |
Pointer to last histogram state for check. | |
int | m_lastValue {} |
last value for comparison, depending on type | |
std::vector< TH1 * > | m_deltaHists |
vector of histograms (max m_amountDeltas) | |
bool | m_updated {} |
if any delta was updated in this event | |
Class to keep track of delta histograms.
Definition at line 23 of file HistDelta.h.
HistDelta | ( | EDeltaType | t = c_Disabled , |
int | p = 0 , |
||
unsigned int | a = 0 |
||
) |
Construktor.
t | type |
p | parameter for type |
a | amount of deletas in the past |
Definition at line 15 of file HistDelta.cc.
TH1 * getDelta | ( | unsigned int | n = 0 , |
bool | onlyIfUpdated = true |
||
) |
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 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 24 of file HistDelta.cc.
void update | ( | 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 31 of file HistDelta.cc.
int m_parameter {} |
parameter depending on algo, e.g.
nr of entries or events
Definition at line 34 of file HistDelta.h.