diff --git a/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java b/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java index 895faeb015..43e97be033 100644 --- a/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java +++ b/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java @@ -79,6 +79,10 @@ public void setTot(int tot) { public double getTime() { return time; } + + public double getStartTime() { + return this.startTime; + } public void setTime(double time) { this.time = time; diff --git a/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/HitFinder.java b/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/HitFinder.java index 20e1864234..c0b2a0830f 100644 --- a/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/HitFinder.java +++ b/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/HitFinder.java @@ -5,6 +5,7 @@ import org.jlab.geom.base.Detector; import org.jlab.io.base.DataBank; import org.jlab.io.base.DataEvent; +import org.jlab.rec.alert.constants.CalibrationConstantsLoader; /** * The {@code HitFinder} class finds hits in the atof. @@ -124,12 +125,18 @@ public void findHits(DataEvent event, Detector atof, float startTime) { //Matching the hits: if same module and different order, they make up a bar hit if (this_hit_up.matchBar(this_hit_down)) { //Bar hits are matched to ahdc tracks and listed - if (countMatches > 0) { - //If the up hit was already involved in a match, do not make an additionnal match - //Chosing to ignore double matches for now because it happened for <1% of events in cosmic runs - continue; - } BarHit this_bar_hit = new BarHit(this_hit_down, this_hit_up); + int key = this_hit_up.getSector()*10000 + this_hit_up.getLayer()*1000 + this_hit_up.getComponent()*10;//Order does not matter (t0 computed from time sum) + double[] timeOffsets = CalibrationConstantsLoader.ATOF_TIME_OFFSETS.get(key); + double meanTime = timeOffsets[0]; + double sigmaTime = Math.abs(timeOffsets[3]); + //Cuts for bar time sum are derived correcting with FD electrons + //So we need to move the cut to be centered at the same startTime for FT electron events + //For now, we will just keep all FT electron events even if out of time + if(this_hit_up.getStartTime()!=-1000 && this_hit_up.getStartTime()!=0){ + if(2*this_bar_hit.getTime() > meanTime + 5*sigmaTime) continue; + if(2*this_bar_hit.getTime() < meanTime - 3*sigmaTime) continue; + } this.barHits.add(this_bar_hit); countMatches++; }