Skip to content

Commit 81931a2

Browse files
committed
Add the number of tracks into the charm-bulk correlation
1 parent 74a5210 commit 81931a2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

PWGHF/D2H/Tasks/taskPtFlucCharmHadrons.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ struct HfTaskPtFlucCharmHadrons {
186186

187187
// charm-bulk correlations (optional)
188188
if (saveCharmBulkCorrelations) {
189-
registry.add("hCharmBulkCorrelations", "Charm-bulk correlations", HistType::kTHnSparseF, {aInvMass, aCent, aPt, aSign, aMlOne, aMlTwo, aCandEta, aMPtTrkA, aMPtTrkB, aPtCandProduct}, true);
189+
registry.add("hCharmBulkCorrelations", "Charm-bulk correlations", HistType::kTHnSparseF, {aInvMass, aCent, aPt, aSign, aMlOne, aMlTwo, aCandEta, aMPtTrkA, aMPtTrkB, aPtCandProduct, aNTrkA, aNTrkB}, true);
190190
registry.add("hMeanPtTrkAllColls", "Mean pT of charged hadrons for all collisions", HistType::kTHnSparseF, {aCent, aMPtTrkA, aMPtTrkB, aPtTrkProduct, aNTrkA, aNTrkB}, true);
191191
}
192192

@@ -250,7 +250,7 @@ struct HfTaskPtFlucCharmHadrons {
250250

251251
/// remove candidate daughters from the mean pT of tracks in A and B (if they are in the respective subevent)
252252
template <DecayChannel Channel, typename CandT>
253-
float removeDaughtersFromMeanPt(const CandT& cand, float rawMeanPt, int n, const std::vector<int>& trkIDs)
253+
std::pair<float, int> removeDaughtersFromMeanPt(const CandT& cand, float rawMeanPt, int n, const std::vector<int>& trkIDs)
254254
{
255255
int removedCount = 0;
256256
float removedSumPt = 0.f;
@@ -270,9 +270,9 @@ struct HfTaskPtFlucCharmHadrons {
270270
}
271271
if (removedCount > 0) {
272272
double totalSum = static_cast<double>(rawMeanPt) * n;
273-
return static_cast<float>((totalSum - removedSumPt) / (n - removedCount));
273+
return {static_cast<float>((totalSum - removedSumPt) / (n - removedCount)), n - removedCount};
274274
}
275-
return rawMeanPt;
275+
return {rawMeanPt, n};
276276
}
277277

278278
// ---------------------------------------------------------------------------
@@ -421,11 +421,11 @@ struct HfTaskPtFlucCharmHadrons {
421421
float meanPtA{0.f};
422422
float meanPtB{0.f};
423423
if (eta > etaAMin.value && eta < etaAMax.value) {
424-
meanPtB = removeDaughtersFromMeanPt<Channel, decltype(cand)>(cand, RawMeanPtB, nB, trkIDB);
424+
std::tie(meanPtB, nB) = removeDaughtersFromMeanPt<Channel, decltype(cand)>(cand, RawMeanPtB, nB, trkIDB);
425425
meanPtA = RawMeanPtA; // no need to remove daughters from A if candidate is in A
426426
candPtProduct = pt * meanPtB;
427427
} else if (eta > etaBMin.value && eta < etaBMax.value) {
428-
meanPtA = removeDaughtersFromMeanPt<Channel, decltype(cand)>(cand, RawMeanPtA, nA, trkIDA);
428+
std::tie(meanPtA, nA) = removeDaughtersFromMeanPt<Channel, decltype(cand)>(cand, RawMeanPtA, nA, trkIDA);
429429
meanPtB = RawMeanPtB; // no need to remove daughters from B if candidate is in B
430430
candPtProduct = pt * meanPtA;
431431
}
@@ -434,7 +434,7 @@ struct HfTaskPtFlucCharmHadrons {
434434
auto [invMass, sign] = getCandMassAndSign<Channel, decltype(cand), T1, Trk>(cand);
435435

436436
// fill charm-bulk correlation thnsparse
437-
registry.fill(HIST("hCharmBulkCorrelations"), invMass, cent, pt, sign, ml1, ml2, eta, meanPtA, meanPtB, candPtProduct);
437+
registry.fill(HIST("hCharmBulkCorrelations"), invMass, cent, pt, sign, ml1, ml2, eta, meanPtA, meanPtB, candPtProduct, nA, nB);
438438
}
439439
} else {
440440
int nDcandTotA = 0;

0 commit comments

Comments
 (0)