Skip to content
Merged
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 @@ -26,7 +26,9 @@ public class ATOFHit {
private String type;
private boolean isInACluster;
private int associatedClusterIndex;
private double meanTimeAligned;
int idTDC;


public int getSector() {
return sector;
Expand Down Expand Up @@ -79,6 +81,14 @@ public void setTot(int tot) {
public double getTime() {
return time;
}

public double getStartTime() {
return this.startTime;
}

public double getMeanTimeAligned(){
return this.meanTimeAligned;
}

public void setTime(double time) {
this.time = time;
Expand Down Expand Up @@ -198,12 +208,12 @@ public final int convertTdcToTime() {
//Time offsets
double[] timeOffsets = CalibrationConstantsLoader.ATOF_TIME_OFFSETS.get(key);
double[] timeOffsetsRef = CalibrationConstantsLoader.ATOF_TIME_OFFSETS.get(referenceModuleKey);

this.meanTimeAligned = timeOffsetsRef[0];
//The names below correspond to the CCDB entries
//They will most probably evolve
//For now let's say t0 is used to store the bar-to-bar and wedge-to-wedge alignments
double t0 = timeOffsets[0];
double tChannelToChannelPhiAlignment = (t0 - timeOffsetsRef[0]);
double tChannelToChannelPhiAlignment = (t0 - this.meanTimeAligned);
if(this.type=="bar up" || this.type=="bar down") //bar alignment is done with the sum of the two times
tChannelToChannelPhiAlignment=tChannelToChannelPhiAlignment/2.;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ public class BarHit extends ATOFHit {
public ATOFHit getHitUp() {
return hitUp;
}

/**
* Computes bar time sum and check if it is around
* the value the hits were aligned to. For now,
* 40ns cut. When calibrations are final, it should
* be refined to reflect the resolution.
*
*/
public boolean isInTime() {
double timeShift = 0;
//For FT electron for which the startTime is set at -1000
//We need to shift where the cut is applied
if(this.hitUp.getStartTime()<0) timeShift = 2180;
if(Math.abs(
this.hitUp.getTime()+this.hitDown.getTime()
-timeShift
-this.hitUp.getMeanTimeAligned())
<40)
return true;
return false;
}

public void setHitUp(ATOFHit hit_up) {
this.hitUp = hit_up;
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,9 @@ 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);
//Only add bar hits for which the time sum is in time
if(!this_bar_hit.isInTime()) continue;
this.barHits.add(this_bar_hit);
countMatches++;
}
Expand Down