Parallel world detector steps refer to main world

I’m following the instructions at http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/ForApplicationDeveloper/BackupVersions/V10.5-2.0/html/Detector/parallelWorld.html to build a parallel world volume and assign a sensitive detector. This is working partially, in that the sensitive detector I have assigned to a volume in my parallel world is getting hits. BUT the behavior does not match the description on the developer’s guide in two important ways:

  1. Particles are not stopping (i.e. starting a new G4Step) at parallel world boundaries.
  2. The G4Step* received by the G4VSensitiveDetector::ProcessHits function refers to the main world, not the parallel world, verified by simply looking at the associated volume names

Any suggestions on what to look for to debug this? Some extra step I need to take that is not documented in the referred guide?

Many thanks,
~Ben

Hi,
Could you please set
/tracking/verbose 1
and see if there actually are steps hitting to your parallel world volume that has the detector?
Makoto

Hi,

My problem turned out to be that I was getting the step indirectly. My custom THit class took a G4Track for its constructor, then called track->GetStep() to get step-related information, but the step returned there was for the current tracking world. The step received by the parallel world sensitive detector did in fact have the correct information.

In hindsight it’s obvious that step->GetTrack()->GetStep() != step for the parallel world…

Thank you for following up on this!