From dab2ced1e444811661c5da6051177bdc643218f1 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 10 Mar 2024 20:23:24 -0500 Subject: [PATCH] support MT in magnetic field --- DDG4/python/DDSim/DD4hepSimulation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DDG4/python/DDSim/DD4hepSimulation.py b/DDG4/python/DDSim/DD4hepSimulation.py index 49be47eae..ca4039467 100644 --- a/DDG4/python/DDSim/DD4hepSimulation.py +++ b/DDG4/python/DDSim/DD4hepSimulation.py @@ -533,7 +533,10 @@ def run(self): def __setMagneticFieldOptions(self, geant4): """ create and configure the magnetic tracking setup """ - field = geant4.addConfig('Geant4FieldTrackingSetupAction/MagFieldTrackingSetup') + if self.numberOfThreads > 1: + seq, field = geant4.addDetectorConstruction("Geant4FieldTrackingConstruction/MagFieldTrackingSetup") + else: + field = geant4.addConfig('Geant4FieldTrackingSetupAction/MagFieldTrackingSetup') field.stepper = self.field.stepper field.equation = self.field.equation field.eps_min = self.field.eps_min