ATLAS Offline Software
TFCS1DFunctionSpline.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FASTCALOSIMEVENT_TFCS1DFunctionSpline_h
6 #define ISF_FASTCALOSIMEVENT_TFCS1DFunctionSpline_h
7 
9 
11 #include <TSpline.h>
12 #include <vector>
13 
14 class TH1;
16 
18 // ^ heavy use of gRandom, but class is not used anywhere
19 {
20 public:
21  TFCS1DFunctionSpline(TH1 *hist = nullptr, double maxdevgoal = 0.01,
22  double maxeffsiggoal = 3, int maxnp = 20) {
23  if (hist)
24  Initialize(hist, maxdevgoal, maxeffsiggoal, maxnp);
25  };
27 
28  static double get_maxdev(const TH1 *hist, const TSpline3 &sp,
29  double &maxeffsig, double &p_maxdev,
30  double &p_maxeffsig, int ntoy = 10000);
31 
32  double Initialize(TH1 *hist, double maxdevgoal = 0.01,
33  double maxeffsiggoal = 3, int maxnp = 20);
34 
35  double InitializeFromSpline(TH1 *hist, const TSpline3 &sp,
36  double maxdevgoal = 0.01,
37  double maxeffsiggoal = 3);
38  double InitializeEqualDistance(TH1 *hist, double maxdevgoal = 0.01,
39  double maxeffsiggoal = 3,
40  int nsplinepoints = 5);
41  double InitializeEqualProbability(TH1 *hist, double maxdevgoal = 0.01,
42  double maxeffsiggoal = 3,
43  int nsplinepoints = 5);
44 
46 
49  virtual double rnd_to_fct(double rnd) const;
50 
51  const TSpline3 &spline() const { return m_spline; };
52  TSpline3 &spline() { return m_spline; };
53 
54  static void unit_test ATLAS_NOT_THREAD_SAFE(TH1 *hist = nullptr);
55 
56 protected:
57  static double optimize(TSpline3 &sp_best, std::vector<double> &nprop,
58  const TH1 *hist,
60  double maxdevgoal = 0.01, double maxeffsiggoal = 3);
61 
62  TSpline3 m_spline;
63 
64 private:
65  ClassDef(TFCS1DFunctionSpline, 1) // TFCS1DFunctionSpline
66 };
67 
68 #endif
TFCS1DFunctionSpline::TFCS1DFunctionSpline
TFCS1DFunctionSpline(TH1 *hist=nullptr, double maxdevgoal=0.01, double maxeffsiggoal=3, int maxnp=20)
Definition: TFCS1DFunctionSpline.h:21
TFCS1DFunctionSpline
Definition: TFCS1DFunctionSpline.h:19
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
plotmaker.hist
hist
Definition: plotmaker.py:148
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
TFCS1DFunctionSpline::spline
TSpline3 & spline()
Definition: TFCS1DFunctionSpline.h:52
TFCS1DFunctionSpline::m_spline
TSpline3 m_spline
Definition: TFCS1DFunctionSpline.h:62
TFCS1DFunction::get_maxdev
static double get_maxdev(TH1 *, TH1 *)
Definition: TFCS1DFunction.cxx:21
TFCS1DFunctionInt32Histogram
Definition: TFCS1DFunctionInt32Histogram.h:15
TFCS1DFunctionSpline::ATLAS_NOT_THREAD_SAFE
static void unit_test ATLAS_NOT_THREAD_SAFE(TH1 *hist=nullptr)
jobOptions.Initialize
Initialize
Definition: jobOptions.pA.py:28
TFCS1DFunctionSpline::spline
const TSpline3 & spline() const
Definition: TFCS1DFunctionSpline.h:51
TFCS1DFunction.h
TFCS1DFunction
Definition: TFCS1DFunction.h:17
checker_macros.h
Define macros for attributes used to control the static checker.
TFCS1DFunctionSpline::~TFCS1DFunctionSpline
~TFCS1DFunctionSpline()
Definition: TFCS1DFunctionSpline.h:26