15 FitParam::FitParam() {}
17 void FitParam::Init() {
18 if (!IsDiscrete())
return;
20 std::cout <<
" cannot have npoint = 0" << std::endl;
25 SetMapRange(fMin, fMax, 1);
28 SetMapRange(fMin, fMax, 100);
31 fDParam = (fMapMax - fMapMin) / Double_t(fNPoint - 1);
32 if (fNPoint == 1) fDParam = 0;
33 fMin = Hal::Std::Discretize(fNPoint - 1, fMapMin, fMapMax, fMin,
'-');
34 fMax = Hal::Std::Discretize(fNPoint - 1, fMapMin, fMapMax, fMax,
'+');
35 fStart = Hal::Std::Discretize(fNPoint - 1, fMapMin, fMapMax, fStart,
'=');
38 FitParam::~FitParam() {}
40 void FitParam::SetRange(Double_t min, Double_t max) {
53 fStart = 0.5 * (min + max);
56 void FitParam::SetMapRange(Double_t min, Double_t max, Int_t points) {
57 if (points <= 1) SetIsFixed(kTRUE);
69 void FitParam::Print(Option_t* )
const {
70 std::cout <<
"PARAM " << GetParName() << std::endl;
71 TString disc =
"no", fix =
"no";
72 if (IsDiscrete()) disc =
"yes";
73 if (IsFixed()) fix =
"yes";
74 std::cout <<
"\tIsDiscrete: " << disc <<
"\tIsFixed: " << fix << std::endl;
75 std::cout <<
"\tStart val " << Form(
"%4.4f ", GetStartVal()) << std::endl;
76 std::cout << Form(
"\tLimits %4.4f - %4.4f ", GetMin(), GetMax()) << std::endl;
77 std::cout <<
"\tMap settings" << std::endl;
78 std::cout << Form(
"\tNPoints %i NDx %4.4f", GetNPoints(), GetDParam()) << std::endl;
79 std::cout << Form(
"\tMap Min: %4.4f Map Max: %4.4f", GetMapMin(), GetMapMax()) << std::endl;
80 std::cout <<
"\tValues ";
81 auto array = GetValuesArray();
82 for (
unsigned int i = 0; i < array.size(); i++) {
83 std::cout << array[i] <<
" ";
85 std::cout << std::endl;
88 const std::vector<Double_t> FitParam::GetValuesArray()
const {
89 std::vector<Double_t> values;
91 values.push_back(fMin);
94 if (IsFixed() || fDParam == 0) {
95 values.push_back(fMin);
97 for (
double x = fMin; x <= fMax; x += fDParam) {