5#ifndef TRIGCOSTANALYSIS_VARIABLE_H
6#define TRIGCOSTANALYSIS_VARIABLE_H 1
8#include "GaudiKernel/StatusCode.h"
73 const std::string&
getName()
const;
92 StatusCode
fill(
float value,
float weight = 1.0);
100 StatusCode
fill(
float xvalue,
float yvalue,
float weight);
107 StatusCode
fill(
const std::string&
label,
float weight = 1.0);
113 StatusCode
increment(
float weight = 1.0);
VariableType
Behaviour of Variable.
@ kPerEvent
Variable should buffer fill calls in an accumulator and fill the underlying histogram once at the end...
@ kPerCall
Variable should fill underlying histogram on each fill.
LogType
Histogram x-axis type flag.
@ kLinear
Linear x-binning.
@ kLog
Logarithmic x-binning.
float m_weight
Cache of the event weight.
StatusCode endEvent()
Called by the framework.
Variable()=delete
Forbid default constructor.
StatusCode increment(float weight=1.0)
Convenience function.
StatusCode fill(float value, float weight=1.0)
Fill histogram (per-Call Variable), or add value to internal accumulator (per-Event Variable) to be f...
void setDenominator(float value)
Sets, until the end of the event, a denominator which will be used to normalise every Fill.
StatusCode setYBinLabel(int bin, const std::string &label)
Set label on given bin in cached histogram on y axis.
const std::string & getName() const
Getter for Variable's name.
size_t getCalls() const
Getter for how many times fill() has already been called on this Variable in this event.
const VariableType m_variableType
~Variable()=default
Default destructor.
Variable(const Variable &)=delete
Forbid copy.
float getAccumulator() const
Getter for accumulated value of a kPerEvent Variable.
StatusCode setBinLabel(int bin, const std::string &label)
Set label on given bin in cached histogram.
float m_oneOverDenominator
Cache of the reciprocal of the denominator used to normalise when filling the histogram.
Variable & operator=(const Variable &)=delete
Forbid copy.
std::string label(const std::string &format, int i)