Skip to content

Commit b5c5976

Browse files
committed
Modernise
1 parent b8ab7f0 commit b5c5976

18 files changed

+62
-61
lines changed

PWGHF/D2H/Macros/HFInvMassFitter.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ void HFInvMassFitter::drawFit(TVirtualPad* pad, Int_t writeFitInfo)
563563
gStyle->SetFrameFillColor(0);
564564
pad->cd();
565565
if (writeFitInfo > 0) {
566-
TPaveText* textInfoLeft = new TPaveText(0.12, 0.65, 0.47, 0.89, "NDC");
567-
TPaveText* textInfoRight = new TPaveText(0.6, 0.7, 1., .87, "NDC");
566+
auto* textInfoLeft = new TPaveText(0.12, 0.65, 0.47, 0.89, "NDC");
567+
auto* textInfoRight = new TPaveText(0.6, 0.7, 1., .87, "NDC");
568568
textInfoLeft->SetBorderSize(0);
569569
textInfoLeft->SetFillStyle(0);
570570
textInfoRight->SetBorderSize(0);
@@ -621,7 +621,7 @@ void HFInvMassFitter::drawResidual(TVirtualPad* pad)
621621
{
622622
pad->cd();
623623
mResidualFrame->GetYaxis()->SetTitle("");
624-
TPaveText* textInfo = new TPaveText(0.12, 0.65, 0.47, .89, "NDC");
624+
auto* textInfo = new TPaveText(0.12, 0.65, 0.47, .89, "NDC");
625625
textInfo->SetBorderSize(0);
626626
textInfo->SetFillStyle(0);
627627
textInfo->SetTextColor(kBlue);
@@ -651,8 +651,8 @@ void HFInvMassFitter::highlightPeakRegion(const RooPlot* plot, Color_t color, Wi
651651
const Double_t sigma = mRooSigmaSgn->getVal();
652652
const Double_t minForSgn = mean - mNSigmaForSidebands * sigma;
653653
const Double_t maxForSgn = mean + mNSigmaForSidebands * sigma;
654-
TLine* leftLine = new TLine(minForSgn, yMin, minForSgn, yMax);
655-
TLine* rightLine = new TLine(maxForSgn, yMin, maxForSgn, yMax);
654+
auto* leftLine = new TLine(minForSgn, yMin, minForSgn, yMax);
655+
auto* rightLine = new TLine(maxForSgn, yMin, maxForSgn, yMax);
656656
for (const auto& line : std::array<TLine*, 2>{leftLine, rightLine}) {
657657
line->SetLineColor(color);
658658
line->SetLineWidth(width);

PWGHF/D2H/Macros/HFInvMassFitter.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ class HFInvMassFitter : public TNamed
6767
std::vector<std::string> namesOfReflPdf{"reflFuncGaus", "reflFuncDoubleGaus", "reflFuncPoly3", "reflFuncPoly6"};
6868
HFInvMassFitter();
6969
HFInvMassFitter(const TH1* histoToFit, Double_t minValue, Double_t maxValue, Int_t fitTypeBkg = Expo, Int_t fitTypeSgn = SingleGaus);
70-
~HFInvMassFitter();
70+
~HFInvMassFitter() override;
7171
void setHistogramForFit(const TH1* histoToFit)
7272
{
7373
if (mHistoInvMass) {
7474
delete mHistoInvMass;
7575
}
7676
mHistoInvMass = dynamic_cast<TH1*>(histoToFit->Clone("mHistoInvMass"));
77-
mHistoInvMass->SetDirectory(0);
77+
mHistoInvMass->SetDirectory(nullptr);
7878
}
7979
void setUseLikelihoodFit() { mFitOption = "L,E"; }
8080
void setUseChi2Fit() { mFitOption = "Chi2"; }
@@ -197,21 +197,21 @@ class HFInvMassFitter : public TNamed
197197
}
198198
void setDrawBgPrefit(Bool_t value = true) { mDrawBgPrefit = value; }
199199
void setHighlightPeakRegion(Bool_t value = true) { mHighlightPeakRegion = value; }
200-
Double_t getChiSquareOverNDFTotal() const { return mChiSquareOverNdfTotal; }
201-
Double_t getChiSquareOverNDFBkg() const { return mChiSquareOverNdfBkg; }
202-
Double_t getRawYield() const { return mRawYield; }
203-
Double_t getRawYieldError() const { return mRawYieldErr; }
204-
Double_t getRawYieldCounted() const { return mRawYieldCounted; }
205-
Double_t getRawYieldCountedError() const { return mRawYieldCountedErr; }
206-
Double_t getBkgYield() const { return mBkgYield; }
207-
Double_t getBkgYieldError() const { return mBkgYieldErr; }
208-
Double_t getSignificance() const { return mSignificance; }
209-
Double_t getSignificanceError() const { return mSignificanceErr; }
210-
Double_t getMean() const { return mRooMeanSgn->getVal(); }
211-
Double_t getMeanUncertainty() const { return mRooMeanSgn->getError(); }
212-
Double_t getSigma() const { return mRooSigmaSgn->getVal(); }
213-
Double_t getSigmaUncertainty() const { return mRooSigmaSgn->getError(); }
214-
Double_t getReflOverSig() const
200+
[[nodiscard]] Double_t getChiSquareOverNDFTotal() const { return mChiSquareOverNdfTotal; }
201+
[[nodiscard]] Double_t getChiSquareOverNDFBkg() const { return mChiSquareOverNdfBkg; }
202+
[[nodiscard]] Double_t getRawYield() const { return mRawYield; }
203+
[[nodiscard]] Double_t getRawYieldError() const { return mRawYieldErr; }
204+
[[nodiscard]] Double_t getRawYieldCounted() const { return mRawYieldCounted; }
205+
[[nodiscard]] Double_t getRawYieldCountedError() const { return mRawYieldCountedErr; }
206+
[[nodiscard]] Double_t getBkgYield() const { return mBkgYield; }
207+
[[nodiscard]] Double_t getBkgYieldError() const { return mBkgYieldErr; }
208+
[[nodiscard]] Double_t getSignificance() const { return mSignificance; }
209+
[[nodiscard]] Double_t getSignificanceError() const { return mSignificanceErr; }
210+
[[nodiscard]] Double_t getMean() const { return mRooMeanSgn->getVal(); }
211+
[[nodiscard]] Double_t getMeanUncertainty() const { return mRooMeanSgn->getError(); }
212+
[[nodiscard]] Double_t getSigma() const { return mRooSigmaSgn->getVal(); }
213+
[[nodiscard]] Double_t getSigmaUncertainty() const { return mRooSigmaSgn->getError(); }
214+
[[nodiscard]] Double_t getReflOverSig() const
215215
{
216216
if (mReflPdf) {
217217
return mReflOverSgn;

PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,9 +984,9 @@ struct HfDataCreatorCharmHadPiReduced {
984984
std::vector<int> arrDaughDstarIndex;
985985
RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDstarIndex, std::array{0}, 1);
986986
if (arrDaughDstarIndex.size() == NDaughtersDstar) {
987-
bool matchD0{0};
988-
for (auto iProng = 0u; iProng < arrDaughDstarIndex.size(); ++iProng) {
989-
auto daughI = particlesMc.rawIteratorAt(arrDaughDstarIndex[iProng]);
987+
bool matchD0{false};
988+
for (const int iProng : arrDaughDstarIndex) {
989+
auto daughI = particlesMc.rawIteratorAt(iProng);
990990
if (std::abs(daughI.pdgCode()) == Pdg::kD0) {
991991
matchD0 = RecoDecay::isMatchedMCGen(particlesMc, daughI, +Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &signD, 2);
992992
}
@@ -1045,7 +1045,7 @@ struct HfDataCreatorCharmHadPiReduced {
10451045
auto bc = collision.template bc_as<BBCs>();
10461046
if (runNumber != bc.runNumber()) {
10471047
LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber;
1048-
o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(configs.ccdbPathGrpMag, bc.timestamp());
1048+
auto* grpo = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(configs.ccdbPathGrpMag, bc.timestamp());
10491049
if (grpo == nullptr) {
10501050
LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp());
10511051
}

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ struct HfDataCreatorJpsiHadReduced {
750750
auto bc = collision.template bc_as<BBCs>();
751751
if (runNumber != bc.runNumber()) {
752752
LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber;
753-
o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(ccdbPathGrpMag, bc.timestamp());
753+
auto* grpo = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(ccdbPathGrpMag, bc.timestamp());
754754
if (grpo == nullptr) {
755755
LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp());
756756
}

PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ struct HfTaskDstarToD0Pi {
284284
LOGF(fatal, "Histogram %s not found in weight file!", histName.c_str());
285285
return;
286286
}
287-
hWeights[ithWeight]->SetDirectory(0);
287+
hWeights[ithWeight]->SetDirectory(nullptr);
288288
hWeights[ithWeight]->SetName(("hWeight" + std::to_string(ithWeight + 1)).c_str());
289289
}
290290
weightFile->Close();
@@ -587,7 +587,7 @@ struct HfTaskDstarToD0Pi {
587587
if (recCollisions.size()) {
588588
std::vector<std::pair<soa::Filtered<CollisionsWCentMcLabel>::iterator, int>> tempRecCols;
589589
for (const auto& recCol : recCollisions) {
590-
tempRecCols.push_back(std::make_pair(recCol, recCol.numContrib()));
590+
tempRecCols.emplace_back(recCol, recCol.numContrib());
591591
}
592592
std::sort(tempRecCols.begin(), tempRecCols.end(), compare);
593593
centFT0MGen = tempRecCols.at(0).first.centFT0M();

PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ struct HfTaskOmegac0ToOmegapi {
135135

136136
if (doprocessDataKFParticleFT0C || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleFT0M || doprocessDataKFParticleMlFT0M) {
137137
axes.push_back(thnAxisCent);
138-
axes.push_back(thnConfigAxisNumPvContr);
138+
axes.emplace_back(thnConfigAxisNumPvContr);
139139
}
140140

141141
if (doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) {
142142
axes.push_back(thnAxisCentMc);
143-
axes.push_back(thnConfigAxisNumPvContr);
143+
axes.emplace_back(thnConfigAxisNumPvContr);
144144
axesMcGen.push_back(thnAxisCentMc);
145-
axesMcGen.push_back(thnConfigAxisNumPvContr);
145+
axesMcGen.emplace_back(thnConfigAxisNumPvContr);
146146
}
147147

148148
if (doprocessMcKFParticle || doprocessMcKFParticleMl || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) {

PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ struct HfTaskXicToXiPiPi {
526526
std::array<float, 3> prodVtxZProngs{};
527527
int counter = 0;
528528
RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{+kXiMinus, +kPiPlus, +kPiPlus}, 2);
529-
for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) {
530-
auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]);
529+
for (const int iProng : arrDaughIndex) {
530+
auto daughI = mcParticles.rawIteratorAt(iProng);
531531
ptProngs[counter] = daughI.pt();
532532
etaProngs[counter] = daughI.eta();
533533
yProngs[counter] = RecoDecay::y(daughI.pVector(), pdg->Mass(daughI.pdgCode()));

PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ struct HfCorrelatorDplusHadronsDplusSelection {
133133
if (std::abs(hfHelper.yDplus(candidate)) >= yCandMax || candidate.pt() <= ptCandMin) {
134134
continue;
135135
}
136-
isDplusFound = 1;
136+
isDplusFound = true;
137137
break;
138138
}
139139
}
@@ -152,7 +152,7 @@ struct HfCorrelatorDplusHadronsDplusSelection {
152152
void processDplusSelectionMcGen(aod::McCollision const&,
153153
CandDplusMcGen const& mcParticles)
154154
{
155-
bool isDplusFound = 0;
155+
bool isDplusFound = false;
156156
for (const auto& particle1 : mcParticles) {
157157
if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) {
158158
continue;
@@ -161,7 +161,7 @@ struct HfCorrelatorDplusHadronsDplusSelection {
161161
if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) {
162162
continue;
163163
}
164-
isDplusFound = 1;
164+
isDplusFound = true;
165165
break;
166166
}
167167
dplusSel(isDplusFound);

PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "Common/Core/RecoDecay.h"
2828

29+
#include <CommonConstants/MathConstants.h>
2930
#include <CommonConstants/PhysicsConstants.h>
3031
#include <Framework/ASoAHelpers.h>
3132
#include <Framework/AnalysisDataModel.h>
@@ -191,7 +192,7 @@ struct HfTaskCharmHadronsFemtoDream {
191192
ConfigurableAxis binMulPercentile{"binMulPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning"};
192193
ConfigurableAxis binpTTrack{"binpTTrack", {50, 0.5, 10.05}, "pT binning of the pT vs. TempFitVar plot (Track)"};
193194
ConfigurableAxis binEta{"binEta", {{200, -1.5, 1.5}}, "eta binning"};
194-
ConfigurableAxis binPhi{"binPhi", {{200, 0, 2.f * 3.14159274101257324e+00f}}, "phi binning"};
195+
ConfigurableAxis binPhi{"binPhi", {{200, 0, o2::constants::math::TwoPI}}, "phi binning"};
195196
ConfigurableAxis binkT{"binkT", {150, 0., 9.}, "binning kT"};
196197
ConfigurableAxis binkstar{"binkstar", {1500, 0., 6.}, "binning kstar"};
197198
ConfigurableAxis binNSigmaTPC{"binNSigmaTPC", {1600, -8, 8}, "Binning of Nsigma TPC plot"};

PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ struct HfTaskElectronWeakBoson {
463463
lastRunNumber = runNumber;
464464

465465
// initialize magnetic field
466-
o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(ccdbPathGrpMag, currentTimestamp);
466+
auto* grpo = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(ccdbPathGrpMag, currentTimestamp);
467467
o2::base::Propagator::initFieldFromGRP(grpo);
468468
double magneticField = o2::base::Propagator::Instance()->getNominalBz();
469469
LOG(info) << "magneticField = " << magneticField;

0 commit comments

Comments
 (0)