Skip to content

Commit fbd23f9

Browse files
sawenzelclaude
andcommitted
Make the partonic-decay test independent of the Pythia8 version
This rewrites the partonic decay test so that it passes with Pythia8 8.315 and 8.318. - Pythia8 8.318 hadronises the partons of a meMode 91 decay itself, so the decay succeeds, whereas 8.315 leaves partons and the decay fails. - The test now checks that no partonic particle is left to be transported, and the matching outcome in either case. https://its.cern.ch/jira/browse/O2-5903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f2a6da1 commit fbd23f9

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

‎Generators/test/test_EventDecayer.cxx‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,18 +504,34 @@ BOOST_AUTO_TEST_CASE(seeding)
504504
setParams();
505505
}
506506

507-
BOOST_AUTO_TEST_CASE(partonic_decay_fails)
507+
// quarks, gluon, diquarks and the Pythia8 pseudo-particles 81-99
508+
bool isPartonic(int pdg)
508509
{
509-
// Xic+ -> s uu_1 with meMode 91, which Pythia8 leaves as partons
510+
int a = std::abs(pdg);
511+
bool diquark = a > 1100 && a < 5600 && a / 1000 < 6 && (a / 10) % 10 == 0 && (a / 100) % 10 <= a / 1000 && (a / 100) % 10 > 0 && (a % 10) % 2 == 1;
512+
return (a >= 1 && a <= 8) || a == 21 || (a >= 81 && a <= 99) || diquark;
513+
}
514+
515+
BOOST_AUTO_TEST_CASE(partonic_decay_never_transports_partons)
516+
{
517+
// Xic+ -> s uu_1 with meMode 91; whether Pythia8 hadronises the partons depends on its version (8.318 does, 8.315 does not)
510518
setParams("", writeCfg("4232:oneChannel = 1 1.0 91 3 2203\n"));
511519
EventDecayer decayer;
512520
BOOST_REQUIRE(decayer.init());
513521
std::vector<TParticle> particles{makeParticle(4232, 5., true)};
514522
auto before = particles;
515523
auto report = decayer.decay(particles);
516-
checkUnchanged(particles, before);
517-
BOOST_CHECK_EQUAL(report.failed[4232], 1);
518-
BOOST_CHECK(report.decayed.empty());
524+
for (auto const& p : particles) {
525+
BOOST_CHECK(!(toBeDone(p) && isPartonic(p.GetPdgCode())));
526+
}
527+
if (report.failed[4232] == 1) {
528+
checkUnchanged(particles, before);
529+
BOOST_CHECK(report.decayed.empty());
530+
} else {
531+
BOOST_CHECK_EQUAL(report.decayed[4232], 1);
532+
BOOST_CHECK(!toBeDone(particles[0]));
533+
BOOST_CHECK(particles.size() > 1);
534+
}
519535
}
520536

521537
BOOST_AUTO_TEST_CASE(failed_intermediate_decay_fails)

0 commit comments

Comments
 (0)