Project

General

Profile

Bug #1364

Failure to resize hit list following a conditional remove

Added by Rogers, Chris over 10 years ago. Updated almost 9 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Target version:
-
Start date:
24 October 2013
Due date:
% Done:

0%

Estimated time:

Description

I found an example where the hit list is not resized properly following a call to Bunch::conditional_remove. Code is like:

def tail_cut(bunch_list, n_sigma):
    lengths = [len(bunch) for bunch in bunch_list]
    for bunch in bunch_list:
        bunch.conditional_remove({'pid':2212}, operator.ne)
        length = 0
        while len(bunch) != length:
            length = len(bunch)
            for u in ['x', 'px']:
                sigma = bunch.moment([u, u])**0.5
                mu = bunch.mean([u])[u]
                lb = mu - sigma*n_sigma
                ub = mu + sigma*n_sigma
                bunch.cut({u:lb}, operator.lt)
                bunch.cut({u:ub}, operator.gt)
    lengths = [lengths[i]-len(bunch) for i, bunch in enumerate(bunch_list)]
    print lengths

But when I come to calculate a moment, the moment calculation still includes the hits that were cut. len(bunch) appears to show the correct value, but looking at the loop in bunchcore::get_moment_char I see that XBOA is using an incorrect list size.

#1

Updated by Rogers, Chris almost 9 years ago

  • Status changed from Open to Rejected

No longer relevant

Also available in: Atom PDF