![]() |
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.
The class owns the histograms. It keeps track of necessary updates which are depending on underlying histogram changes and conditions like entries, undeflow entries, events, to determine the delta update. It can stored several delta histograms (time series).
Definition at line 27 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 36 of file HistDelta.h.
|
explicit |
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 23 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 106 of file HistDelta.cc.
| void reset | ( | void | ) |
Reset histogram and deltas, not the parameters.
Definition at line 99 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 29 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 39 of file HistDelta.cc.
| unsigned int m_amountDeltas {} |
| std::vector<std::unique_ptr<TH1> > m_deltaHists |
vector of histograms (max m_amountDeltas)
Definition at line 42 of file HistDelta.h.
| std::unique_ptr<TH1> m_lastHist {nullptr} |
| int m_lastValue {0} |
| int m_parameter {0} |
parameter depending on algo, e.g.
nr of entries or events
Definition at line 38 of file HistDelta.h.
| EDeltaType m_type {c_Disabled} |
| bool m_updated {false} |