Skip to content

Commit 6b0d3f7

Browse files
authored
[PWGHF] Fixed bug in D-track resonance workflow (AliceO2Group#12386)
1 parent fe98a01 commit 6b0d3f7

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

PWGHF/D2H/DataModel/ReducedDataModel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ DECLARE_SOA_TABLE(HfRedVzeros, "AOD", "HFREDVZERO", //! Table with V0 candidate
12741274
DECLARE_SOA_TABLE(HfRedTrkNoParams, "AOD", "HFREDTRKNOPARAM", //! Table with tracks without track parameters for resonances reduced workflow
12751275
o2::soa::Index<>,
12761276
// Indices
1277+
hf_track_index_reduced::TrackId,
12771278
hf_track_index_reduced::HfRedCollisionId,
12781279
// Static
12791280
hf_track_vars_reduced::Px,

PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,30 +102,35 @@ struct HfCandidateCreatorCharmResoReduced {
102102
Produces<aod::Hf2PrTrkIds> rowCandidateResoIndices2PrTrks;
103103
// D Configurables
104104
struct : ConfigurableGroup {
105+
std::string prefix = "dmesonsCuts";
105106
Configurable<std::vector<double>> binsPtD{"binsPtD", std::vector<double>{hf_cuts_d_daughter::vecBinsPt}, "pT bin limits for D daughter cuts"};
106107
Configurable<LabeledArray<double>> cutsD{"cutsD", {hf_cuts_d_daughter::Cuts[0], hf_cuts_d_daughter::NBinsPt, hf_cuts_d_daughter::NCutVars, hf_cuts_d_daughter::labelsPt, hf_cuts_d_daughter::labelsCutVar}, "D daughter selections"};
107108
Configurable<bool> keepSideBands{"keepSideBands", false, "flag to keep events from D meson sidebands for backgorund estimation"};
108109
} cfgDmesCuts;
109110
// V0 cuts configurables
110111
struct : ConfigurableGroup {
112+
std::string prefix = "v0Cuts";
111113
Configurable<LabeledArray<double>> cutsV0{"cutsV0", {hf_cuts_v0_daughter::Cuts[0], hf_cuts_v0_daughter::NBinsPt, hf_cuts_v0_daughter::NCutVars, hf_cuts_v0_daughter::labelsPt, hf_cuts_v0_daughter::labelsCutVar}, "V0 daughter selections"};
112114
Configurable<std::vector<double>> binsPtV0{"binsPtV0", std::vector<double>{hf_cuts_v0_daughter::vecBinsPt}, "pT bin limits for V0 daughter cuts"};
113115
Configurable<int> v0Type{"v0Type", 0, "V0 type to be selected (0: K0s, 1: Lambda"};
114116
} cfgV0Cuts;
115117
// Track cuts configurables
116118
struct : ConfigurableGroup {
119+
std::string prefix = "trackCuts";
117120
Configurable<LabeledArray<double>> cutsTrk{"cutsTrk", {hf_cuts_track_daughter::Cuts[0], hf_cuts_track_daughter::NCutVars, hf_cuts_track_daughter::labelsCutVar}, "Track daughter selections, set to -1 to disable cuts"};
118121
Configurable<int> massHypo{"massHypo", 1, "Mass Hypothesis for the track daughters (0: pion, 1: kaon, 2: proton)"};
119122
} cfgTrackCuts;
120123
// Mixed Event configurables
121124
struct : ConfigurableGroup {
125+
std::string prefix = "mixedEvent";
122126
Configurable<int> numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"};
123127
Configurable<int> numberEventsToSkip{"numberEventsToSkip", -1, "Number of events to Skip in ME process"};
124128
ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0., 45., 60., 75., 95, 250}, "event multiplicity pools (PV contributors for now)"};
125129
ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0, -4, -1, 1, 4, 10.0}, "z vertex position pools"};
126130
} cfgMixedEvent;
127131
// Histogram axes configurables
128132
struct : ConfigurableGroup {
133+
std::string prefix = "histAxes";
129134
ConfigurableAxis axisPtD{"axisPtD", {100, 0., 50}, "#it{p}_{T} (GeV/#it{c})"};
130135
ConfigurableAxis axisPtV0{"axisPtV0", {100, 0., 50}, "#it{p}_{T} (GeV/#it{c})"};
131136
ConfigurableAxis axisPtReso{"axisPtReso", {100, 0., 50}, "#it{p}_{T} (GeV/#it{c})"};
@@ -691,10 +696,8 @@ struct HfCandidateCreatorCharmResoReduced {
691696
bool alreadyCounted{false};
692697
for (const auto& candV0Tr : candsV0Tr) {
693698
if constexpr (bachType == BachelorType::V0) { // Case: V0
694-
if (rejectPairsWithCommonDaughter) {
695-
if (std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong0Id()) != dDaughtersIDs.end() || std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong1Id()) != dDaughtersIDs.end()) {
696-
continue;
697-
}
699+
if (rejectPairsWithCommonDaughter && (std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong0Id()) != dDaughtersIDs.end() || std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong1Id()) != dDaughtersIDs.end())) {
700+
continue;
698701
}
699702
if (!isV0Selected(candV0Tr)) {
700703
continue;
@@ -704,10 +707,8 @@ struct HfCandidateCreatorCharmResoReduced {
704707
alreadyCounted = true;
705708
}
706709
} else if constexpr (bachType == BachelorType::Track) { // Case: Track
707-
if (rejectPairsWithCommonDaughter) {
708-
if (std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.globalIndex()) != dDaughtersIDs.end()) {
709-
continue;
710-
}
710+
if (rejectPairsWithCommonDaughter && std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.trackId()) != dDaughtersIDs.end()) {
711+
continue;
711712
}
712713
if (!isTrackSelected(candV0Tr)) {
713714
continue;

PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ struct HfDataCreatorCharmResoReduced {
162162

163163
// selection single tracks
164164
struct : ConfigurableGroup {
165-
std::string prefix = "single_tracks";
165+
std::string prefix = "singleTracks";
166166
Configurable<int> setTrackSelections{"setTrackSelections", 2, "flag to apply track selections: 0=none; 1=global track w/o DCA selection; 2=global track; 3=only ITS quality"};
167167
Configurable<float> maxEta{"maxEta", 0.8, "maximum pseudorapidity for single tracks to be paired with D mesons"};
168168
Configurable<float> minPt{"minPt", 0.1, "minimum pT for single tracks to be paired with D mesons"};
@@ -173,6 +173,7 @@ struct HfDataCreatorCharmResoReduced {
173173

174174
// QA histograms
175175
struct : ConfigurableGroup {
176+
std::string prefix = "qaPlots";
176177
Configurable<bool> applyCutsForQaHistograms{"applyCutsForQaHistograms", true, "flag to apply cuts to QA histograms"};
177178
Configurable<float> cutMassDstarMin{"cutMassDstarMin", 0.143, "minimum mass for Dstar candidates"};
178179
Configurable<float> cutMassDstarMax{"cutMassDstarMax", 0.155, "maximum mass for Dstar candidates"};
@@ -929,6 +930,7 @@ struct HfDataCreatorCharmResoReduced {
929930
SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::D0Matched);
930931
origin = candCharmBach.originMcRec();
931932
}
933+
flagTrack = getMatchingFlagTrack(bachelorTrack);
932934
if (hf_decay::hf_cand_2prong::daughtersD0Main.contains(static_cast<hf_decay::hf_cand_2prong::DecayChannelMain>(std::abs(flagCharmBach))) && flagTrack == hf_decay::hf_cand_reso::PartialMatchMc::PionMatched) {
933935
auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], bachelorTrack};
934936
auto pdgCodesDzeroDaughters = hf_decay::hf_cand_2prong::daughtersD0Main.at(static_cast<hf_decay::hf_cand_2prong::DecayChannelMain>(std::abs(flagCharmBach)));
@@ -1436,7 +1438,8 @@ struct HfDataCreatorCharmResoReduced {
14361438
} // end of DType switch
14371439
// fill track table
14381440
if (!selectedTracks.count(track.globalIndex())) {
1439-
hfTrackNoParam(indexHfReducedCollision,
1441+
hfTrackNoParam(track.globalIndex(),
1442+
indexHfReducedCollision,
14401443
track.px(), track.py(), track.pz(), track.sign(),
14411444
track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(),
14421445
track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(),

0 commit comments

Comments
 (0)