Skip to content

Commit 60e10f5

Browse files
authored
[PWGHF] Fix bug in process MC rec of Ds-h correlation task due to missing absolute value (#14436)
1 parent 68393ae commit 60e10f5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ struct HfCorrelatorDsHadrons {
241241
ConfigurableAxis binsMultiplicity{"binsMultiplicity", {200, 0., 800.}, "Multiplicity"};
242242
ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"};
243243
ConfigurableAxis binsPid{"binsPid", {24, -12., 12.}, "n #sigma"};
244+
ConfigurableAxis binsDcaXY{"binsDcaXY", {128, -0.2, 0.2}, "DCA xy"};
244245
ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"};
245246
ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"};
246247

@@ -258,6 +259,7 @@ struct HfCorrelatorDsHadrons {
258259
AxisSpec const axisPosZ = {binsPosZ, "PosZ"};
259260
AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"};
260261
AxisSpec const axisStatus = {15, 0.5, 15.5, "Selection status"};
262+
AxisSpec const axisDcaXY = {binsDcaXY, "DCA xy"};
261263
AxisSpec const axisPid{binsPid, "n #sigma"};
262264

263265
// Histograms for data analysis
@@ -293,6 +295,7 @@ struct HfCorrelatorDsHadrons {
293295
registry.add("hTpcTofNSigmaCombPion", "n sigma tpc and tof combined for pion hypothesis", {HistType::kTH2F, {{axisPid}, {axisPtHadron}}});
294296
registry.add("hTpcTofNSigmaCombKaon", "n sigma tpc and tof combined for kaon hypothesis", {HistType::kTH2F, {{axisPid}, {axisPtHadron}}});
295297
registry.add("hTpcTofNSigmaCombProton", "n sigma tpc and tof combined for proton hypothesis", {HistType::kTH2F, {{axisPid}, {axisPtHadron}}});
298+
registry.add("hDcaXYVsPt", "DCA xy vs pt", {HistType::kTH2F, {{axisDcaXY}, {axisPtHadron}}});
296299
}
297300
}
298301
// Histograms for MC Reco analysis
@@ -626,13 +629,13 @@ struct HfCorrelatorDsHadrons {
626629
registry.fill(HIST("hTpcTofNSigmaCombKaonMc"), std::sqrt(std::pow(o2::aod::pidutils::tpcNSigma(o2::track::PID::Kaon, track), 2) + std::pow(o2::aod::pidutils::tofNSigma(o2::track::PID::Kaon, track), 2)), track.pt());
627630
registry.fill(HIST("hTpcTofNSigmaCombProtonMc"), std::sqrt(std::pow(o2::aod::pidutils::tpcNSigma(o2::track::PID::Proton, track), 2) + std::pow(o2::aod::pidutils::tofNSigma(o2::track::PID::Proton, track), 2)), track.pt());
628631
// MC truth match
629-
if (trkPIDspecies->at(0) == o2::track::PID::Kaon && mcParticle.pdgCode() != kKPlus) {
632+
if (trkPIDspecies->at(0) == o2::track::PID::Kaon && std::abs(mcParticle.pdgCode()) != kKPlus) {
630633
continue;
631634
}
632-
if (trkPIDspecies->at(0) == o2::track::PID::Pion && mcParticle.pdgCode() != kPiPlus) {
635+
if (trkPIDspecies->at(0) == o2::track::PID::Pion && std::abs(mcParticle.pdgCode()) != kPiPlus) {
633636
continue;
634637
}
635-
if (trkPIDspecies->at(0) == o2::track::PID::Proton && mcParticle.pdgCode() != kProton) {
638+
if (trkPIDspecies->at(0) == o2::track::PID::Proton && std::abs(mcParticle.pdgCode()) != kProton) {
636639
continue;
637640
}
638641
// Physical primary requirement
@@ -654,9 +657,6 @@ struct HfCorrelatorDsHadrons {
654657
isPhysicalPrimary = mcParticle.isPhysicalPrimary();
655658
auto trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true);
656659
entryDsHadronGenInfo(isDsPrompt, isPhysicalPrimary, trackOrigin);
657-
//} else {
658-
// registry.fill(HIST("hFakeTracksMcRec"), track.pt());
659-
//}
660660
// for secondary particle fraction estimation
661661
if (!isAlreadyFilledEvent) {
662662
registry.fill(HIST("hPtParticleAssocVsCandMcRec"), track.pt(), candidate.pt());
@@ -679,9 +679,6 @@ struct HfCorrelatorDsHadrons {
679679
isPhysicalPrimary = mcParticle.isPhysicalPrimary();
680680
auto trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true);
681681
entryDsHadronGenInfo(isDsPrompt, isPhysicalPrimary, trackOrigin);
682-
//} else {
683-
// registry.fill(HIST("hFakeTracksMcRec"), track.pt());
684-
//}
685682
// for secondary particle fraction estimation
686683
if (!isAlreadyFilledEvent) {
687684
registry.fill(HIST("hPtParticleAssocVsCandMcRec"), track.pt(), candidate.pt());
@@ -898,6 +895,9 @@ struct HfCorrelatorDsHadrons {
898895
registry.fill(HIST("hTpcTofNSigmaCombKaon"), std::sqrt(std::pow(o2::aod::pidutils::tpcNSigma(o2::track::PID::Kaon, track), 2) + std::pow(o2::aod::pidutils::tofNSigma(o2::track::PID::Kaon, track), 2)), track.pt());
899896
registry.fill(HIST("hTpcTofNSigmaCombProton"), std::sqrt(std::pow(o2::aod::pidutils::tpcNSigma(o2::track::PID::Proton, track), 2) + std::pow(o2::aod::pidutils::tofNSigma(o2::track::PID::Proton, track), 2)), track.pt());
900897
}
898+
899+
registry.fill(HIST("hDcaXYVsPt"), track.dcaXY(), track.pt());
900+
901901
assocTrackReduced(indexHfcReducedCollision, track.globalIndex(), track.phi(), track.eta(), track.pt() * track.sign());
902902
assocTrackSelInfo(indexHfcReducedCollision, track.tpcNClsCrossedRows(), track.itsClusterMap(), track.itsNCls(), track.dcaXY(), track.dcaZ());
903903
}

0 commit comments

Comments
 (0)