2 added + 9 modified, total 11 files
hps-java/src/main/resources/org/lcsim/hps/steering
diff -N ecal_fadc_ap.lcsim
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ecal_fadc_ap.lcsim 19 Nov 2011 00:52:55 -0000 1.1
@@ -0,0 +1,79 @@
+<!--
+ Example LCSim steering file to run simple HPS ECal clustering and analysis.
+ @author Sho Uemura <[log in to unmask]>
+ @version $Id: ecal_fadc_ap.lcsim,v 1.1 2011/11/19 00:52:55 meeg Exp $
+
+-->
+<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+ xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
+ <inputFiles>
+ <file>${inputFile}.slcio</file>
+ </inputFiles>
+ <control>
+ <numberOfEvents>-1</numberOfEvents>
+ <printInputFiles>true</printInputFiles>
+ </control>
+ <classpath>
+ <jar>~/.m2/repository/org/lcsim/hps-java/1.0-SNAPSHOT/hps-java-1.0-SNAPSHOT.jar</jar>
+ </classpath>
+ <execute>
+ <driver name="EventMarkerDriver"/>
+ <driver name="EcalReadout"/>
+ <driver name="EcalClusterer"/>
+ <driver name="EcalTrigger"/>
+ <driver name="EcalPlots"/>
+ <driver name="EcalFADCPlots"/>
+ <driver name="EcalTriggerPlots"/>
+ <!--<driver name="Writer"/>-->
+ <driver name="AidaSaveDriver"/>
+ <driver name="ClockDriver"/>
+ </execute>
+ <drivers>
+ <driver name="Writer"
+ type="org.lcsim.util.loop.LCIODriver">
+ <outputFilePath>${inputFile}_ecalClusters</outputFilePath>
+ </driver>
+ <driver name="EcalReadout"
+ type="org.lcsim.hps.recon.ecal.HPSEcalSimpleReadoutDriver">
+ <readoutCycle>1</readoutCycle>
+ <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>Ecal</ecalName>
+ <ecalCollectionName>EcalRawHits</ecalCollectionName>
+ </driver>
+ <driver name="EcalTrigger"
+ type="org.lcsim.hps.recon.ecal.HPSFADCTriggerDriver">
+ <clusterCollectionName>EcalClusters</clusterCollectionName>
+ <outputFileName>${inputFile}_triggers</outputFileName>
+ <ecalName>Ecal</ecalName>
+ </driver>
+ <driver name="EcalPlots"
+ type="org.lcsim.hps.analysis.ecal.HPSEcalPlotsDriver">
+ <ecalCollectionName>EcalRawHits</ecalCollectionName>
+ </driver>
+ <driver name="EcalFADCPlots"
+ type="org.lcsim.hps.analysis.ecal.HPSEcalFADCPlotsDriver">
+ <ecalCollectionName>EcalRawHits</ecalCollectionName>
+ <edepThreshold>0.05</edepThreshold>
+ </driver>
+ <driver name="EcalTriggerPlots"
+ type="org.lcsim.hps.analysis.ecal.HPSEcalTriggerPlotsDriver">
+ </driver>
+ <driver name="EventMarkerDriver"
+ type="org.lcsim.job.EventMarkerDriver">
+ <eventInterval>100</eventInterval>
+ </driver>
+ <driver name="AidaSaveDriver"
+ type="org.lcsim.job.AidaSaveDriver">
+ <outputFileName>${inputFile}_ecalPlots</outputFileName>
+ </driver>
+ <driver name="ClockDriver"
+ type="org.lcsim.hps.util.ClockDriver">
+ </driver>
+ </drivers>
+</lcsim>
hps-java/src/main/resources/org/lcsim/hps/steering
diff -N ecal_fadc_bkgd.lcsim
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ecal_fadc_bkgd.lcsim 19 Nov 2011 00:52:55 -0000 1.1
@@ -0,0 +1,87 @@
+<!--
+ Example LCSim steering file to run simple HPS ECal clustering and analysis.
+ @author Sho Uemura <[log in to unmask]>
+ @version $Id: ecal_fadc_bkgd.lcsim,v 1.1 2011/11/19 00:52:55 meeg Exp $
+
+-->
+<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+ xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
+ <inputFiles>
+ <file>${inputFile}.slcio</file>
+ </inputFiles>
+ <control>
+ <numberOfEvents>-1</numberOfEvents>
+ <printInputFiles>true</printInputFiles>
+ </control>
+ <classpath>
+ <jar>~/.m2/repository/org/lcsim/hps-java/1.0-SNAPSHOT/hps-java-1.0-SNAPSHOT.jar</jar>
+ </classpath>
+ <execute>
+ <driver name="EventMarkerDriver"/>
+ <driver name="EcalReadout"/>
+ <driver name="EcalConverter"/>
+ <driver name="EcalClusterer"/>
+ <driver name="EcalTrigger"/>
+ <driver name="EcalPlots"/>
+ <driver name="EcalFADCPlots"/>
+ <driver name="EcalTriggerPlots"/>
+ <!--<driver name="Writer"/>-->
+ <driver name="AidaSaveDriver"/>
+ <driver name="ClockDriver"/>
+ </execute>
+ <drivers>
+ <driver name="Writer"
+ type="org.lcsim.util.loop.LCIODriver">
+ <outputFilePath>${inputFile}_ecalClusters</outputFilePath>
+ </driver>
+ <driver name="EcalReadout"
+ type="org.lcsim.hps.recon.ecal.HPSEcalFADCReadoutDriver">
+ <readoutPeriod>4.0</readoutPeriod>
+ <ecalName>Ecal</ecalName>
+ <ecalCollectionName>EcalHits</ecalCollectionName>
+ <ecalRawCollectionName>EcalRawHits</ecalRawCollectionName>
+ <threshold>0.005</threshold>
+ </driver>
+ <driver name="EcalConverter"
+ type="org.lcsim.hps.recon.ecal.HPSEcalConverterDriver">
+ <ecalName>Ecal</ecalName>
+ <rawCollectionName>EcalRawHits</rawCollectionName>
+ <ecalCollectionName>EcalCorrectedHits</ecalCollectionName>
+ </driver>
+ <driver name="EcalClusterer"
+ type="org.lcsim.hps.recon.ecal.HPSEcalClusterer">
+ <ecalName>Ecal</ecalName>
+ <ecalCollectionName>EcalCorrectedHits</ecalCollectionName>
+ </driver>
+ <driver name="EcalTrigger"
+ type="org.lcsim.hps.recon.ecal.HPSFADCTriggerDriver">
+ <clusterCollectionName>EcalClusters</clusterCollectionName>
+ <outputFileName>${inputFile}_triggers</outputFileName>
+ <ecalName>Ecal</ecalName>
+ </driver>
+ <driver name="EcalPlots"
+ type="org.lcsim.hps.analysis.ecal.HPSEcalPlotsDriver">
+ <ecalCollectionName>EcalCorrectedHits</ecalCollectionName>
+ </driver>
+ <driver name="EcalFADCPlots"
+ type="org.lcsim.hps.analysis.ecal.HPSEcalFADCPlotsDriver">
+ <rawCollectionName>EcalRawHits</rawCollectionName>
+ <ecalCollectionName>EcalCorrectedHits</ecalCollectionName>
+ <edepThreshold>0.05</edepThreshold>
+ </driver>
+ <driver name="EcalTriggerPlots"
+ type="org.lcsim.hps.analysis.ecal.HPSEcalTriggerPlotsDriver">
+ </driver>
+ <driver name="EventMarkerDriver"
+ type="org.lcsim.job.EventMarkerDriver">
+ <eventInterval>100</eventInterval>
+ </driver>
+ <driver name="AidaSaveDriver"
+ type="org.lcsim.job.AidaSaveDriver">
+ <outputFileName>${inputFile}_ecalPlots</outputFileName>
+ </driver>
+ <driver name="ClockDriver"
+ type="org.lcsim.hps.util.ClockDriver">
+ </driver>
+ </drivers>
+</lcsim>
hps-java/src/main/resources/org/lcsim/hps/steering
diff -u -r1.5 -r1.6
--- ecal_1bit_bkgd.lcsim 17 Nov 2011 01:43:27 -0000 1.5
+++ ecal_1bit_bkgd.lcsim 19 Nov 2011 00:52:55 -0000 1.6
@@ -1,7 +1,7 @@
<!--
Example LCSim steering file to run simple HPS ECal clustering and analysis.
@author Sho Uemura <[log in to unmask]>
- @version $Id: ecal_1bit_bkgd.lcsim,v 1.5 2011/11/17 01:43:27 meeg Exp $
+ @version $Id: ecal_1bit_bkgd.lcsim,v 1.6 2011/11/19 00:52:55 meeg Exp $
-->
<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
@@ -22,7 +22,7 @@
<driver name="EcalClusterer"/>
<driver name="EcalTrigger"/>
<driver name="EcalPlots"/>
- <driver name="Writer"/>
+ <!--<driver name="Writer"/>-->
<driver name="AidaSaveDriver"/>
<driver name="ClockDriver"/>
</execute>
@@ -33,7 +33,8 @@
</driver>
<driver name="EcalReadout"
type="org.lcsim.hps.recon.ecal.HPSEcalDiscriminatorReadoutDriver">
- <readoutPeriod>15.0</readoutPeriod>
+ <readoutPeriod>5.0</readoutPeriod>
+ <outputWidth>10.0</outputWidth>
<ecalName>Ecal</ecalName>
<ecalCollectionName>EcalHits</ecalCollectionName>
<ecalRawCollectionName>EcalRawHits</ecalRawCollectionName>
@@ -44,6 +45,8 @@
<clusterThreshold>0</clusterThreshold>
<ecalName>Ecal</ecalName>
<ecalCollectionName>EcalRawHits</ecalCollectionName>
+ <xMin>-5</xMin>
+ <xMax>4</xMax>
</driver>
<driver name="EcalTrigger"
type="org.lcsim.hps.recon.ecal.HPS1BitTriggerDriver">
hps-java/src/main/resources/org/lcsim/hps/steering
diff -u -r1.4 -r1.5
--- ecal_1bit_ap.lcsim 17 Nov 2011 01:43:27 -0000 1.4
+++ ecal_1bit_ap.lcsim 19 Nov 2011 00:52:55 -0000 1.5
@@ -1,7 +1,7 @@
<!--
Example LCSim steering file to run simple HPS ECal clustering and analysis.
@author Sho Uemura <[log in to unmask]>
- @version $Id: ecal_1bit_ap.lcsim,v 1.4 2011/11/17 01:43:27 meeg Exp $
+ @version $Id: ecal_1bit_ap.lcsim,v 1.5 2011/11/19 00:52:55 meeg Exp $
-->
<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
@@ -21,7 +21,7 @@
<driver name="EcalClusterer"/>
<driver name="EcalTrigger"/>
<driver name="EcalPlots"/>
- <driver name="Writer"/>
+ <!--<driver name="Writer"/>-->
<driver name="AidaSaveDriver"/>
<driver name="ClockDriver"/>
</execute>
@@ -43,6 +43,8 @@
<clusterThreshold>0</clusterThreshold>
<ecalName>Ecal</ecalName>
<ecalCollectionName>EcalRawHits</ecalCollectionName>
+ <xMin>-5</xMin>
+ <xMax>4</xMax>
</driver>
<driver name="EcalTrigger"
type="org.lcsim.hps.recon.ecal.HPS1BitTriggerDriver">
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.1 -r1.2
--- HPSFADCCalorimeterHit.java 4 Nov 2011 00:51:18 -0000 1.1
+++ HPSFADCCalorimeterHit.java 19 Nov 2011 00:52:55 -0000 1.2
@@ -4,13 +4,14 @@
*/
package org.lcsim.hps.recon.ecal;
+import java.util.Comparator;
import org.lcsim.event.CalorimeterHit;
import org.lcsim.event.RawCalorimeterHit;
/**
*
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSFADCCalorimeterHit.java,v 1.1 2011/11/04 00:51:18 meeg Exp $
+ * @version $Id: HPSFADCCalorimeterHit.java,v 1.2 2011/11/19 00:52:55 meeg Exp $
*/
public class HPSFADCCalorimeterHit implements RawCalorimeterHit {
@@ -45,5 +46,10 @@
this.analogHit = analogHit;
}
+ static class TimeComparator implements Comparator<RawCalorimeterHit> {
+ public int compare(RawCalorimeterHit o1, RawCalorimeterHit o2) {
+ return o1.getTimeStamp() - o2.getTimeStamp();
+ }
+ }
}
\ No newline at end of file
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.2 -r1.3
--- HPSFADCClusterer.java 17 Nov 2011 01:43:26 -0000 1.2
+++ HPSFADCClusterer.java 19 Nov 2011 00:52:55 -0000 1.3
@@ -21,13 +21,13 @@
*
* @author Sho Uemura <[log in to unmask]>
*
- * @version $Id: HPSFADCClusterer.java,v 1.2 2011/11/17 01:43:26 meeg Exp $
+ * @version $Id: HPSFADCClusterer.java,v 1.3 2011/11/19 00:52:55 meeg Exp $
*/
public class HPSFADCClusterer extends HPSEcalClusterer {
HPSEcalConverter converter = null;
int coincidenceWindow = 2;
- LinkedList<RawCalorimeterHit> buffer = new LinkedList<RawCalorimeterHit>();
+ LinkedList<HPSFADCCalorimeterHit> buffer = new LinkedList<HPSFADCCalorimeterHit>();
int currentTime;
public HPSFADCClusterer() {
@@ -73,7 +73,7 @@
buffer.remove();
}
- for (HPSFADCCalorimeterHit hit : hits) {
+ for (HPSFADCCalorimeterHit hit : buffer) {
hitMap.put(hit.getCellID(), converter.HitDtoA(hit));
}
}
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.4 -r1.5
--- HPSRawCalorimeterHit.java 30 Sep 2011 23:31:27 -0000 1.4
+++ HPSRawCalorimeterHit.java 19 Nov 2011 00:52:55 -0000 1.5
@@ -1,5 +1,7 @@
package org.lcsim.hps.recon.ecal;
+import java.util.Comparator;
+import org.lcsim.event.CalorimeterHit;
import org.lcsim.event.base.BaseCalorimeterHit;
/**
@@ -7,24 +9,30 @@
* for use in ECalReadout
*
* @author Sho Uemura
- * @version $Id: HPSRawCalorimeterHit.java,v 1.4 2011/09/30 23:31:27 meeg Exp $
+ * @version $Id: HPSRawCalorimeterHit.java,v 1.5 2011/11/19 00:52:55 meeg Exp $
*/
public class HPSRawCalorimeterHit extends BaseCalorimeterHit {
- /**
- * Fully qualified constructor that sets rawEnergy
- *
- * @param energy Raw energy for this cell
- * @param position Global Cartesian coordinate for this cell
- * @param time Time of energy deposition
- * @param id Cell ID
- * @param type Type
- */
- public HPSRawCalorimeterHit(double energy, double[] position, double time, long id, int type) {
- this.rawEnergy = energy;
- this.position = position;
- this.time = time;
- this.id = id;
- this.type = type;
- }
+ /**
+ * Fully qualified constructor that sets rawEnergy
+ *
+ * @param energy Raw energy for this cell
+ * @param position Global Cartesian coordinate for this cell
+ * @param time Time of energy deposition
+ * @param id Cell ID
+ * @param type Type
+ */
+ public HPSRawCalorimeterHit(double energy, double[] position, double time, long id, int type) {
+ this.rawEnergy = energy;
+ this.position = position;
+ this.time = time;
+ this.id = id;
+ this.type = type;
+ }
+
+ static class TimeComparator implements Comparator<CalorimeterHit> {
+ public int compare(CalorimeterHit o1, CalorimeterHit o2) {
+ return Double.compare(o1.getTime(), o2.getTime());
+ }
+ }
}
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.15 -r1.16
--- HPSEcalClusterer.java 17 Nov 2011 01:43:26 -0000 1.15
+++ HPSEcalClusterer.java 19 Nov 2011 00:52:55 -0000 1.16
@@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -13,7 +14,7 @@
import org.lcsim.geometry.Detector;
import org.lcsim.geometry.subdetector.HPSEcal3.NeighborMap;
import org.lcsim.geometry.subdetector.HPSEcal3;
-import org.lcsim.recon.cluster.util.Clusterer;
+import org.lcsim.hps.util.ClockSingleton;
import org.lcsim.util.Driver;
import org.lcsim.util.lcio.LCIOConstants;
@@ -26,7 +27,7 @@
* @author Jeremy McCormick <[log in to unmask]>
* @author Tim Nelson <[log in to unmask]>
*
- * @version $Id: HPSEcalClusterer.java,v 1.15 2011/11/17 01:43:26 meeg Exp $
+ * @version $Id: HPSEcalClusterer.java,v 1.16 2011/11/19 00:52:55 meeg Exp $
*/
public class HPSEcalClusterer extends Driver {
@@ -42,10 +43,17 @@
boolean oddX;
// Map of crystals to their neighbors.
NeighborMap neighborMap = null;
+ double coincidenceWindow = 8.0;
+ LinkedList<CalorimeterHit> buffer = new LinkedList<CalorimeterHit>();
+ int currentTime;
public HPSEcalClusterer() {
}
+ public void setCoincidenceWindow(double coincidenceWindow) {
+ this.coincidenceWindow = coincidenceWindow;
+ }
+
public void setClusterCollectionName(String clusterCollectionName) {
this.clusterCollectionName = clusterCollectionName;
}
@@ -98,12 +106,25 @@
if (hits == null)
throw new RuntimeException("Event is missing ECal raw hits collection!");
- // Hit map.
+ buffer.addAll(hits);
+ // Make a hit map for quick lookup by ID.
Map<Long, CalorimeterHit> hitMap = new HashMap<Long, CalorimeterHit>();
+ if (!hits.isEmpty()) {
+ double time = hits.get(0).getTime() - coincidenceWindow;
+ //purge old hits
+ while (!buffer.isEmpty() && buffer.peek().getTime() <= time) {
+ buffer.remove();
+ }
- // Make a hit map for quick lookup by ID.
- for (CalorimeterHit hit : hits) {
- hitMap.put(hit.getCellID(), hit);
+ for (CalorimeterHit hit : buffer) {
+ //check that the buffer is in sorted order
+ if (hit.getTime() < time) {
+ throw new RuntimeException(String.format("Hits entering clusterer out of order; hit with time %f found"
+ + " before hit with time %f", time, hit.getTime()));
+ }
+ time = hit.getTime();
+ hitMap.put(hit.getCellID(), hit);
+ }
}
// Put Cluster collection into event.
@@ -116,10 +137,8 @@
// New Cluster list to be added to event.
List<Cluster> clusters = new ArrayList<Cluster>();
- Collection<CalorimeterHit> hits = map.values();
-
// Loop over ECal hits to find cluster seeds.
- for (CalorimeterHit hit : hits) {
+ for (CalorimeterHit hit : map.values()) {
// Cut on min seed E.
if (hit.getRawEnergy() < seedEMin)
continue;
hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.1 -r1.2
--- HPSEcalFADCReadoutDriver.java 4 Nov 2011 00:51:19 -0000 1.1
+++ HPSEcalFADCReadoutDriver.java 19 Nov 2011 00:52:55 -0000 1.2
@@ -17,7 +17,7 @@
* Simulates time evolution of preamp output pulse.
*
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcalFADCReadoutDriver.java,v 1.1 2011/11/04 00:51:19 meeg Exp $
+ * @version $Id: HPSEcalFADCReadoutDriver.java,v 1.2 2011/11/19 00:52:55 meeg Exp $
*/
public class HPSEcalFADCReadoutDriver extends HPSEcalReadoutDriver<RawCalorimeterHit> {
//buffer for deposited energy
@@ -100,7 +100,7 @@
eDepMap = new HashMap<Long, RingBuffer>();
sumMap = new HashMap<Long, Double>();
timeMap = new HashMap<Long, Integer>();
- outputQueue = new PriorityQueue(20, new HitComparator());
+ outputQueue = new PriorityQueue(20, new HPSFADCCalorimeterHit.TimeComparator());
pulseIntegral = t0 * Math.E / readoutPeriod;
}
@@ -116,11 +116,4 @@
return 0.0;
}
}
-
- static class HitComparator implements Comparator<RawCalorimeterHit> {
-
- public int compare(RawCalorimeterHit o1, RawCalorimeterHit o2) {
- return o1.getTimeStamp() - o2.getTimeStamp();
- }
- }
}
\ No newline at end of file
hps-java/src/main/java/org/lcsim/hps/analysis/ecal
diff -u -r1.1 -r1.2
--- HPSEcalFADCPlotsDriver.java 4 Nov 2011 00:51:19 -0000 1.1
+++ HPSEcalFADCPlotsDriver.java 19 Nov 2011 00:52:56 -0000 1.2
@@ -5,6 +5,7 @@
import java.util.List;
import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
import org.lcsim.event.RawCalorimeterHit;
import org.lcsim.hps.recon.ecal.HPSEcalCluster;
@@ -15,24 +16,29 @@
* Diagnostic plots for HPS ECal.
*
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcalFADCPlotsDriver.java,v 1.1 2011/11/04 00:51:19 meeg Exp $
+ * @version $Id: HPSEcalFADCPlotsDriver.java,v 1.2 2011/11/19 00:52:56 meeg Exp $
*/
public class HPSEcalFADCPlotsDriver extends Driver {
String edepCollectionName = "EcalHits";
- String rawCollectionName = "EcalRawHits";
- String ecalCollectionName = "EcalCorrectedHits";
+ String rawCollectionName = null;
+ String ecalCollectionName = null;
String clusterCollectionName = "EcalClusters";
AIDA aida = AIDA.defaultInstance();
IHistogram1D edepE;
IHistogram1D rawE;
IHistogram1D ecalE;
- double edepThreshold = 0.2;
+ IHistogram1D clusterE;
+ double edepThreshold = 0.05;
public void setEdepThreshold(double edepThreshold) {
this.edepThreshold = edepThreshold;
}
+ public void setRawCollectionName(String rawCollectionName) {
+ this.rawCollectionName = rawCollectionName;
+ }
+
public void setEcalCollectionName(String ecalCollectionName) {
this.ecalCollectionName = ecalCollectionName;
}
@@ -45,11 +51,18 @@
edepE = aida.histogram1D(
edepCollectionName + " : Hits",
500, 0.0, 5.0);
- rawE = aida.histogram1D(
- rawCollectionName + " : Hits",
- 500, 0.0, 500.0);
- ecalE = aida.histogram1D(
- ecalCollectionName + " : Hits",
+ if (rawCollectionName != null) {
+ rawE = aida.histogram1D(
+ rawCollectionName + " : Hits",
+ 500, 0.0, 500.0);
+ }
+ if (ecalCollectionName != null) {
+ ecalE = aida.histogram1D(
+ ecalCollectionName + " : Hits",
+ 500, 0.0, 5.0);
+ }
+ clusterE = aida.histogram1D(
+ clusterCollectionName + " : Clusters",
500, 0.0, 5.0);
}
@@ -61,22 +74,33 @@
List<CalorimeterHit> edepHits = event.get(CalorimeterHit.class, edepCollectionName);
if (edepHits == null)
throw new RuntimeException("Missing hit collection!");
- List<RawCalorimeterHit> rawHits = event.get(RawCalorimeterHit.class, rawCollectionName);
- if (rawHits == null)
- throw new RuntimeException("Missing hit collection!");
- List<CalorimeterHit> ecalHits = event.get(CalorimeterHit.class, ecalCollectionName);
- if (ecalHits == null)
- throw new RuntimeException("Missing hit collection!");
+
+ if (rawCollectionName != null) {
+ List<RawCalorimeterHit> rawHits = event.get(RawCalorimeterHit.class, rawCollectionName);
+ if (rawHits == null)
+ throw new RuntimeException("Missing hit collection!");
+
+ for (RawCalorimeterHit hit : rawHits) {
+ rawE.fill(hit.getAmplitude());
+ }
+ }
+
+ if (ecalCollectionName != null) {
+ List<CalorimeterHit> ecalHits = event.get(CalorimeterHit.class, ecalCollectionName);
+ if (ecalHits == null)
+ throw new RuntimeException("Missing hit collection!");
+
+ for (CalorimeterHit hit : ecalHits) {
+ ecalE.fill(hit.getRawEnergy());
+ }
+ }
for (CalorimeterHit hit : edepHits) {
if (hit.getRawEnergy() > edepThreshold)
edepE.fill(hit.getRawEnergy());
}
- for (RawCalorimeterHit hit : rawHits) {
- rawE.fill(hit.getAmplitude());
- }
- for (CalorimeterHit hit : ecalHits) {
- ecalE.fill(hit.getRawEnergy());
+ for (Cluster cluster : clusters) {
+ clusterE.fill(cluster.getEnergy());
}
}
}
hps-java/src/main/java/org/lcsim/hps/analysis/ecal
diff -u -r1.1 -r1.2
--- HPSEcalTriggerPlotsDriver.java 21 Oct 2011 19:56:56 -0000 1.1
+++ HPSEcalTriggerPlotsDriver.java 19 Nov 2011 00:52:56 -0000 1.2
@@ -19,7 +19,7 @@
* Diagnostic plots for HPS ECal.
*
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcalTriggerPlotsDriver.java,v 1.1 2011/10/21 19:56:56 meeg Exp $
+ * @version $Id: HPSEcalTriggerPlotsDriver.java,v 1.2 2011/11/19 00:52:56 meeg Exp $
*/
public class HPSEcalTriggerPlotsDriver extends Driver {
@@ -31,7 +31,6 @@
IHistogram2D seedHitXYPlot;
IHistogram2D triggerClusterHitXYPlot;
IHistogram2D triggerSeedHitXYPlot;
- int numTriggers = 0;
IDDecoder dec = null;
public void setEcalCollectionName(String ecalCollectionName) {
CVSspam 0.2.8