Skip to content

Commit a722886

Browse files
authored
move rg-l engine geometry initialization to detectorChanged (#1306)
1 parent d6b3cf6 commit a722886

3 files changed

Lines changed: 9 additions & 16 deletions

File tree

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ public class AHDCEngine extends ReconstructionEngine {
4646

4747
@Override
4848
public void detectorChanged(int run) {
49-
// FIXME: move geometry initialization here
49+
factory = (new AlertDCFactory()).createDetectorCLAS(new DatabaseConstantProvider(run,"default"));
5050
}
5151

5252
@Override
5353
public boolean init() {
5454

55-
factory = (new AlertDCFactory()).createDetectorCLAS(new DatabaseConstantProvider());
56-
5755
Map<String, Integer> tableMap = new HashMap<>();
5856
tableMap.put("/calibration/alert/ahdc/time_offsets", 3);
5957
tableMap.put("/calibration/alert/ahdc/time_to_distance_wire", 3);

reconstruction/alert/src/main/java/org/jlab/service/alert/ALERTEngine.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ public ALERTEngine() {
134134
}
135135

136136
@Override
137-
public void detectorChanged(int run) {}
137+
public void detectorChanged(int run) {
138+
DatabaseConstantProvider cp = new DatabaseConstantProvider(run, "default");
139+
ATOF = (new AlertTOFFactory()).createDetectorCLAS(cp);
140+
AHDC = (new AlertDCFactory()).createDetectorCLAS(cp);
141+
}
138142

139143
/**
140144
* ALERTEngine initialization.
@@ -149,13 +153,6 @@ public boolean init() {
149153
modelTrackMatching = new ModelTrackMatching();
150154
modelPrePID = new ModelPrePID();
151155

152-
AlertTOFFactory factory = new AlertTOFFactory();
153-
154-
// One CCDB session for both ATOF and AHDC geometry.
155-
DatabaseConstantProvider cp = new DatabaseConstantProvider(11, "default");
156-
ATOF = factory.createDetectorCLAS(cp);
157-
AHDC = (new AlertDCFactory()).createDetectorCLAS(cp);
158-
159156
Map<String, Integer> tableMap = new HashMap<>();
160157
tableMap.put("/calibration/alert/ahdc/gains", 3);
161158
requireConstants(tableMap);

reconstruction/alert/src/main/java/org/jlab/service/atof/ATOFEngine.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,15 @@ public boolean processDataEventUser(DataEvent event) {
120120

121121
@Override
122122
public void detectorChanged(int run) {
123-
// FIXME: move geometry initialization here
123+
AlertTOFFactory factory = new AlertTOFFactory();
124+
DatabaseConstantProvider cp = new DatabaseConstantProvider(run, "default");
125+
this.ATOF = factory.createDetectorCLAS(cp);
124126
}
125127

126128
@Override
127129
public boolean init() {
128130
rbc = new RecoBankWriter();
129131

130-
AlertTOFFactory factory = new AlertTOFFactory();
131-
DatabaseConstantProvider cp = new DatabaseConstantProvider(11, "default");
132-
this.ATOF = factory.createDetectorCLAS(cp);
133-
134132
Map<String, Integer> tableMap = new HashMap<>();
135133
tableMap.put("/calibration/alert/atof/effective_velocity", 3);
136134
tableMap.put("/calibration/alert/atof/time_walk", 4);

0 commit comments

Comments
 (0)