JeffersonLab / japan

Just Another Parity ANalyzer
7 stars 13 forks source link

Bugfix: Correct coda event number in burst (MINOR) #232

Closed wdconinc closed 5 years ago

wdconinc commented 5 years ago

Propagate CODA event number in +=, -= and accumulators

In particular, try to find the smallest non-zero CODA event number. This means that now

mul->Scan("CodaEventNumber")
burst->Scan("CodaEventNumber")

all return the right result (curiously even the first one was wrong since it returned the CODA event number of the first POSITIVE helicity event).

Possibly related to #217 in a sense that the reason why mps_counter is set to the value at the first positive helicity windows is the same as here. We only set some variables when we execute operator=. The order of operations for helicity pattern quantities is operator= on first positive helicity, operator+= on all the next, then operator= on the first negative, operator+= on all the next, then Sum, Difference on the positive and negative, which does operator= on the positive and then operator+= or operator-= on the negative. In short, first positive is what ends up getting assigned... tl;dr, use CodaEventNumber instead of mps_counter.

At this point only CODA event number is propagated correctly, so event type, scan data, clean data, etc, including the quantities in QwHelicity will still be incorrect.