Author: [log in to unmask] Date: Wed Jan 7 18:01:22 2015 New Revision: 1901 Log: Change method to take single Cluster rather than list. Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java Wed Jan 7 18:01:22 2015 @@ -196,23 +196,20 @@ } /** - * Find the unique set of MCParticles that are referenced by the - * hits of the Cluster. + * Find the unique set of MCParticles that are referenced by the hits of the Cluster. * @param clusters The input Cluster. * @return The set of unique MCParticles. */ - public static Set<MCParticle> findMCParticles(List<Cluster> clusters) { + public static Set<MCParticle> findMCParticles(Cluster cluster) { Set<MCParticle> particles = new HashSet<MCParticle>(); - for (Cluster cluster : clusters) { - for (CalorimeterHit hit : cluster.getCalorimeterHits()) { - if (hit instanceof SimCalorimeterHit) { - SimCalorimeterHit simHit = (SimCalorimeterHit)hit; - for (int i = 0; i < simHit.getMCParticleCount(); i++) { - particles.add(simHit.getMCParticle(i)); - } + for (CalorimeterHit hit : cluster.getCalorimeterHits()) { + if (hit instanceof SimCalorimeterHit) { + SimCalorimeterHit simHit = (SimCalorimeterHit)hit; + for (int i = 0; i < simHit.getMCParticleCount(); i++) { + particles.add(simHit.getMCParticle(i)); } } - } + } return particles; } @@ -366,10 +363,8 @@ for (Cluster cluster : clusters) { if (cluster instanceof BaseCluster) { BaseCluster baseCluster = (BaseCluster)cluster; - //if (baseCluster.needsPropertyCalculation()) { baseCluster.setPropertyCalculator(calc); baseCluster.calculateProperties(); - //} } } }