Commit in hps-java/src/main on MAIN | |||
java/org/lcsim/hps/users/mgraham/DataTrackerHitDriver.java | +26 | -27 | 1.2 -> 1.3 |
java/org/lcsim/hps/monitoring/SVTHitReconstructionPlots.java | -120 | 1.1 removed | |
resources/org/lcsim/hps/steering/HitRecoMonitoring.lcsim | +9 | -1 | 1.2 -> 1.3 |
java/org/lcsim/hps/recon/tracking/SVTRawTrackerHitThresholdDriver.java | +81 | added 1.1 | |
/HPSNearestNeighborRMS.java | +3 | -2 | 1.4 -> 1.5 |
java/org/lcsim/hps/monitoring/svt/SVTHitReconstructionPlots.java | +42 | -6 | 1.1 -> 1.2 |
/SVTHitPulsePlots.java | +4 | -5 | 1.1 -> 1.2 |
+165 | -161 |
Bunch of changes for SVT hit monitoring
diff -u -r1.2 -r1.3 --- DataTrackerHitDriver.java 25 Apr 2012 20:22:11 -0000 1.2 +++ DataTrackerHitDriver.java 1 May 2012 17:59:22 -0000 1.3 @@ -9,12 +9,9 @@
import org.lcsim.detector.tracker.silicon.SiSensor; import org.lcsim.detector.tracker.silicon.SiTrackerModule; import org.lcsim.event.EventHeader;
-import org.lcsim.event.RawTrackerHit; -import org.lcsim.event.SimTrackerHit;
import org.lcsim.geometry.Detector; import org.lcsim.hps.recon.tracking.*; import org.lcsim.recon.tracking.digitization.sisim.*;
-import org.lcsim.recon.tracking.digitization.sisim.config.SimTrackerHitReadoutDriver;
import org.lcsim.util.Driver; import org.lcsim.util.lcio.LCIOUtil;
@@ -133,29 +130,7 @@
*/ private void initialize() {
- - // Create Strip clustering algorithm. - HPSNearestNeighborRMS stripClusteringAlgo = new HPSNearestNeighborRMS(); - stripClusteringAlgo.setSeedThreshold(clusterSeedThreshold); - stripClusteringAlgo.setNeighborThreshold(clusterNeighborThreshold); - stripClusteringAlgo.setClusterThreshold(clusterThreshold); - -// hitMaker=new HPSFittedRawTrackerHitMaker(shaperFit); - // Create the clusterers and set hit-making parameters. - stripClusterer = new HPSStripMaker( stripClusteringAlgo); - - stripClusterer.setMaxClusterSize(clusterMaxSize); - stripClusterer.setCentralStripAveragingThreshold(clusterCentralStripAveragingThreshold); - - // Set the cluster errors. - stripClusterer.SetOneClusterErr(oneClusterErr); - stripClusterer.SetTwoClusterErr(twoClusterErr); - stripClusterer.SetThreeClusterErr(threeClusterErr); - stripClusterer.SetFourClusterErr(fourClusterErr); - stripClusterer.SetFiveClusterErr(fiveClusterErr); - - // Set the detector to process. - processPaths.add(subdetectorName);
+
}
@@ -198,6 +173,30 @@
//if (debug) // System.out.println("added " + processModules.size() + " modules"); }
+ + + // Create Strip clustering algorithm. + HPSNearestNeighborRMS stripClusteringAlgo = new HPSNearestNeighborRMS(); + stripClusteringAlgo.setSeedThreshold(clusterSeedThreshold); + stripClusteringAlgo.setNeighborThreshold(clusterNeighborThreshold); + stripClusteringAlgo.setClusterThreshold(clusterThreshold); + +// hitMaker=new HPSFittedRawTrackerHitMaker(shaperFit); + // Create the clusterers and set hit-making parameters. + stripClusterer = new HPSStripMaker( stripClusteringAlgo); + + stripClusterer.setMaxClusterSize(clusterMaxSize); + stripClusterer.setCentralStripAveragingThreshold(clusterCentralStripAveragingThreshold); + + // Set the cluster errors. + stripClusterer.SetOneClusterErr(oneClusterErr); + stripClusterer.SetTwoClusterErr(twoClusterErr); + stripClusterer.SetThreeClusterErr(threeClusterErr); + stripClusterer.SetFourClusterErr(fourClusterErr); + stripClusterer.SetFiveClusterErr(fiveClusterErr); + + // Set the detector to process. + processPaths.add(subdetectorName);
} /**
@@ -217,7 +216,7 @@
// } // Make strip hits.
- for (SiSensor sensor : processSensors) {
+ for (SiSensor sensor : processSensors) {
stripHits1D.addAll(stripClusterer.makeHits(sensor)); }
diff -N SVTHitReconstructionPlots.java --- SVTHitReconstructionPlots.java 30 Apr 2012 18:49:46 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,120 +0,0 @@
-package org.lcsim.hps.monitoring; - -import hep.aida.*; -import java.util.ArrayList; -import java.util.List; -import org.lcsim.detector.tracker.silicon.SiSensor; -import org.lcsim.event.EventHeader; -import org.lcsim.event.RawTrackerHit; -import org.lcsim.geometry.Detector; -import org.lcsim.hps.recon.tracking.HPSFittedRawTrackerHit; -import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants; -import org.lcsim.recon.tracking.digitization.sisim.SiTrackerHitStrip1D; -import org.lcsim.util.Driver; -import org.lcsim.util.aida.AIDA; - -/** - * - * @author mgraham - */ -public class SVTHitReconstructionPlots extends Driver { - - private List<IPlotter> plotters = new ArrayList<IPlotter>(); - private AIDA aida = AIDA.defaultInstance(); - private String rawTrackerHitCollectionName = "RawTrackerHitMaker_RawTrackerHits"; - private String rawCalorimeterHitCollectionName = "EcalRawHits"; - private String trackerHitCollectionName = "StripClusterer_SiTrackerHitStrip1D"; - private String trackerName = "Tracker"; - private int eventCount; - private Detector detector = null; - private IHistogram2D adcValuePlot; - - protected void detectorChanged(Detector detector) { - this.detector = detector; - aida.tree().cd("/"); - - - List<SiSensor> sensors = detector.getSubdetector(trackerName).getDetectorElement().findDescendants(SiSensor.class); - - - IAnalysisFactory fac = aida.analysisFactory(); - IPlotter plotter = fac.createPlotterFactory().create("HPS SVT Timing Plots"); - plotters.add(plotter); - IPlotterStyle style = plotter.style(); - style.dataStyle().fillStyle().setColor("yellow"); - style.dataStyle().errorBarStyle().setVisible(false); - plotter.createRegions(5, 4); - - IPlotter plotter2 = fac.createPlotterFactory().create("HPS SVT Amplitude Plots"); - plotters.add(plotter2); - IPlotterStyle style2 = plotter2.style(); - style2.dataStyle().fillStyle().setColor("yellow"); - style2.dataStyle().errorBarStyle().setVisible(false); - plotter2.createRegions(5, 4); - - IPlotter plotter3 = fac.createPlotterFactory().create("HPS SVT Pulse Plots"); - plotters.add(plotter3); - IPlotterStyle style3 = plotter3.style(); - - style3.dataStyle().fillStyle().setColor("yellow"); - style3.dataStyle().errorBarStyle().setVisible(false); - plotter3.createRegions(5, 4); - - int ns = sensors.size(); - for (int i = 0; i < ns; i++) { - IHistogram1D timingPlot = aida.histogram1D(sensors.get(i).getName() + "_timing", 50, -10, 90); - IHistogram1D amplitudePlot = aida.histogram1D(sensors.get(i).getName() + "_amplitude", 50, 0, 3000.0); - IHistogram2D pulsePlot = aida.histogram2D(sensors.get(i).getName() + "_pulse", 6, 0, 24 * 6.0, 50, -100, 3000.0); - plotter.region(i).plot(timingPlot); - plotter2.region(i).plot(amplitudePlot); - plotter3.region(i).plot(pulsePlot); - } - plotter.show(); - plotter2.show(); - plotter3.show(); - } - - public SVTHitReconstructionPlots() { - } - - public void setRawTrackerHitCollectionName(String rawTrackerHitCollectionName) { - this.rawTrackerHitCollectionName = rawTrackerHitCollectionName; - } - - public void setRawCalorimeterHitCollectionName(String rawCalorimeterHitCollectionName) { - this.rawCalorimeterHitCollectionName = rawCalorimeterHitCollectionName; - } - - public void setTrackerHitCollectionName(String trackerHitCollectionName) { - this.trackerHitCollectionName = trackerHitCollectionName; - } - - public void process(EventHeader event) { - ++eventCount; - List<RawTrackerHit> rawHits = event.get(RawTrackerHit.class, "SVTRawTrackerHits"); - List<HPSFittedRawTrackerHit> fittedrawHits = event.get(HPSFittedRawTrackerHit.class, "SVTFittedRawTrackerHits"); - List<SiTrackerHitStrip1D> stripHits = event.get(SiTrackerHitStrip1D.class, "StripClusterer_SiTrackerHitStrip1D"); - for (HPSFittedRawTrackerHit hrth : fittedrawHits) { - double fittedAmp = hrth.getAmp(); - double fittedT0 = hrth.getT0(); - String sensorName = hrth.getRawTrackerHit().getDetectorElement().getName(); - aida.histogram1D(sensorName + "_timing").fill(fittedT0); - aida.histogram1D(sensorName + "_amplitude").fill(fittedAmp); - fillPulsePlot(hrth.getRawTrackerHit()); - - } - - } - - private void fillPulsePlot(RawTrackerHit hit) { - String sensorName = hit.getDetectorElement().getName(); - SiSensor sensor = (SiSensor) hit.getDetectorElement(); - int strip = hit.getIdentifierFieldValue("strip"); - short[] adcVal = hit.getADCValues(); - double ped = HPSSVTCalibrationConstants.getPedestal(sensor, strip); - for (int i = 0; i < 6; i++) { - double pedSub = (adcVal[i] - ped); - aida.histogram2D(sensorName+"_pulse").fill(24.0*i, pedSub); - } - } -}
diff -u -r1.2 -r1.3 --- HitRecoMonitoring.lcsim 30 Apr 2012 23:17:35 -0000 1.2 +++ HitRecoMonitoring.lcsim 1 May 2012 17:59:22 -0000 1.3 @@ -14,6 +14,7 @@
<driver name="RawTrackerHitFitterDriver"/> <driver name="TrackerHitDriver"/> <driver name="SVTHitRecoPlots"/>
+ <driver name="CleanupDriver"/>
</execute> <drivers>
@@ -44,6 +45,13 @@
<eventInterval>1</eventInterval> </driver> <driver name="HPSSVTDAQMaps" type="org.lcsim.hps.recon.tracking.HPSSVTDAQMaps"/>
- <driver name="RawTrackerHitMaker" type="org.lcsim.hps.recon.tracking.SVTDataToRawTrackerHitDriver"/>
+ <driver name="RawTrackerHitMaker" type="org.lcsim.hps.recon.tracking.SVTDataToRawTrackerHitDriver"/>
+
+ <driver name="CleanupDriver"
+ type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver">
+ <collectionNames>TrackerHits SVTRawTrackerHits SVTFittedRawTrackerHits</collectionNames>
+ </driver>
+
+
</drivers> </lcsim>
diff -N SVTRawTrackerHitThresholdDriver.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ SVTRawTrackerHitThresholdDriver.java 1 May 2012 17:59:22 -0000 1.1 @@ -0,0 +1,81 @@
+package org.lcsim.hps.recon.tracking; + +import java.util.ArrayList; +import java.util.List; +import org.lcsim.detector.tracker.silicon.SiSensor; +import org.lcsim.event.EventHeader; +import org.lcsim.event.RawTrackerHit; +import org.lcsim.geometry.Detector; +import org.lcsim.util.Driver; + +/** + * + * @author mgraham + */ +public class SVTRawTrackerHitThresholdDriver extends Driver { + + private String rawTrackerHitCollectionName = "RawTrackerHitMaker_RawTrackerHits"; + private String outputHitCollectionName = "RawTrackerHitsThreshold"; + private String calibFileName = "foobar"; + private String trackerName = "Tracker"; + private Detector detector; + private List<SiSensor> sensors; + private double noiseThreshold = 3; + private int nhitsAboveNoise = 2; + + public SVTRawTrackerHitThresholdDriver() { + } + + public void setRawTrackerHitCollectionName(String rawTrackerHitCollectionName) { + this.rawTrackerHitCollectionName = rawTrackerHitCollectionName; + } + + public void setOutputHitCollectionName(String outputHitCollectionName) { + this.outputHitCollectionName = outputHitCollectionName; + } + + public void setCalibFileName(String calibFileName) { + this.calibFileName = calibFileName; + } + + public void setNoiseThreshold(double thres){ + this.noiseThreshold=thres; + } + + public void setNhitsAboveNoise(int nhits){ + this.nhitsAboveNoise=nhits; + } + + protected void detectorChanged(Detector detector) { + } + + public void process(EventHeader event) { + if (event.hasCollection(RawTrackerHit.class, rawTrackerHitCollectionName)) { + if (!HPSSVTCalibrationConstants.calibrationLoaded()) { + HPSSVTCalibrationConstants.loadCalibrationConstants(); + } + // Get RawTrackerHit collection from event. + List<RawTrackerHit> rawTrackerHits = event.get(RawTrackerHit.class, rawTrackerHitCollectionName); + List<RawTrackerHit> outputHits = new ArrayList<RawTrackerHit>(); + + // Increment strip hit count. + for (RawTrackerHit hit : rawTrackerHits) { + SiSensor sensor=(SiSensor) hit.getDetectorElement(); + int strip=hit.getIdentifierFieldValue("strip"); + short[] adcVal=hit.getADCValues(); + double ped=HPSSVTCalibrationConstants.getPedestal(sensor, strip); + double noise=HPSSVTCalibrationConstants.getNoise(sensor, strip); + int nAbove=0; + for(int i=0;i<6;i++){ + double pedSubNorm=(adcVal[i]-ped)/noise; + if(pedSubNorm>noiseThreshold) + nAbove++; + } + if(nAbove>=nhitsAboveNoise) + outputHits.add(hit); + } + + event.put(outputHitCollectionName, outputHits, RawTrackerHit.class, 0); + } + } +}
\ No newline at end of file
diff -u -r1.4 -r1.5 --- HPSNearestNeighborRMS.java 25 Apr 2012 18:01:32 -0000 1.4 +++ HPSNearestNeighborRMS.java 1 May 2012 17:59:22 -0000 1.5 @@ -18,7 +18,7 @@
private double _neighbor_threshold; private double _cluster_threshold; private double _meanTime=48;
- private double _timeWindow = 12;
+ private double _timeWindow = 48;
/** * Instantiate NearestNeighborRMS with specified thresholds.
@@ -151,7 +151,8 @@
// Check for duplicate RawTrackerHits or channel numbers if (channel_to_hit.containsKey(channel_number)) {
- throw new RuntimeException("Duplicate channel number: "+channel_number);
+// throw new RuntimeException("Duplicate channel number: "+channel_number);
+ System.out.println("Duplicate channel number: "+channel_number);
} // Add this hit to the maps that relate channels and hits
diff -u -r1.1 -r1.2 --- SVTHitReconstructionPlots.java 30 Apr 2012 23:17:00 -0000 1.1 +++ SVTHitReconstructionPlots.java 1 May 2012 17:59:22 -0000 1.2 @@ -2,7 +2,9 @@
import hep.aida.*; import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.lcsim.detector.tracker.silicon.SiSensor; import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit;
@@ -27,12 +29,13 @@
private String trackerName = "Tracker"; private Detector detector=null; private int eventCount;
+ private List<SiSensor> sensors;
protected void detectorChanged(Detector detector) { this.detector = detector; aida.tree().cd("/");
- List<SiSensor> sensors = detector.getSubdetector(trackerName).getDetectorElement().findDescendants(SiSensor.class);
+ sensors = detector.getSubdetector(trackerName).getDetectorElement().findDescendants(SiSensor.class);
IAnalysisFactory fac = aida.analysisFactory();
@@ -49,16 +52,42 @@
style2.dataStyle().fillStyle().setColor("yellow"); style2.dataStyle().errorBarStyle().setVisible(false); plotter2.createRegions(5, 4);
-
+
+
+ IPlotter plotter3 = fac.createPlotterFactory().create("HPS SVT Raw Hit Plots");
+ plotters.add(plotter3);
+ IPlotterStyle style3 = plotter3.style();
+ style3.dataStyle().fillStyle().setColor("yellow");
+ style3.dataStyle().errorBarStyle().setVisible(false);
+ plotter3.createRegions(5, 4);
+
+ IPlotter plotter4 = fac.createPlotterFactory().create("HPS SVT Reco Hit Plots");
+ plotters.add(plotter4);
+ IPlotterStyle style4 = plotter4.style();
+ style4.dataStyle().fillStyle().setColor("yellow");
+ style4.dataStyle().errorBarStyle().setVisible(false);
+ plotter4.createRegions(5, 4);
+
int ns = sensors.size(); for (int i = 0; i < ns; i++) {
- IHistogram1D timingPlot = aida.histogram1D(sensors.get(i).getName() + "_timing", 50, -10, 90); - IHistogram1D amplitudePlot = aida.histogram1D(sensors.get(i).getName() + "_amplitude", 50, 0, 3000.0);
+ IHistogram1D timingPlot = aida.histogram1D(sensors.get(i).getName() + "_timing", 60, -10, 50); + IHistogram1D amplitudePlot = aida.histogram1D(sensors.get(i).getName() + "_amplitude", 50, 0, 2000.0); + + IHistogram1D nrawPlot = aida.histogram1D(sensors.get(i).getName() + "_raw_hits", 10, 0, 9.0); + IHistogram1D nrecoPlot = aida.histogram1D(sensors.get(i).getName() + "_reco_hits", 10, 0, 9.0); + IHistogram1D nclustPlot = aida.histogram1D(sensors.get(i).getName() + "_clusters", 10, 0, 9.0); +
plotter.region(i).plot(timingPlot); plotter2.region(i).plot(amplitudePlot);
+ plotter3.region(i).plot(nrawPlot); + plotter4.region(i).plot(nrecoPlot); +
} plotter.show(); plotter2.show();
+ plotter3.show(); + plotter4.show(); +
} public SVTHitReconstructionPlots() {
@@ -83,15 +112,22 @@
++eventCount; List<RawTrackerHit> rawHits = event.get(RawTrackerHit.class, rawTrackerHitCollectionName); List<HPSFittedRawTrackerHit> fittedrawHits = event.get(HPSFittedRawTrackerHit.class, fittedTrackerHitCollectionName);
- List<SiTrackerHitStrip1D> stripHits = event.get(SiTrackerHitStrip1D.class, trackerHitCollectionName);
+ List<SiTrackerHitStrip1D> stripHits = event.get(SiTrackerHitStrip1D.class, trackerHitCollectionName);
for (HPSFittedRawTrackerHit hrth : fittedrawHits) { double fittedAmp = hrth.getAmp(); double fittedT0 = hrth.getT0(); String sensorName = hrth.getRawTrackerHit().getDetectorElement().getName(); aida.histogram1D(sensorName + "_timing").fill(fittedT0); aida.histogram1D(sensorName + "_amplitude").fill(fittedAmp);
-
}
+ for(SiSensor sensor:sensors){ + String sensorName=sensor.getName(); + int nraw=sensor.getReadout().getHits(RawTrackerHit.class).size(); + int nreco=sensor.getReadout().getHits(HPSFittedRawTrackerHit.class).size(); + aida.histogram1D(sensorName + "_raw_hits").fill(nraw); + aida.histogram1D(sensorName + "_reco_hits").fill(nreco); + } +
} }
diff -u -r1.1 -r1.2 --- SVTHitPulsePlots.java 30 Apr 2012 23:16:41 -0000 1.1 +++ SVTHitPulsePlots.java 1 May 2012 17:59:22 -0000 1.2 @@ -35,17 +35,16 @@
IAnalysisFactory fac = aida.analysisFactory();
- IPlotter plotter3 = fac.createPlotterFactory().create("HPS SVT Pulse Plots");
+ IPlotter plotter3 = fac.createPlotterFactory().create("HPS SVT Pulse Plots: Raw Hits");
plotters.add(plotter3); IPlotterStyle style3 = plotter3.style(); style3.statisticsBoxStyle().setVisible(false); style3.dataStyle().fillStyle().setColor("yellow"); style3.dataStyle().errorBarStyle().setVisible(false);
- plotter3.createRegions(5, 4); -
+ plotter3.createRegions(5, 4);
int ns = sensors.size(); for (int i = 0; i < ns; i++) {
- IHistogram2D pulsePlot = aida.histogram2D(sensors.get(i).getName() + "_pulse", 6, 0, 24 * 6.0, 50, 2500, 8000.0);
+ IHistogram2D pulsePlot = aida.histogram2D(sensors.get(i).getName() + "_pulse", 6, 0, 24 * 6.0, 50, -1000, 2000.0);
plotter3.region(i).plot(pulsePlot); } plotter3.show();
@@ -79,7 +78,7 @@
short[] adcVal = hit.getADCValues(); double ped = HPSSVTCalibrationConstants.getPedestal(sensor, strip); for (int i = 0; i < 6; i++) {
- double pedSub = (adcVal[i]);
+ double pedSub = (adcVal[i]-ped);
aida.histogram2D(sensorName+"_pulse").fill(24.0*i, pedSub); } }
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1