Problem 1993

Summary: G4SDStructure does not propagate G4bool warning flag to subdirs
Product: Geant4 Reporter: Wouter Deconinck <wdconinc>
Component: digits_hits/detectorAssignee: asai
Status: RESOLVED FIXED    
Severity: minor    
Priority: P4    
Version: 10.3   
Hardware: All   
OS: All   
Attachments: Patch for G4SDStructure against geant4.10.03.p01 source

Description Wouter Deconinck 2017-07-21 20:10:03 CEST
Created attachment 466 [details]
Patch for G4SDStructure against geant4.10.03.p01 source

Summary:
Calling G4SDManager::FindSensitiveDetector(G4String name, G4bool warning) propagates the warning flag to the first level of G4SDStructure::FindSensitiveDetector(name,warning), but inside that function the flag is not passed to the recursive call to G4SDStructure when SDs are organized in directories.

Test scenario:
1. Call G4SDManager::GetSDPointer()->FindSensitiveDetector(name,false) with a name that contains a '/' but a second level name that does not exist yet (e.g. "remoll/det_2001")

Expected behavior:
Calling FindSensitiveDetector(name,false) should not warn when a detector is not found.

Observed behavior:
Regardless of the G4bool warning flag, a warning is generated when the second level SD name is not found.

Reason for behavior:
G4SDStructure::FindSensitiveDetector recursively calls tgtSDS->FindSensitiveDetector(aName) which throws away the flag (default value is true).

Patch attached against geant4.10.03.p01 source.
Comment 1 asai 2017-08-02 00:07:28 CEST
Thank you for spotting the issue. The fix you specified will be included in the next patch release (or 10.4 release if we do not make another patch release soon).
Kind regards,
Makoto