Skip to content

Commit 06b134b

Browse files
committed
[PWGLF] eventShapeCoex: Fix code-check findings
Include Framework/AnalysisHelpers.h directly (misc-include-cleaner), mark meanPt [[nodiscard]], use std::array for the QA-bit order and brace-initialise the PDG service. No change in output.
1 parent 3f44ff5 commit 06b134b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎PWGLF/TableProducer/GlobalEventProperties/eventShapeCoex.cxx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424

2525
#include <Framework/ASoA.h>
2626
#include <Framework/AnalysisDataModel.h>
27+
#include <Framework/AnalysisHelpers.h>
2728
#include <Framework/AnalysisTask.h>
2829
#include <Framework/Configurable.h>
2930
#include <Framework/InitContext.h>
3031
#include <Framework/Logger.h>
3132
#include <Framework/O2DatabasePDGPlugin.h>
3233
#include <Framework/runDataProcessing.h>
3334

35+
#include <array>
3436
#include <cmath>
3537
#include <cstdint>
3638

@@ -64,7 +66,7 @@ struct SubEventSums {
6466
qy4 += 2. * sin2 * cos2;
6567
}
6668

67-
float meanPt() const { return (n > 0) ? static_cast<float>(sumPt / n) : std::nanf(""); }
69+
[[nodiscard]] float meanPt() const { return (n > 0) ? static_cast<float>(sumPt / n) : std::nanf(""); }
6870
};
6971
} // namespace
7072

@@ -73,7 +75,7 @@ struct EventShapeCoex {
7375
Produces<aod::EvShapeCoexGen> coexGen;
7476
Produces<aod::EvShapeCoexMcLabels> coexMcLabels;
7577

76-
Service<o2::framework::O2DatabasePDG> pdg;
78+
Service<o2::framework::O2DatabasePDG> pdg{};
7779

7880
Configurable<float> vtxZCut{"vtxZCut", 10.0f, "Max |PV z| (cm)"};
7981
Configurable<float> ptMin{"ptMin", 0.15f, "Minimum track pT (GeV/c)"};
@@ -134,7 +136,7 @@ struct EventShapeCoex {
134136

135137
// bit i of qaBits = QaBitOrder[i]
136138
static constexpr int NQaBits = 12;
137-
static constexpr o2::aod::evsel::EventSelectionFlags QaBitOrder[NQaBits] = {
139+
static constexpr std::array<o2::aod::evsel::EventSelectionFlags, NQaBits> QaBitOrder = {
138140
o2::aod::evsel::kNoSameBunchPileup, o2::aod::evsel::kIsGoodZvtxFT0vsPV,
139141
o2::aod::evsel::kIsVertexITSTPC, o2::aod::evsel::kIsVertexTOFmatched,
140142
o2::aod::evsel::kNoCollInTimeRangeNarrow, o2::aod::evsel::kNoCollInTimeRangeStrict,

0 commit comments

Comments
 (0)