HDF5 file handling

Hi,
I am using the AnalysisManager interface to write some ntuples in hdf5 format. I successfully managed to do so, following example B5, but there are a number of things which are unclear to me:

  1. The ntuples are saved under the directory ‘default_ntuples’. How do I change this name?
  2. From the example (B5) it seems that the only way to write a column of std::vector type is to pass a reference to a std::vector when constructing the tuple and then update this vector at each Event. The update values are automatically written down upon calling AddNtupleRow(). Is this correct? Isn’t there a “FillNTupleXColumn” function to call, instead?
  3. How do I add attributes to my hdf5 file? Is there an interface for doing it through the AnalysisManager?

EDIT: I am using Geant4 10.4.03.

Thanks in advance for any tips!

Any chance of help? I am a bit stuck, especially with point 3.

Hello,

First, my apologies for a delay in answering.

  1. The ntuples are saved under the directory ‘default_ntuples’. How do I change this name?

analysisManager->SetNtupleDirectoryName("newName");

  1. From the example (B5) it seems that the only way to write a column of std::vector type is to pass a reference to a std::vector when constructing the tuple and then update this vector at each Event. The update values are automatically written down upon calling AddNtupleRow(). Is this correct? Isn’t there a “FillNTupleXColumn” function to call, instead?

Your observation is correct; for efficiency reasons there is no “FillNTupleXVectorColumn” function.

Please, note also that all analysis manager functions are described in the Application Developers Guide:
https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Analysis/analysis.html

  1. How do I add attributes to my hdf5 file? Is there an interface for doing it through the AnalysisManager?

There are no functions defined in the analysis manager for this. Could you be more explicit, which attributes would you need to set?

Best regards,