Skip to content

Commit fb66101

Browse files
committed
DSCB: add class members and member functions (set, get, fix)
1 parent 570144e commit fb66101

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
@@ -86,6 +86,7 @@ HFInvMassFitter::HFInvMassFitter(TH1* histoToFit,
8686
mFixedSigma(false),
8787
mFixedSigmaDoubleGaus(false),
8888
mBoundSigma(false),
89+
mFixedDscbTailParams(false),
8990
mSigmaValue(0.012),
9091
mParamSgn(0.1),
9192
mFracDoubleGaus(0.2),
@@ -106,6 +107,18 @@ HFInvMassFitter::HFInvMassFitter(TH1* histoToFit,
106107
mChiSquareOverNdfTotal(0),
107108
mChiSquareOverNdfBkg(0),
108109
mFixReflOverSgn(false),
110+
mDscbAlphaLInitialValue(1.5),
111+
mDscbAlphaLLowLimit(0.1),
112+
mDscbAlphaLUpLimit(5.0),
113+
mDscbAlphaRInitialValue(1.5),
114+
mDscbAlphaRLowLimit(0.1),
115+
mDscbAlphaRUpLimit(5.0),
116+
mDscbNLInitialValue(2.0),
117+
mDscbNLLowLimit(0.5),
118+
mDscbNLUpLimit(50.),
119+
mDscbNRInitialValue(2.0),
120+
mDscbNRLowLimit(0.5),
121+
mDscbNRUpLimit(50.),
109122
mRooMeanSgn(nullptr),
110123
mRooSigmaSgn(nullptr),
111124
mRooSecSigmaSgn(nullptr),
@@ -116,6 +129,10 @@ HFInvMassFitter::HFInvMassFitter(TH1* histoToFit,
116129
mRooNSgn(nullptr),
117130
mRooNBkg(nullptr),
118131
mRooNRefl(nullptr),
132+
mRooDscbAlphaL(nullptr),
133+
mRooDscbAlphaR(nullptr),
134+
mRooDscbNL(nullptr),
135+
mRooDscbNR(nullptr),
119136
mTotalPdf(nullptr),
120137
mInvMassFrame(nullptr),
121138
mReflFrame(nullptr),
@@ -1014,6 +1031,39 @@ void HFInvMassFitter::setTemplateReflections(TH1* histoRefl)
10141031
mHistoTemplateRefl->SetName("mHistoTemplateRefl");
10151032
}
10161033

1034+
void HFInvMassFitter::setFixDscbAlphaL(double alphaL)
1035+
{
1036+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1037+
printf("Fit type should be DSCB!\n");
1038+
}
1039+
mFixedDscbTailParams = kTRUE;
1040+
mDscbAlphaLInitialValue = alphaL;
1041+
}
1042+
void HFInvMassFitter::setFixDscbAlphaR(double alphaR)
1043+
{
1044+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1045+
printf("Fit type should be DSCB!\n");
1046+
}
1047+
mFixedDscbTailParams = kTRUE;
1048+
mDscbAlphaRInitialValue = alphaR;
1049+
}
1050+
void HFInvMassFitter::setFixDscbNL(double nL)
1051+
{
1052+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1053+
printf("Fit type should be DSCB!\n");
1054+
}
1055+
mFixedDscbTailParams = kTRUE;
1056+
mDscbNLInitialValue = nL;
1057+
}
1058+
void HFInvMassFitter::setFixDscbNR(double nR)
1059+
{
1060+
if (mTypeOfSgnPdf != DoubleSidedCrystalBall) {
1061+
printf("Fit type should be DSCB!\n");
1062+
}
1063+
mFixedDscbTailParams = kTRUE;
1064+
mDscbNRInitialValue = nR;
1065+
}
1066+
10171067
double HFInvMassFitter::randomizeInitialParameter(const ParameterRanges& parameterRanges) const
10181068
{
10191069
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)