Problem 2222 - OpBoundaryProcess triggers InvokeSD unexpectedly
Summary: OpBoundaryProcess triggers InvokeSD unexpectedly
Status: RESOLVED WORKSFORME
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/optical (show other problems)
Version: 10.6
Hardware: All All
: P4 minor
Assignee: Daren Sawkey
URL:
Depends on:
Blocks:
 
Reported: 2020-01-30 15:30 CET by Daren Sawkey
Modified: 2021-09-14 13:34 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Daren Sawkey 2020-01-30 15:30:26 CET
G4OpBoundaryProcess may be used to trigger the sensitive detector ProcessHits() method, via
/process/optical/boundary/setInvokeSD true
(the default)

It is only expected to be triggered if the boundary status is Detection [1]. However G4OpBoundaryProcess::PostStepDoIt can call the base G4VDiscreteProcess::PostStepDotIt [2] for other boundary statuses, e.g. StepTooSmall. In this case the sensitive detector ProcessHits() is called without the checks on boundary status and whether setInvokeSD is true.

For example, if the setInvokeSD functionality is used with the LXe extended example, by renaming LXePMTSD::ProcessHits_constStep to ProcessHits and removing the code from LXeSteppingAction, we see unwanted calls to ProcessHits. Set 
/process/optical/boundary/verbose 1

This bug report is based on the investigation into another report [3].

[1] https://geant4.kek.jp/lxr/source/processes/optical/src/G4OpBoundaryProcess.cc#L480

[2] https://geant4.kek.jp/lxr/source/processes/optical/src/G4OpBoundaryProcess.cc#L185

[3] https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2131
Comment 1 Daren Sawkey 2021-09-14 13:34:56 CEST
The wls example has been updated for release 11. The example now uses G4OpBoundaryProcess::InvokeSD() and it appears to work well.