[Halld-mc] bug fix against G4.10.04.p02 for opticalPhoton tracking

Richard Jones richard.t.jones at uconn.edu
Sat Nov 24 10:48:18 EST 2018


Dear Gabriele,

I would like to submit a basic bug fix for G4.10.04.p02
G4ParallelWorldProcess method StartTracking in G4ParallelWorldProcess.cc.
The bug is that opticalPhoton particles (Cerenkov radiation in the
particular case I am studying) are assigned the incorrect speed of
propagation on the first step if they are generated in a mass-containing
volume in a parallel geometry, and layered mass geometry is turned on.
Under these conditions, the opticalPhoton travels at the wrong speed of
light for the first step (corresponds to the volume on the default mass
layer), after which it undergoes OpBoundary process and the speed for all
following steps is computed for the correct medium. Only the first step is
problematic. But this is a big problem in the case of a DIRC, where the
first step can be 1 m or more in length. I am a developer of the simulation
for the GlueX experiment at Jefferson Lab, which is using one of the
original DIRC detectors from BaBar. My proposed patch follows below. It
only affects the algorithm if layered_mass_geometry is turned on. The
"layered mass geometry" feature was introduced in G4.9.6, and is essential
for the GlueX geometry description.

-Richard Jones, University of Connecticut

*** G4ParallelWorldProcess.cc-orig Sat Nov 24 06:44:43 2018
--- G4ParallelWorldProcess.cc Sat Nov 24 06:44:12 2018
***************
*** 151,156 ****
--- 151,162 ----
    {
      G4StepPoint* realWorldPostStepPoint =
trk->GetStep()->GetPostStepPoint();
      SwitchMaterial(realWorldPostStepPoint);
+     G4StepPoint *realWorldPreStepPoint =
trk->GetStep()->GetPreStepPoint();
+     SwitchMaterial(realWorldPreStepPoint);
+     G4double velocity = trk->CalculateVelocity();
+     realWorldPostStepPoint->SetVelocity(velocity);
+     realWorldPreStepPoint->SetVelocity(velocity);
+     trk->SetVelocity(velocity);
    }
    *(fpHyperStep->GetPreStepPoint()) = *(fpHyperStep->GetPostStepPoint());
  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/halld-mc/attachments/20181124/6d8a6d54/attachment.html>


More information about the Halld-mc mailing list