Skip to content

Implement external generator for Monopoles - #2557

Open
jackal1-66 wants to merge 1 commit into
AliceO2Group:masterfrom
jackal1-66:monopoleGen
Open

jackal1-66 wants to merge 1 commit into
AliceO2Group:masterfrom
jackal1-66:monopoleGen

Conversation

@jackal1-66

@jackal1-66 jackal1-66 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds a configurable external generator for magnetic monopoles to O2DPG, so that monopole
samples can be produced from a highly configurable JSON configuration. A new BSM folder is also created to contain the future generators of the newly created PAG.
Two production modes are available at the moment, selected by "mode":

  • schwinger — a monopole/antimonopole pair, back-to-back in the pair rest frame, as produced
    by the Schwinger mechanism in the field of an ultraperipheral heavy-ion collision. The default
    spectrum is Maxwell–Jüttner, dN/dp ∝ p² exp(-√(p²+m²)/T) with T = 18.37 GeV, obtained from an
    unbinned maximum-likelihood fit to the reference PbPb HepMC samples. @igor Ostrovskiy if you could check this specific part it would be highly appreciated. The temperature was fitted from your data, but if you have a specific value I can just set it there.
  • single — independent single monopoles, charge sign fixed or random.

The idea is that in the future people could add more simulation modes by using the same external generator.
Every quantity — mass, magnetic charge, multiplicity, momentum, direction, azimuth, vertex, recoil —
is a value spec: a fixed number, a weighted list, or a draw from uniform, loguniform, gaus,
exp, powerlaw, poisson, thermal or an arbitrary formula (any TFormula), with optional
truncation, "integer": true and "sampleOnce": true. Non-analytic shapes are drawn from a
tabulated inverse CDF built once at startup. The momentum magnitude can be given as p, pt,
ekin or etot and the direction as eta, y, theta or costheta. Unknown JSON keys will cause an error during execution, so that the users do not lose time generating with an unwanted configuration.
The transported monopole mass and magnetic charge are transport settings (G4.monopoleMass,
G4.monopoleMagneticCharge) and are read in a different process than the generator, so
it cannot set them. They have to be given on the command line or, as in the ini file here,
in a [G4] section. The generator reads them back and refuses to start when they disagree with its
own configuration (transport.onMismatch: fatal by default, warn, ignore). When the JSON
leaves the mass or the charge open and the transport key was given explicitly, the transport value
is adopted, so a mass scan is one JSON file plus a varying G4.monopoleMass.
I validated the full development using both standalone o2-sim and O2DPG workflows, running multiple pass with various configurations.

@jackal1-66
jackal1-66 requested a review from sawenzel as a code owner November 18, 2026 14:38
@github-actions

Copy link
Copy Markdown

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1
async-2024-PbPb-apass2
async-2023-PbPb-apass5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant