FairShip supports a wide range of primary event generators, each targeting a distinct physics programme of the SHiP experiment. All generators plug into the sameDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ShipSoft/FairShip/llms.txt
Use this file to discover all available pages before exploring further.
FairPrimaryGenerator interface so that Geant4 receives a consistent list of primary particles regardless of how they were produced. The active generator is selected by a flag or subcommand passed to macro/run_simScript.py; at most one primary generator may be active in a single run, though --EvtGenDecayer can be layered on top of any of them.
Pythia8 (--Pythia8)
Pythia8 is the default generator and underpins the three main hidden-particle signal modes. The beam momentum is 400 GeV and the target is a proton. The concrete Pythia8 generator class depends on the scenario:
- HNL signal
- Dark photon
- Charm-only
HNLPythia8Generator produces heavy neutral leptons from charm or beauty hadron decays. The ProcessLevel:all = off setting disables Pythia8’s own showering so that only the HNL decay kinematics are generated; Geant4 handles all subsequent propagation.-f or the inputFile default), re-decays the heavy hadrons in Pythia8, and applies geometric acceptance cuts based on the decay volume aperture.Production and decay couplings can be set independently for acceptance studies:-A inclusive flag reference
| Value | Generator class | Physics |
|---|---|---|
c | HNLPythia8Generator | ccbar→HNL (default) |
b | HNLPythia8Generator | bbbar→HNL |
bc | HNLPythia8Generator | Bc⁺/Bc⁻→HNL |
meson | DPPythia8Generator | Meson decay → DP |
pbrem | DPPythia8Generator | Proton bremsstrahlung → DP |
qcd | DPPythia8Generator | ff̄ → DP (PDG ID 4900023) |
inclusive | HNLPythia8Generator | All processes |
Pythia6 (--Pythia6)
The legacy Pythia6 generator (tPythia6Generator) simulates 50 GeV gamma/muon interactions on a neutron target. It is provided for backward compatibility with older production workflows. The interaction vertex is placed at the downstream edge of the muon shield.
EvtGen decayer (--EvtGenDecayer)
--EvtGenDecayer is not a standalone generator but an overlay that replaces Pythia8’s internal decayer for J/ψ and other quarkonium resonances with EvtGen’s TEvtGenDecayer. It activates DecayConfigTEvtGen.C and can be combined with any primary generator:
--EvtGenDecayer overrides any earlier SetPythiaDecayer call, including those made by the GENIE mode. It should be the last decayer-related flag processed.EventCalc (--evtcalc)
EventCalc is an external event generator that produces physics events in a text-based .dat format. FairShip converts these to ROOT with macro/convertEvtCalc.py and then reads them with EvtCalcGenerator.
The generator calls EvtCalcGenerator.SetPositions(zTa, zDV) to correctly position events relative to the target (zTa) and the decay volume front face (zDV). When -n -1 is given, all events in the file are processed.
GENIE neutrino interactions (Genie subcommand)
GENIE events are read from a pre-produced GENIE output ROOT file via GenieGenerator. The subcommand form must be used:
Start z position (cm) for distributing neutrino interaction vertices.
End z position (cm) for neutrino interaction vertex distribution.
gst TTree from the GENIE input is copied to sim_{tag}.root so that neutrino truth information is preserved alongside the Geant4 hits. GENIE configuration helpers live in python/configGenieGenerator.py. The Pythia decayer is set to DecayConfigNuAge.C for this mode.
Particle gun (PG subcommand)
The particle gun is activated with the PG positional subcommand. It is most useful for acceptance studies, detector calibration, and geometry validation runs.
Muon background (--MuonBack)
The muon background generator reads muon tracks from a file produced by a previous full Pythia8+Geant4 run with enhanced charm production:
PlaneHAPoint branch) and adjusts the target z offset accordingly. The --FastMuon flag restricts transport to muons only, while --FollowMuon additionally makes the muon shield active for muon tracking studies.
Fixed target (macro/run_fixedTarget.py)
For minimum-bias inclusive production studies, a dedicated script is available:
| Argument | Meaning |
|---|---|
-n NEVENTS | Number of events |
-e ENERGY | Beam energy in GeV |
-r RUNNR | Run number (sets output directory) |
FixedTargetGenerator can also be activated within run_simScript.py via --FixedTarget. The z-offset of the interaction point relative to the target front face is controlled by --z-offset (default −84 mm).
HNL physics module (python/hnl.py)
The HNL class provides lifetime and branching-ratio calculations that the Pythia8 generator uses to weight events correctly:
ROOT.TDatabasePDG and CKM matrix elements to compute partial widths for all kinematically open channels. The True argument enables verbose output during initialisation.
Dark photon physics module (python/darkphoton.py)
The DarkPhoton class interpolates the PDG hadronic R-ratio table to compute the partial width into hadrons and the total production cross section as a function of centre-of-mass energy:
python/dpProductionRates.py module handles meson-decay and proton-bremsstrahlung production rates used by DPPythia8Generator during event generation.