Skip to content

Commit ceff349

Browse files
committed
fix clang-tidy
1 parent d7cd423 commit ceff349

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

PWGLF/Tasks/Nuspex/antinucleiInJets.cxx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ struct AntinucleiInJets {
229229
TH1F* antideuteronsPerpCone = nullptr;
230230

231231
// CCDB manager service for accessing condition data
232-
Service<o2::ccdb::BasicCCDBManager> ccdb;
232+
Service<o2::ccdb::BasicCCDBManager> ccdb{};
233233

234234
// Direct interface to the CCDB API for manual data access
235235
o2::ccdb::CcdbApi ccdbApi;
@@ -683,7 +683,7 @@ struct AntinucleiInJets {
683683
}
684684
}
685685

686-
void getReweightingHistograms(o2::framework::Service<o2::ccdb::BasicCCDBManager> const& ccdbObj, TString filepath)
686+
void getReweightingHistograms(o2::framework::Service<o2::ccdb::BasicCCDBManager> const& ccdbObj, TString const& filepath)
687687
{
688688
TList* list = ccdbObj->get<TList>(filepath.Data());
689689
if (!list) {
@@ -692,26 +692,26 @@ struct AntinucleiInJets {
692692
}
693693

694694
// Get reweighting histograms for primary fraction
695-
primaryAntiprotons = static_cast<TH1F*>(list->FindObject("weightsProton"));
696-
primaryAntiLambda = static_cast<TH1F*>(list->FindObject("weightsLambda"));
697-
primaryAntiSigma = static_cast<TH1F*>(list->FindObject("weightsSigma"));
698-
primaryAntiXi = static_cast<TH1F*>(list->FindObject("weightsXi"));
699-
primaryAntiOmega = static_cast<TH1F*>(list->FindObject("weightsOmega"));
695+
primaryAntiprotons = dynamic_cast<TH1F*>(list->FindObject("weightsProton"));
696+
primaryAntiLambda = dynamic_cast<TH1F*>(list->FindObject("weightsLambda"));
697+
primaryAntiSigma = dynamic_cast<TH1F*>(list->FindObject("weightsSigma"));
698+
primaryAntiXi = dynamic_cast<TH1F*>(list->FindObject("weightsXi"));
699+
primaryAntiOmega = dynamic_cast<TH1F*>(list->FindObject("weightsOmega"));
700700

701701
if (!primaryAntiprotons || !primaryAntiSigma || !primaryAntiLambda || !primaryAntiXi || !primaryAntiOmega) {
702702
LOGP(error, "Missing one or more reweighting histograms for primary fraction in CCDB list");
703703
}
704704

705705
// Get reweighting histograms for antiproton efficiency
706-
antiprotonsInsideJets = static_cast<TH1F*>(list->FindObject("weightsJet"));
707-
antiprotonsPerpCone = static_cast<TH1F*>(list->FindObject("weightsUe"));
706+
antiprotonsInsideJets = dynamic_cast<TH1F*>(list->FindObject("weightsJet"));
707+
antiprotonsPerpCone = dynamic_cast<TH1F*>(list->FindObject("weightsUe"));
708708
if (!antiprotonsInsideJets || !antiprotonsPerpCone) {
709709
LOGP(error, "Missing one or more reweighting histograms for antiproton efficiency in CCDB list");
710710
}
711711

712712
// Get reweighting histograms for antideuteron efficiency
713-
antideuteronsInsideJets = static_cast<TH1F*>(list->FindObject("weightsAntidJet"));
714-
antideuteronsPerpCone = static_cast<TH1F*>(list->FindObject("weightsAntidUe"));
713+
antideuteronsInsideJets = dynamic_cast<TH1F*>(list->FindObject("weightsAntidJet"));
714+
antideuteronsPerpCone = dynamic_cast<TH1F*>(list->FindObject("weightsAntidUe"));
715715
if (!antideuteronsInsideJets || !antideuteronsPerpCone) {
716716
LOGP(error, "Missing one or more reweighting histograms for antideuteron efficiency in CCDB list");
717717
}
@@ -1788,6 +1788,8 @@ struct AntinucleiInJets {
17881788
case PDG_t::kSigmaBarMinus:
17891789
registryMC.fill(HIST("sigmaBar"), particle.pt());
17901790
break;
1791+
default:
1792+
break;
17911793
}
17921794
}
17931795
}
@@ -2995,6 +2997,8 @@ struct AntinucleiInJets {
29952997
case -o2::constants::physics::Pdg::kHelium3:
29962998
registryMC.fill(HIST("antihelium3_gen_syst"), particle.pt());
29972999
break;
3000+
default:
3001+
break;
29983002
}
29993003
}
30003004
}

0 commit comments

Comments
 (0)