Vindaar / TimepixAnalysis

Contains code related to calibration and analysis of Timepix based detector + CAST related code
MIT License
19 stars 6 forks source link

Generalize RootToHDF5 script #43

Closed Vindaar closed 9 months ago

Vindaar commented 4 years ago

The RootToHdf5 python script created from https://github.com/Vindaar/TimepixAnalysis/blob/master/CDL-RootToHdf5/CDL-toH5_likelihood.py in #40 is still specific to the Marlin ROOT trees to some extent, since we map all data types to float except X/YCoordinateVector, which we map to variable length uint8 and the charge vectors to uint16.

We instead have to extract the data types and shapes from the ROOT tree directly and then create the appropriate dataset with the correct shape, read the whole datasets and write them in one go. Instead of currently iterating field by field, which is super slow (which was implemented back when we had a different goal in mind for this script, namely only extract certain fields).

Vindaar commented 9 months ago

It's as general as it is going to get. I have no interest in working on that further. When needed I would just code up a few lines in Nim using the ROOT wrapper and nimhdf5. Much quicker and easier to implement for me. :man_shrugging: