Skip to content

Commit 6859e4a

Browse files
committed
DSCB: add class members and member functions (set, get, fix)
1 parent a95b7a4 commit 6859e4a

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

PWGHF/D2H/Macros/HFInvMassFitter.cxx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ HFInvMassFitter::HFInvMassFitter(TH1* histoToFit,
8787
mFixedSigma(false),
8888
mFixedSigmaDoubleGaus(false),
8989
mBoundSigma(false),
90+
mFixedDscbTailParams(false),
9091
mSigmaValue(0.012),
9192
mParamSgn(0.1),
9293
mFracDoubleGaus(0.2),
@@ -107,6 +108,18 @@ HFInvMassFitter::HFInvMassFitter(TH1* histoToFit,
107108
mChiSquareOverNdfTotal(0),
108109
mChiSquareOverNdfBkg(0),
109110
mFixReflOverSgn(false),
111+
mDscbAlphaLInitialValue(1.5),
112+
mDscbAlphaLLowLimit(0.1),
113+
mDscbAlphaLUpLimit(5.0),
114+
mDscbAlphaRInitialValue(1.5),
115+
mDscbAlphaRLowLimit(0.1),
116+
mDscbAlphaRUpLimit(5.0),
117+
mDscbNLInitialValue(2.0),
118+
mDscbNLLowLimit(0.5),
119+
mDscbNLUpLimit(50.),
120+
mDscbNRInitialValue(2.0),
121+
mDscbNRLowLimit(0.5),
122+
mDscbNRUpLimit(50.),
110123
mRooMeanSgn(nullptr),
111124
mRooSigmaSgn(nullptr),
112125
mRooSecSigmaSgn(nullptr),
@@ -117,6 +130,10 @@ HFInvMassFitter::HFInvMassFitter(TH1* histoToFit,
117130
mRooNSgn(nullptr),
118131
mRooNBkg(nullptr),
119132
mRooNRefl(nullptr),
133+
mRooDscbAlphaL(nullptr),
134+
mRooDscbAlphaR(nullptr),
135+
mRooDscbNL(nullptr),
136+
mRooDscbNR(nullptr),
120137
mTotalPdf(nullptr),
121138
mInvMassFrame(nullptr),
122139
mReflFrame(nullptr),
@@ -1017,6 +1034,39 @@ void HFInvMassFitter::setTemplateReflections(TH1* histoRefl)
10171034
mHistoTemplateRefl->SetName("mHistoTemplateRefl");
10181035
}
10191036

1037+
void HFInvMassFitter::setFixDscbAlphaL(double alphaL)
1038+
{
1039+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1040+
printf("Fit type should be DSCB!\n");
1041+
}
1042+
mFixedDscbTailParams = kTRUE;
1043+
mDscbAlphaLInitialValue = alphaL;
1044+
}
1045+
void HFInvMassFitter::setFixDscbAlphaR(double alphaR)
1046+
{
1047+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1048+
printf("Fit type should be DSCB!\n");
1049+
}
1050+
mFixedDscbTailParams = kTRUE;
1051+
mDscbAlphaRInitialValue = alphaR;
1052+
}
1053+
void HFInvMassFitter::setFixDscbNL(double nL)
1054+
{
1055+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1056+
printf("Fit type should be DSCB!\n");
1057+
}
1058+
mFixedDscbTailParams = kTRUE;
1059+
mDscbNLInitialValue = nL;
1060+
}
1061+
void HFInvMassFitter::setFixDscbNR(double nR)
1062+
{
1063+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1064+
printf("Fit type should be DSCB!\n");
1065+
}
1066+
mFixedDscbTailParams = kTRUE;
1067+
mDscbNRInitialValue = nR;
1068+
}
1069+
10201070
double HFInvMassFitter::randomizeInitialParameter(const ParameterRanges& parameterRanges) const
10211071
{
10221072
constexpr double DefaultSigmaFraction{10.};

PWGHF/D2H/Macros/HFInvMassFitter.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class HFInvMassFitter : public TNamed
6565
DoubleGaus = 1,
6666
DoubleGausSigmaRatioPar = 2,
6767
GausSec = 3,
68+
DoubleSidedCrystalBall = 4,
6869
NTypesOfSgnPdf
6970
};
7071
enum TypeOfReflPdf {
@@ -106,6 +107,22 @@ class HFInvMassFitter : public TNamed
106107
void setFixRatioToGausSigma(double sigmaFrac);
107108
void setFixSignalYield(double yield) { mFixedRawYield = yield; }
108109
void setNumberOfSigmaForSidebands(double numberOfSigma) { mNSigmaForSidebands = numberOfSigma; }
110+
void setFixDscbAlphaL(double alphaL);
111+
void setFixDscbAlphaR(double alphaR);
112+
void setFixDscbNL(double nL);
113+
void setFixDscbNR(double nR);
114+
void setDscbAlphaLInitialValue(double value) { mDscbAlphaLInitialValue = value; }
115+
void setDscbAlphaLLowLimit(double value) { mDscbAlphaLLowLimit = value; }
116+
void setDscbAlphaLUpLimit(double value) { mDscbAlphaLUpLimit = value; }
117+
void setDscbAlphaRInitialValue(double value) { mDscbAlphaRInitialValue = value; }
118+
void setDscbAlphaRLowLimit(double value) { mDscbAlphaRLowLimit = value; }
119+
void setDscbAlphaRUpLimit(double value) { mDscbAlphaRUpLimit = value; }
120+
void setDscbNLInitialValue(double value) { mDscbNLInitialValue = value; }
121+
void setDscbNLLowLimit(double value) { mDscbNLLowLimit = value; }
122+
void setDscbNLUpLimit(double value) { mDscbNLUpLimit = value; }
123+
void setDscbNRInitialValue(double value) { mDscbNRInitialValue = value; }
124+
void setDscbNRLowLimit(double value) { mDscbNRLowLimit = value; }
125+
void setDscbNRUpLimit(double value) { mDscbNRUpLimit = value; }
109126
void plotBkg(RooAbsPdf* mFunc, Color_t color = kRed);
110127
void plotRefl(RooAbsPdf* mFunc);
111128
void setReflFuncFixed();
@@ -129,6 +146,14 @@ class HFInvMassFitter : public TNamed
129146
[[nodiscard]] double getMeanUncertainty() const { return mRooMeanSgn->getError(); }
130147
[[nodiscard]] double getSigma() const { return mRooSigmaSgn->getVal(); }
131148
[[nodiscard]] double getSigmaUncertainty() const { return mRooSigmaSgn->getError(); }
149+
[[nodiscard]] double getDscbAlphaL() const { return mRooDscbAlphaL ? mRooDscbAlphaL->getVal() : 0.; }
150+
[[nodiscard]] double getDscbAlphaR() const { return mRooDscbAlphaR ? mRooDscbAlphaR->getVal() : 0.; }
151+
[[nodiscard]] double getDscbNL() const { return mRooDscbNL ? mRooDscbNL->getVal() : 0.; }
152+
[[nodiscard]] double getDscbNR() const { return mRooDscbNR ? mRooDscbNR->getVal() : 0.; }
153+
[[nodiscard]] double getDscbAlphaLUncertainty() const { return mRooDscbAlphaL ? mRooDscbAlphaL->getError() : 0.; }
154+
[[nodiscard]] double getDscbAlphaRUncertainty() const { return mRooDscbAlphaR ? mRooDscbAlphaR->getError() : 0.; }
155+
[[nodiscard]] double getDscbNLUncertainty() const { return mRooDscbNL ? mRooDscbNL->getError() : 0.; }
156+
[[nodiscard]] double getDscbNRUncertainty() const { return mRooDscbNR ? mRooDscbNR->getError() : 0.; }
132157
[[nodiscard]] double getSecSigma() const { return mRooSecSigmaSgn->getVal(); }
133158
[[nodiscard]] double getSecSigmaUncertainty() const { return mRooSecSigmaSgn->getError(); }
134159
[[nodiscard]] double getFracDoubleGaus() const { return mRooFracDoubleGaus->getVal(); }
@@ -179,6 +204,7 @@ class HFInvMassFitter : public TNamed
179204
bool mFixedSigma; /// fix sigma or not
180205
bool mFixedSigmaDoubleGaus; /// fix sigma of 2gaussian or not
181206
bool mBoundSigma; /// set bound sigma or not
207+
bool mFixedDscbTailParams; /// switch for fix double sided Crystal Ball tail parameters
182208
double mSigmaValue; /// value of sigma
183209
double mParamSgn; /// +/- range variation of bound Sigma of gaussian in %
184210
double mFracDoubleGaus; /// initialization for fraction of 2nd gaussian in case of k2Gaus or k2GausSigmaRatioPar
@@ -199,6 +225,18 @@ class HFInvMassFitter : public TNamed
199225
double mChiSquareOverNdfTotal; /// chi2/ndf of the total fit
200226
double mChiSquareOverNdfBkg; /// chi2/ndf of the background (sidebands) pre-fit
201227
bool mFixReflOverSgn; /// switch for fix refl/signal
228+
double mDscbAlphaLInitialValue; /// double sided Crystal Ball alpha left initial value
229+
double mDscbAlphaLLowLimit; /// double sided Crystal Ball alpha left lower limit
230+
double mDscbAlphaLUpLimit; /// double sided Crystal Ball alpha left upper limit
231+
double mDscbAlphaRInitialValue; /// double sided Crystal Ball alpha right initial value
232+
double mDscbAlphaRLowLimit; /// double sided Crystal Ball alpha right lower limit
233+
double mDscbAlphaRUpLimit; /// double sided Crystal Ball alpha right upper limit
234+
double mDscbNLInitialValue; /// double sided Crystal Ball n left initial value
235+
double mDscbNLLowLimit; /// double sided Crystal Ball n left lower limit
236+
double mDscbNLUpLimit; /// double sided Crystal Ball n left upper limit
237+
double mDscbNRInitialValue; /// double sided Crystal Ball n right initial value
238+
double mDscbNRLowLimit; /// double sided Crystal Ball n right lower limit
239+
double mDscbNRUpLimit; /// double sided Crystal Ball n right upper limit
202240
RooRealVar* mRooMeanSgn; /// mean for gaussian of signal
203241
RooRealVar* mRooSigmaSgn; /// sigma for gaussian of signal
204242
RooRealVar* mRooSecSigmaSgn; /// second sigma for composite gaussian of signal
@@ -209,6 +247,10 @@ class HFInvMassFitter : public TNamed
209247
RooRealVar* mRooNSgn; /// total Signal fit function integral
210248
RooRealVar* mRooNBkg; /// total background fit function integral
211249
RooRealVar* mRooNRefl; /// total reflection fit function integral
250+
RooRealVar* mRooDscbAlphaL; /// double sided Crystal Ball alpha left
251+
RooRealVar* mRooDscbAlphaR; /// double sided Crystal Ball alpha right
252+
RooRealVar* mRooDscbNL; /// double sided Crystal Ball n left
253+
RooRealVar* mRooDscbNR; /// double sided Crystal Ball n right
212254
RooAbsPdf* mTotalPdf; /// total fit function
213255
RooPlot* mInvMassFrame; /// frame of mass
214256
RooPlot* mReflFrame; /// reflection frame

0 commit comments

Comments
 (0)