Skip to content

Commit f1e783c

Browse files
author
Churamani Paudel
committed
AHDC: fail fast when calibration constants missing
1 parent a6b77a1 commit f1e783c

File tree

1 file changed

+28
-6
lines changed
  • reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit

1 file changed

+28
-6
lines changed

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

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) {
6060
// -----------------------------
6161
// Raw hit cuts
6262
// -----------------------------
63-
double[] rawHitCuts = CalibrationConstantsLoader.AHDC_RAW_HIT_CUTS.get(key_value);
64-
if (rawHitCuts == null) continue;
63+
// double[] rawHitCuts = CalibrationConstantsLoader.AHDC_RAW_HIT_CUTS.get(key_value);
64+
//if (rawHitCuts == null) continue;
6565

66+
67+
double[] rawHitCuts = CalibrationConstantsLoader.AHDC_RAW_HIT_CUTS.get(key_value);
68+
if (rawHitCuts == null) {throw new IllegalStateException("Missing CCDB table /calibration/alert/ahdc/raw_hit_cuts for key=" + key_value+ " (check run/variation + key mapping)");
69+
}
70+
6671
double t_min = rawHitCuts[0];
6772
double t_max = rawHitCuts[1];
6873
double tot_min = rawHitCuts[2];
@@ -75,11 +80,28 @@ public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) {
7580
// -----------------------------
7681
// Time calibration + t->d
7782
// -----------------------------
78-
double[] timeOffsets = CalibrationConstantsLoader.AHDC_TIME_OFFSETS.get(key_value);
79-
if (timeOffsets == null) continue;
83+
//double[] timeOffsets = CalibrationConstantsLoader.AHDC_TIME_OFFSETS.get(key_value);
84+
//if (timeOffsets == null) continue;
85+
86+
// double[] timeOffsets = CalibrationConstantsLoader.AHDC_TIME_OFFSETS.get(key_value);
87+
//if (timeOffsets == null) {
88+
//throw new IllegalStateException("Missing AHDC time_offsets for key=" + key_value);
89+
//}
90+
91+
double[] timeOffsets = CalibrationConstantsLoader.AHDC_TIME_OFFSETS.get(key_value);
92+
93+
if (timeOffsets == null) {
94+
throw new IllegalStateException("Missing CCDB /calibration/alert/ahdc/time_offsets for key=" + key_value + " (check run/variation + key mapping)");
95+
}
96+
97+
98+
99+
double[] time2distance = CalibrationConstantsLoader.AHDC_TIME_TO_DISTANCE.get(key_value);
100+
if (time2distance == null) { throw new IllegalStateException("Missing CCDB table /calibration/alert/ahdc/time_to_distance for key=" + key_value+ " (check run/variation + key mapping)");
101+
}
80102

81-
double[] time2distance = CalibrationConstantsLoader.AHDC_TIME_TO_DISTANCE.get(10101);
82-
if (time2distance == null) continue;
103+
// double[] time2distance = CalibrationConstantsLoader.AHDC_TIME_TO_DISTANCE.get(10101);
104+
// if (time2distance == null) continue;
83105

84106
double t0 = timeOffsets[0];
85107

0 commit comments

Comments
 (0)