Skip to content

Commit e73febc

Browse files
committed
Fix to DeltaChord for Global and Local field managers
1 parent e74a2e0 commit e73febc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Detectors/gconfig/src/O2MonopolePhysics.cxx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,12 @@ class O2MonopoleTransportation : public G4Transportation
344344
const G4bool previousMoment = G4Transportation::EnableMagneticMoment(true);
345345
auto* previousChordFinder = fieldManager->GetChordFinder();
346346
const G4bool previousChangesEnergy = fieldManager->DoesFieldChangeEnergy();
347+
const G4double previousDeltaChord = mChordFinder->GetDeltaChord();
348+
// Preserve the chord tolerance configured for the active field manager.
349+
// The monopole chord finder is shared by global and local field managers.
350+
if (previousChordFinder != nullptr) {
351+
mChordFinder->SetDeltaChord(previousChordFinder->GetDeltaChord());
352+
}
347353
fieldManager->SetChordFinder(mChordFinder);
348354
// the end kinetic energy and time of flight are then taken from the integrated track
349355
fieldManager->SetFieldChangesEnergy(true);
@@ -353,6 +359,7 @@ class O2MonopoleTransportation : public G4Transportation
353359

354360
fieldManager->SetFieldChangesEnergy(previousChangesEnergy);
355361
fieldManager->SetChordFinder(previousChordFinder);
362+
mChordFinder->SetDeltaChord(previousDeltaChord);
356363
G4Transportation::EnableMagneticMoment(previousMoment);
357364
return length;
358365
}

0 commit comments

Comments
 (0)