Problem 1908

Summary: G4MultipleSensitiveDetector does not handle correctly some corner cases
Product: Geant4 Reporter: Andrea Dotti <andrea.dotti>
Component: digits_hits/detectorAssignee: Andrea Dotti <andrea.dotti>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P4    
Version: 10.2   
Hardware: All   
OS: All   

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