@@ -233,6 +233,9 @@ struct HfTaskDplus {
233233 if (storeIR) {
234234 axes.push_back (thnAxisIR);
235235 }
236+ if (storePvContributors) {
237+ axes.push_back (thnAxisPvContributors);
238+ }
236239 if (doprocessDataWithMlWithUpc || doprocessDataWithUpc) {
237240 axes.push_back (thnAxisGapType);
238241 axes.push_back (thnAxisFT0A);
@@ -410,10 +413,16 @@ struct HfTaskDplus {
410413 }
411414 }
412415 } else { // Data
413- if (storeCentrality && storeOccupancy) {
416+ if (storeCentrality && storeOccupancy && storePvContributors) {
417+ registry.fill (HIST (" hSparseMass" ), HfHelper::invMassDplusToPiKPi (candidate), candidate.pt (), outputMl[0 ], outputMl[1 ], outputMl[2 ], centrality, occupancy, numPvContributors);
418+ } else if (storeCentrality && storeOccupancy && !storePvContributors) {
414419 registry.fill (HIST (" hSparseMass" ), HfHelper::invMassDplusToPiKPi (candidate), candidate.pt (), outputMl[0 ], outputMl[1 ], outputMl[2 ], centrality, occupancy);
420+ } else if (storeCentrality && !storeOccupancy && storePvContributors) {
421+ registry.fill (HIST (" hSparseMass" ), HfHelper::invMassDplusToPiKPi (candidate), candidate.pt (), outputMl[0 ], outputMl[1 ], outputMl[2 ], centrality, numPvContributors);
415422 } else if (storeCentrality && !storeOccupancy) {
416423 registry.fill (HIST (" hSparseMass" ), HfHelper::invMassDplusToPiKPi (candidate), candidate.pt (), outputMl[0 ], outputMl[1 ], outputMl[2 ], centrality);
424+ } else if (!storeCentrality && storeOccupancy && storePvContributors) {
425+ registry.fill (HIST (" hSparseMass" ), HfHelper::invMassDplusToPiKPi (candidate), candidate.pt (), outputMl[0 ], outputMl[1 ], outputMl[2 ], occupancy, numPvContributors);
417426 } else if (!storeCentrality && storeOccupancy) {
418427 registry.fill (HIST (" hSparseMass" ), HfHelper::invMassDplusToPiKPi (candidate), candidate.pt (), outputMl[0 ], outputMl[1 ], outputMl[2 ], occupancy);
419428 } else if (!storeCentrality && !storeOccupancy && storePvContributors) {
@@ -559,7 +568,7 @@ struct HfTaskDplus {
559568 continue ;
560569 }
561570
562- if (storeCentrality || storeOccupancy) {
571+ if (storeCentrality || storeOccupancy || storePvContributors ) {
563572 auto collision = candidate.template collision_as <CollisionsCent>();
564573 if (storeCentrality && centEstimator != CentralityEstimator::None) {
565574 cent = getCentralityColl (collision, centEstimator);
@@ -771,7 +780,8 @@ struct HfTaskDplus {
771780 int const nAxesCent = storeCentrality ? 1 : 0 ; // centrality if storeCentrality
772781 int const nAxesOcc = storeOccupancy ? 1 : 0 ; // occupancy if storeOccupancy
773782 int const nAxesIR = storeIR ? 1 : 0 ; // IR if storeIR
774- int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOcc + nAxesIR;
783+ int const nAxesPv = storePvContributors ? 1 : 0 ;
784+ int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOcc + nAxesIR + nAxesPv;
775785
776786 std::vector<double > valuesToFill;
777787 valuesToFill.reserve (nAxesTotal);
@@ -797,6 +807,9 @@ struct HfTaskDplus {
797807 if (storeIR) {
798808 valuesToFill.push_back (ir);
799809 }
810+ if (storePvContributors) {
811+ valuesToFill.push_back (static_cast <double >(collision.numContrib ()));
812+ }
800813 valuesToFill.push_back (static_cast <double >(gap));
801814 valuesToFill.push_back (static_cast <double >(fitInfo.ampFT0A ));
802815 valuesToFill.push_back (static_cast <double >(fitInfo.ampFT0C ));
0 commit comments