DUNE / larnd-sim

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

Light backtracking reshape #201

Closed YifanC closed 9 months ago

YifanC commented 9 months ago

Based on feature branch brussell_light_backtrack.

This change stores truth information in such format, [('trigger_id', 'i4'), ('op_channel_id','i4'), ('tick','i4'), ('event_id','i4'), ('segment_id','i8'), ('pe_current','f8')], where trigger_id, op_channel_id and tick correspond to the index of the light_wvfm dataset which takes the shape of (#light triggers, #light readout channels, #light samples).

It has been tested on one file, MiniRun5_1E19_RHC.convert2h5.00666.EDEPSIM.hdf5, with modular variation activated and deactivated. This test used configuration of setting MAX_MC_TRUTH_IDS to 0, 20, 50, 100, 200 and MC_TRUTH_THRESHOLD to 1. When MAX_MC_TRUTH_IDS = 0, the output file size is about 1GB. With other settings, the output file size is about 1.1GB.

The run time with respect to the setting MAX_MC_TRUTH_IDS can be found in the following graph. Note that the default larndsim/bin/lightLUT.npz is used for this test. Using the light LUT's with finer granularity will increase the run time by a few minutes. run_time_vs_max_track

The plot below shows how many segments contribute to a light waveform per optical channel per trigger. The file size with the different settings indicate that MAX_MC_TRUTH_IDS = 20 may be sufficient, but on the conservative side, I suggest to set it to 50. The detector property yaml files are adjust accordingly. max_track_ids_guide

In addition, I'm showing the negative sum of the truth contribution in pe and ADC/4 in trigger 0 channel 16 as an example. The amplitudes do not match. Perhaps I'm comparing the wrong quantity. It needs to be looked into further. Other than that I think this branch is ready to be merged. MR5_666_tirg0_opchannel16

marjoleinvannuland commented 9 months ago

I think the missing amplitude can be explained by the MC_TRUTH_THRESHOLD value

YifanC commented 9 months ago

@marjoleinvannuland This is the same channel same trigger setting the pe threshold to 0. I think it still doesn't match. MR5_666_tirg0_opchannel16_0pe