Skip to content

Commit fa29360

Browse files
feat(ALERTEngine): initialize ATOF detector and check that there are 5 interclusters for the prediction (#1054)
1 parent 7b0987d commit fa29360

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public class ALERTEngine extends ReconstructionEngine {
4646
*/
4747
private RecoBankWriter rbc;
4848

49+
Detector ATOF; // ALERT ATOF detector
50+
4951
/**
5052
* Current run number being processed.
5153
* TODO: why atomic here and nowhere else?
@@ -82,6 +84,10 @@ public boolean init() {
8284

8385
modelTrackMatching = new ModelTrackMatching();
8486

87+
AlertTOFFactory factory = new AlertTOFFactory();
88+
DatabaseConstantProvider cp = new DatabaseConstantProvider(11, "default");
89+
ATOF = factory.createDetectorCLAS(cp);
90+
8591
if(this.getEngineConfigString("Mode")!=null) {
8692
//if (Objects.equals(this.getEngineConfigString("Mode"), Mode.AI_Track_Finding.name()))
8793
// mode = Mode.AI_Track_Finding;
@@ -160,11 +166,9 @@ public boolean processDataEvent(DataEvent event) {
160166
interClusters.add(new Pair<>(x, y));
161167
}
162168
}
169+
if (interClusters.size() != 5) continue;
163170

164171
try {
165-
AlertTOFFactory factory = new AlertTOFFactory();
166-
DatabaseConstantProvider cp = new DatabaseConstantProvider(11, "default");
167-
Detector ATOF = factory.createDetectorCLAS(cp);
168172

169173
float[] pred = modelTrackMatching.prediction(interClusters);
170174
int sector_pred = (int) pred[0];

0 commit comments

Comments
 (0)