diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicitySequence.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicitySequence.java index 603591b1d..ff5b05b7f 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicitySequence.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicitySequence.java @@ -388,6 +388,34 @@ protected final boolean analyze() { return integrity && geninit; } + private final int rejectPairs() { + int n = 0; + for (int ii=0; ii0) { + this.states.get(ii-1).addSwStatusMask(HelicityState.Mask.KILLPAIR); + this.states.get(ii).addSwStatusMask(HelicityState.Mask.KILLPAIR); + n++; + } + } + } + if (this.states.get(0).getPairSync() == HelicityBit.MINUS) { + this.states.get(0).addSwStatusMask(HelicityState.Mask.KILLPAIR); + } + if (this.states.get(this.states.size()-1).getPairSync() == HelicityBit.PLUS) { + this.states.get(this.states.size()-1).addSwStatusMask(HelicityState.Mask.KILLPAIR); + } + return n; + } + /** * Perform integrity checking on the sequence. * @return whether the integrity checking succeeded @@ -461,7 +489,8 @@ else if (seconds > (1.0+0.5)/this.helicityClock) { "\nQUARTET ERRORS: "+quartetErrors+ "\nBIGGAP ERRORS: "+bigGapErrors+ "\nSMALLGAP ERRORS: "+smallGapErrors+ - "\nGENERATOR ERRORS: "+generatorErrors + "\nGENERATOR ERRORS: "+generatorErrors+ + "\nKILLPAIR ERRORS: "+rejectPairs() ); return (hwpErrors+syncErrors+quartetErrors+bigGapErrors+smallGapErrors+generatorErrors) == 0; diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicityState.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicityState.java index 5227d56bf..4b3c5cef9 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicityState.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/helicity/HelicityState.java @@ -25,6 +25,7 @@ public static class Mask { public static final int PATTERN =0x4; public static final int BIGGAP =0x8; public static final int SMALLGAP =0x10; + public static final int KILLPAIR =0x12; } // FIXME: these should go in CCDB