1 removed + 7 modified, total 8 files
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.1 -r1.2
--- HPSRawCalorimeterHit.java 29 Aug 2011 23:05:37 -0000 1.1
+++ HPSRawCalorimeterHit.java 2 Sep 2011 21:16:19 -0000 1.2
@@ -8,7 +8,7 @@
* for use in ECalReadout
*
* @author Sho Uemura
- * @version $Id: HPSRawCalorimeterHit.java,v 1.1 2011/08/29 23:05:37 meeg Exp $
+ * @version $Id: HPSRawCalorimeterHit.java,v 1.2 2011/09/02 21:16:19 meeg Exp $
*/
public class HPSRawCalorimeterHit extends BaseCalorimeterHit {
@@ -33,17 +33,17 @@
IDDecoder dec = getIDDecoder();
dec.setID(id);
if (dec.getValue("ix")>0) {
- if (dec.getValue("side")>0) {
+ if (dec.getValue("iy")>0) {
return 1;
} else {
return 4;
}
} else {
- if (dec.getValue("side")>0) {
+ if (dec.getValue("iy")>0) {
return 2;
} else {
return 3;
}
}
}
-}
\ No newline at end of file
+}
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.11 -r1.12
--- HPSEcalClusterer.java 29 Aug 2011 23:05:37 -0000 1.11
+++ HPSEcalClusterer.java 2 Sep 2011 21:16:20 -0000 1.12
@@ -11,27 +11,26 @@
import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
-import org.lcsim.geometry.subdetector.HPSEcal;
-import org.lcsim.geometry.subdetector.HPSEcal.NeighborMap;
-import org.lcsim.geometry.subdetector.HPSEcal2;
+import org.lcsim.geometry.subdetector.HPSEcal3.NeighborMap;
+import org.lcsim.geometry.subdetector.HPSEcal3;
import org.lcsim.recon.cluster.util.Clusterer;
import org.lcsim.util.Driver;
import org.lcsim.util.lcio.LCIOConstants;
/**
- * Creates clusters from CalorimeterHits in the HPSEcal detector.
+ * This Driver creates clusters from the CalorimeterHits of an
+ * {@link org.lcsim.geometry.subdetectur.HPSEcal3} detector.
*
* The clustering algorithm is from pages 83 and 84 of the HPS Proposal.
*
* @author Jeremy McCormick <[log in to unmask]>
* @author Tim Nelson <[log in to unmask]>
*
- * @version $Id: HPSEcalClusterer.java,v 1.11 2011/08/29 23:05:37 meeg Exp $
+ * @version $Id: HPSEcalClusterer.java,v 1.12 2011/09/02 21:16:20 meeg Exp $
*/
public class HPSEcalClusterer extends Driver implements Clusterer {
- HPSEcal ecal;
+ HPSEcal3 ecal;
String ecalCollectionName;
String ecalName;
String clusterCollectionName = "EcalClusters";
@@ -77,7 +76,7 @@
public void detectorChanged(Detector detector) {
// Get the Subdetector.
- ecal = (HPSEcal2) detector.getSubdetector(ecalName);
+ ecal = (HPSEcal3) detector.getSubdetector(ecalName);
// Cache ref to neighbor map.
neighborMap = ecal.getNeighborMap();
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.5 -r1.6
--- HPSEcalTimeEvolutionReadoutDriver.java 31 Aug 2011 22:18:09 -0000 1.5
+++ HPSEcalTimeEvolutionReadoutDriver.java 2 Sep 2011 21:16:20 -0000 1.6
@@ -15,7 +15,7 @@
* Simulates time evolution of preamp output pulse.
*
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcalTimeEvolutionReadoutDriver.java,v 1.5 2011/08/31 22:18:09 meeg Exp $
+ * @version $Id: HPSEcalTimeEvolutionReadoutDriver.java,v 1.6 2011/09/02 21:16:20 meeg Exp $
*/
public class HPSEcalTimeEvolutionReadoutDriver extends HPSEcalReadoutDriver {
@@ -53,12 +53,12 @@
for (CalorimeterHit hit : hits) {
IDDecoder dec = ecal.getIDDecoder();
dec.setID(hit.getCellID());
- int ix = dec.getValue("ix");
- int iy = dec.getValue("iy");
- //temporary hack to disable crystals and flip X coordinate
- int side = dec.getValue("side");
- if (iy == 1 && ix * side >= -10 && ix * side <= -2)
- continue;
+// int ix = dec.getValue("ix");
+// int iy = dec.getValue("iy");
+// //temporary hack to disable crystals and flip X coordinate
+// int side = dec.getValue("side");
+// if (iy == 1 && ix * side >= -10 && ix * side <= -2)
+// continue;
RingBuffer eDepBuffer = eDepMap.get(hit.getCellID());
if (eDepBuffer == null) {
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.13 -r1.14
--- HPSEcal1BitClusterer.java 29 Aug 2011 23:05:37 -0000 1.13
+++ HPSEcal1BitClusterer.java 2 Sep 2011 21:16:20 -0000 1.14
@@ -12,9 +12,8 @@
import org.lcsim.event.EventHeader;
import org.lcsim.geometry.Detector;
import org.lcsim.geometry.IDDecoder;
-import org.lcsim.geometry.subdetector.HPSEcal;
-import org.lcsim.geometry.subdetector.HPSEcal.NeighborMap;
-import org.lcsim.geometry.subdetector.HPSEcal2;
+import org.lcsim.geometry.subdetector.HPSEcal3.NeighborMap;
+import org.lcsim.geometry.subdetector.HPSEcal3;
import org.lcsim.util.Driver;
import org.lcsim.util.lcio.LCIOConstants;
import org.lcsim.recon.cluster.util.Clusterer;
@@ -27,11 +26,11 @@
* @author Jeremy McCormick <[log in to unmask]>
* @author Tim Nelson <[log in to unmask]>
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcal1BitClusterer.java,v 1.13 2011/08/29 23:05:37 meeg Exp $
+ * @version $Id: HPSEcal1BitClusterer.java,v 1.14 2011/09/02 21:16:20 meeg Exp $
*/
public class HPSEcal1BitClusterer extends Driver implements Clusterer {
- HPSEcal ecal;
+ HPSEcal3 ecal;
String ecalName;
String ecalCollectionName;
String clusterCollectionName = "EcalClusters";
@@ -77,7 +76,7 @@
public void detectorChanged(Detector detector) {
// Get the Subdetector.
- ecal = (HPSEcal2) detector.getSubdetector(ecalName);
+ ecal = (HPSEcal3) detector.getSubdetector(ecalName);
// Cache ref to neighbor map.
neighborMap = ecal.getNeighborMap();
@@ -176,10 +175,9 @@
// Get ID field values.
int x1 = dec.getValue("ix");
int y1 = dec.getValue("iy");
- int side1 = dec.getValue("side");
Integer hitCount = hitCounts.get(possibleCluster);
- //System.out.printf("Possible cluster: x: %d, y: %d, side:%d, hits: %d\n",x1,y1,side1,hitCount);
+ //System.out.printf("Possible cluster: x: %d, y: %d, hits: %d\n",x1,y1,hitCount);
boolean isCluster = true;
for (Long neighborId : neighbors) {
// Set the ID.
@@ -190,7 +188,7 @@
// Get ID field values.
int x2 = dec.getValue("ix");
int y2 = dec.getValue("iy");
- if (side1 == 1) {
+ if (y1>0) {
if (x1 > 0) {
//quadrant 1
if (x1 == 1) {
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.4 -r1.5
--- HPSEcalSimpleReadoutDriver.java 31 Aug 2011 22:18:09 -0000 1.4
+++ HPSEcalSimpleReadoutDriver.java 2 Sep 2011 21:16:20 -0000 1.5
@@ -13,7 +13,7 @@
* No time evolution - this just integrates all hits in a cycle.
*
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcalSimpleReadoutDriver.java,v 1.4 2011/08/31 22:18:09 meeg Exp $
+ * @version $Id: HPSEcalSimpleReadoutDriver.java,v 1.5 2011/09/02 21:16:20 meeg Exp $
*/
public class HPSEcalSimpleReadoutDriver extends HPSEcalReadoutDriver {
@@ -25,12 +25,12 @@
List<HPSRawCalorimeterHit> hitList = new ArrayList<HPSRawCalorimeterHit>();
for (Long cellID : eDepMap.keySet()) {
dec.setID(cellID);
- int ix = dec.getValue("ix");
- int iy = dec.getValue("iy");
- //temporary hack to disable crystals and flip X coordinate
- int side = dec.getValue("side");
- if (iy == 1 && ix*side >= -10 && ix*side <= -2)
- continue;
+// int ix = dec.getValue("ix");
+// int iy = dec.getValue("iy");
+// //temporary hack to disable crystals and flip X coordinate
+// int side = dec.getValue("side");
+// if (iy == 1 && ix*side >= -10 && ix*side <= -2)
+// continue;
if (eDepMap.get(cellID) > threshold)
hitList.add(new HPSRawCalorimeterHit(eDepMap.get(cellID), dec.getPosition(), 0.0, cellID, hitType));
}
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -N HPSEcal3Clusterer.java
--- HPSEcal3Clusterer.java 1 Sep 2011 23:59:32 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,214 +0,0 @@
-package org.lcsim.hps.recon.ecal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.lcsim.event.CalorimeterHit;
-import org.lcsim.event.Cluster;
-import org.lcsim.event.EventHeader;
-import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
-import org.lcsim.geometry.subdetector.HPSEcal3.NeighborMap;
-import org.lcsim.geometry.subdetector.HPSEcal3;
-import org.lcsim.recon.cluster.util.BasicCluster;
-import org.lcsim.util.Driver;
-import org.lcsim.util.lcio.LCIOConstants;
-
-/**
- * This Driver creates clusters from the CalorimeterHits of an
- * {@link org.lcsim.geometry.subdetectur.HPSEcal3} detector.
- *
- * This is based on {@link HPSEcalClusterer}. It removes the concept
- * of side and uses signed Y indices.
- *
- * The clustering algorithm is from pages 83 and 84 of the HPS Proposal.
- *
- * @author Jeremy McCormick <[log in to unmask]>
- * @author Tim Nelson <[log in to unmask]>
- *
- * @version $Id: HPSEcal3Clusterer.java,v 1.1 2011/09/01 23:59:32 jeremy Exp $
- */
-public class HPSEcal3Clusterer extends Driver
-{
- // Reference to the HPSEcal3 subdetector.
- HPSEcal3 ecal;
-
- // Name of collection containing Ecal hits.
- String ecalCollectionName;
-
- // Name of Ecal detector.
- String ecalName;
-
- // Name of Ecal cluster output collection.
- String clusterCollectionName = "EcalClusters";
-
- // Execute debug code?
- boolean debug = false;
-
- // Minimum energy [GeV] for cluster seed.
- double seedEMin = .05;
-
- // Minimum energy [GeV] to add hit to cluster.
- double addEMin = .03;
-
- // Map of crystals to their neighbors.
- NeighborMap neighborMap = null;
-
- public HPSEcal3Clusterer()
- {}
-
- public void setDebug(boolean debug)
- {
- this.debug = debug;
- }
-
- public void setClusterCollectionName(String clusterCollectionName)
- {
- this.clusterCollectionName = clusterCollectionName;
- }
-
- public void setSeedEMin(double seedEMin)
- {
- this.seedEMin = seedEMin;
- }
-
- public void setAddEMin(double addEMin)
- {
- this.addEMin = addEMin;
- }
-
- public void setEcalCollectionName(String ecalCollectionName)
- {
- this.ecalCollectionName = ecalCollectionName;
- }
-
- public void setEcalName(String ecalName)
- {
- this.ecalName = ecalName;
- }
-
- public void startOfData()
- {
- if (ecalCollectionName == null)
- throw new RuntimeException("The parameter ecalCollectionName was not set!");
-
- if (ecalName == null)
- throw new RuntimeException("The parameter ecalName was not set!");
- }
-
- public void detectorChanged(Detector detector)
- {
- // Get the Subdetector.
- ecal = (HPSEcal3)detector.getSubdetector(ecalName);
-
- // Cache the ref to neighbor map.
- neighborMap = ecal.getNeighborMap();
-
- // Print out subdet params and neighbor map.
- if (debug)
- {
- System.out.println(ecal.getName());
- System.out.println(" nx="+ecal.nx());
- System.out.println(" ny="+ecal.ny());
- System.out.println(" beamgap="+ecal.beamGap());
- System.out.println(" dface="+ecal.distanceToFace());
-
- System.out.println(neighborMap.toString());
- }
- }
-
- public void process(EventHeader event)
- {
- //System.out.println(this.getClass().getCanonicalName() + " - process");
-
- // Get the list of ECal hits.
- List<CalorimeterHit> hits = event.get(CalorimeterHit.class, ecalCollectionName);
- if (hits == null)
- throw new RuntimeException("Event is missing ECal raw hits collection!");
-
- // Get the decoder for the ECal IDs.
- IDDecoder dec = ecal.getIDDecoder();
-
- // Hit map.
- Map<Long,CalorimeterHit> hitMap = new HashMap<Long,CalorimeterHit>();
-
- // Make a hit map for quick lookup by ID.
- for (CalorimeterHit hit : hits)
- {
- hitMap.put(hit.getCellID(), hit);
- }
-
- // New Cluster list to be added to event.
- List<Cluster> clusters = new ArrayList<Cluster>();
-
- // Loop over ECal hits to find cluster seeds.
- for (CalorimeterHit hit : hits)
- {
- // Cut on min seed E.
- if (hit.getRawEnergy() < seedEMin)
- continue;
-
- // Get neighbor crystal IDs.
- Set<Long> neighbors = neighborMap.get(hit.getCellID());
-
- if (debug)
- {
- dec.setID(hit.getCellID());
- System.out.println(dec.getValue("system") + ", " + dec.getValue("ix") + ", " + dec.getValue("iy"));
- if (neighbors == null)
- {
- throw new RuntimeException("Oops! Set of neighbors is null!");
- }
- }
-
- // New list for neighboring hits.
- List<CalorimeterHit> neighborHits = new ArrayList<CalorimeterHit>();
-
- // Loop over this hit's neighbors to make a hit list for the cluster.
- boolean isSeed = true;
- for (Long neighborId : neighbors)
- {
- // Look for the neighbor hit.
- CalorimeterHit neighborHit = hitMap.get(neighborId);
-
- // Does this neighboring crystal have a hit in the event?
- if (neighborHit != null)
- {
- // Check if the neighbor cell has more energy.
- if (neighborHit.getRawEnergy() > hit.getRawEnergy())
- {
- // Neighbor has more energy, so this cell cannot be a seed.
- isSeed = false;
- break;
- }
-
- // Add to the cluster if hit is above the minimum energy.
- if (neighborHit.getRawEnergy() >= addEMin)
- {
- neighborHits.add(neighborHit);
- }
- }
- }
-
- // Did we find a seed?
- if (isSeed)
- {
- // Make a new cluster from the hit list.
- BasicCluster cluster = new BasicCluster();
- cluster.addHit(hit);
- for (CalorimeterHit clusHit : neighborHits)
- {
- cluster.addHit(clusHit);
- }
- clusters.add(cluster);
- }
- }
-
- // Put Cluster collection into event.
- int flag = 1 << LCIOConstants.CLBIT_HITS;
- event.put(clusterCollectionName, clusters, Cluster.class, flag);
- }
-}
\ No newline at end of file
hps-java/src/main/resources/org/lcsim/hps/steering
diff -u -r1.4 -r1.5
--- ecal_example.lcsim 29 Aug 2011 23:07:02 -0000 1.4
+++ ecal_example.lcsim 2 Sep 2011 21:16:20 -0000 1.5
@@ -30,14 +30,14 @@
<driver name="EcalReadout"
type="org.lcsim.hps.recon.ecal.HPSEcalSimpleReadoutDriver">
<readoutCycle>1</readoutCycle>
- <ecalName>HPSEcalTest</ecalName>
+ <ecalName>Ecal</ecalName>
<ecalCollectionName>EcalHits</ecalCollectionName>
<ecalRawCollectionName>EcalRawHits</ecalRawCollectionName>
<threshold>0.05</threshold>
</driver>
<driver name="EcalClusterer"
type="org.lcsim.hps.recon.ecal.HPSEcalClusterer">
- <ecalName>HPSEcalTest</ecalName>
+ <ecalName>Ecal</ecalName>
<ecalCollectionName>EcalRawHits</ecalCollectionName>
</driver>
<driver name="EcalPlots"
hps-java/src/main/java/org/lcsim/hps/analysis/ecal
diff -u -r1.9 -r1.10
--- HPSEcalPlotsDriver.java 31 Aug 2011 22:18:09 -0000 1.9
+++ HPSEcalPlotsDriver.java 2 Sep 2011 21:16:20 -0000 1.10
@@ -34,7 +34,7 @@
* Diagnostic plots for HPS ECal.
*
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: HPSEcalPlotsDriver.java,v 1.9 2011/08/31 22:18:09 meeg Exp $
+ * @version $Id: HPSEcalPlotsDriver.java,v 1.10 2011/09/02 21:16:20 meeg Exp $
*/
public class HPSEcalPlotsDriver extends Driver {
@@ -322,7 +322,7 @@
}
//TODO: change the quadrants back for correct X coordinate
- if ((quadrants[0] && quadrants[3]) || (quadrants[1] && quadrants[2])) {
+ if ((quadrants[0] && quadrants[2]) || (quadrants[1] && quadrants[3])) {
trigger = true;
numTriggers++;
}
@@ -361,7 +361,7 @@
int nhits100MeV = 0;
int nhitsOver100MeV = 0;
- if (trigger) {
+ if (trigger && numTriggers<=100) {
hitXYPlot = aida.histogram2D(
ecalCollectionName + " : hit E, event " + String.format("%07d", ClockSingleton.getClock()),
47, -23.5, 23.5, 11, -5.5, 5.5);
@@ -412,12 +412,11 @@
IIdentifier id = hit.getIdentifier();
int ix = helper.unpack(id).getValue(helper.getFieldIndex("ix"));
int iy = helper.unpack(id).getValue(helper.getFieldIndex("iy"));
- int side = helper.unpack(id).getValue(helper.getFieldIndex("side"));
crystalXPlot.fill(ix);
crystalYPlot.fill(iy);
crystalXYPlot.fill(ix, iy);
- if (trigger)
- hitXYPlot.fill(ix, iy * side, eraw);
+ if (trigger && numTriggers<=100)
+ hitXYPlot.fill(ix, iy, eraw);
}
hitUnder100MeVPlot.fill(nhits100MeV);
CVSspam 0.2.8