Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
CorrFit1DCFPoly.cxx
1/*
2 * CorrFit1DCFPoly.cxx
3 *
4 * Created on: 28 lis 2017
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "CorrFit1DCFPoly.h"
10
11namespace Hal {
12 CorrFit1DCF_Poly::CorrFit1DCF_Poly(Int_t degree) : CorrFit1DCF(degree + 1) {
13 switch (degree) {
14 case 1: {
15 FixParameter(BID(), 0);
16 FixParameter(CID(), 0);
17 } break;
18 case 2: {
19 FixParameter(CID(), 0);
20 } break;
21 default: {
22 // do nothing
23 } break;
24 }
25 FixParameter(NormID(), 1);
26 SetParameterName(AID(), "A");
27 SetParameterName(BID(), "B");
28 SetParameterName(CID(), "C");
30 }
31
32 Double_t CorrFit1DCF_Poly::CalculateCF(const Double_t* x, const Double_t* params) const {
33 return params[NormID()] * (params[AID()] * x[0] + params[BID()] * x[0] * x[0] + params[CID()] * x[0] * x[0] * x[0]);
34 }
35
36 CorrFit1DCF_Poly::~CorrFit1DCF_Poly() {}
37
38 Double_t CorrFit1DCF_Poly2::CalculateCF(const Double_t* x, const Double_t* params) const {
39 return params[NormID()] * (1 + params[AID()] * x[0] + params[BID()] * x[0] * x[0] + params[CID()] * x[0] * x[0] * x[0]);
40 }
41
42 CorrFit1DCF_Poly2::CorrFit1DCF_Poly2(Int_t /*degree*/) {}
43
44 CorrFit1DCF_Poly2::~CorrFit1DCF_Poly2() {}
45} // namespace Hal
virtual Double_t CalculateCF(const Double_t *x, const Double_t *params) const
CorrFit1DCF_Poly(Int_t degree=2)
virtual Double_t CalculateCF(const Double_t *x, const Double_t *params) const
Int_t NormID() const
void FixParameter(Int_t par, Double_t val)
Definition CorrFit.cxx:106
void SetParameterName(Int_t par, TString name)
Definition CorrFit.cxx:110