5#ifndef ISF_FASTCALOSIMEVENT_TFCS1DFunctionTemplateHistogram_h
6#define ISF_FASTCALOSIMEVENT_TFCS1DFunctionTemplateHistogram_h
14template <
typename Txvec,
typename Ty,
typename Trandom =
float>
45 Int_t nbins = hist->GetNbinsX();
47 std::vector<double> temp_HistoContents;
56 m_HistoBorders.SetMinMax(hist->GetXaxis()->GetBinLowEdge(first + 1),
57 hist->GetXaxis()->GetBinUpEdge(last + 1));
59 for (Int_t ibin = first; ibin <= last; ++ibin) {
61 hist->GetXaxis()->GetBinLowEdge(ibin + 1));
68 <<
" x=" << hist->GetXaxis()->GetBinLowEdge(ibin + 1)
74 <<
" x=" << hist->GetXaxis()->GetBinLowEdge(ibin)
78 temp_HistoContents[ibin] /
integral);
96 ATH_MSG_INFO(
"bin=" << ibin + 1 <<
" fbin=" << ihist <<
"/"
98 << hist->GetXaxis()->GetBinLowEdge(ibin + 1)
99 <<
"," << hist->GetXaxis()->GetBinUpEdge(ibin + 1)
101 <<
" int=" << temp_HistoContents[ibin] /
integral
107 if (ihist != nbins) {
109 m_HistoBorders.SetMinMax(hist->GetXaxis()->GetBinLowEdge(first + 1),
110 hist->GetXaxis()->GetBinUpEdge(last + 1));
122 Trandom residual_rnd;
152 TFCS1DFunction_HistogramInt8BinEdges, uint8_t, float> {
156 uint8_t, float>(
h){};
164 TFCS1DFunction_HistogramInt8BinEdges, uint16_t, float> {
168 uint16_t, float>(
h){};
176 TFCS1DFunction_HistogramInt8BinEdges, uint32_t, float> {
180 uint32_t, float>(
h){};
188 TFCS1DFunction_HistogramInt16BinEdges, uint16_t, float> {
192 uint16_t, float>(
h){};
200 TFCS1DFunction_HistogramInt16BinEdges, uint32_t, float> {
204 uint32_t, float>(
h){};
212 TFCS1DFunction_HistogramInt32BinEdges, uint32_t, float> {
216 uint32_t, float>(
h){};
uint32_t TFCS1DFunction_size_t
Header file for AthHistogramAlgorithm.
TFCS1DFunctionInt16Int16Histogram(TH1 *h=nullptr)
TFCS1DFunctionInt16Int32Histogram(TH1 *h=nullptr)
TFCS1DFunctionInt32Int32Histogram(TH1 *h=nullptr)
TFCS1DFunctionInt8Int16Histogram(TH1 *h=nullptr)
TFCS1DFunctionInt8Int32Histogram(TH1 *h=nullptr)
TFCS1DFunctionInt8Int8Histogram(TH1 *h=nullptr)
const Txvec & get_HistoBordersx() const
Txvec & get_HistoBordersx()
void Initialize(const TH1 *hist, bool doprint=true)
Initialize from root histogram.
const TFCS1DFunction_HistogramContent< Ty, Trandom > & get_HistoContents() const
size_t get_nbins() const
return number of bins
std::size_t MemorySizeArray() const
~TFCS1DFunctionTemplateHistogram()
std::size_t MemorySize() const
Gives the total memory size, including the size of additional memory allocated inside the class.
TFCS1DFunction_HistogramContent< Ty, Trandom > m_HistoContents
TFCS1DFunction_HistogramContent< Ty, Trandom > & get_HistoContents()
TFCS1DFunctionTemplateHistogram(TH1 *hist=nullptr, bool doprint=true)
virtual double rnd_to_fct(double rnd) const
Function gets random number rnd in the range [0,1) as argument and returns function value according t...
TFCS1DFunction_size_t size_t
void set_nbins(size_t nbins)
set number of bins
static double CheckAndIntegrate1DHistogram(const TH1 *hist, std::vector< double > &integral_vec, int &first, int &last)
virtual void rnd_to_fct(float value[], const float rnd[]) const
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function valu...