Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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++;
}
Expand Down