From 49ecc20b0113f79fbb6653a4ea2898db51b36db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:55:28 +0200 Subject: [PATCH] Fix cpplint errors Fixes errors from the following categories: - `readability/inheritance` - `readability/braces` - `readability/multiline_comment` - `whitespace/newline` - `whitespace/empty_if_body` - `build/include_what_you_use` - `build/header_guard` --- PWGLF/TableProducer/Nuspex/hyhe4builder.cxx | 1 + PWGLF/TableProducer/Resonances/cksspinalignment.cxx | 9 ++++----- PWGLF/TableProducer/Strangeness/lambdakzerofinder.cxx | 1 + .../Strangeness/strangederivedbuilder.cxx | 4 ++-- PWGLF/Tasks/Nuspex/AntimatterAbsorptionHMPID.cxx | 1 + PWGLF/Tasks/Nuspex/hypertritonAnalysis.cxx | 1 + PWGLF/Tasks/Resonances/lambdav2.cxx | 9 +++------ PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx | 10 +++++----- PWGLF/Utils/collisionCutsGroupLinkDef.h | 5 +---- PWGLF/Utils/v0SelectionGroupLinkDef.h | 5 +---- 10 files changed, 20 insertions(+), 26 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyhe4builder.cxx b/PWGLF/TableProducer/Nuspex/hyhe4builder.cxx index f4ddba0fdbe..50e450b7936 100644 --- a/PWGLF/TableProducer/Nuspex/hyhe4builder.cxx +++ b/PWGLF/TableProducer/Nuspex/hyhe4builder.cxx @@ -47,6 +47,7 @@ #include #include #include +#include using namespace std; using namespace o2; diff --git a/PWGLF/TableProducer/Resonances/cksspinalignment.cxx b/PWGLF/TableProducer/Resonances/cksspinalignment.cxx index c52483f28fe..8a62bb13ad4 100644 --- a/PWGLF/TableProducer/Resonances/cksspinalignment.cxx +++ b/PWGLF/TableProducer/Resonances/cksspinalignment.cxx @@ -139,11 +139,10 @@ struct cksspinalignment { } bool keepEvent(uint64_t eventIndex) const - { /* - if (cfgKeepFraction >= 1.0f) { - return true; - } - */ + { + // if (cfgKeepFraction >= 1.0f) { + // return true; + // } // SplitMix64 pseudo-random hash uint64_t x = eventIndex + 0x9e3779b97f4a7c15ULL; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ULL; diff --git a/PWGLF/TableProducer/Strangeness/lambdakzerofinder.cxx b/PWGLF/TableProducer/Strangeness/lambdakzerofinder.cxx index 6c20a736eda..e1329901149 100644 --- a/PWGLF/TableProducer/Strangeness/lambdakzerofinder.cxx +++ b/PWGLF/TableProducer/Strangeness/lambdakzerofinder.cxx @@ -61,6 +61,7 @@ #include #include #include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 57ebfa938a0..e4f22fddc9f 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -579,8 +579,8 @@ struct strangederivedbuilder { // auto TraCascTable_thisColl = TraCascades.sliceBy(TraCascperCollision, collIdx); bool strange = V0Table_thisColl.size() > 0 || CascTable_thisColl.size() > 0 || - KFCascTable_thisColl.size() > 0 /* || - TraCascTable_thisColl.size() > 0*/ + KFCascTable_thisColl.size() > 0 + // ||TraCascTable_thisColl.size() > 0 ; auto bc = collision.template bc_as(); diff --git a/PWGLF/Tasks/Nuspex/AntimatterAbsorptionHMPID.cxx b/PWGLF/Tasks/Nuspex/AntimatterAbsorptionHMPID.cxx index 50dd28efbdc..ce410a7dd57 100644 --- a/PWGLF/Tasks/Nuspex/AntimatterAbsorptionHMPID.cxx +++ b/PWGLF/Tasks/Nuspex/AntimatterAbsorptionHMPID.cxx @@ -44,6 +44,7 @@ #include #include #include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGLF/Tasks/Nuspex/hypertritonAnalysis.cxx b/PWGLF/Tasks/Nuspex/hypertritonAnalysis.cxx index 1d2d5c11ec0..6ed90f63f57 100644 --- a/PWGLF/Tasks/Nuspex/hypertritonAnalysis.cxx +++ b/PWGLF/Tasks/Nuspex/hypertritonAnalysis.cxx @@ -47,6 +47,7 @@ #include #include #include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGLF/Tasks/Resonances/lambdav2.cxx b/PWGLF/Tasks/Resonances/lambdav2.cxx index 59d6e11bd2c..cf1cdfb8ef3 100644 --- a/PWGLF/Tasks/Resonances/lambdav2.cxx +++ b/PWGLF/Tasks/Resonances/lambdav2.cxx @@ -209,8 +209,7 @@ struct lambdav2 { template bool SelectionPID(const T& candidate, int PID) { - if (PID == 0) // pion - { + if (PID == 0) { // pion auto combPIDPi = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi())); if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.6 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { return true; @@ -218,8 +217,7 @@ struct lambdav2 { if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDPi < nsigmaCutTOFPi) { return true; } - } else if (PID == 1) // kaon - { + } else if (PID == 1) { // kaon auto combPIDKa = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa())); if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.45 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { return true; @@ -227,8 +225,7 @@ struct lambdav2 { if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDKa < nsigmaCutTOFKa) { return true; } - } else // proton - { + } else { // proton auto combPIDPr = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr())); if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.6 && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPCPr) { return true; diff --git a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx index 81b6ec46eb1..48162411c03 100644 --- a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx @@ -1303,7 +1303,7 @@ struct PhiStrangeCorrelation { histos.fill(histoKey, collision.posZ(), mcCollision.centFT0M(), assoc.pt(), assoc.y()); } - }; + }; // NOLINT(readability/braces) fillRecoAssocSpecies(makeAssocInput(k0sReduced), HIST("k0s/h4K0SMCReco")); fillRecoAssocSpecies(makeAssocInput(lambdaReduced), HIST("lambda/h4LambdaMCReco")); @@ -1337,7 +1337,7 @@ struct PhiStrangeCorrelation { for (const auto& mcParticle : mcParticlesThisMcColl) { if (std::abs(mcParticle.y()) > yConfigs.cfgYAcceptance) { continue; - }; + } auto fillGenHistos = [&](auto h3Key, auto h4Key) { histos.fill(h3Key, mcCollision.centFT0M(), mcParticle.pt(), mcParticle.y()); @@ -1352,7 +1352,7 @@ struct PhiStrangeCorrelation { } fillGenHistos(h3Key, h4Key); - }; + }; // NOLINT(readability/braces) switch (std::abs(mcParticle.pdgCode())) { case o2::constants::physics::Pdg::kPhi: @@ -1404,13 +1404,13 @@ struct PhiStrangeCorrelation { for (const auto& mcParticle : mcParticles) { if (std::abs(mcParticle.y()) > yConfigs.cfgYAcceptance) { continue; - }; + } auto fillPartCollection = [&]() { if (activeCorrelationTypes->at(PartType) && isGenSpeciesValid(mcParticle, minPtMcGenConfigs.bypassPtCut.value)) { assocParticles[PartType].emplace_back(mcParticle.pt(), mcParticle.y(), mcParticle.phi()); } - }; + }; // NOLINT(readability/braces) switch (std::abs(mcParticle.pdgCode())) { case o2::constants::physics::Pdg::kPhi: diff --git a/PWGLF/Utils/collisionCutsGroupLinkDef.h b/PWGLF/Utils/collisionCutsGroupLinkDef.h index e327556fbd2..a6aa000a66e 100644 --- a/PWGLF/Utils/collisionCutsGroupLinkDef.h +++ b/PWGLF/Utils/collisionCutsGroupLinkDef.h @@ -17,8 +17,7 @@ /// /// \author Bong-Hwi Lim -#ifndef PWGLF_UTILS_COLLISIONCUTSGROUPLINKDEF_H_ -#define PWGLF_UTILS_COLLISIONCUTSGROUPLINKDEF_H_ +// NOLINT(build/header_guard) #pragma link off all globals; #pragma link off all classes; @@ -30,5 +29,3 @@ #pragma link C++ class std::vector < int> + ; #pragma link C++ class std::vector < float> + ; #pragma link C++ class std::vector < bool> + ; - -#endif // PWGLF_UTILS_COLLISIONCUTSGROUPLINKDEF_H_ diff --git a/PWGLF/Utils/v0SelectionGroupLinkDef.h b/PWGLF/Utils/v0SelectionGroupLinkDef.h index 3c81add2fc2..c40840a0625 100644 --- a/PWGLF/Utils/v0SelectionGroupLinkDef.h +++ b/PWGLF/Utils/v0SelectionGroupLinkDef.h @@ -9,8 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef PWGLF_UTILS_V0SELECTIONGROUPLINKDEF_H_ -#define PWGLF_UTILS_V0SELECTIONGROUPLINKDEF_H_ +// NOLINT(build/header_guard) #pragma link off all globals; #pragma link off all classes; @@ -21,5 +20,3 @@ #pragma link C++ class std::vector < float> + ; #pragma link C++ class std::vector < double> + ; #pragma link C++ class std::vector < bool> + ; - -#endif // PWGLF_UTILS_V0SELECTIONGROUPLINKDEF_H_