int sum in get_median_slice() need to be double sum to get the correct half of the cumulative frequency. for example, If the sum is 1 (basically only one count in the middle of the histogram) and it is still an integer, sum/2 would be 0, and the median calculation will results always the beginning of the histogram no matter where one count is...
Initial iblk needs to be 4 to remove 1st block from all 4 DDA boards since the IRS number format is like below
[1st blk in DDA1, 1st blk in DDA2, 1st blk in DDA3, 1st blk in DDA4, 2nd blk in DDA1, 2ndblk in DDA2, 2ndblk in DDA3, 2ndblk in DDA4, ...]
If Initial iblk is 1, It will remove only 1st blk in DDA1
int sum
inget_median_slice()
need to bedouble sum
to get the correct half of the cumulative frequency. for example, If thesum
is 1 (basically only one count in the middle of the histogram) and it is still an integer,sum/2
would be 0, and the median calculation will results always the beginning of the histogram no matter where one count is...Initial
iblk
needs to be 4 to remove 1st block from all 4 DDA boards since the IRS number format is like below [1st blk in DDA1, 1st blk in DDA2, 1st blk in DDA3, 1st blk in DDA4, 2nd blk in DDA1, 2ndblk in DDA2, 2ndblk in DDA3, 2ndblk in DDA4, ...] If Initialiblk
is 1, It will remove only 1st blk in DDA1