Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
CorrFit1DCFPainter.cxx
1/*
2 * CorrFit1DPainter.cxx
3 *
4 * Created on: 23 lip 2024
5 * Author: daniel
6 */
7
8#include "CorrFit1DCFPainter.h"
9
10#include <RtypesCore.h>
11#include <TF1.h>
12#include <TLegend.h>
13#include <TString.h>
14#include <TVirtualPad.h>
15#include <vector>
16
17#include "CorrFit.h"
18#include "CorrFit1DCF.h"
19#include "CorrFitFunc.h"
20#include "Femto1DCF.h"
21#include "Femto1DCFPainter.h"
22#include "Painter.h"
23
24namespace Hal {
25
26 void CorrFit1DCFPainter::MakeFunctions() {
27 std::vector<TF1*> vec;
28 vec.push_back(GetDrawableFunc(""));
29 fFunctions.push_back(vec);
30 }
31
32 CorrFit1DCFPainter::CorrFit1DCFPainter(CorrFit1DCF* fit, Femto1DCF* cf) : CorrFitPainter(fit), fCF(cf) {
33 fCFPainter = (Femto1DCFPainter*) fCF->GetPainter();
34 if (fCFPainter) fCFPainter->AddPainter(this);
35 }
36
37 TF1* CorrFit1DCFPainter::GetDrawableFunc(TString opt) {
38 if (!fFittedFunc) return nullptr;
39 return ((CorrFit1DCF*) fFittedFunc)->GetFunctionForDrawing();
40 }
41
42 void CorrFit1DCFPainter::MakeLegend() {
43 if (CheckOpt(kLegendBit)) {
44 LockPad();
45 fLegendPad = GetPad(1);
46 UnlockPad();
47 }
48 CorrFitPainter::MakeLegend();
49 }
50
51 CorrFit1DCFPainter::~CorrFit1DCFPainter() {}
52
53 void CorrFit1DCFPainter::UpdateParameters() {
54 auto func = (CorrFit1DCF*) fFittedFunc;
55 for (int i = 0; i < fFittedFunc->GetParametersNo(); i++) {
56 func->fTempParamsEval[i] = func->GetParameter(i);
57 }
58 // TODO fFittedFunction->SetParameter(par,val);
59 func->ParametersChanged();
60 func->CopyParamsToTF1(fFunctions[0][0], kTRUE, kTRUE);
61 }
62
63} /* namespace Hal */