jacg / explore-G4

Monte Carlo simulation of PET scanner design
2 stars 3 forks source link

Waveform writer #7

Closed jmbenlloch closed 3 years ago

jmbenlloch commented 3 years ago

This PR adds a writer for two tables:

There are no tests included yet.

I'm also trying to use a G4GenericMessenger to read the output file name from the config file, without any success yet. Maybe that config management could go in a different PR?

jacg commented 3 years ago

The config management /G4GenericMessenger business is a minor detail that can be done once the dust settles a bit. Far more important, and more difficult to solve, is the lack of tests.

These need to be done on a few different levels:

[*] I'm still not 100% convinced that we want a separate method for each dataset. I've already reduced the boilerplate copy-paste which was present in them (I'll push this, shortly), but they still irk me a bit. Perhaps the little bit of detail they hide is worth their existence. I need to think about it a bit more.

I'm also bothered by the need to keep track of the indices of each dataset. Surely we can get this from hdf5?

[Aside: I'm tempted to entrust the hdf5 interfacing to Rust. Originally I thought that driving G4 from Rust was going to be hopelessly painful. I'm less pessimistic now, especially if we can target nain4 instead of G4. If we get ahead of schedule on the milestone deadlines, I'll be able to give this a bit more thought. If it works, the idea will be to do pretty much everything on the Rust side.]