lcsim/src/org/lcsim/recon/cluster/util
diff -u -r1.4 -r1.5
--- HitsCluster.java 25 Aug 2005 23:36:53 -0000 1.4
+++ HitsCluster.java 21 Jun 2006 17:19:25 -0000 1.5
@@ -14,13 +14,14 @@
{
protected List<CalorimeterHit> hits = new ArrayList<CalorimeterHit>();
public double energy;
+ public double raw_energy;
public void addHit(CalorimeterHit hit)
{
hits.add(hit);
- energy += hit.getRawEnergy();
+ energy += hit.getCorrectedEnergy();
}
-
+
public List<CalorimeterHit> getCalorimeterHits()
{
return hits;
@@ -28,7 +29,7 @@
public List<Cluster> getClusters()
{
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
public double[] getDirectionError()
@@ -41,6 +42,19 @@
return energy;
}
+ /**
+ * Return the sum of the raw energies from the hits in the cluster
+ */
+ public double getRawEnergy()
+ {
+ if(raw_energy>0) return raw_energy;
+
+ for( CalorimeterHit hit : this.getCalorimeterHits() ) {
+ raw_energy += hit.getRawEnergy();
+ }
+ return raw_energy;
+ }
+
public double[] getHitContributions()
{
return null;
lcsim/src/org/lcsim/recon/cluster/util
diff -u -r1.2 -r1.3
--- RefinedCluster.java 25 Aug 2005 23:36:54 -0000 1.2
+++ RefinedCluster.java 21 Jun 2006 17:19:25 -0000 1.3
@@ -14,11 +14,12 @@
{
private List<Cluster> clusters = new ArrayList<Cluster>();
public double energy;
-
+ public double raw_energy;
+
public List<CalorimeterHit> getCalorimeterHits()
{
// Should this return the list of hits in the clusters?
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
public List<Cluster> getClusters()
@@ -36,6 +37,19 @@
return energy;
}
+ /**
+ * Return the sum of the raw energies from the hits in the cluster
+ */
+ public double getRawEnergy()
+ {
+ if(raw_energy>0) return raw_energy;
+
+ for( CalorimeterHit hit : this.getCalorimeterHits() ) {
+ raw_energy += hit.getRawEnergy();
+ }
+ return raw_energy;
+ }
+
public double[] getDirectionError()
{
return null;
@@ -85,7 +99,7 @@
{
return 0;
}
-
+
public int getSize()
{
int size = 0;