1 package org.lcsim.recon.tracking.digitization.sisim.config;
2
3 import java.util.Arrays;
4 import java.util.HashSet;
5 import java.util.List;
6
7 import org.lcsim.event.EventHeader;
8 import org.lcsim.geometry.Detector;
9 import org.lcsim.geometry.compact.Subdetector;
10
11
12
13
14
15
16
17
18
19
20 public class ReadoutCleanupDriver
21 extends CollectionHandler
22 {
23 public ReadoutCleanupDriver()
24 {}
25
26 public ReadoutCleanupDriver(List<String> collectionNames) {
27 super(collectionNames);
28 }
29
30 public ReadoutCleanupDriver(String[] collectionNames) {
31 super(collectionNames);
32 }
33
34 public void setCollectionNames(String[] collectionNames) {
35 this.collections = new HashSet<String>(Arrays.asList(collectionNames));
36 }
37
38 protected void process(EventHeader event)
39 {
40 Detector detector = event.getDetector();
41
42 for (Subdetector subdet : detector.getSubdetectors().values()) {
43 if (subdet.getReadout() != null) {
44 if (canHandle(subdet.getReadout().getName())) {
45 if (subdet.getDetectorElement() != null) {
46 subdet.getDetectorElement().clearReadouts();
47 }
48 }
49 }
50 }
51 }
52 }