ATLAS Offline Software
TFCS1DFunction.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_TFCS1DFunction_h
6 #define ISF_FASTCALOSIMEVENT_TFCS1DFunction_h
7 
8 // STL includes
9 #include <vector>
10 
12 
14 
15 class TH1;
16 
17 class TFCS1DFunction : public TFCSFunction {
18 public:
21 
22  virtual int ndim() const { return 1; };
23 
27  virtual void rnd_to_fct(float value[], const float rnd[]) const;
28 
31  virtual double rnd_to_fct(double rnd) const = 0;
32 
36  virtual bool operator==(const TFCS1DFunction &ref) const {
37  return this == &ref;
38  };
39 
40  static double get_maxdev(TH1 *, TH1 *);
41 
42  static double CheckAndIntegrate1DHistogram(const TH1 *hist,
43  std::vector<double> &integral_vec,
44  int &first, int &last);
45 
46  static TH1 *generate_histogram_random_slope
47  ATLAS_NOT_THREAD_SAFE(int nbinsx = 50, double xmin = 0, double xmax = 1,
48  double zerothreshold = 0.1);
49  static TH1 *generate_histogram_random_gauss ATLAS_NOT_THREAD_SAFE(
50  int nbinsx = 50, int ntoy = 100000, double xmin = 1, double xmax = 5,
51  double xpeak = 1.5, double sigma = 0.6);
52  static void unit_test ATLAS_NOT_THREAD_SAFE(TH1 *hist, TFCS1DFunction *rtof,
53  int nrnd = 1000000,
54  TH1 *histfine = nullptr);
55 
56 private:
57  ClassDef(TFCS1DFunction, 2) // TFCS1DFunction
58 };
59 
60 #endif
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
plotmaker.hist
hist
Definition: plotmaker.py:148
TFCS1DFunction::rnd_to_fct
virtual double rnd_to_fct(double rnd) const =0
Function gets random number rnd in the range [0,1) as argument and returns function value.
TFCS1DFunction::ATLAS_NOT_THREAD_SAFE
static void unit_test ATLAS_NOT_THREAD_SAFE(TH1 *hist, TFCS1DFunction *rtof, int nrnd=1000000, TH1 *histfine=nullptr)
TFCS1DFunction::ATLAS_NOT_THREAD_SAFE
static TH1 *generate_histogram_random_gauss ATLAS_NOT_THREAD_SAFE(int nbinsx=50, int ntoy=100000, double xmin=1, double xmax=5, double xpeak=1.5, double sigma=0.6)
TFCS1DFunction::~TFCS1DFunction
~TFCS1DFunction()
Definition: TFCS1DFunction.h:20
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
athena.value
value
Definition: athena.py:122
TFCSFunction
Definition: TFCSFunction.h:12
TFCS1DFunction::get_maxdev
static double get_maxdev(TH1 *, TH1 *)
Definition: TFCS1DFunction.cxx:21
TFCS1DFunction::ATLAS_NOT_THREAD_SAFE
static TH1 *generate_histogram_random_slope ATLAS_NOT_THREAD_SAFE(int nbinsx=50, double xmin=0, double xmax=1, double zerothreshold=0.1)
xmin
double xmin
Definition: listroot.cxx:60
TFCS1DFunction::CheckAndIntegrate1DHistogram
static double CheckAndIntegrate1DHistogram(const TH1 *hist, std::vector< double > &integral_vec, int &first, int &last)
Definition: TFCS1DFunction.cxx:52
TFCS1DFunction::TFCS1DFunction
TFCS1DFunction()
Definition: TFCS1DFunction.h:19
TFCS1DFunction::ndim
virtual int ndim() const
Return the number of dimensions for the function.
Definition: TFCS1DFunction.h:22
ref
const boost::regex ref(r_ef)
TH1
Definition: rootspy.cxx:268
DeMoScan.first
bool first
Definition: DeMoScan.py:534
xmax
double xmax
Definition: listroot.cxx:61
TFCS1DFunction::operator==
virtual bool operator==(const TFCS1DFunction &ref) const
The == operator compares the content of instances.
Definition: TFCS1DFunction.h:36
TFCS1DFunction
Definition: TFCS1DFunction.h:17
checker_macros.h
Define macros for attributes used to control the static checker.
TFCSFunction.h