Skip to content

Commit 0bb5884

Browse files
committed
assigning geant4 run number from gemc options
1 parent 33b109f commit 0bb5884

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

gemc/eventDispenser/eventDispenser.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
// geant4
1717
#include "G4UImanager.hh"
18+
#include "G4RunManager.hh"
1819

1920
using namespace std;
2021

@@ -180,6 +181,9 @@ int EventDispenser::processEvents() {
180181
}
181182

182183
log->info(1, "Starting run ", runNumber, " with ", nevents, " events.");
184+
// Tag the next G4Run with this run number. Guarded because standalone/unit-test
185+
// contexts (e.g. the event_dispenser example) may run without a G4RunManager.
186+
if (G4RunManager* g4rm = G4RunManager::GetRunManager()) { g4rm->SetRunIDCounter(runNumber); }
183187

184188
// Dispatch all events for this run in a single call.
185189
// The command string is a standard Geant4 UI command: \c /run/beamOn <N>.

releases/0.3.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This version includes:
99
- Volume inspection from the geometry tree
1010
- Geometry-tree right panel redesign: sticky style buttons, expanding parameters box, system-aware visibility
1111
- Unified `value*unit` notation for `gparticle` kinematic fields
12+
- `digitization_variation` option to override the gsystem variation for digitization constants/tables
1213
- `GEMC_PLUGIN_PATH` and `-plugin_path` for external plugin discovery
1314
- Pre-parse plugin options hook for dynamic plugin option registration
1415
- Clearer command-line help: reviewed every module's option/switch help, added usage examples, and
@@ -501,6 +502,13 @@ Both x86_64 and ARM64 platforms are supported.
501502
(`gsystem`, selects the geometry/conditions variation) versus `run` (`eventDispenser`, the run number
502503
assigned to generated events and the key used with `-run_weights`); both descriptions and help now
503504
cross-reference each other and the automatic Geant4 `g4runno`.
505+
- Added a `digitization_variation` option (defined by the `gdynamicdigitization` module) that overrides the
506+
per-system `gsystem` variation used when digitization routines load their calibration constants and
507+
translation tables. When unset (the default), each routine follows the variation of the `gsystem` it
508+
belongs to, resolved per digitization name at geometry load in `loadDigitizationPlugins()`; when set, the
509+
override applies to every routine. The resolved variation is stored on each `GDynamicDigitization` routine
510+
and passed to `loadConstants()`/`loadTT()`. This also fixes the variation reaching those calls, which
511+
previously defaulted to an empty string because `EventDispenser`'s variation member was never assigned.
504512
- Removed the unused `checkOverlaps` switch from `g4system`: it was registered and shown in help but
505513
never read. Overlap checking is controlled solely by the integer `check_overlaps` option, whose
506514
value `1` already enables the `G4PVPlacement` surface overlap check (`pSurfChk`) at volume placement;

0 commit comments

Comments
 (0)