ATLAS Offline Software
Loading...
Searching...
No Matches
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
14class TH1;
16
18// ^ heavy use of gRandom, but class is not used anywhere
19{
20public:
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
56protected:
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
64private:
65 ClassDef(TFCS1DFunctionSpline, 1) // TFCS1DFunctionSpline
66};
67
68#endif
static Double_t sp
static TRandom * rnd
Define macros for attributes used to control the static checker.
static void unit_test ATLAS_NOT_THREAD_SAFE(TH1 *hist=nullptr)
const TSpline3 & spline() const
TFCS1DFunctionSpline(TH1 *hist=nullptr, double maxdevgoal=0.01, double maxeffsiggoal=3, int maxnp=20)
double Initialize(TH1 *hist, double maxdevgoal=0.01, double maxeffsiggoal=3, int maxnp=20)
static double optimize(TSpline3 &sp_best, std::vector< double > &nprop, const TH1 *hist, TFCS1DFunctionInt32Histogram &hist_fct, double maxdevgoal=0.01, double maxeffsiggoal=3)
static double get_maxdev(TH1 *, TH1 *)
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...