DUNE / larnd-sim

Simulation framework for a pixelated Liquid Argon TPC
Apache License 2.0
10 stars 26 forks source link

Feature restore association count to store #229

Closed YifanC closed 2 months ago

YifanC commented 2 months ago

This PR mainly tackles that the sync packets backtracking info has "wrong" shape, which breaks the functions of variable ASSOCIATION_COUNT_TO_STORE and MAX_TRACKS_PER_PIXEL. The next thing is that I notice we append a mix of array and list for backtracking information since the results are casted into np.array's at the beginning of save_results, but this change is not essential.

YifanC commented 2 months ago

@krwood Before this fix, the sync packets backtracking information comes with a length of 2* ASSOCIATION_COUNT_TO_STORE while we want it to be MAX_TRACKS_PER_PIXEL. (In Git Issue #227 I've complained that we should modify how we make these arrays, so it would be clearer what it represents.) It worked only because we happen to set ASSOCIATION_COUNT_TO_STORE=10 and MAX_TRACKS_PER_PIXEL=20. It will not cast a non-regular shaped list to array unless its datatype is object (https://github.com/DUNE/larnd-sim/blob/40395800933ec9284a0604eba710ad4e2e13f725/larndsim/fee.py#L346-L348). larndsim would not run without a fix like this if ASSOCIATION_COUNT_TO_STORE and MAX_TRACKS_PER_PIXEL are varied. It is verified after this, ASSOCIATION_COUNT_TO_STORE and MAX_TRACKS_PER_PIXEL behave as expected. The current suite of validation plots would not reflect that.