Closed russellphysics closed 5 months ago
Hi Brooke @russellphysics, thanks for the PR! I renamed some attributes to be consistent with the rest of the output. Hope you are okay with it. In addition, when I tested this, I encountered some issues.
waveforms_true_track_id.size
will always be greater than 0 as long as max_light_truth_ids is set to a non-zero value. However, truth_data can still be empty due to the filter function you added. When truth_data
is empty, the data appending here or here may raise error.
If I modify waveforms_true_track_id.size
to truth_data.size
here and here correspondingly, it would be fine for non module variation case, but again having error in merge_module_light_wvfm_same_trigger(), because the backtracking size for each module is different (ref).
Another issue is that if module variation is enabled, the det_id
/ op_channel_id
will always be up to the number of single module light channels. Namely, (0, 95) for 2x2, but this det_id
/ op_channel_id
is expected to be global channel id (0, 385) in the current setup.
Consider this two, I wonder if it would be easier if the light backtracking filter is run after the waveform merging for module variation cases. I suppose something after this, which can be used for both module variation and non module variation.
Thanks!
Thank you, Yifan. We recently encountered the same issue of an empty truth_data
container in the process of code profiling. We added an if statement for an empty container to evade this issue.
Regarding the issues on compatibility with running larndsim with module variations enabled, unfortunately we did not validate this code with module variations enabled, rather we only validated with the default configuration in 2x2_sim develop branch. We do not yet have remedy for the first issue and need to take a closer look at the module variation specific function referenced. The final issue noted appears straightforward to remedy by indexing the opdet id based on module under consideration.
Superseded by #201
Light truth backtracking reshaped to suppress null-valued ticks. N-dimensional arrays saved per spill. Apply masks to quickly filter to light truth of interest. Truth fields: 'event_id', 'det_id', 'track_id', 'pe_current', and 'tick'. This implementation was validated on 2x2 production MiniRun 5 edepsim files, verifying on spill, optical detector, and waveform level that information from original backtracking implementation was accurately preserved with new implementation. Example validation attached.![example2](https://github.com/DUNE/larnd-sim/assets/32598683/f5c2b847-98c5-483f-b869-ece19f82be06)