diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/banks/HitReader.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/banks/HitReader.java index ffc03d587..7e9b77cdf 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/banks/HitReader.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/banks/HitReader.java @@ -222,6 +222,7 @@ else if(Constants.getInstance().useOnlyBMTC50PercTruthHits && hit.getType()==BMT * @param omitLayer * @param omitHemisphere * @param status + * @param adcStatus */ public void fetch_SVTHits(DataEvent event, int omitLayer, int omitHemisphere, IndexedTable status, IndexedTable adcStatus) { @@ -246,14 +247,14 @@ public void fetch_SVTHits(DataEvent event, int omitLayer, int omitHemisphere, //This ADC=-1 status is in a ccdb table boolean pass=true; int adcStat = adcStatus.getIntValue("adcstatus", 0, 0, 0); - for (int i = 0; i < rows; i++) { - int ADC = bankDGTZ.getInt("ADC", i); - if(ADCConvertor.isEventCorrupted(ADC, adcStat)==false) { - pass=false; - } - } - if(pass==false) - return; +// for (int i = 0; i < rows; i++) { +// int ADC = bankDGTZ.getInt("ADC", i); +// if(ADCConvertor.isEventCorrupted(ADC, adcStat)==false) { +// pass=false; +// } +// } +// if(pass==false) +// return; //bankDGTZ.show(); // first get tdcs Map tdcs = new HashMap<>(); @@ -348,6 +349,7 @@ public void fetch_SVTHits(DataEvent event, int omitLayer, int omitHemisphere, double E = ADCConvertor.SVTADCtoDAQ(ADC, isMC); if(E==-1) continue; + Strip SvtStrip = new Strip(strip, E, time); SvtStrip.setPitch(SVTGeometry.getPitch()); // get the strip line @@ -365,9 +367,13 @@ public void fetch_SVTHits(DataEvent event, int omitLayer, int omitHemisphere, hit.setId(id); if (Constants.getInstance().flagSeeds) hit.MCstatus = order; - + if(!ADCConvertor.isEventUnCorrupted(ADC, adcStat)) { + hit.isCorrupted=true; + } // add this hit - if(hit.getRegion()!=Constants.getInstance().getRmReg()) { + + if(hit.getRegion()!=Constants.getInstance().getRmReg() + && !hit.isCorrupted) { if(Constants.getInstance().useOnlyMCTruthHits() ) { if(hit.MCstatus==0) hits.add(hit); diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/ADCConvertor.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/ADCConvertor.java index e54e52259..0ea57e58f 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/ADCConvertor.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/ADCConvertor.java @@ -11,7 +11,7 @@ public ADCConvertor() { } - public static boolean isEventCorrupted(int adc, int adcstat) { + public static boolean isEventUnCorrupted(int adc, int adcstat) { boolean pass = true; if(adc==-1 && adc*adcstat==0) //0: event corrupted; -1 event is OK pass=false; diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/Hit.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/Hit.java index 3c7116bb3..296a82605 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/Hit.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/hit/Hit.java @@ -33,6 +33,7 @@ public class Hit implements Comparable { public boolean newClustering = false; public int MCstatus = -1; + public boolean isCorrupted; // constructor public Hit(DetectorType detector, BMTType type, int sector, int layer, Strip strip) {