Skip to content

Commit c75ab97

Browse files
Add simulation flag in HitReader to bypass criteria for a hit in simulation.
1 parent 303d2f3 commit c75ab97

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit

reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/HitReader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ public class HitReader {
1212

1313
private ArrayList<Hit> _AHDCHits;
1414
private ArrayList<TrueHit> _TrueAHDCHits;
15+
private boolean sim = false;
1516

16-
public HitReader(DataEvent event, AlertDCDetector detector, boolean simulation) {
17+
public HitReader(DataEvent event, AlertDCDetector detector, boolean simulation) {
18+
sim = simulation;
1719
fetch_AHDCHits(event, detector);
1820
if (simulation) fetch_TrueAHDCHits(event);
1921
}
@@ -52,7 +54,7 @@ public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) {
5254
double ped_max = rawHitCuts[7];
5355
//System.out.println("t_min : " + t_min + " t_max : " + t_max + " tot_min : " + tot_min + " tot_max : " + tot_max + " adc_min : " + adc_min + " adc_max : " + adc_max + " ped_min : " + ped_min + " ped_max : " + ped_max);
5456
// Apply these cuts
55-
if ((adc >= adc_min) && (adc <= adc_max) && (leadingEdgeTime >= t_min) && (leadingEdgeTime <= t_max) && (timeOverThreshold >= tot_min) && (timeOverThreshold <= tot_max) && (adcOffset >= ped_min) && (adcOffset <= ped_max)) {
57+
if (((adc >= adc_min) && (adc <= adc_max) && (leadingEdgeTime >= t_min) && (leadingEdgeTime <= t_max) && (timeOverThreshold >= tot_min) && (timeOverThreshold <= tot_max) && (adcOffset >= ped_min) && (adcOffset <= ped_max)) || sim) {
5658
// Retrieve others CCDB
5759
double[] timeOffsets = CalibrationConstantsLoader.AHDC_TIME_OFFSETS.get( key_value );
5860
double[] time2distance = CalibrationConstantsLoader.AHDC_TIME_TO_DISTANCE.get( 10101 ); // the time to distance table has only one row ! (10101 is its only key)

0 commit comments

Comments
 (0)