Skip to content

Commit 20214ef

Browse files
committed
address clang-tidy issues
1 parent 0f3c935 commit 20214ef

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

PWGHF/D2H/Macros/HFInvMassFitter.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void HFInvMassFitter::doFit()
238238
// estimate signal yield
239239
RooAbsReal* bkgIntegral = mBkgPdf->createIntegral(*mass, NormSet(*mass), Range("bkg")); // bkg integral
240240
mIntegralBkg = bkgIntegral->getValV(); // fraction of BG's integral in "bkg" range out of that in "full" range (which is 1 by construction). Not an absolute value.
241-
double estimatedSignal;
241+
double estimatedSignal{};
242242
checkForSignal(estimatedSignal); // SIG's absolute integral in "bkg" range
243243
calculateBackground(mBkgYield, mBkgYieldErr); // BG's absolute integral in "bkg" range
244244

@@ -514,9 +514,9 @@ void HFInvMassFitter::drawFit(TVirtualPad* pad, const std::vector<std::string>&
514514
textFitMetrics->AddText(Form("S = %.0f #pm %.0f ", mRawYield, mRawYieldErr));
515515
textFitMetrics->AddText(Form("S_{count} = %.0f #pm %.0f ", mRawYieldCounted, mRawYieldCountedErr));
516516
if (mTypeOfBkgPdf != NoBkg) {
517-
textFitMetrics->AddText(Form("B (%d#sigma) = %.0f #pm %.0f", mNSigmaForSidebands, mBkgYield, mBkgYieldErr));
518-
textFitMetrics->AddText(Form("S/B (%d#sigma) = %.4g ", mNSigmaForSidebands, mRawYield / mBkgYield));
519-
textFitMetrics->AddText(Form("Significance (%d#sigma) = %.1f #pm %.1f ", mNSigmaForSidebands, mSignificance, mSignificanceErr));
517+
textFitMetrics->AddText(Form("B (%.1f#sigma) = %.0f #pm %.0f", mNSigmaForSidebands, mBkgYield, mBkgYieldErr));
518+
textFitMetrics->AddText(Form("S/B (%.1f#sigma) = %.4g ", mNSigmaForSidebands, mRawYield / mBkgYield));
519+
textFitMetrics->AddText(Form("Significance (%.1f#sigma) = %.1f #pm %.1f ", mNSigmaForSidebands, mSignificance, mSignificanceErr));
520520
textFitMetrics->AddText(Form("#chi^{2} / ndf = %.3f", mChiSquareOverNdfTotal));
521521
}
522522
if (mReflPdf != nullptr) {
@@ -652,7 +652,7 @@ void HFInvMassFitter::countSignal(double& signal, double& signalErr) const
652652
}
653653
sum += mHistoInvMass->GetBinContent(binForMaxSgn) * binForMaxSgnFraction;
654654

655-
double bkg, errBkg;
655+
double bkg{}, errBkg{};
656656
calculateBackground(bkg, errBkg);
657657

658658
signal = sum - bkg;
@@ -676,9 +676,9 @@ void HFInvMassFitter::calculateBackground(double& bkg, double& errBkg) const
676676
// calculate significance
677677
void HFInvMassFitter::calculateSignificance(double& significance, double& errSignificance) const
678678
{
679-
double signal, errSignal;
679+
double signal{}, errSignal{};
680680
calculateSignal(signal, errSignal);
681-
double bkg, errBkg;
681+
double bkg{}, errBkg{};
682682
calculateBackground(bkg, errBkg);
683683
double const sgnErrSquare = errSignal * errSignal;
684684
double const bkgErrSquare = errBkg * errBkg;
@@ -699,7 +699,7 @@ void HFInvMassFitter::checkForSignal(double& estimatedSignal)
699699
for (int i = binForMinSgn; i <= binForMaxSgn; i++) {
700700
sum += mHistoInvMass->GetBinContent(i);
701701
}
702-
double bkg, errBkg;
702+
double bkg{}, errBkg{};
703703
calculateBackground(bkg, errBkg);
704704
estimatedSignal = sum - bkg;
705705
}
@@ -804,7 +804,7 @@ void HFInvMassFitter::calculateFitToDataRatio() const
804804
RooHist* ratioHist = new RooHist();
805805

806806
for (int i = 0; i < dataHist->GetN(); ++i) {
807-
double x, dataY, dataErr;
807+
double x{}, dataY{}, dataErr{};
808808
dataHist->GetPoint(i, x, dataY);
809809
dataErr = dataHist->GetErrorY(i);
810810

PWGHF/D2H/Macros/HFInvMassFitter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ class HFInvMassFitter : public TNamed
158158
double mSecMass; /// Second peak mean value
159159
double mSigmaSgn; /// signal gaussian sigma
160160
double mSecSigma; /// Second peak gaussian sigma
161-
int mNSigmaForSidebands; /// number of sigmas to veto the signal peak
162-
int mNSigmaForSgn; /// number of sigmas to veto the signal peak
161+
double mNSigmaForSidebands; /// number of sigmas to veto the signal peak
162+
double mNSigmaForSgn; /// number of sigmas to veto the signal peak
163163
double mSigmaSgnErr; /// uncertainty on signal gaussian sigma
164164
double mSigmaSgnDoubleGaus; /// signal 2gaussian sigma
165165
bool mFixedMean; /// switch for fix mean of gaussian

0 commit comments

Comments
 (0)