10#include "CorrFit3DCFMultiDim.h"
13#include "CorrFitFunctor.h"
14#include "CorrFitInfo.h"
20#include <RtypesCore.h>
35 fData = fFunctor->GetData(pars);
40 Double_t bin = (
fBinX - 1) * fFunctorXbins * fFunctorYbins + (fBinY - 1) * fFunctorYbins + fBinZ - 1;
41 Double_t num = fData->
Get(bin) - 1.0;
42 if (TMath::IsNaN(num)) num = 0;
46 CorrFit3DCFMultiDim::CorrFit3DCFMultiDim(Int_t params) :
CorrFit3DCF(params) { fMinAlgo = EMinAlgo::kHalScan; }
48 void CorrFit3DCFMultiDim::SetFunctor(CorrFitFunctor* functor) {
53 void CorrFit3DCFMultiDim::SetFunctorFromMap(TString filename) {
54 fFunctor =
new CorrFitFunctor(filename);
58 void CorrFit3DCFMultiDim::SetAutoLimits() {
63#ifdef _MULTIDIM_DEBUG_
64 std::cout <<
"SET AUTO LIMITS" << std::endl;
66 for (
int i = 0; i < fFunctor->GetNParams(); i++) {
67 name = fFunctor->GetParameterName(i);
73#ifdef _MULTIDIM_DEBUG_
74 std::cout <<
"AUTO DONE" << std::endl;
78 CorrFit3DCFMultiDim::~CorrFit3DCFMultiDim() {
79 if (fFunctor)
delete fFunctor;
83 if (alg == kHalScan || alg == kHalAnt) {
84 if (alg == kHalAnt) { std::cout <<
"Smart scan" << std::endl; }
87 Cout::Text(
"This class supports correctly only Minimizer",
"L", kYellow);
97 TString name = par_name;
101 Double_t step_size = (Max - Min) / (Double_t(points - 1));
102 if (points == 0) step_size = 0;
103#ifdef _MULTIDIM_DEBUG_
104 std::cout <<
"SET MAP STEPS " << par_name <<
"\t" << Min <<
" " << Max <<
" " << points <<
" "
105 <<
" " << step_size << std::endl;
107 std::string Name = name.Data();
110#ifdef _MULTIDIM_DEBUG_
111 std::cout <<
"SET FREE STEPS " << par_name <<
"\t" <<
GetParMin(i) <<
" " <<
GetParMax(i) <<
" " << points <<
" "
112 <<
" " << 0.01 << std::endl;
118#ifdef _MULTIDIM_DEBUG_
119 std::cout <<
"SET FIXED " << par_name <<
"\t" <<
GetParMin(i) <<
" " <<
GetParMax(i) << std::endl;
125 std::cout <<
"PREPARING MINIMIZER DONE !" << std::endl;
132 if (cf ==
nullptr) {
Cout::PrintInfo(
"Cannot find 3DCF in CorrFitInfo !", EInfo::kCriticalError); }
135 TH3* testThis = (TH3*) thisCf->
GetNum();
136 TH3* testMap = (TH3*) cf->
GetNum();
137 if (!Hal::Std::AreSimilar(testThis, testMap, kFALSE)) {
138 Cout::PrintInfo(
"CorrFitInfo incompatible histograms in CorrFitInfo and Femto3DCF !", EInfo::kError);
140 fFunctorXbins = testThis->GetXaxis()->GetNbins();
141 fFunctorYbins = testThis->GetYaxis()->GetNbins();
virtual Double_t CalculateCF(const Double_t *x, const Double_t *params) const
virtual void SetMinimizer(EMinAlgo alg)
virtual void PrepareHalMinimizer() const
virtual void RecalculateFunction() const
Bool_t GetParameterConfig(TString name, Double_t &min, Double_t &max, Int_t &npoints) const
Int_t GetParametersNo() const
TString GetParameterName(Int_t no) const
Double_t GetParMax(Int_t par) const
Double_t GetParMin(Int_t par) const
Double_t * fTempParamsEval
void SetParLimits(Int_t par, Double_t min, Double_t max)
std::vector< FitParam > fParameters
virtual void SetMinimizer(EMinAlgo alg)
Bool_t IsParFixed(Int_t par) const
static void Text(TString text, TString option="L", Color_t color=-1)
static void PrintInfo(TString text, Hal::EInfo status)
Femto::EKinematics GetFrame() const
virtual bool SetFixedVariable(unsigned int ivar, const std::string &name, double val)
virtual bool SetVariableLimits(unsigned int ivar, double lower, double upper)
static Minimizer * Instance()
virtual bool SetLimitedVariable(unsigned int ivar, const std::string &name, double val, double points, double lower, double upper)