1 #ifndef __KV_CALIBRATOR__
2 #define __KV_CALIBRATOR__
6 #include "KVDetector.h"
8 #include "KVValueRange.h"
134 return (
X >= Xmin) && (
X <= Xmax);
141 :
KVBase(
"Calibrator",
type),
fDetector(nullptr),
fCalibFunc(new
TF1(
"KVCalibrator::fCalibFunc", formula)),
fReady(
kFALSE),
fUseInverseFunction(
kFALSE),
fInputMin(99),
fInputMax(-1),
fInversionFail(
kFALSE),
fRandomize(false)
#define ClassDefOverride(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TRandom * gRandom
Base class for KaliVeda framework.
static Double_t ProtectedGetX(const TF1 *func, Double_t val, GetX_status &status, std::optional< Double_t > xmin={}, std::optional< Double_t > xmax={})
Base class for all detector calibrations.
Double_t operator()(Double_t x, const KVNameValueList &par="")
virtual Int_t GetNumberParams() const
TF1 * GetCalibFunction() const
KVDetector * GetDetector() const
virtual void SetParameter(int i, Double_t par_val)
void Print(Option_t *opt="") const override
Print a description of the calibration object, including a list of its parameters.
void adjust_range_of_inverse_calibration()
void SetCalibFunction(TF1 *f)
void SetUseInverseFunction(Bool_t yes=kTRUE)
virtual Double_t Invert(Double_t x, const KVNameValueList &) const
Bool_t fReady
= kTRUE if calibration formula & parameters have been set up
Bool_t fInversionFail
problem inverting calibration function
KVDrawable< TGraph > GetGraphOfCalibration(int npts, KVValueRange< double > input_range, const KVNameValueList &par="")
Double_t fInputMin
required minimum input signal for inverse calibration
virtual void SetDetector(KVDetector *d)
virtual Bool_t IsAvailableFor(const KVNameValueList &) const
virtual void SetOptions(const KVNameValueList &)
Double_t do_inversion(Double_t x) const
virtual Double_t Compute(Double_t x, const KVNameValueList &) const
void SetStatus(Bool_t ready)
TF1 * fCalibFunc
calibration function
Double_t GetParameter(int i) const
Double_t fInputMax
required maximum input signal for inverse calibration
KVCalibrator(const TString &formula, const TString &type)
TString GetInputSignalType() const
void SetRandomize(Bool_t yes=kTRUE)
TString fOutputSignal
type of output calibrated signal
void SetOutputSignalType(const TString &type)
void SetInputSignalType(const TString &type)
TString GetOutputSignalType() const
KVDetector * fDetector
associated detector
Bool_t fUseInverseFunction
true if inverse i.e. TF1::GetX should be used for Compute()
Bool_t fRandomize
randomize input integer values with uniform distribution in range [-0.5,0.5]
TString fInputSignal
type of signal used as input
Bool_t InversionFailure() const
Bool_t IsUseInverseFunction() const
static KVCalibrator * MakeCalibrator(const Char_t *type)
bool in_range(double X, double Xmin, double Xmax)
Base class for detector geometry description, interface to energy-loss calculations.
Simple wrapper for objects which can be drawn (graphs, histograms)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Range of values specified by minimum, maximum.
virtual Double_t GetParameter(const TString &name) const
virtual Int_t GetNpar() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual void SetParameter(const TString &name, Double_t value)
virtual Double_t Uniform(Double_t x1, Double_t x2)