Skip to content

Commit af15261

Browse files
committed
solve code-check issues
1 parent aad8347 commit af15261

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

PWGHF/HFC/DataModel/DMesonPairsTables.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ DECLARE_SOA_COLUMN(MlProbD0barCand2, mlProbD0barCand2, std::vector<float>); //!
5757
} // namespace hf_correlation_d_meson_pair
5858

5959
// Definition of the D meson pair table. Contains the info needed at Data level.
60+
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
6061
#define DECLARE_DMESON_PAIR_TABLE(_pair_type_, _marker_value_, _description_) \
6162
DECLARE_SOA_TABLE(_pair_type_, "AOD", _description_, o2::soa::Marker<_marker_value_>, \
6263
hf_correlation_d_meson_pair::PtCand1, \
@@ -75,13 +76,15 @@ DECLARE_SOA_COLUMN(MlProbD0barCand2, mlProbD0barCand2, std::vector<float>); //!
7576
hf_correlation_d_meson_pair::CandidateType1, \
7677
hf_correlation_d_meson_pair::CandidateType2);
7778
// Definition of the D meson pair table with info at MC level.
79+
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
7880
#define DECLARE_DMESON_PAIR_MCINFO_TABLE(_pair_type_, _marker_value_, _description_) \
7981
DECLARE_SOA_TABLE(_pair_type_, "AOD", _description_ "MCINFO", o2::soa::Marker<_marker_value_>, \
8082
hf_correlation_d_meson_pair::Origin1, \
8183
hf_correlation_d_meson_pair::Origin2, \
8284
hf_correlation_d_meson_pair::MatchedMc1, \
8385
hf_correlation_d_meson_pair::MatchedMc2);
8486
// Definition of the table with the ML info of the D meson pair.
87+
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
8588
#define DECLARE_DMESON_PAIR_MLINFO_TABLE(_pair_type_, _marker_value_, _description_) \
8689
DECLARE_SOA_TABLE(_pair_type_, "AOD", _description_ "ML", o2::soa::Marker<_marker_value_>, \
8790
hf_correlation_d_meson_pair::MlProbD0Cand1, \

PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
#include "PWGHF/HFC/DataModel/CorrelationTables.h"
2525
#include "PWGHF/HFC/DataModel/DMesonPairsTables.h"
2626

27+
#include "Common/CCDB/EventSelectionParams.h"
2728
#include "Common/Core/RecoDecay.h"
29+
#include "Common/DataModel/EventSelection.h"
30+
#include "Common/DataModel/Multiplicity.h"
31+
#include "Common/DataModel/TrackSelectionTables.h"
2832

2933
#include <CCDB/CcdbApi.h>
3034
#include <CommonConstants/MathConstants.h>
@@ -45,6 +49,8 @@
4549

4650
#include <Rtypes.h>
4751

52+
#include <array>
53+
#include <cmath>
4854
#include <cstdint>
4955
#include <string>
5056
#include <vector>
@@ -164,7 +170,7 @@ struct HfCorrelatorDMesonPairs {
164170
Configurable<bool> applyMl{"applyMl", false, "Flag to apply ML selections"};
165171
Configurable<std::vector<double>> binsPtMl{"binsPtMl", std::vector<double>{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"};
166172
Configurable<std::vector<int>> cutDirMl{"cutDirMl", std::vector<int>{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"};
167-
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"};
173+
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {static_cast<const double*>(hf_cuts_ml::Cuts[0]), hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"};
168174
Configurable<int> nClassesMl{"nClassesMl", static_cast<int>(hf_cuts_ml::NCutScores), "Number of classes in ML model"};
169175
Configurable<std::vector<std::string>> namesInputFeatures{"namesInputFeatures", std::vector<std::string>{"feature1", "feature2"}, "Names of ML model input features"};
170176

@@ -278,7 +284,7 @@ struct HfCorrelatorDMesonPairs {
278284

279285
auto vbins = (std::vector<double>)binsPt;
280286
constexpr int kNBinsSelStatus = 25;
281-
std::string labels[kNBinsSelStatus];
287+
std::array<std::string, kNBinsSelStatus> labels;
282288

283289
labels[0] = "total # of Selected pairs";
284290
// Cand1 analysis
@@ -320,7 +326,7 @@ struct HfCorrelatorDMesonPairs {
320326
}
321327

322328
constexpr int kNBinsMatching = 8;
323-
std::string labelsMatching[kNBinsMatching];
329+
std::array<std::string, kNBinsMatching> labelsMatching;
324330
// Cand1 analysis
325331
labelsMatching[0] = "total # of Cand 1";
326332
labelsMatching[1] = "# of matched D Cand 1";
@@ -342,7 +348,7 @@ struct HfCorrelatorDMesonPairs {
342348
}
343349

344350
constexpr int kNBinsSinglePart = 6;
345-
std::string labelsSinglePart[kNBinsSinglePart];
351+
std::array<std::string, kNBinsSinglePart> labelsSinglePart;
346352
// Candidate analysis
347353
labelsSinglePart[0] = "total # of Candidates";
348354
labelsSinglePart[1] = "# of selected D";
@@ -576,7 +582,7 @@ struct HfCorrelatorDMesonPairs {
576582

577583
/// Fill selection status histogram
578584
void fillEntry(const bool& isDCand1, const bool& isDbarCand1, const bool& isDCand2, const bool& isDbarCand2,
579-
const uint8_t& candidateType1, const uint8_t& candidateType2, float yCand1, float yCand2, float phiCand1, float phiCand2, float etaCand1, float etaCand2,
585+
const uint8_t& candidateType1, const uint8_t& candidateType2, float yCand1, float yCand2, float etaCand1, float etaCand2, float phiCand1, float phiCand2,
580586
double ptCand1, double ptCand2, float massDCand1, float massDbarCand1, float massDCand2, float massDbarCand2)
581587
{
582588

@@ -805,18 +811,23 @@ struct HfCorrelatorDMesonPairs {
805811
// Loop on the associated tracks for offline event mixing
806812
for (const auto& track : tracks) {
807813
// apply track selection
808-
if (track.collisionId() != gCollisionId)
814+
if (track.collisionId() != gCollisionId) {
809815
continue;
816+
}
810817

811818
// Manual trackFilter check
812-
if (std::abs(track.eta()) >= etaTrackMax)
819+
if (std::abs(track.eta()) >= etaTrackMax) {
813820
continue;
814-
if (track.pt() <= ptTrackMin)
821+
}
822+
if (track.pt() <= ptTrackMin) {
815823
continue;
816-
if (std::abs(track.dcaXY()) >= dcaXYTrackMax)
824+
}
825+
if (std::abs(track.dcaXY()) >= dcaXYTrackMax) {
817826
continue;
818-
if (std::abs(track.dcaZ()) >= dcaZTrackMax)
827+
}
828+
if (std::abs(track.dcaZ()) >= dcaZTrackMax) {
819829
continue;
830+
}
820831
// Removing D0 daughters by checking track indices
821832
if (daughterTracksCutFlag) {
822833
if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) {

0 commit comments

Comments
 (0)