Skip to content

Commit 880b9f0

Browse files
committed
feat: adding cut on bar time sum for events for which the start time is defined
1 parent 02592b5 commit 880b9f0

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ public void setTot(int tot) {
7979
public double getTime() {
8080
return time;
8181
}
82+
83+
public double getStartTime() {
84+
return this.startTime;
85+
}
8286

8387
public void setTime(double time) {
8488
this.time = time;

reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/HitFinder.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.jlab.geom.base.Detector;
66
import org.jlab.io.base.DataBank;
77
import org.jlab.io.base.DataEvent;
8+
import org.jlab.rec.alert.constants.CalibrationConstantsLoader;
89

910
/**
1011
* The {@code HitFinder} class finds hits in the atof.
@@ -124,12 +125,18 @@ public void findHits(DataEvent event, Detector atof, float startTime) {
124125
//Matching the hits: if same module and different order, they make up a bar hit
125126
if (this_hit_up.matchBar(this_hit_down)) {
126127
//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-
}
132128
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+
}
133140
this.barHits.add(this_bar_hit);
134141
countMatches++;
135142
}

0 commit comments

Comments
 (0)