Skip to content

Commit fbace92

Browse files
authored
Merge pull request #4231 from hrjheng/DecayFinder
DecayFinder search/match fix
2 parents a4380b3 + de78126 commit fbace92

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

offline/packages/decayfinder/DecayFinder.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ bool DecayFinder::findDecay(PHCompositeNode* topNode)
361361
exit(1);
362362
}
363363

364+
// correct mother PID to search for match
365+
const int mother_id_to_match = m_getChargeConjugate ? std::abs(m_mother_ID) : m_mother_ID;
366+
364367
if (m_truthinfo && !m_geneventmap) // This should use the truth info container if we have no HepMC record
365368
{
366369
if (Verbosity() >= VERBOSITY_SOME)
@@ -374,7 +377,7 @@ bool DecayFinder::findDecay(PHCompositeNode* topNode)
374377
{
375378
PHG4Particle* g4particle = iter->second;
376379
int this_pid = m_getChargeConjugate ? abs(g4particle->get_pid()) : g4particle->get_pid();
377-
if (this_pid == m_mother_ID)
380+
if (this_pid == mother_id_to_match)
378381
{
379382
if (Verbosity() >= VERBOSITY_MAX)
380383
{
@@ -455,7 +458,7 @@ bool DecayFinder::findDecay(PHCompositeNode* topNode)
455458
for (HepMC::GenEvent::particle_const_iterator p = theEvent->particles_begin(); p != theEvent->particles_end(); ++p)
456459
{
457460
int this_pid = m_getChargeConjugate ? abs((*p)->pdg_id()) : (*p)->pdg_id();
458-
if (this_pid == m_mother_ID)
461+
if (this_pid == mother_id_to_match)
459462
{
460463
if (Verbosity() >= VERBOSITY_MAX)
461464
{

0 commit comments

Comments
 (0)