Problem 452

Summary: Ownership of SensDets in external frameworks which integrate G4SD
Product: Geant4 Reporter: schiefer
Component: digits_hitsAssignee: Makoto.Asai
Status: CLOSED DUPLICATE    
Severity: normal CC: alexander.brandt
Priority: P2    
Version: 4.1   
Hardware: PC   
OS: Linux   

Description schiefer 2003-02-03 07:51:18 CET
We are with the ATLAS Collaboration and try to develop a common interface
between a Gaudi AlgTool and a G4VSensitiveDetector class. The AlgTool provides
nothing but runtime instantiation, as we would like to assign SensDets
dynamically at runtime.

The problem we ran into is that the G4SDManager seems to take ownership of the
SDs and deletes them once the G4RunManager terminates. Now, of course, the Gaudi
ToolSvc comes along and wants to do the same thing with the SD as a AlgTool
component, and the second delete causes a segfault.

I wonder if this isn't a very common case, other collaborations integrating G4
code into their frameworks, and if it would not be reasonable to provide a
switch for keeping ownership at some places in the G4 code, probably the SDs are
not the only component where this makes sense.
Comment 1 Makoto.Asai 2003-02-03 09:44:59 CET
*** This bug has been marked as a duplicate of 451 ***
*** 'Makoto.Asai@cern.ch' will be responsible for this bug. ***