Belle II Software  release-08-01-10
HistDelta Class Reference

Class to keep track of delta histograms. More...

#include <HistDelta.h>

Collaboration diagram for HistDelta:

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
 

Detailed Description

Class to keep track of delta histograms.

Definition at line 23 of file HistDelta.h.

Constructor & Destructor Documentation

◆ HistDelta()

HistDelta ( EDeltaType  t = c_Disabled,
int  p = 0,
unsigned int  a = 0 
)

Construktor.

Parameters
ttype
pparameter for type
aamount of deletas in the past

Definition at line 15 of file HistDelta.cc.

16 {
17  m_type = t;
18  m_parameter = p;
19  m_amountDeltas = a;
20  m_lastHist = nullptr;
21  m_lastValue = 0;
22 };
EDeltaType m_type
type of delta algo
Definition: HistDelta.h:33
int m_lastValue
last value for comparison, depending on type
Definition: HistDelta.h:37
unsigned int m_amountDeltas
amount of past histograms, at least 1
Definition: HistDelta.h:35
int m_parameter
parameter depending on algo, e.g.
Definition: HistDelta.h:34
TH1 * m_lastHist
Pointer to last histogram state for check.
Definition: HistDelta.h:36

Member Function Documentation

◆ getDelta()

TH1 * getDelta ( unsigned int  n = 0,
bool  onlyIfUpdated = true 
)

Get Delta Histogram.

Parameters
nnumber of delta into the past, 0 is most recent one
onlyIfUpdatedreq only updated deltas, return nullptr otherwise
Returns
Found histogram or nullptr

Definition at line 100 of file HistDelta.cc.

◆ set()

void set ( EDeltaType  t,
int  p,
unsigned int  a 
)

Parameter setter.

Parameters
ttype
pparameter for type
aamount of deltas in the past

Definition at line 24 of file HistDelta.cc.

◆ update()

void update ( TH1 *  hist)

Check if update of delta histogram is necessary.

Parameters
histpointer 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.

Member Data Documentation

◆ m_parameter

int m_parameter {}

parameter depending on algo, e.g.

nr of entries or events

Definition at line 34 of file HistDelta.h.


The documentation for this class was generated from the following files: