I am trying to use Root5 with Geant4. In general, I would like to store the simulated data from Geant4 in Root format. However, I’ve got a problem. It happens when I am trying to open A ROOT file. It seems, like ROOT file does not created when I am doing so. I am sending appropriate files of the program, as well as output from executable code. This problem occurred after upgrading ROOT from version 5.11.06 to 5.12.00. I am not sure that I did not have the same problem with previous version, however the program was in working condition and, at least, I could open the Root file and store the data.
I would be appreciated for any help.
August 4, 2006
tamuRDM.tar.gz (6.94 KB)
You have a quite complex logic to open the file and create the Tree.
This logic is difficult to follow without executing the code.
However, I note these messages/warnings in your output file:
[code]----> The Root File Name originally was: outputTree.root
----> The Root File Name has been changed to: Bi207bck_250.root
=============>> tamuDataCollection 3 :
=============>> tamuDataCollection 3 0 :
Couldn’t open ROOT file: Bi207bck_250.root
Thank you for very fast reply. I change the name of the root file back to the outputTree.root, however, your suggestion does not solve the problem. Though, you are right about lack of information on the code itself. In this message I put the rest of the missing files. The logic of opening the root file and filling the trees is indeed quite complex. I am not an expert in Root or Geant4, or even C++, so if you would suggest the way how to simplify handling of the root file, I would be appreciated.
P.S. Again, I put also the dump of the GEANT4 output.
tamuRDM.tar.gz (26 KB)
It seems that current version of GEANT4.8.1 and ROOT5.12.00 do not like pointers to the TFile objects. I used to create a pointer to the TFile object within one part of the code that is responsible for the handling of the output data from GEANT4 simulations and then use this pointer in some other part of the code. Now, I rewrite the code, where I specified TFile object as a global variable. Of course this is reduce flexibility of the code, however I have got “working” version of the simulation program. The modified version of the code (tamuDataCollection.cc and tamuDataCollection.hh) is included in this message. I would be appreciated if someone could suggest a better solution to mentioned problem.
August 8, 2006
tamuRDM.tar.gz (35.9 KB)
Nowhere in your code, I see a line opening your dataFile.