Skip to content

Complete replacement of PYTHIA6 with PYTHIA8 (2022)

Costas Andreopoulos edited this page Apr 8, 2022 · 12 revisions

Developer team

Costas Andreopoulos, Alfonso Garcia

Target GENIE product releases

v3.4.0

Scope of project

In GENIE v3.0.0 GENIE was interfaced to PYTHIA8 within AGKY only. This required a major refactoring of hadronization and decayer interfaces, to eliminate from there all PYTHIA6 specific classes (eg. TMCParticle). It was demonstrated that physics predictions using PYTHIA6 remained the same before/after the refactoring. It was also demonstrated that PYTHIA6 can be swapped with PYTHIA8 and predictions remain identical in a broad range of tests. The relevant PR is here.

The scope of this project is to interface GENIE with PYTHIA8, as a replacement to PYTHIA6, in all other locations in the code beyond the AGKY model.

On completion, PYTHIA8 will be the default included in CMC configurations running out of the box. The PYTHIA6 dependency will become optional, but configurations will be kept and PYTHIA6 will be supported till the release of GENIE v4.0.0.

Deliverables

  1. PYTHIA8 alternatives to all GENIE/PYTHIA6 interface codes that lack one.
  2. Refactored GENIE/PYTHIA interfaces: Codes that include PYTHIA6 or PYTHIA8 calls will be factored out and made interchangeable, while all code that does not depend on a specific version will be factored out and reused by both versions.
  3. Updated configurations allowing consistent use of either the PYTHIA6 or PYTHIA8 version in all GENIE CMCs.
  4. Demonstrate that refactoring had no impact on current GENIE/PYTHIA6 predictions.
  5. Demonstrate that GENIE/PYTHIA8 predictions are identical to GENIE/PYTHIA6 ones, for identical configurations.

Milestones

  1. Proposal for code refactoring following review of existing GENIE/PYTHIA codes.

Requirements

  • All GENIE codes relying on PYTHIA6 should be maintained, as the PYTHIA6 dependency and support will not be dropped till GENIE v4.0.0
  • GENIE codes relying on PYTHIA6 should get a PYTHIA8 equivalent.
  • GENIE codes relying on PYTHIA6 should not give compilation issues, if a user opt to use PYTHIA8 and doesn't provide PYTHIA6. This implies that all PYTHIA6-specific codes are placed within an an #ifdef __GENIE_PYTHIA6_ENABLED__ #endif block. Similarly for codes that rely on PYTHIA8.
  • It should be possible for a user to build GENIE enabling any of a) only PYTHIA6, b) only PYTHIA8, or c) both PYTHIA6 and PYTHIA8.
  • The use of PYTHIA6 or PYTHIA8 should be decided at the level of XML configuration.
  • Configurations that rely on PYTHIA8 on a built with only PYTHIA6 enabled, should lead to an informative error message on dependencies and should exit graciously. Similarly, for configurations that rely on PYTHIA6 on a built with only PYTHIA8 enabled.
  • Interchangeable codes that interface GENIE to either PYTHIA6 or PYTHIA8, must initialise PYTHIA with identical physics settings. Using equivalent PYTHIA6 and PYTHIA8 configurations, GENIE should generate identical (or nearly identical) predictions. Any visible difference will be considered as a showstopper, and its origin will have to be understood before further PYTHIA8 deployment.

Schematic outline of program of work

The following GENIE codes have dependencies on PYTHIA6

  • Physics/Hadronization/Pythia6Hadro2019.h/.cxx: Ignore. This was handled in the previous refactoring and PYTHIA8 ready, There is an equivalent Pythia8Hadro2019, and PYTHIA6-specific calls in this class are within an #ifdef __GENIE_PYTHIA6_ENABLED__ #endif block

  • Framework/Numerical/RandomGen.h/.cxx: This code synchornises the GENIE and PYTHIA random number seeds. It is not PYTHIA8 ready. PYTHIA6 header file and call to SetMRPY() is not protected within an an #ifdef __GENIE_PYTHIA6_ENABLED__ #endif block. There is no equivalent PYTHIA8 codes. (Should this class be PYTHIA8 ready as part of the previous development?)

  • Physics/Decay/PythiaDecayer.h/.cxx: In GENIE, all particles other baryon resonances are decayed using this code. Work will proceed along the lines of the previous hadronization development. PythiaDecayer will be renamed to Pythia6Decayer2022. An equivalent Pythia8Decayer2022 will be added. Common parts of the code that do not depend on the specifics of PYTHIA6 or PYTHIA8, will be factored out in a PythiaBaseDecayer2022. Both Pythia6Decayer2022 and Pythia8Decayer2022 will inherit from PythiaBaseDecayer2022.

  • Physics/Hadronization/AGCharm2019.h./.cxx: This is the Andreopoulos-Gallagher (AG) charm hadronization model in GENIE. The leading charm hadron is produced using input charm fractions and fragmentation functions. The remnant (non charm) system is hadronised by PYTHIA. Here, the code hadronizing the remnant system will be factored out. Parts of that code that doesn't depend on the specifics of PYTHIA6 or PYTHIA8 (like the lengthy code for the determination of quark IDs) will be factored out in a new base class: AGCharmPythiaBaseHadro2022. New concrete classes, AGCharmPythia6Hadro2022 and AGCharmPythia8Hadro2022 will inherit from AGCharmPythiaBaseHadro2022 and implement, respectively, the PYTHIA6 and PYTHIA8 specifics. AGCharm2019 will be renamed as AGCharm2022.

  • Physics/HELepton/EventGen/GLRESGenerator.h/.cxx: Alfonso?

  • Physics/HELepton/EventGen/PhotonCOHGenerator.h/.cxx: Alfonso?

  • Physics/HELepton/EventGen/PhotonRESGenerator.h/.cxx: Alfonso?

  • Physics/Hadronization/LeptoHadronization.h/.cxx: Alfonso?

As part of this development, touch all relevant XML configurations and replace "Default" with more descriptive names. For clarity, labels of configuration for the top level hadronization or decay algorithms, such as AGKY2019 or AGCharm2022, should include the version of PYTHIA (eg "YYYwPYTHIA6" or ""YYYwPYTHIA8"")

Details on validation plan

  • Test compilation/builds with a) only PYTHIA6 enabled, b) only PYTHIA8 enabled, and c) both PYTHIA6 and PYTHIA8 enabled.
  • For each build, make sure that GENIE/PYTHIA6 and GENIE/PYTHIA8 codes either a) run if the required dependency exists, or b) print informative message and exit graciously if the required dependency does not exist.
  • For each running configuration produce large (1M) event samples, with settings and model configurations that invoke PYTHIA more often than standard configurations, and monitor error messages, frequency of MC dead ends and frequency of rejected unphysical events. Compare against GENIE v3.2.0.
  • Compare distributions from similar runs between GENIE/PYTHIA6 codes in v3.2.0 and refactored GENIE/PYTHIA6 codes in the development branch.
  • Compare distributions from similar runs between GENIE/PYTHIA6 and GENIE/PYTHIA8 codes in the development branch.

Documentation and publications

N/A

Anticipated review points

  • Initial review of deliverables, requirements and plan for code restructing
  • Code review and validation, after completion of restructuring of core ME simulation.
  • Code review and validation, after completion of restructuring of HEDIS extension (if done on a different timescale).

Dependencies with other projects

N/A