Open RasmusOrsoe opened 2 months ago
Just a minor comment/warning in _find_photons_for_merging
: the time windows are assumed to begin at the start of the first pulse/photon, which can lead to some bias. In data, the start time can be between 0 and merge_window
ns before the first pulse because the DAQ is always sampling (well, for our purposes). A second pulse that comes soon after may not be merged in data, but if the window start time is set to the time of the first pulse it may always be merged.
This PR adds new functionality to
GraphDefinition
that allows it to merge coincident pulses/photons on the same PMT within somemerge_window
if themerge_coincident
argument is set toTrue
(defaults toFalse
). The merging is charge-weighted if charge is available in the input data.To avoid having to pass arguments to the
GraphDefinition
, the names of the time and charge columns are created asDetector
properties, and this PR adds the property for all existingDetector
s.Here's an example:
The corresponding output is
As you can see, the two first rows and the last two rows in the original data is same-pmt pulses (first is less than 2 ns apart and second is more than 6 ns apart). Because we chose a merging window of 4.5ns, only the first same-pmt pulses are merged.