ATLAS Offline Software
TFCS1DFunctionHistogram.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FASTCALOSIMEVENT_TFCS1DFunctionHistogram_h
6 #define ISF_FASTCALOSIMEVENT_TFCS1DFunctionHistogram_h
7 
9 #include "TH1.h"
10 #include <vector>
11 #include <memory>
12 
14 
15 public:
17  TFCS1DFunctionHistogram(TH1 *hist, double);
18 
19  void Initialize(TH1 *hist, double);
20 
22  virtual double rnd_to_fct(double rnd) const;
23  TH1 *vector_to_histo();
24  double get_inverse(double rnd) const;
25  static double linear(double y1, double y2, double x1, double x2, double x);
26  static double non_linear(double y1, double y2, double x1, double x2,
27  double x);
28 
29  static double get_maxdev(TH1 *, TH1D *);
30  void smart_rebin_loop(TH1 *hist, double);
31  static double get_change(TH1 *);
32  static TH1D *smart_rebin(TH1D *);
33  static std::unique_ptr<double[]> histo_to_array(TH1 *);
34  static double sample_from_histo(TH1 *hist, double);
35  double sample_from_histovalues(double);
36 
37  const std::vector<float>& get_HistoBorders() { return m_HistoBorders; };
38  const std::vector<float>& get_HistoContents() { return m_HistoContents; };
39 
40 protected:
41  std::vector<float> m_HistoBorders;
42  std::vector<float> m_HistoContents;
43 
44  ClassDef(TFCS1DFunctionHistogram, 1) // TFCS1DFunctionHistogram
45 };
46 
47 #endif
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
TFCS1DFunctionHistogram::rnd_to_fct
virtual double rnd_to_fct(double rnd) const
Function gets random number rnd in the range [0,1) as argument and returns function value.
Definition: TFCS1DFunctionHistogram.cxx:223
TFCS1DFunctionHistogram::vector_to_histo
TH1 * vector_to_histo()
Definition: TFCS1DFunctionHistogram.cxx:65
plotmaker.hist
hist
Definition: plotmaker.py:148
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
TFCS1DFunction::rnd_to_fct
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...
Definition: TFCS1DFunction.cxx:17
TFCS1DFunctionHistogram::sample_from_histo
static double sample_from_histo(TH1 *hist, double)
Definition: TFCS1DFunctionHistogram.cxx:39
TFCS1DFunctionHistogram::smart_rebin
static TH1D * smart_rebin(TH1D *)
Definition: TFCS1DFunctionHistogram.cxx:164
TFCS1DFunctionHistogram::m_HistoContents
std::vector< float > m_HistoContents
Definition: TFCS1DFunctionHistogram.h:42
TFCS1DFunctionHistogram::smart_rebin_loop
void smart_rebin_loop(TH1 *hist, double)
Definition: TFCS1DFunctionHistogram.cxx:80
TFCS1DFunctionHistogram::get_HistoBorders
const std::vector< float > & get_HistoBorders()
Definition: TFCS1DFunctionHistogram.h:37
x
#define x
TFCS1DFunctionHistogram::linear
static double linear(double y1, double y2, double x1, double x2, double x)
Definition: TFCS1DFunctionHistogram.cxx:230
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
TFCS1DFunctionHistogram::get_change
static double get_change(TH1 *)
Definition: TFCS1DFunctionHistogram.cxx:151
TFCS1DFunctionHistogram
Definition: TFCS1DFunctionHistogram.h:13
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
TFCS1DFunctionHistogram::non_linear
static double non_linear(double y1, double y2, double x1, double x2, double x)
Definition: TFCS1DFunctionHistogram.cxx:246
TFCS1DFunctionHistogram::m_HistoBorders
std::vector< float > m_HistoBorders
Definition: TFCS1DFunctionHistogram.h:38
TFCS1DFunctionHistogram::get_maxdev
static double get_maxdev(TH1 *, TH1D *)
Definition: TFCS1DFunctionHistogram.cxx:139
TFCS1DFunctionHistogram::TFCS1DFunctionHistogram
TFCS1DFunctionHistogram()
Definition: TFCS1DFunctionHistogram.h:16
TFCS1DFunctionHistogram::sample_from_histovalues
double sample_from_histovalues(double)
Definition: TFCS1DFunctionHistogram.cxx:52
TFCS1DFunction.h
TFCS1DFunctionHistogram::histo_to_array
static std::unique_ptr< double[]> histo_to_array(TH1 *)
Definition: TFCS1DFunctionHistogram.cxx:25
TFCS1DFunctionHistogram::Initialize
void Initialize(TH1 *hist, double)
Definition: TFCS1DFunctionHistogram.cxx:20
TFCS1DFunctionHistogram::get_HistoContents
const std::vector< float > & get_HistoContents()
Definition: TFCS1DFunctionHistogram.h:38
TFCS1DFunction
Definition: TFCS1DFunction.h:17
TFCS1DFunctionHistogram::get_inverse
double get_inverse(double rnd) const
Definition: TFCS1DFunctionHistogram.cxx:260