Skip to content

Commit 7b5e6c4

Browse files
committed
Code check
1 parent fa96d2a commit 7b5e6c4

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ struct HfDataCreatorJpsiHadReduced {
153153
Configurable<double> ptTrackMin{"ptTrackMin", 0.5, "minimum bachelor track pT threshold (GeV/c)"};
154154
Configurable<double> absEtaTrackMax{"absEtaTrackMax", 0.8, "maximum bachelor track absolute eta threshold"};
155155
Configurable<std::vector<double>> binsPtTrack{"binsPtTrack", std::vector<double>{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for bachelor track DCA XY pT-dependent cut"};
156-
Configurable<LabeledArray<double>> cutsTrackDCA{"cutsTrackDCA", {hf_cuts_single_track::CutsTrack[0], hf_cuts_single_track::NBinsPtTrack, hf_cuts_single_track::NCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for bachelor track"};
156+
Configurable<LabeledArray<double>> cutsTrackDCA{"cutsTrackDCA", {&hf_cuts_single_track::CutsTrack[0][0], hf_cuts_single_track::NBinsPtTrack, hf_cuts_single_track::NCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for bachelor track"};
157157
// topological/kinematic cuts
158158
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{hf_cuts_jpsi_to_mu_mu::vecBinsPt}, "J/Psi pT bin limits"};
159-
Configurable<LabeledArray<double>> cuts{"cuts", {hf_cuts_jpsi_to_mu_mu::Cuts[0], hf_cuts_jpsi_to_mu_mu::NBinsPt, hf_cuts_jpsi_to_mu_mu::NCutVars, hf_cuts_jpsi_to_mu_mu::labelsPt, hf_cuts_jpsi_to_mu_mu::labelsCutVar}, "J/Psi candidate selection per pT bin"};
159+
Configurable<LabeledArray<double>> cuts{"cuts", {&hf_cuts_jpsi_to_mu_mu::Cuts[0][0], hf_cuts_jpsi_to_mu_mu::NBinsPt, hf_cuts_jpsi_to_mu_mu::NCutVars, hf_cuts_jpsi_to_mu_mu::labelsPt, hf_cuts_jpsi_to_mu_mu::labelsCutVar}, "J/Psi candidate selection per pT bin"};
160160
Configurable<double> invMassWindowJpsiHad{"invMassWindowJpsiHad", 0.3, "invariant-mass window for Jpsi-Had pair preselections (GeV/c2)"};
161161
Configurable<double> deltaMPhiMax{"deltaMPhiMax", 0.02, "invariant-mass window for phi preselections (GeV/c2) (only for Bs->J/PsiPhi)"};
162162
Configurable<double> deltaMK0StarMax{"deltaMK0StarMax", 0.15, "invariant-mass window for K*0 preselections (GeV/c2) (only for B0->J/PsiK0*)"};
@@ -206,14 +206,14 @@ struct HfDataCreatorJpsiHadReduced {
206206
selectorElectron.setRangePtTpc(selectionsPid.ptPidTpcMin, selectionsPid.ptPidTpcMax);
207207
selectorElectron.setRangeNSigmaTpc(selectionsPid.nSigmaTpcElMinForVeto, selectionsPid.nSigmaTpcElMaxForVeto);
208208

209-
std::array<int, 6> doProcess = {doprocessJpsiKData, doprocessJpsiKMc, doprocessJpsiK0StarData, doprocessJpsiK0StarMc, doprocessJpsiPhiData, doprocessJpsiPhiMc};
209+
std::array<bool, 6> doProcess = {doprocessJpsiKData, doprocessJpsiKMc, doprocessJpsiK0StarData, doprocessJpsiK0StarMc, doprocessJpsiPhiData, doprocessJpsiPhiMc};
210210
if (std::accumulate(doProcess.begin(), doProcess.end(), 0) != 1) {
211211
LOGP(fatal, "One and only one process function can be enabled at a time, please fix your configuration!");
212212
}
213213

214214
// Set up the histogram registry
215215
constexpr int NumBinsSelections = 2 + aod::SelectionStep::RecoPID;
216-
std::string labels[NumBinsSelections];
216+
std::array<std::string, NumBinsSelections> labels;
217217
labels[0] = "No selection";
218218
labels[1 + aod::SelectionStep::RecoSkims] = "Skims selection";
219219
labels[1 + aod::SelectionStep::RecoTopol] = "Skims & Topological selections";
@@ -225,7 +225,7 @@ struct HfDataCreatorJpsiHadReduced {
225225
}
226226

227227
constexpr int NumBinsEvents = NEvent;
228-
std::string labelsEvents[NumBinsEvents];
228+
std::array<std::string, NumBinsEvents> labelsEvents;
229229
labelsEvents[Event::Processed] = "processed";
230230
labelsEvents[Event::NoCharmHadPiSelected] = "without CharmHad-Pi pairs";
231231
labelsEvents[Event::CharmHadPiSelected] = "with CharmHad-Pi pairs";
@@ -419,10 +419,7 @@ struct HfDataCreatorJpsiHadReduced {
419419

420420
pidElectron = selectorElectron.statusTpc(track, track.tpcNSigmaEl());
421421

422-
if (pidElectron == TrackSelectorPID::Accepted) {
423-
return false;
424-
}
425-
return true;
422+
return pidElectron != TrackSelectorPID::Accepted;
426423
}
427424

428425
/// B meson preselections
@@ -895,7 +892,7 @@ struct HfDataCreatorJpsiHadReduced {
895892

896893
// fill Kaon tracks table
897894
// if information on track already stored, go to next track
898-
if (!selectedTracksBach.count(trackBach.globalIndex())) {
895+
if (!selectedTracksBach.contains(trackBach.globalIndex())) {
899896
hfTrackLfDau0(trackBach.globalIndex(), indexHfReducedCollision,
900897
trackParCovBach.getX(), trackParCovBach.getAlpha(),
901898
trackParCovBach.getY(), trackParCovBach.getZ(), trackParCovBach.getSnp(),
@@ -1004,7 +1001,7 @@ struct HfDataCreatorJpsiHadReduced {
10041001
const auto& negDauTrackParCov = trackBach.sign() > 0 ? trackBach2ParCov : trackParCovBach;
10051002

10061003
// if information on track already stored, go to next track
1007-
if (!selectedTracksBach.count(posDauTrack.globalIndex())) {
1004+
if (!selectedTracksBach.contains(posDauTrack.globalIndex())) {
10081005
hfTrackLfDau0(posDauTrack.globalIndex(), indexHfReducedCollision,
10091006
posDauTrackParCov.getX(), posDauTrackParCov.getAlpha(),
10101007
posDauTrackParCov.getY(), posDauTrackParCov.getZ(), posDauTrackParCov.getSnp(),
@@ -1028,7 +1025,7 @@ struct HfDataCreatorJpsiHadReduced {
10281025

10291026
// fill daughter tracks table
10301027
// if information on track already stored, go to next track
1031-
if (!selectedTracksBach2.count(negDauTrack.globalIndex())) {
1028+
if (!selectedTracksBach2.contains(negDauTrack.globalIndex())) {
10321029
hfTrackLfDau1(negDauTrack.globalIndex(), indexHfReducedCollision,
10331030
negDauTrackParCov.getX(), negDauTrackParCov.getAlpha(),
10341031
negDauTrackParCov.getY(), negDauTrackParCov.getZ(), negDauTrackParCov.getSnp(),
@@ -1136,7 +1133,7 @@ struct HfDataCreatorJpsiHadReduced {
11361133
const auto& negDauTrackParCov = trackBach.sign() > 0 ? trackBach2ParCov : trackParCovBach;
11371134

11381135
// if information on track already stored, go to next track
1139-
if (!selectedTracksBach.count(posDauTrack.globalIndex())) {
1136+
if (!selectedTracksBach.contains(posDauTrack.globalIndex())) {
11401137
hfTrackLfDau0(posDauTrack.globalIndex(), indexHfReducedCollision,
11411138
posDauTrackParCov.getX(), posDauTrackParCov.getAlpha(),
11421139
posDauTrackParCov.getY(), posDauTrackParCov.getZ(), posDauTrackParCov.getSnp(),
@@ -1160,7 +1157,7 @@ struct HfDataCreatorJpsiHadReduced {
11601157

11611158
// fill daughter tracks table
11621159
// if information on track already stored, go to next track
1163-
if (!selectedTracksBach2.count(negDauTrack.globalIndex())) {
1160+
if (!selectedTracksBach2.contains(negDauTrack.globalIndex())) {
11641161
hfTrackLfDau1(negDauTrack.globalIndex(), indexHfReducedCollision,
11651162
negDauTrackParCov.getX(), negDauTrackParCov.getAlpha(),
11661163
negDauTrackParCov.getY(), negDauTrackParCov.getZ(), negDauTrackParCov.getSnp(),

0 commit comments

Comments
 (0)