Problem 1579

Summary: If Ntuple name is empty AIDA/XML output file is corrupted
Product: Geant4 Reporter: Andrea Dotti <andrea.dotti>
Component: analysisAssignee: Ivana.Hrivnacova
Status: RESOLVED FIXED    
Severity: minor    
Priority: P5    
Version: 10.0   
Hardware: All   
OS: All   

Description Andrea Dotti 2014-02-28 19:28:40 CET
Hello,
this is a minor issue, actually caused by a mis-use of an API. However a protection could be added to analysis module to prevent this. 

The problem is that if user uses an empty string "" for n-tuple name and selects XML format, the output file is corrupted (truncated).
I think that an exception could be thrown just to inform user in such a case.

Here is a way to reproduce the problem:

#include "g4xml.hh"

{
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->SetFileName("BlaBla");
analysisManager->CreateNtuple("", "Hits"); //<<<<<<<<<< Bug!
[...]
}
Comment 1 Ivana.Hrivnacova 2014-03-15 21:30:22 CET
n co
Comment 2 Ivana.Hrivnacova 2014-03-15 21:32:22 CET
Hello,

Thank you for reporting this problem.
We will add a protection against such situation and make it available with the next patch.

Best regards,
Comment 3 Ivana.Hrivnacova 2014-04-16 16:11:49 CEST
The problem is now fixed in the development version and the fix is also provided for the next patch release. Creating objects (h1d, h2d  or ntuple) with empty names is not allowed, a warning will be issued and the object is not created in such case.

Best regards,