Skip to content

Commit c4d74cf

Browse files
authored
Update treeCreatorToXiPi.cxx
1 parent f66cdb0 commit c4d74cf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

PWGHF/TableProducer/treeCreatorToXiPi.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ DECLARE_SOA_TABLE(HfToXiPiEvs, "AOD", "HFTOXIPIEV",
153153
full::IsEventSel8, full::IsEventSelZ);
154154

155155
DECLARE_SOA_TABLE(HfToXiPiFulls, "AOD", "HFTOXIPIFULL",
156-
full::XPv, full::YPv, full::ZPv, collision::NumContrib, collision::Chi2,
156+
full::XPv, full::YPv, full::ZPv, full::Centrality, collision::NumContrib, collision::Chi2,
157157
full::XDecayVtxCharmBaryon, full::YDecayVtxCharmBaryon, full::ZDecayVtxCharmBaryon,
158158
full::XDecayVtxCascade, full::YDecayVtxCascade, full::ZDecayVtxCascade,
159159
full::XDecayVtxV0, full::YDecayVtxV0, full::ZDecayVtxV0,
@@ -246,10 +246,18 @@ struct HfTreeCreatorToXiPi {
246246
template <bool useCentrality, typename MyEventTableType, typename T>
247247
void fillCandidate(const T& candidate, int8_t flagMc, int8_t debugMc, int8_t originMc, bool collisionMatched)
248248
{
249+
250+
float centrality = -999.f;
251+
if constexpr (useCentrality) {
252+
auto const& collision = candidate.template collision_as<MyEventTableType>();
253+
centrality = o2::hf_centrality::getCentralityColl(collision);
254+
}
255+
249256
rowCandidateFull(
250257
candidate.xPv(),
251258
candidate.yPv(),
252259
candidate.zPv(),
260+
centrality,
253261
candidate.template collision_as<MyEventTableType>().numContrib(),
254262
candidate.template collision_as<MyEventTableType>().chi2(),
255263
candidate.xDecayVtxCharmBaryon(),

0 commit comments

Comments
 (0)