Skip to content

Commit a005cc8

Browse files
authored
fix an issue in DCHBPostClusterAI (#589)
* fix an issue in DCHBPostClusterAI.java to save all necessary clusters in HB cluster bank * add clusters in tracks from AI-assisted tracking into cluster list
1 parent 6287832 commit a005cc8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBPostClusterAI.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
/**
3232
*
33-
* @author ziegler
33+
* @author ziegler, tongtong
3434
*/
3535
public class DCHBPostClusterAI extends DCEngine {
3636

@@ -71,7 +71,7 @@ public boolean processDataEvent(DataEvent event) {
7171
//AI
7272
List<Track> trkcands = null;
7373
List<Cross> crosses = null;
74-
List<FittedCluster> clusters = null;
74+
List<FittedCluster> clusters = new ArrayList<>();
7575
List<Segment> segments = null;
7676
List<FittedHit> fhits = null;
7777

@@ -103,7 +103,6 @@ public boolean processDataEvent(DataEvent event) {
103103
LOGGER.log(Level.FINE, "Pass Cross"+c.printInfo());
104104
}
105105
if (crosses.isEmpty()) {
106-
clusters = new ArrayList<>();
107106
for(Segment seg : segments) {
108107
clusters.add(seg.get_fittedCluster());
109108
}
@@ -126,14 +125,18 @@ public boolean processDataEvent(DataEvent event) {
126125
dcSwim, true);
127126

128127
// track found
129-
clusters = new ArrayList<>();
130128
int trkId = 1;
131129
if (trkcands.size() > 0) {
132130
// remove overlaps
133131
trkcandFinder.removeOverlappingTracks(trkcands);
134132
for (Track trk : trkcands) {
135133
trk.setIsAITrack(true);
136134

135+
for (Cross c : trk) {
136+
clusters.add(c.get_Segment1().get_fittedCluster());
137+
clusters.add(c.get_Segment2().get_fittedCluster());
138+
}
139+
137140
// reset the id
138141
trk.set_Id(trkId);
139142
trkcandFinder.matchHits(trk.getStateVecs(),
@@ -312,6 +315,7 @@ public boolean processDataEvent(DataEvent event) {
312315
if (trkcands.isEmpty()) {
313316
event.appendBanks(
314317
writer.fillHBHitsBank(event, fhits),
318+
writer.fillHBClustersBank(event, clusters),
315319
writer.fillHBSegmentsBank(event, segments),
316320
writer.fillHBCrossesBank(event, crosses));
317321
}

0 commit comments

Comments
 (0)