Skip to content

Commit 0897d59

Browse files
N-Plxtongtongcao
authored andcommitted
1004 atof bar hits noise rejection (#1007)
* feat: adding cut on bar time sum for events for which the start time is defined * feat: changing cut to fixed 40ns around bar time sum mean
1 parent 912638d commit 0897d59

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public class ATOFHit {
2626
private String type;
2727
private boolean isInACluster;
2828
private int associatedClusterIndex;
29+
private double meanTimeAligned;
2930
int idTDC;
31+
3032

3133
public int getSector() {
3234
return sector;
@@ -79,6 +81,14 @@ public void setTot(int tot) {
7981
public double getTime() {
8082
return time;
8183
}
84+
85+
public double getStartTime() {
86+
return this.startTime;
87+
}
88+
89+
public double getMeanTimeAligned(){
90+
return this.meanTimeAligned;
91+
}
8292

8393
public void setTime(double time) {
8494
this.time = time;
@@ -198,12 +208,12 @@ public final int convertTdcToTime() {
198208
//Time offsets
199209
double[] timeOffsets = CalibrationConstantsLoader.ATOF_TIME_OFFSETS.get(key);
200210
double[] timeOffsetsRef = CalibrationConstantsLoader.ATOF_TIME_OFFSETS.get(referenceModuleKey);
201-
211+
this.meanTimeAligned = timeOffsetsRef[0];
202212
//The names below correspond to the CCDB entries
203213
//They will most probably evolve
204214
//For now let's say t0 is used to store the bar-to-bar and wedge-to-wedge alignments
205215
double t0 = timeOffsets[0];
206-
double tChannelToChannelPhiAlignment = (t0 - timeOffsetsRef[0]);
216+
double tChannelToChannelPhiAlignment = (t0 - this.meanTimeAligned);
207217
if(this.type=="bar up" || this.type=="bar down") //bar alignment is done with the sum of the two times
208218
tChannelToChannelPhiAlignment=tChannelToChannelPhiAlignment/2.;
209219

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@ public class BarHit extends ATOFHit {
2121
public ATOFHit getHitUp() {
2222
return hitUp;
2323
}
24+
25+
/**
26+
* Computes bar time sum and check if it is around
27+
* the value the hits were aligned to. For now,
28+
* 40ns cut. When calibrations are final, it should
29+
* be refined to reflect the resolution.
30+
*
31+
*/
32+
public boolean isInTime() {
33+
double timeShift = 0;
34+
//For FT electron for which the startTime is set at -1000
35+
//We need to shift where the cut is applied
36+
if(this.hitUp.getStartTime()<0) timeShift = 2180;
37+
if(Math.abs(
38+
this.hitUp.getTime()+this.hitDown.getTime()
39+
-timeShift
40+
-this.hitUp.getMeanTimeAligned())
41+
<40)
42+
return true;
43+
return false;
44+
}
2445

2546
public void setHitUp(ATOFHit hit_up) {
2647
this.hitUp = hit_up;

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

Lines changed: 3 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,9 @@ 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+
//Only add bar hits for which the time sum is in time
130+
if(!this_bar_hit.isInTime()) continue;
133131
this.barHits.add(this_bar_hit);
134132
countMatches++;
135133
}

0 commit comments

Comments
 (0)