|
5 | 5 | import org.jlab.geom.base.Detector; |
6 | 6 | import org.jlab.io.base.DataBank; |
7 | 7 | import org.jlab.io.base.DataEvent; |
| 8 | +import org.jlab.rec.alert.constants.CalibrationConstantsLoader; |
8 | 9 |
|
9 | 10 | /** |
10 | 11 | * The {@code HitFinder} class finds hits in the atof. |
@@ -124,12 +125,18 @@ public void findHits(DataEvent event, Detector atof, float startTime) { |
124 | 125 | //Matching the hits: if same module and different order, they make up a bar hit |
125 | 126 | if (this_hit_up.matchBar(this_hit_down)) { |
126 | 127 | //Bar hits are matched to ahdc tracks and listed |
127 | | - if (countMatches > 0) { |
128 | | - //If the up hit was already involved in a match, do not make an additionnal match |
129 | | - //Chosing to ignore double matches for now because it happened for <1% of events in cosmic runs |
130 | | - continue; |
131 | | - } |
132 | 128 | BarHit this_bar_hit = new BarHit(this_hit_down, this_hit_up); |
| 129 | + 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) |
| 130 | + double[] timeOffsets = CalibrationConstantsLoader.ATOF_TIME_OFFSETS.get(key); |
| 131 | + double meanTime = timeOffsets[0]; |
| 132 | + double sigmaTime = Math.abs(timeOffsets[3]); |
| 133 | + //Cuts for bar time sum are derived correcting with FD electrons |
| 134 | + //So we need to move the cut to be centered at the same startTime for FT electron events |
| 135 | + //For now, we will just keep all FT electron events even if out of time |
| 136 | + if(this_hit_up.getStartTime()!=-1000 && this_hit_up.getStartTime()!=0){ |
| 137 | + if(2*this_bar_hit.getTime() > meanTime + 5*sigmaTime) continue; |
| 138 | + if(2*this_bar_hit.getTime() < meanTime - 3*sigmaTime) continue; |
| 139 | + } |
133 | 140 | this.barHits.add(this_bar_hit); |
134 | 141 | countMatches++; |
135 | 142 | } |
|
0 commit comments