Skip to content

Commit b6c7257

Browse files
raffaelladevitatongtongcao
authored andcommitted
Fixes to bank schema and constants loading (#574)
* adding indexTDC to AI and Dn HBT hit banks * setting default variation at the engine init not to mask variation from yaml
1 parent ae6148d commit b6c7257

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

etc/bankdefs/hipo4/dc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"info": "reconstructed hits using DC wire positions",
77
"entries": [
88
{"name":"id", "type":"S", "info":"id of the hit"},
9-
{"name": "indexTDC", "type":"S", "info":"inex in the bank DC::TDC"},
9+
{"name":"indexTDC", "type":"S", "info":"index in the bank DC::TDC"},
1010
{"name":"status", "type":"S", "info":"id of the hit"},
1111
{"name":"sector", "type":"B", "info":"DC sector"},
1212
{"name":"superlayer", "type":"B", "info":"DC superlayer (1...6)"},
@@ -73,6 +73,7 @@
7373
"info": "reconstructed hits using DC wire positions",
7474
"entries": [
7575
{"name":"id", "type":"S", "info":"id of the hit"},
76+
{"name":"indexTDC", "type":"S", "info":"index in the bank DC::TDC"},
7677
{"name":"status", "type":"S", "info":"id of the hit"},
7778
{"name":"sector", "type":"B", "info":"DC sector"},
7879
{"name":"superlayer", "type":"B", "info":"DC superlayer (1...6)"},

etc/bankdefs/hipo4/dcnn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"info": "reconstructed hits using DC wire positions",
77
"entries": [
88
{"name":"id", "type":"S", "info":"id of the hit"},
9+
{"name":"indexTDC", "type":"S", "info":"index in the bank DC::TDC"},
910
{"name":"status", "type":"S", "info":"id of the hit"},
1011
{"name":"sector", "type":"B", "info":"DC sector"},
1112
{"name":"superlayer", "type":"B", "info":"DC superlayer (1...6)"},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.jlab.io.base.DataEvent;
77
import org.jlab.detector.banks.RawDataBank;
88
import org.jlab.geom.detector.alert.AHDC.AlertDCDetector;
9-
import org.jlab.rec.alert.constants.CalibrationConstantsLoader;
9+
import org.jlab.rec.constants.CalibrationConstantsLoader;
1010

1111
public class HitReader {
1212

reconstruction/alert/src/main/java/org/jlab/rec/constants/CalibrationConstantsLoader.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
package org.jlab.rec.alert.constants;
1+
package org.jlab.rec.constants;
22

33
import org.jlab.detector.calib.utils.ConstantsManager;
44
import org.jlab.detector.calib.utils.DatabaseConstantProvider;
55
import org.jlab.utils.groups.IndexedTable;
66

77
import java.util.HashMap;
88
import java.util.Map;
9-
import java.lang.Integer;
10-
import java.lang.Double;
119

1210
/**
1311
* This class loads constants from CCDB
@@ -26,20 +24,19 @@ public CalibrationConstantsLoader() {
2624

2725
// Maps for constants from database
2826
// AHDC
29-
public static Map<Integer, double[]> AHDC_TIME_OFFSETS = new HashMap<Integer,double[]>(); ///< AHDC Parameters for timing offsets
30-
public static Map<Integer, double[]> AHDC_TIME_TO_DISTANCE = new HashMap<Integer,double[]>(); ///< AHDC Parameters for time to distance
31-
public static Map<Integer, double[]> AHDC_RAW_HIT_CUTS = new HashMap<Integer,double[]>(); ///< AHDC Parameters for raw hit cuts
27+
public static Map<Integer, double[]> AHDC_TIME_OFFSETS = new HashMap<>(); ///< AHDC Parameters for timing offsets
28+
public static Map<Integer, double[]> AHDC_TIME_TO_DISTANCE = new HashMap<>(); ///< AHDC Parameters for time to distance
29+
public static Map<Integer, double[]> AHDC_RAW_HIT_CUTS = new HashMap<>(); ///< AHDC Parameters for raw hit cuts
3230

3331
// ATOF
34-
public static Map<Integer, double[]> ATOF_EFFECTIVE_VELOCITY = new HashMap<Integer,double[]>(); ///< ATOF Parameters for effective velocity
35-
public static Map<Integer, double[]> ATOF_TIME_WALK = new HashMap<Integer,double[]>(); ///< ATOF Parameters for time walk
36-
public static Map<Integer, double[]> ATOF_ATTENUATION_LENGTH = new HashMap<Integer,double[]>(); ///< ATOF Parameters for attenuation lenght
37-
public static Map<Integer, double[]> ATOF_TIME_OFFSETS = new HashMap<Integer,double[]>(); ///< ATOF Parameters for timing offsets
32+
public static Map<Integer, double[]> ATOF_EFFECTIVE_VELOCITY = new HashMap<>(); ///< ATOF Parameters for effective velocity
33+
public static Map<Integer, double[]> ATOF_TIME_WALK = new HashMap<>(); ///< ATOF Parameters for time walk
34+
public static Map<Integer, double[]> ATOF_ATTENUATION_LENGTH = new HashMap<>(); ///< ATOF Parameters for attenuation lenght
35+
public static Map<Integer, double[]> ATOF_TIME_OFFSETS = new HashMap<>(); ///< ATOF Parameters for timing offsets
3836

39-
public static synchronized void Load(int runno, String var, ConstantsManager manager) {
37+
public static synchronized void Load(int runno, ConstantsManager manager) {
4038

4139
//System.out.println("*Loading calibration constants*");
42-
manager.setVariation(var);
4340

4441
IndexedTable ahdc_timeOffsets = manager.getConstants(runno, "/calibration/alert/ahdc/time_offsets");
4542
IndexedTable ahdc_time2distance = manager.getConstants(runno, "/calibration/alert/ahdc/time_to_distance");

reconstruction/alert/src/main/java/org/jlab/service/ahdc/AHDCEngine.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
import org.jlab.rec.ahdc.PreCluster.PreClusterFinder;
2323
import org.jlab.rec.ahdc.Track.Track;
2424
import org.jlab.rec.ahdc.Mode;
25-
import org.jlab.rec.alert.constants.CalibrationConstantsLoader;
26-
2725
import java.io.File;
2826
import java.util.*;
2927
import org.jlab.detector.calib.utils.DatabaseConstantProvider;
3028
import org.jlab.geom.detector.alert.AHDC.AlertDCDetector;
3129
import org.jlab.geom.detector.alert.AHDC.AlertDCFactory;
30+
import org.jlab.rec.constants.CalibrationConstantsLoader;
3231

3332
/** AHDCEngine reconstruction service.
3433
*
@@ -102,7 +101,9 @@ public boolean init() {
102101
"/calibration/alert/atof/time_offsets"
103102
};
104103
requireConstants(Arrays.asList(alertTables));
105-
104+
105+
this.getConstantsManager().setVariation("default");
106+
106107
this.registerOutputBank("AHDC::hits","AHDC::preclusters","AHDC::clusters","AHDC::track","AHDC::kftrack","AHDC::mc","AHDC::ai:prediction");
107108

108109
return true;
@@ -137,7 +138,7 @@ public boolean processDataEvent(DataEvent event) {
137138
// Load the constants
138139
//-------------------
139140
if(Run!=newRun) {
140-
CalibrationConstantsLoader.Load(newRun,"default",this.getConstantsManager());
141+
CalibrationConstantsLoader.Load(newRun, this.getConstantsManager());
141142
Run = newRun;
142143
}
143144
}

0 commit comments

Comments
 (0)