Skip to content

Commit 9a96489

Browse files
committed
Implement Antonio comment
1 parent 487b93f commit 9a96489

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,13 @@ struct HfDerivedDataCreatorCorrelationsReduced {
321321
double trigCandPt = trigCand.pt();
322322
registry.fill(HIST("hPhiVsPtTrig"), RecoDecay::constrainAngle(trigCand.phi(), -o2::constants::math::PIHalf), trigCandPt);
323323
registry.fill(HIST("hEtaVsPtTrig"), trigCand.eta(), trigCandPt);
324-
bool isFirstAssoc{true};
324+
if constexpr (candType == CandType::Hadron) {
325+
rowTrigHads(trigCandPt, trigCand.tpcNClsCrossedRows(), trigCand.itsClusterMap(), trigCand.itsNCls(), trigCand.dcaXY(), trigCand.dcaZ());
326+
} else {
327+
std::array<float, 2> outputMl = getCandMlScores<candType>(trigCand);
328+
rowTrigCharms(trigCandPt, getCandMass<candType>(trigCand), outputMl[0], outputMl[1]);
329+
}
330+
325331
for (const auto& assTrk : assTrks) {
326332
double assTrkPt = assTrk.pt();
327333
if (usePtDiffDcaXYCut) {
@@ -351,17 +357,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
351357
double deltaPhi = RecoDecay::constrainAngle(assTrk.phi() - trigCand.phi(), -o2::constants::math::PIHalf);
352358
rowAssocTrkSels(assTrk.tpcNClsCrossedRows(), assTrk.itsClusterMap(), assTrk.itsNCls(), assTrk.dcaXY(), assTrk.dcaZ());
353359
if constexpr (candType == CandType::Hadron) {
354-
if (isFirstAssoc) {
355-
rowTrigHads(trigCandPt, trigCand.tpcNClsCrossedRows(), trigCand.itsClusterMap(), trigCand.itsNCls(), trigCand.dcaXY(), trigCand.dcaZ());
356-
isFirstAssoc = false;
357-
}
358360
rowSEHadHadPairs(rowCollisions.lastIndex(), rowTrigHads.lastIndex(), assTrkPt, deltaEta, deltaPhi);
359361
} else {
360-
if (isFirstAssoc) {
361-
std::array<float, 2> outputMl = getCandMlScores<candType>(trigCand);
362-
rowTrigCharms(trigCandPt, getCandMass<candType>(trigCand), outputMl[0], outputMl[1]);
363-
isFirstAssoc = false;
364-
}
365362
rowSECharmHadPairs(rowCollisions.lastIndex(), rowTrigCharms.lastIndex(), assTrkPt, deltaEta, deltaPhi);
366363
}
367364
}

0 commit comments

Comments
 (0)