14#include <TAttMarker.h>
20#include <TLegendEntry.h>
27#include "CorrFit1DCF.h"
29#include "CorrFit1DCFPainter.h"
30#include "CorrFitHDFunc1D.h"
31#include "CorrFitMask.h"
32#include "CorrFitMask1D.h"
44 if (
GetParametersNo() < 2) { HalCoutDebug(
"1D corrfit func should contain at least 2 params"); }
54 Double_t CorrFit1DCF::EvalDenominator(Double_t x)
const {
65 for (
int i = 0; i <= num->GetNbinsX(); i++) {
66 Double_t e_num = num->GetBinError(i);
67 Double_t e_den = num->GetBinError(i);
68 num->SetBinError(i, TMath::Sqrt(e_num * e_num + e_den * e_den));
83 double CorrFit1DCF::GetChiTFD(
const double* )
const {
88 Bool_t useHD = kFALSE;
90 for (
int i = 0; i < cf->
GetNbins(); i++) {
100 e3 = GetNumericalError(
fBinX) * Cf_theo;
101 Cf_theo = Cf_theo * B;
106 f += chi / (ecf * ecf + e3 * e3);
108#ifdef CF_FIT_TRACKING
110 std::cout << Form(
"%4.3f\t", par[i]);
112 std::cout <<
"->" << f << std::endl;
121 Bool_t useHD = kFALSE;
123 for (
int i = 0; i < cf->
GetNbins(); i++) {
129 Double_t logA = (C * (A + B)) / (A * (C + 1.0));
130 Double_t logB = (A + B) / (B * (C + 1.0));
131 f += -(A * TMath::Log(logA) + B * TMath::Log(logB));
134#ifdef CF_FIT_TRACKING
136 std::cout << Form(
"%4.3f\t", par[i]);
138 std::cout <<
"->" << f << std::endl;
143 double CorrFit1DCF::GetChiTF(
const double* )
const {
147 Bool_t useHD = kFALSE;
149 for (
int i = 0; i < Cf->
GetNbins(); i++) {
155 Double_t eb = GetNumericalError(
fBinX);
157 Double_t delta = C - cf;
158 f += delta * delta / (ea * ea);
160#ifdef CF_FIT_TRACKING
162 std::cout << Form(
"%4.3f\t", par[i]);
164 std::cout <<
"->" << f << std::endl;
182 if (
fMask ==
nullptr) {
190 GetMask()->Reset(
false);
197 Double_t free_parameters = 0;
202 Bool_t useHD = kFALSE;
210 CorrFit1DCF::~CorrFit1DCF() {}
219 TF1* draw_func =
new TF1(Hal::Std::GetUniqueName(
"func_draw"),
241 const Int_t bin0 =
fBinX * 2 - 2;
242 for (
int i = 0; i < 3; i++) {
252 Double_t val =
EvalCF(x, params);
253 return val / params[
NormID()];
259 for (
int i = 0; i < cf->GetBinsHD().GetSize(); i++) {
260 Int_t hdBin = cf->GetBinsHD()[i];
264 cf->GetCFMapHD()[hdBin] = p;
270 if (mask ==
nullptr)
return;
271 if (!mask->AreCompatible(
fCF))
return;
virtual Double_t Eval(Double_t q) const
virtual void Fit(TObject *histo)
void EstimateActiveBins()
virtual Double_t CalculateCF(const Double_t *, const Double_t *) const
CorrFit1DCF(Int_t parameters=3)
Double_t GetFunDrawable(Double_t *x, Double_t *params) const
Double_t EvalCFNormalized(const Double_t *x, const Double_t *params) const
void SetFittingMask(const CorrFitMask &map)
Double_t EvalCF(const Double_t *x, const Double_t *params) const
void RecalculateSmoothFunction() const
virtual void MakePainter(TString opt)
virtual TF1 * GetFunctionForDrawing() const
void SetErrors(TH1 *num, const TH1 *den) const
double GetLogTFD(const double *par) const
virtual void CalculateNumErrors(TH1 *)
TH1 * fDenominatorHistogram
CorrFitPainter * fPainter
TH1 * fCorrelationFunctionHistogram
Femto::EKinematics fKinematics
virtual void Fit(TObject *histo)
TH1 * fNumeratorHistogram
Array_1< Double_t > fRange
Int_t GetBin(Int_t no) const
Double_t EvalHD(Double_t hdBin) const
Double_t GetBinCFVal(Int_t bin, Bool_t extrapolated) const
virtual void SetMask(const CorrFitMask &mask, TH1 *denominator, Bool_t hd)=0
Int_t HDBinToBin(Int_t hd_bin) const
Width_t GetLineWidth() const
Int_t GetParametersNo() const
TString GetParameterName(Int_t no) const
Double_t GetParameter(Int_t par) const
Double_t * fTempParamsEval
Style_t GetLineStyle() const
Color_t GetLineColor() const
void SetParameterName(Int_t par, TString name)
std::vector< FitParam > fParameters
virtual void SetOption(TString option)