Skip to content

Commit c966c87

Browse files
author
Valerio Di Bella
committed
clean error + add histograms
1 parent 96ac357 commit c966c87

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

PWGHF/HFC/TableProducer/correlatorDplusDplusReduced.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,21 @@ struct HfCorrelatorDplusDplusReduced {
114114
collision.posZ());
115115
}
116116

117-
template <typename Coll, bool doMc = false, bool doMl = false, typename T>
117+
template <typename Coll, bool DoMc = false, bool DoMl = false, typename T>
118118
void fillCandidateTable(const T& candidate, int localEvIdx = -1, int sign = 1)
119119
{
120120
int8_t flagMc = 0;
121121
int8_t originMc = 0;
122122
int8_t channelMc = 0;
123123

124-
if constexpr (doMc) {
124+
if constexpr (DoMc) {
125125
flagMc = candidate.flagMcMatchRec();
126126
originMc = candidate.originMcRec();
127127
channelMc = candidate.flagMcDecayChanRec();
128128
}
129129

130130
std::vector<float> outputMl = {-999., -999.};
131-
if constexpr (doMl) {
131+
if constexpr (DoMl) {
132132
for (unsigned int iclass = 0; iclass < classMlIndexes->size(); iclass++) {
133133
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMlIndexes->at(iclass)];
134134
}
@@ -283,7 +283,7 @@ struct HfCorrelatorDplusDplusReduced {
283283
}
284284
}
285285

286-
void processData(aod::Collisions const& collisions, SelectedCandidates const& candidates, aod::Tracks const&)
286+
void processData(aod::Collisions const& collisions, SelectedCandidates const& candidates, aod::Tracks const&, aod::BCsWithTimestamps const&)
287287
{
288288
static int lastRunNumber = -1;
289289
// reserve memory
@@ -315,16 +315,16 @@ struct HfCorrelatorDplusDplusReduced {
315315
continue;
316316
fillEvent(collision);
317317
for (const auto& candidate : candidatesInThisCollision) {
318-
auto prong_candidate = candidate.prong1_as<aod::Tracks>();
319-
auto candidate_sign = prong_candidate.sign();
320-
fillCandidateTable<aod::Collisions>(candidate, rowCandidateFullEvents.lastIndex(), candidate_sign);
318+
auto prongCandidate = candidate.prong1_as<aod::Tracks>();
319+
auto candidateSign = -prongCandidate.sign();
320+
fillCandidateTable<aod::Collisions>(candidate, rowCandidateFullEvents.lastIndex(), candidateSign);
321321
}
322322
}
323323
}
324324
PROCESS_SWITCH(HfCorrelatorDplusDplusReduced, processData, "Process data per collision", false);
325325

326326
void processMcRec(aod::Collisions const& collisions,
327-
SelectedCandidatesMc const& candidates)
327+
SelectedCandidatesMc const& candidates, aod::Tracks const&)
328328
{
329329
// reserve memory
330330
rowCandidateFullEvents.reserve(collisions.size());
@@ -342,9 +342,9 @@ struct HfCorrelatorDplusDplusReduced {
342342
continue;
343343
fillEvent(collision);
344344
for (const auto& candidate : candidatesInThisCollision) {
345-
auto prong_candidate = candidate.prong1_as<aod::Tracks>();
346-
auto candidate_sign = prong_candidate.sign();
347-
fillCandidateTable<aod::Collisions, true>(candidate, rowCandidateFullEvents.lastIndex(), candidate_sign);
345+
auto prongCandidate = candidate.prong1_as<aod::Tracks>();
346+
auto candidateSign = -prongCandidate.sign();
347+
fillCandidateTable<aod::Collisions, true>(candidate, rowCandidateFullEvents.lastIndex(), candidateSign);
348348
}
349349
}
350350
}

PWGHF/HFC/Tasks/taskCorrelationDplusDplusReduced.cxx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ struct HfTaskCorrelationDplusDplusReduced {
5555
void init(InitContext const&)
5656
{
5757
registry.add("hMassDplus", "D+ candidates;inv. mass (#pi#pi K) (GeV/#it{c}^{2}))", {HistType::kTH1F, {{120, 1.5848, 2.1848}}});
58+
registry.add("hMassDminus", "D- candidates;inv. mass (#pi#pi K) (GeV/#it{c}^{2}))", {HistType::kTH1F, {{120, 1.5848, 2.1848}}});
5859
registry.add("hMassDplusMatched", "D+ matched candidates;inv. mass (#pi#pi K) (GeV/#it{c}^{2}))", {HistType::kTH1F, {{120, 1.5848, 2.1848}}});
60+
registry.add("hMassDminusMatched", "D- matched candidates;inv. mass (#pi#pi K) (GeV/#it{c}^{2}))", {HistType::kTH1F, {{120, 1.5848, 2.1848}}});
5961
registry.add("hMassDplusminusPair", "D plus-minus pair candidates;inv. mass (#pi K) (GeV/#it{c}^{2});inv. mass (#pi K) (GeV/#it{c}^{2})", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {120, 1.5848, 2.1848}}});
6062
registry.add("hMassDplusPair", "D plus pair candidates;inv. mass (#pi K) (GeV/#it{c}^{2});inv. mass (#pi K) (GeV/#it{c}^{2})", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {120, 1.5848, 2.1848}}});
6163
registry.add("hMassDminusPair", "D minus pair candidates;inv. mass (#pi K) (GeV/#it{c}^{2});inv. mass (#pi K) (GeV/#it{c}^{2})", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {120, 1.5848, 2.1848}}});
@@ -72,7 +74,11 @@ struct HfTaskCorrelationDplusDplusReduced {
7274
auto sign1 = 1;
7375
if (cand1.pt() < 0) {
7476
sign1 = -1;
77+
registry.fill(HIST("hMassDminus"), mass1);
78+
} else {
79+
registry.fill(HIST("hMassDplus"), mass1);
7580
}
81+
7682
for (auto cand2 = cand1 + 1; cand2 != localCandidates.end(); ++cand2) {
7783
auto mass2 = cand2.m();
7884
auto sign2 = 1;
@@ -100,9 +106,15 @@ struct HfTaskCorrelationDplusDplusReduced {
100106

101107
for (const auto& cand1 : localCandidates) {
102108
auto mass1 = cand1.m();
103-
registry.fill(HIST("hMassDplus"), mass1);
104-
if (std::abs(cand1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)
105-
registry.fill(HIST("hMassDplusMatched"), mass1);
109+
if (cand1.pt() < 0) {
110+
registry.fill(HIST("hMassDminus"), mass1);
111+
if (std::abs(cand1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)
112+
registry.fill(HIST("hMassDminusMatched"), mass1);
113+
} else {
114+
registry.fill(HIST("hMassDplus"), mass1);
115+
if (std::abs(cand1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)
116+
registry.fill(HIST("hMassDplusMatched"), mass1);
117+
}
106118
}
107119
}
108120
PROCESS_SWITCH(HfTaskCorrelationDplusDplusReduced, processLocalDataMcRec, "Process local MC data", false);

0 commit comments

Comments
 (0)