3 modified files
lcsim/src/org/lcsim/contrib/CarstenHensel
diff -u -r1.3 -r1.4
--- FixedConeClustererAnalyzer.java 24 Aug 2005 15:11:51 -0000 1.3
+++ FixedConeClustererAnalyzer.java 14 Feb 2007 00:16:04 -0000 1.4
@@ -9,15 +9,18 @@
package org.lcsim.contrib.CarstenHensel;
import hep.aida.ITree;
import hep.aida.ref.tree.TreeObjectAlreadyExistException;
+
import java.text.DecimalFormat;
import java.text.FieldPosition;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
import org.lcsim.event.MCParticle;
-import org.lcsim.geometry.subdetector.CalorimeterIDDecoder;
+import org.lcsim.geometry.IDDecoder;
import org.lcsim.recon.cluster.fixedcone.FixedConeClusterer;
import org.lcsim.recon.cluster.util.BasicCluster;
import org.lcsim.util.Driver;
@@ -38,7 +41,8 @@
private int eventCounter = 0;
private boolean initialized = false;
private FixedConeClusterer fcClusterer;
- private CalorimeterIDDecoder decoder;
+ //private CalorimeterIDDecoder decoder;
+ private IDDecoder decoder;
/** Creates a new instance of FixedConeClustererAnalyzer */
public FixedConeClustererAnalyzer() {
@@ -110,7 +114,7 @@
- this.decoder = (CalorimeterIDDecoder)event.getMetaData(ecalBarrHits).getIDDecoder();
+ this.decoder = event.getMetaData(ecalBarrHits).getIDDecoder();
// create a map of cells keyed on their index
Map<Long, CalorimeterHit> hitMap = new HashMap<Long, CalorimeterHit>();
@@ -127,10 +131,10 @@
this.fcClusterer = new FixedConeClusterer(initRadius, initSeed, initEmin);
- List<BasicCluster> clusters = fcClusterer.makeClusters(ecalBarrHits, decoder);
- for (BasicCluster cluster : clusters) {
+ List<Cluster> clusters = fcClusterer.createClusters(ecalBarrHits);
+ for (Cluster cluster : clusters) {
if(cluster.getCalorimeterHits().size() > 5) { // number of cells
- aida.cloud1D("cluster energy over total energy").fill(cluster.getRawEnergy() / eMax);
+ aida.cloud1D("cluster energy over total energy").fill(((BasicCluster)cluster).getRawEnergy() / eMax);
}
}
this.tree.cd("/" + this.treePath);
lcsim/src/org/lcsim/contrib/CarstenHensel
diff -u -r1.2 -r1.3
--- HMatrixAnalyzer.java 25 Aug 2005 19:09:37 -0000 1.2
+++ HMatrixAnalyzer.java 14 Feb 2007 00:16:04 -0000 1.3
@@ -150,7 +150,7 @@
- List<BasicCluster> clusters = fcClusterer.makeClusters(ecalBarrHits, decoder);
+ List<Cluster> clusters = fcClusterer.createClusters(ecalBarrHits);
// Get all the clusters and cluster sets to prepare to loop over them.
List<List<Cluster>> clusterSets = event.get(Cluster.class);
@@ -163,7 +163,7 @@
// Loop through all clusters
- for (BasicCluster cluster : clusters) {
+ for (Cluster cluster : clusters) {
if(cluster.getCalorimeterHits().size() > 5) { // number of cells
@@ -176,7 +176,7 @@
aida.cloud2D("Fractional Energy vs Layer").fill(i, energiesInLayer[i]);
energyPerLayer.add(new Double(energiesInLayer[i]));
}
- double clusterRawEnergy = cluster.getRawEnergy();
+ double clusterRawEnergy = ((BasicCluster)cluster).getRawEnergy();
aida.cloud1D("cluster raw energy").fill(clusterRawEnergy);
val[this.nLayers] = Math.log(clusterRawEnergy) / Math.log(10.0);;
@@ -253,7 +253,7 @@
- private double[] getListOfLayerEnergies(BasicCluster cluster) {
+ private double[] getListOfLayerEnergies(Cluster cluster) {
//System.out.println("Layers " + this.nLayers + " " + this.hMatrix.toString());
double[] energyPerLayer = new double[this.nLayers];
double clusterEnergy = 0.0;
@@ -292,7 +292,7 @@
}
}
- private double[] getHMInputVals(BasicCluster clus) {
+ private double[] getHMInputVals(Cluster clus) {
//FIXME could reuse this array
double[] layerEnergies = new double[this.nLayers + 1];
double clusterEnergy = 0.;
lcsim/src/org/lcsim/contrib/CarstenHensel
diff -u -r1.2 -r1.3
--- MyHMatrixBuilder.java 25 Aug 2005 19:09:37 -0000 1.2
+++ MyHMatrixBuilder.java 14 Feb 2007 00:16:04 -0000 1.3
@@ -15,10 +15,12 @@
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
+
import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
import org.lcsim.event.MCParticle;
-import org.lcsim.geometry.subdetector.CalorimeterIDDecoder;
+import org.lcsim.geometry.IDDecoder;
import org.lcsim.geometry.subdetector.CylindricalCalorimeter;
import org.lcsim.recon.cluster.fixedcone.FixedConeClusterer;
import org.lcsim.recon.cluster.util.BasicCluster;
@@ -40,7 +42,7 @@
private double[] vals;
private HMatrixBuilder hmb;
private String detectorName;
- private CalorimeterIDDecoder decoder;
+ private IDDecoder decoder;
private static final double log10inv = 1./Math.log(10.0);
private int debug = 0;
@@ -132,7 +134,7 @@
// FIXME should get calorimeterhit collection names from a conditions file
List<CalorimeterHit> collection = event.get(CalorimeterHit.class,"EcalBarrHits");
- this.decoder = (CalorimeterIDDecoder) event.getMetaData(collection).getIDDecoder();
+ this.decoder = event.getMetaData(collection).getIDDecoder();
@@ -146,19 +148,19 @@
// create the clusterer
FixedConeClusterer fcc = new FixedConeClusterer(radius, seed, minE);
//cluster
- List<BasicCluster> clusters = fcc.makeClusters(collection, this.decoder);
+ List<Cluster> clusters = fcc.createClusters(collection);
// add this list of clusters to the event (for event display)
event.put("NNClusters r"+radius,clusters);
// Loop over all the clusters
int nGoodClusters = 0;
- for (BasicCluster cluster : clusters) {
+ for (Cluster cluster : clusters) {
int ncells = cluster.getCalorimeterHits().size();
//FIXME should cut on cluster corrected energy
if(ncells>5) {
nGoodClusters++;
//GWW double energy = cluster.getEnergy();
- double energy = cluster.getRawEnergy();
+ double energy = ((BasicCluster)cluster).getRawEnergy();
// should be able to fetch this from the cluster...
this.vals = getHMInputVals(cluster);
@@ -188,7 +190,7 @@
}
- private double[] getHMInputVals(BasicCluster clus) {
+ private double[] getHMInputVals(Cluster clus) {
//FIXME could reuse this array
double[] layerEnergies = new double[this.nLayers + 1];
double clusterEnergy = 0.;
CVSspam 0.2.8