Dear colleagues, It seems that there is an issue with writing ROOT files in G4AnalysisManager. When updating the TTree in ROOT files generated by GEANT4, I faced the following situation: - ROOT reported memory allocation problems and crashed. - The ROOT File was corrupted and not readable anymore. I traced the issue down with the ROOT developers. The ROOT developers think that in G4AnalysisManager the list of free blocks is not set correctly. The evidence found by the ROOT developers is that by opening and closing the ROOT files the number of free blocks is modified (see below). After opening and closing the ROOT file without modifying it, my problems with memory and ROOT file corruption updating the TTree disappear. TFile *file = new TFile("Cu_Bremsstrahlung.root","UPDATE") gFile->GetListOfFree()->ls() OBJ: TList TList Doubly linked list : 0 Free Segment: 4616147 4616212 Free Segment: 64 2000000000 file->Close() TFile *file = new TFile("Cu_Bremsstrahlung.root","UPDATE") gFile->GetListOfFree()->ls() OBJ: TList TList Doubly linked list : 0 Free Segment: 4616347 2000000000 I should mention that I close the file properly with the G4AnalysisManager: G4AnalysisManager* analysisManager = G4AnalysisManager::Instance(); analysisManager->SetVerboseLevel(4); analysisManager->Write(); analysisManager->CloseFile(); Best regards, Christian
The problem was identified in g4tools and is under investigation now by the author. The fix should be available in a short time.
The fix is now available in tools 1.7.0 and 1.4.4, see: http://softinex.lal.in2p3.fr/download/g4tools/ and it is included in the Geant4 development version and proposed for testing. It will be then included in the next Geant4 release (10.00) and the next patch for 9.6 version. Best regards,