Skip to content

Commit d00e56b

Browse files
authored
[PWGCF] Add generic 2-prong MC processor (#12335)
1 parent af983df commit d00e56b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

PWGCF/TableProducer/filter2Prong.cxx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,29 @@ struct Filter2Prong {
251251
}
252252
PROCESS_SWITCH(Filter2Prong, processMC, "Process MC 2-prong daughters", false);
253253

254+
void processMCGeneric(aod::McCollisions::iterator const&, aod::CFMcParticleRefs const& cfmcparticles)
255+
{
256+
// The main filter outputs the primary MC particles. Here we just resolve the daughter indices that are needed for the efficiency matching.
257+
for (const auto& r : cfmcparticles) {
258+
const auto& mcParticle = r.mcParticle();
259+
if (mcParticle.daughtersIds().size() != 2) {
260+
output2ProngMcParts(-1, -1, aod::cf2prongtrack::Generic2Prong); // not a 2-prong
261+
continue;
262+
}
263+
int prongCFId[2] = {-1, -1};
264+
for (uint i = 0; i < 2; ++i) {
265+
for (const auto& cfmcpart : cfmcparticles) {
266+
if (mcParticle.daughtersIds()[i] == cfmcpart.mcParticleId()) {
267+
prongCFId[i] = cfmcpart.globalIndex();
268+
break;
269+
}
270+
}
271+
}
272+
output2ProngMcParts(prongCFId[0], prongCFId[1], aod::cf2prongtrack::Generic2Prong); // the 2-prong Phi, for example, can be checked through its daughters
273+
}
274+
}
275+
PROCESS_SWITCH(Filter2Prong, processMCGeneric, "Process generic MC 2-prong daughters", false);
276+
254277
template <typename T>
255278
bool selectionTrack(const T& candidate)
256279
{

0 commit comments

Comments
 (0)