Problem 1908 - G4MultipleSensitiveDetector does not handle correctly some corner cases
Summary: G4MultipleSensitiveDetector does not handle correctly some corner cases
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: digits_hits/detector (show other problems)
Version: 10.2
Hardware: All All
: P4 minor
Assignee: Andrea Dotti
URL:
Depends on:
Blocks:
 
Reported: 2016-11-11 00:19 CET by Andrea Dotti
Modified: 2016-11-15 23:08 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Andrea Dotti 2016-11-11 00:19:40 CET

    
Comment 1 Andrea Dotti 2016-11-11 00:20:20 CET
There is a corner case not handled correctly, if two logical volumes have the same name, and each has multipleSD attached to it, the names of the multiSDs will be the same causing an overwrite in the SD structure.

Also I am not 100% sure the handling of names is correct, and I think that in case multipleSD are used they are registered multiple times:



Why I did not see warnings that should be spit out in my tests?
Comment 2 Andrea Dotti 2016-11-11 00:21:06 CET
G4VUserDetectorConstruction::SetSensitiveDetector(  ) {
    G4SDManager GetSDMpointer()->AddNewDetector(aSD);  (1)
    [...]
         msd->AddSD(aSD);   This contains the same line (1)
}
Comment 3 Andrea Dotti 2016-11-11 00:21:31 CET
Please ignore the split of this bug-report in several messages
Comment 4 Andrea Dotti 2016-11-15 23:08:02 CET
Current code checks for adding of the same pointer to the tree of SDs. If pointer is already there nothing happens, while a warning is emitted only if a new SD with an already seen name is added.

However current implementation of MultiSD does not allow to share the same SD instance between different LogVols, so I will implement a change that does not add the SD to the manager in the proxy.
In addition the proxy name will include the pointer of the log volume.

Fixed in tags: 
digits_hits-V10-02-09 and run-V10-02-38