Problem 1993 - G4SDStructure does not propagate G4bool warning flag to subdirs
Summary: G4SDStructure does not propagate G4bool warning flag to subdirs
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: digits_hits/detector (show other problems)
Version: 10.3
Hardware: All All
: P4 minor
Assignee: asai
URL:
Depends on:
Blocks:
 
Reported: 2017-07-21 20:10 CEST by Wouter Deconinck
Modified: 2017-08-02 00:07 CEST (History)
0 users

See Also:


Attachments
Patch for G4SDStructure against geant4.10.03.p01 source (437 bytes, patch)
2017-07-21 20:10 CEST, Wouter Deconinck
Details | Diff

Note You need to log in before you can comment on or make changes to this problem.
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