|
6 | 6 | import java.util.ArrayList; |
7 | 7 | import java.util.concurrent.atomic.AtomicInteger; |
8 | 8 |
|
| 9 | +import java.util.HashMap; |
| 10 | +import java.util.Map; |
| 11 | + |
9 | 12 | import org.jlab.clas.reco.ReconstructionEngine; |
10 | 13 | import org.jlab.clas.swimtools.Swim; |
11 | 14 | import org.jlab.detector.calib.utils.DatabaseConstantProvider; |
| 15 | +import org.jlab.utils.groups.IndexedTable; |
12 | 16 | import org.jlab.geom.base.Detector; |
13 | 17 | import org.jlab.geom.detector.alert.ATOF.AlertTOFFactory; |
14 | 18 | import org.jlab.io.base.DataBank; |
@@ -71,6 +75,9 @@ public class ALERTEngine extends ReconstructionEngine { |
71 | 75 | private ModelTrackMatching modelTrackMatching; |
72 | 76 | private ModelPrePID modelPrePID; |
73 | 77 |
|
| 78 | + // AHDC calibration table (refreshed on run change) |
| 79 | + private IndexedTable ahdcAdcGains; |
| 80 | + |
74 | 81 | public void setB(double B) { |
75 | 82 | this.b = B; |
76 | 83 | } |
@@ -103,6 +110,11 @@ public boolean init() { |
103 | 110 | ATOF = factory.createDetectorCLAS(cp); |
104 | 111 | AHDC = (new AlertDCFactory()).createDetectorCLAS(new DatabaseConstantProvider()); |
105 | 112 |
|
| 113 | + Map<String, Integer> tableMap = new HashMap<>(); |
| 114 | + tableMap.put("/calibration/alert/ahdc/gains", 3); |
| 115 | + requireConstants(tableMap); |
| 116 | + this.getConstantsManager().setVariation("default"); |
| 117 | + |
106 | 118 | if(this.getEngineConfigString("Mode")!=null) { |
107 | 119 | //if (Objects.equals(this.getEngineConfigString("Mode"), Mode.AI_Track_Finding.name())) |
108 | 120 | // mode = Mode.AI_Track_Finding; |
@@ -140,6 +152,7 @@ public boolean processDataEvent(DataEvent event) { |
140 | 152 |
|
141 | 153 | if (run.get() == 0 || (run.get() != 0 && run.get() != newRun)) { |
142 | 154 | run.set(newRun); |
| 155 | + ahdcAdcGains = this.getConstantsManager().getConstants(newRun, "/calibration/alert/ahdc/gains"); |
143 | 156 | } |
144 | 157 |
|
145 | 158 | //Do we need to read the event vx,vy,vz? |
|
0 commit comments