Error reading all requested bytes

I am currently trying to make a simulation to gather calibration data for an HPGe detector by using the rdecay01 example and modifying the geometry and adding a modified stepping file (based off of Physics Matters’ youtube tutorial) to get data about the energy deposition. My simulation runs fine, but with the exception that I get an error when I try to open my generated root file in Root.

root [0]
Attaching file TestCAL.root as _file0...
Error in <TFile::ReadBuffer>: error reading all requested bytes from file TestCAL.root, got 279 of 300
Error in <TFile::Init>: TestCAL.root failed to read the file type data.
(TFile *) nullptr

I do not know how to debug this error; are there any common errors that cause this problem? I have attached the files which I modified/added to the rdecay01 simulation.

ActionInitialization.hh (2.1 KB)
DetectorConstruction.hh (2.7 KB)
EventAction.hh (2.7 KB)
RunAction.hh (2.6 KB)
stepping.hh (391 Bytes)

ActionInitialization.cc (3.0 KB)
DetectorConstruction.cc (4.0 KB)
EventAction.cc (3.4 KB)
RunAction.cc (3.9 KB)
stepping.cc (894 Bytes)

I was able to solve this problem. I had not fully removed the HistoManager source and header files. Within the source file, it seems like the root file is initialized at the beginning. In my adjustments, I had re-initialized it, which I believe lead to a corruption of the file.

I removed the HistoManager files and any references to it, and this worked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.