lcsim/src/org/lcsim/recon/pfa/output
diff -u -r1.1 -r1.2
--- FlushReconstructedParticlesDriver.java 16 Jan 2008 21:12:15 -0000 1.1
+++ FlushReconstructedParticlesDriver.java 19 Aug 2008 06:32:17 -0000 1.2
@@ -37,6 +37,21 @@
}
public void process(EventHeader event) {
+ // Grab raw hitmaps
+ Map<Long, CalorimeterHit> hitMap = new HashMap<Long, CalorimeterHit>();
+ for (CalorimeterHit hit : event.get(CalorimeterHit.class, "EcalBarrHits")) { hitMap.put(hit.getCellID(), hit); }
+ for (CalorimeterHit hit : event.get(CalorimeterHit.class, "HcalBarrHits")) { hitMap.put(hit.getCellID(), hit); }
+ for (CalorimeterHit hit : event.get(CalorimeterHit.class, "MuonBarrHits")) { hitMap.put(hit.getCellID(), hit); }
+ for (CalorimeterHit hit : event.get(CalorimeterHit.class, "EcalEndcapHits")) { hitMap.put(hit.getCellID(), hit); }
+ for (CalorimeterHit hit : event.get(CalorimeterHit.class, "HcalEndcapHits")) { hitMap.put(hit.getCellID(), hit); }
+ for (CalorimeterHit hit : event.get(CalorimeterHit.class, "MuonEndcapHits")) { hitMap.put(hit.getCellID(), hit); }
+ for (CalorimeterHit hit : event.get(CalorimeterHit.class, "ForwardEcalEndcapHits")) { hitMap.put(hit.getCellID(), hit); }
+
+ if (!event.hasCollection(ReconstructedParticle.class, m_inputParticleListName)) {
+ // Collection is missing this event
+ return;
+ }
+
List<ReconstructedParticle> inputList = event.get(ReconstructedParticle.class, m_inputParticleListName);
Vector<ReconstructedParticle> outputList = new Vector<ReconstructedParticle>();
Vector<Cluster> outputClusterList = new Vector<Cluster>();
@@ -55,7 +70,9 @@
// Create the output cluster and particle
BasicCluster outputCluster = new BasicCluster();
for (CalorimeterHit hit : hits) {
- outputCluster.addHit(hit);
+ long id = hit.getCellID();
+ CalorimeterHit safeHit = hitMap.get(id);
+ outputCluster.addHit(safeHit);
}
BaseReconstructedParticle outputPart = new BaseReconstructedParticle();
if (outputCluster.getCalorimeterHits().size() > 0) {