23 if (fInputMax < fInputMin)
return;
27 fCalibFunc->GetRange(fXmin, fXmax);
29 Bool_t fMonoIncreasing =
true;
30 Double_t fFuncMax = fCalibFunc->Eval(fXmax);
31 Double_t fFuncMin = fCalibFunc->Eval(fXmin);
32 if (fFuncMin > fFuncMax) {
33 fMonoIncreasing =
false;
37 if (!in_range(fInputMin, fFuncMin, fFuncMax) || !in_range(fInputMax, fFuncMin, fFuncMax)) {
39 if (!in_range(fInputMin, fFuncMin, fFuncMax)) {
40 if (fInputMin < fFuncMin) {
42 if (fMonoIncreasing) {
46 Range = fXmax - fXmin;
47 fFuncMin = fCalibFunc->Eval(fXmin);
49 while (fInputMin < fFuncMin);
55 Range = fXmax - fXmin;
56 fFuncMin = fCalibFunc->Eval(fXmax);
58 while (fInputMin < fFuncMin);
61 else if (fInputMin > fFuncMax) {
63 if (fMonoIncreasing) {
67 Range = fXmax - fXmin;
68 fFuncMax = fCalibFunc->Eval(fXmax);
70 while (fInputMin > fFuncMax);
76 Range = fXmax - fXmin;
77 fFuncMax = fCalibFunc->Eval(fXmin);
79 while (fInputMin > fFuncMax);
83 if (!in_range(fInputMax, fFuncMin, fFuncMax)) {
84 if (fInputMax < fFuncMin) {
86 if (fMonoIncreasing) {
90 Range = fXmax - fXmin;
91 fFuncMin = fCalibFunc->Eval(fXmin);
93 while (fInputMax < fFuncMin);
99 Range = fXmax - fXmin;
100 fFuncMin = fCalibFunc->Eval(fXmax);
102 while (fInputMax < fFuncMin);
105 else if (fInputMax > fFuncMax) {
107 if (fMonoIncreasing) {
111 Range = fXmax - fXmin;
112 fFuncMax = fCalibFunc->Eval(fXmax);
114 while (fInputMax > fFuncMax);
120 Range = fXmax - fXmin;
121 fFuncMax = fCalibFunc->Eval(fXmin);
123 while (fInputMax > fFuncMax);
128 fCalibFunc->SetRange(fXmin, fXmax);
131 if (fMonoIncreasing) {
132 fXmin = fCalibFunc->GetX(fInputMin);
133 fXmax = fCalibFunc->GetX(fInputMax);
136 fXmin = fCalibFunc->GetX(fInputMax);
137 fXmax = fCalibFunc->GetX(fInputMin);
140 fCalibFunc->SetRange(fXmin, fXmax);
155 cout <<
"_________________________________________________" << endl
157 <<
" Name : " << GetName() << endl
158 <<
" Type : " <<
GetType() << endl
159 <<
" Number of Parameters : " << GetNumberParams() << endl
160 <<
" Parameters :" << endl;
161 for (
int i = 0; i < GetNumberParams(); i++) {
162 cout <<
" " << GetParameter(i) << endl;
165 cout <<
" Status : ready" << endl;
167 cout <<
" Status : not ready" << endl;
248 throw (std::invalid_argument(
"missing calibrator options: must give func, min, and max"));
250 SetUseInverseFunction(opt.
IsValue(
"inverse",
"true"));
251 if (IsUseInverseFunction()) {
253 throw (std::invalid_argument(
"missing inverse calibrator options: must give out_min and out_max"));
275 for (
int i = 0; i < npts; ++i) {
276 double input = input_range.
ValueIofN(i, npts);
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
Base class for all detector calibrations.
virtual void SetOptions(const KVNameValueList &)
TGraph * GetGraphOfCalibration(int npts, KVValueRange< double > input_range, const KVNameValueList &par="")
virtual void Print(Option_t *opt="") const
Print a description of the calibration object, including a list of its parameters.
static KVCalibrator * MakeCalibrator(const Char_t *type)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Double_t GetDoubleValue(const Char_t *name) const
Bool_t HasNumericParameter(const Char_t *name) const
Bool_t HasStringParameter(const Char_t *name) const
Bool_t IsValue(const Char_t *name, value_type value) const
const Char_t * GetStringValue(const Char_t *name) const
Range of values specified by minimum, maximum.
ValueType ValueIofN(Int_t i, Int_t n) const
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Longptr_t ExecPlugin(int nargs, const T &... params)
RooCmdArg ClassName(const char *name)
RooCmdArg Range(const char *rangeName, Bool_t adjustNorm=kTRUE)
void swap(RVec< T > &lhs, RVec< T > &rhs)
Type GetType(const std::string &Name)
auto Compute(F &&f) -> Internal::ComputeHelper< std::make_index_sequence< N >, T, F >