KaliVeda
Toolkit for HIC analysis
KVLightEnergyCsI.h
1 #ifndef KV_LIGHT_ENERGY_CSI_H
2 #define KV_LIGHT_ENERGY_CSI_H
3 
4 #include "KVCalibrator.h"
5 #include "KVValueRange.h"
6 
41 
44  std::unique_ptr<TF1> inv_fit_func;
46  Double_t a4_fit = 0.385;
47  std::optional<KVValueRange<double>> a3_range;
48  std::optional<KVValueRange<double>> a4_range;
49 
50  Bool_t CheckParameters(const KVNameValueList& z_and_a) const;
51 
52 protected:
53  mutable Double_t Z;
54  mutable Double_t A;
55 
56 public:
57  KVLightEnergyCsI(Bool_t make_func = kTRUE);
58  Double_t Compute(Double_t chan, const KVNameValueList& z_and_a = "") const override;
59  Double_t Invert(Double_t, const KVNameValueList& z_and_a = "") const override;
60 
61  void Fit(TH1*, int z, int a, std::optional<KVValueRange<Double_t>> fit_e_range = {});
62  void invFit(TH1*, int z, int a, std::optional<KVValueRange<Double_t>> fit_lite_range = {});
63 
64  void SetZandA(double z, double a)
65  {
67  Z = z; A = a;
68  }
69  void fit_with_a3_fixed(double a3)
70  {
72  a3_fit = a3;
73  a3_range.reset();//remove any previously set range
74  }
75  void fit_with_a3_range(double a3_min, double a3_max)
76  {
78  a3_range = {a3_min,a3_max};
79  }
80  void fit_with_a4_fixed(double a4)
81  {
83  a4_fit = a4;
84  a4_range.reset();//remove any previously set range
85  }
86  void fit_with_a4_range(double a4_min, double a4_max)
87  {
89  a4_range = {a4_min,a4_max};
90  }
91 
92  ClassDefOverride(KVLightEnergyCsI, 1) //Light-energy calibration for CsI detectors
93 };
94 
95 #endif
bool Bool_t
double Double_t
#define ClassDefOverride(name, id)
Base class for all detector calibrations.
Definition: KVCalibrator.h:99
Light-energy calibration function for CsI detectors using a Fermi-function dependence on energy for d...
void fit_with_a3_fixed(double a3)
void fit_with_a3_range(double a3_min, double a3_max)
KVLightEnergyCsI(Bool_t make_func=kTRUE)
std::unique_ptr< TF1 > inv_fit_func
Double_t CalculLumiere(Double_t *, Double_t *)
std::optional< KVValueRange< double > > a3_range
default fixed value of a4 parameter for fits
Double_t Compute(Double_t chan, const KVNameValueList &z_and_a="") const override
std::optional< KVValueRange< double > > a4_range
optional range for a3 parameter
Bool_t CheckParameters(const KVNameValueList &z_and_a) const
optional range for a4 parameter
void fit_with_a4_range(double a4_min, double a4_max)
void SetZandA(double z, double a)
Double_t Invert(Double_t, const KVNameValueList &z_and_a="") const override
void invFit(TH1 *, int z, int a, std::optional< KVValueRange< Double_t >> fit_lite_range={})
void Fit(TH1 *, int z, int a, std::optional< KVValueRange< Double_t >> fit_e_range={})
Double_t a4_fit
default fixed value of a3 parameter for fits
Double_t InvCalc(Double_t *, Double_t *)
void fit_with_a4_fixed(double a4)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Range of values specified by minimum, maximum.
Definition: KVValueRange.h:19
TArc a