Commit in hps-java/src/main/java/org/lcsim/hps/monitoring/ecal on MAIN | |||
EcalClusterPlots.java | +18 | -4 | 1.4 -> 1.5 |
EcalHitPlots.java | +29 | -13 | 1.3 -> 1.4 |
EcalPedestalPlots.java | +6 | -1 | 1.7 -> 1.8 |
EcalEvsX.java | +26 | -17 | 1.5 -> 1.6 |
EcalMonitoringPlots.java | +31 | -18 | 1.6 -> 1.7 |
+110 | -53 |
various tweaks to plots
diff -u -r1.4 -r1.5 --- EcalClusterPlots.java 13 May 2012 21:39:24 -0000 1.4 +++ EcalClusterPlots.java 16 May 2012 16:05:59 -0000 1.5 @@ -26,11 +26,21 @@
IHistogram1D clusterEnergyPlot; IHistogram1D clusterMaxEnergyPlot; int eventn = 0;
+ double maxE = 5000; + boolean logScale = false;
public void setInputCollection(String inputCollection) { this.inputCollection = inputCollection; }
+ public void setMaxE(double maxE) { + this.maxE = maxE; + } + + public void setLogScale(boolean logScale) { + this.logScale = logScale; + } +
protected void detectorChanged(Detector detector) { plotterFrame = new AIDAFrame();
@@ -40,10 +50,11 @@
plotter = aida.analysisFactory().createPlotterFactory().create("Cluster Counts"); plotter.setTitle("Cluster Counts"); plotterFrame.addPlotter(plotter);
+ plotter.style().dataStyle().errorBarStyle().setVisible(false);
// Setup plots. aida.tree().cd("/");
- clusterCountPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Count", 10, -0.5, 9.5);
+ clusterCountPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Count per Event", 10, -0.5, 9.5);
clusterSizePlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Size", 10, -0.5, 9.5); // Create the plotter regions.
@@ -56,11 +67,14 @@
plotter2 = aida.analysisFactory().createPlotterFactory().create("Cluster Energies"); plotter2.setTitle("Cluster Energies"); plotterFrame.addPlotter(plotter2);
+ plotter2.style().dataStyle().errorBarStyle().setVisible(false);
-// plotter2.style().yAxisStyle().setParameter("scale", "log");
+ if (logScale) { + plotter2.style().yAxisStyle().setParameter("scale", "log"); + }
- clusterEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Energy", 1000, -100, 5000); - clusterMaxEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Maximum Cluster Energy In Event", 1000, -100, 5000);
+ clusterEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Energy", 1000, 500, maxE); + clusterMaxEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Maximum Cluster Energy In Event", 1000, -100, maxE);
// Create the plotter regions.
diff -u -r1.3 -r1.4 --- EcalHitPlots.java 13 May 2012 21:39:24 -0000 1.3 +++ EcalHitPlots.java 16 May 2012 16:05:59 -0000 1.4 @@ -25,11 +25,21 @@
IHistogram1D hitEnergyPlot; IHistogram1D hitMaxEnergyPlot; int eventn = 0;
+ double maxE = 5000; + boolean logScale = false;
public void setInputCollection(String inputCollection) { this.inputCollection = inputCollection; }
+ public void setMaxE(double maxE) { + this.maxE = maxE; + } + + public void setLogScale(boolean logScale) { + this.logScale = logScale; + } +
protected void detectorChanged(Detector detector) { plotterFrame = new AIDAFrame();
@@ -39,6 +49,7 @@
plotter = aida.analysisFactory().createPlotterFactory().create("Hit Counts"); plotter.setTitle("Hit Counts"); plotterFrame.addPlotter(plotter);
+ plotter.style().dataStyle().errorBarStyle().setVisible(false);
// Setup plots. aida.tree().cd("/");
@@ -55,11 +66,14 @@
plotter2 = aida.analysisFactory().createPlotterFactory().create("Hit Energies"); plotter2.setTitle("Hit Energies"); plotterFrame.addPlotter(plotter2);
+ plotter2.style().dataStyle().errorBarStyle().setVisible(false);
- hitEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Energy", 1000, -100, 5000); - hitMaxEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Maximum Hit Energy In Event", 1000, -100, 5000);
+ hitEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Energy", 1000, -100, maxE); + hitMaxEnergyPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Maximum Hit Energy In Event", 1000, -100, maxE);
-// plotter2.style().yAxisStyle().setParameter("scale", "log");
+ if (logScale) { + plotter2.style().yAxisStyle().setParameter("scale", "log"); + }
// Create the plotter regions. plotter2.createRegions(1, 2);
@@ -88,18 +102,20 @@
} }
- public void endOfData() { - if (plotter != null) { - plotter.hide(); - plotter.destroyRegions(); - } - if (hitCountPlot != null) { - hitCountPlot.reset(); - } - }
+// public void endOfData() { +// if (plotter != null) { +// plotter.hide(); +// plotter.destroyRegions(); +// } +// if (hitCountPlot != null) { +// hitCountPlot.reset(); +// } +// }
public void reset() {
- plotter.hide();
hitCountPlot.reset();
+ hitTimePlot.reset(); + hitEnergyPlot.reset(); + hitMaxEnergyPlot.reset();
} }
\ No newline at end of file
diff -u -r1.7 -r1.8 --- EcalPedestalPlots.java 13 May 2012 21:39:24 -0000 1.7 +++ EcalPedestalPlots.java 16 May 2012 16:05:59 -0000 1.8 @@ -45,6 +45,7 @@
int eventn = 0; boolean hide = false; int calWindow = 0;
+ double maxE = 1000;
public EcalPedestalPlots() { int count = 0;
@@ -63,6 +64,10 @@
} }
+ public void setMaxE(double maxE) { + this.maxE = maxE; + } +
public void setCalWindow(int calWindow) { this.calWindow = calWindow; }
@@ -93,7 +98,7 @@
// IHistogram1D hist = aida.histogram1D("ECAL: x=" + i + "; y=" + j, 1000, 0, 16); // plots[x + 23][y + 5] = aida.cloud1D("ECAL: x=" + x + "; y=" + y); if (calWindow == 0) {
- aPlots[x + 23][y + 5] = aida.histogram1D("ECAL Amplitudes: x=" + x + "; y=" + y, 500, -100, 1000);
+ aPlots[x + 23][y + 5] = aida.histogram1D("ECAL Amplitudes: x=" + x + "; y=" + y, 500, -100, maxE);
} else { aPlots[x + 23][y + 5] = aida.histogram1D("ECAL Amplitudes: x=" + x + "; y=" + y, 1024, -0.5, 1023.5); }
diff -u -r1.5 -r1.6 --- EcalEvsX.java 13 May 2012 21:39:24 -0000 1.5 +++ EcalEvsX.java 16 May 2012 16:05:59 -0000 1.6 @@ -24,6 +24,7 @@
IHistogram2D EvsXPlot; IHistogram1D invMassPlot; IHistogram2D clusterPairEnergyPlot;
+ IHistogram2D clusterPairPositionPlot;
Detector detector; int eventn = 0; double targetZ = 0;
@@ -50,12 +51,14 @@
// Setup the plotter. plotter = aida.analysisFactory().createPlotterFactory().create("HPS ECal E vs X Plot");
+ plotter.style().dataStyle().errorBarStyle().setVisible(false);
// Setup plots. aida.tree().cd("/");
- EvsXPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : E vs X", 50, -400.0, 400.0, 200, -500, 2000); - invMassPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Photon Pair Mass", 100, 0.0, 100.0);
+ EvsXPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : E vs X", 50, -350.0, 350.0, 200, -100, 2000); + invMassPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Photon Pair Mass", 50, 0.0, 100.0);
clusterPairEnergyPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Pair Energies", 1000, -100, 2000, 1000, -100, 2000);
+ clusterPairPositionPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Pair Positions", 50, -350, 350, 50, -350, 350);
// Create the plotter regions. plotter.createRegions(2, 2);
@@ -73,6 +76,12 @@
style.statisticsBoxStyle().setVisible(false); style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); style.zAxisStyle().setParameter("scale", "log");
+ plotter.region(3).plot(clusterPairPositionPlot); + style = plotter.region(3).style(); + style.setParameter("hist2DStyle", "colorMap"); + style.statisticsBoxStyle().setVisible(false); + style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + style.zAxisStyle().setParameter("scale", "log");
plotter.show(); }
@@ -96,12 +105,15 @@
} for (int i = 0; i < clusters.size() - 1; i++) { double e1 = clusters.get(i).getEnergy();
+ double x1 = clusters.get(i).getPosition()[0];
for (int j = i + 1; j < clusters.size(); j++) { double e2 = clusters.get(j).getEnergy();
- if (clusters.get(i).getPosition()[1] * clusters.get(j).getPosition()[1] > 0) { - continue; - }
+ double x2 = clusters.get(j).getPosition()[0]; +// if (clusters.get(i).getPosition()[1] * clusters.get(j).getPosition()[1] > 0) { +// continue; +// }
clusterPairEnergyPlot.fill(Math.max(e1, e2), Math.min(e1, e2));
+ clusterPairPositionPlot.fill(Math.max(x1, x2), Math.min(x1, x2));
// double e1e2 = clusters.get(i).getEnergy() * clusters.get(j).getEnergy(); // double dx2 = Math.pow(clusters.get(i).getPosition()[0] - clusters.get(j).getPosition()[0], 2) + Math.pow(clusters.get(i).getPosition()[1] - clusters.get(j).getPosition()[1], 2); // invMassPlot.fill(Math.sqrt(e1e2 * dx2 / (135 * 135)));
@@ -119,19 +131,16 @@
return new BasicHepLorentzVector(cluster.getEnergy(), VecOp.mult(cluster.getEnergy(), direction)); }
- public void endOfData() { - if (plotter != null) { - plotter.hide(); - plotter.destroyRegions(); - } - if (EvsXPlot != null) { - EvsXPlot.reset(); - } - } -
+// public void endOfData() { +// if (plotter != null) { +// plotter.hide(); +// plotter.destroyRegions(); +// } +// if (EvsXPlot != null) { +// EvsXPlot.reset(); +// } +// }
public void reset() {
- plotter.hide();
EvsXPlot.reset();
- detectorChanged(detector);
} }
\ No newline at end of file
diff -u -r1.6 -r1.7 --- EcalMonitoringPlots.java 13 May 2012 21:39:24 -0000 1.6 +++ EcalMonitoringPlots.java 16 May 2012 16:05:59 -0000 1.7 @@ -3,7 +3,6 @@
import hep.aida.IHistogram2D; import hep.aida.IPlotter; import hep.aida.IPlotterStyle;
-import hep.aida.ref.plotter.PlotterRegion;
import java.util.List; import org.lcsim.event.CalorimeterHit;
@@ -14,16 +13,20 @@
import org.lcsim.geometry.Detector; import org.lcsim.hps.monitoring.Redrawable; import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.recon.ecal.HPSEcalCluster;
import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA; public class EcalMonitoringPlots extends Driver implements Resettable, Redrawable { String inputCollection = "EcalReadoutHits";
+ String clusterCollection = "EcalClusters";
AIDA aida = AIDA.defaultInstance(); IPlotter plotter; IHistogram2D hitCountFillPlot; IHistogram2D hitCountDrawPlot;
+ IHistogram2D clusterCountFillPlot; + IHistogram2D clusterCountDrawPlot;
int eventRefreshRate = 1; int eventn = 0; boolean hide = false;
@@ -35,6 +38,10 @@
this.inputCollection = inputCollection; }
+ public void setClusterCollection(String clusterCollection) { + this.clusterCollection = clusterCollection; + } +
public void setHide(boolean hide) { this.hide = hide; }
@@ -46,16 +53,20 @@
aida.tree().cd("/"); hitCountDrawPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Count", 47, -23.5, 23.5, 11, -5.5, 5.5); hitCountFillPlot = makeCopy(hitCountDrawPlot);
+ clusterCountDrawPlot = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Center Count", 47, -23.5, 23.5, 11, -5.5, 5.5); + clusterCountFillPlot = makeCopy(clusterCountDrawPlot);
// Create the plotter regions.
- plotter.createRegion();
+ plotter.createRegions(1, 2);
plotter.style().statisticsBoxStyle().setVisible(false); IPlotterStyle style = plotter.region(0).style(); style.setParameter("hist2DStyle", "colorMap"); style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); plotter.region(0).plot(hitCountDrawPlot);
- ((PlotterRegion) plotter.region(0)).getPlot().setAllowUserInteraction(false); - ((PlotterRegion) plotter.region(0)).getPlot().setAllowPopupMenus(false);
+ style = plotter.region(1).style(); + style.setParameter("hist2DStyle", "colorMap"); + style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + plotter.region(1).plot(clusterCountDrawPlot);
if (!hide) { plotter.show(); }
@@ -67,37 +78,37 @@
for (BaseRawCalorimeterHit hit : hits) { hitCountFillPlot.fill(hit.getIdentifierFieldValue("ix"), hit.getIdentifierFieldValue("iy")); }
- if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) { - redraw(); - }
} if (event.hasCollection(RawTrackerHit.class, inputCollection)) { List<RawTrackerHit> hits = event.get(RawTrackerHit.class, inputCollection); for (RawTrackerHit hit : hits) { hitCountFillPlot.fill(hit.getIdentifierFieldValue("ix"), hit.getIdentifierFieldValue("iy")); }
- if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) { - redraw(); - }
} if (event.hasCollection(CalorimeterHit.class, inputCollection)) { List<CalorimeterHit> hits = event.get(CalorimeterHit.class, inputCollection); for (CalorimeterHit hit : hits) { hitCountFillPlot.fill(hit.getIdentifierFieldValue("ix"), hit.getIdentifierFieldValue("iy")); }
- if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) { - redraw();
+ } + if (event.hasCollection(HPSEcalCluster.class, clusterCollection)) { + List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, clusterCollection); +//if (clusters.size()>1) + for (HPSEcalCluster cluster : clusters) { + clusterCountFillPlot.fill(cluster.getSeedHit().getIdentifierFieldValue("ix"), cluster.getSeedHit().getIdentifierFieldValue("iy"));
} }
- } - - public void endOfData() { - if (plotter != null) { - plotter.hide(); - plotter.destroyRegions();
+ if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) { + redraw();
} }
+// public void endOfData() { +// if (plotter != null) { +// plotter.hide(); +// plotter.destroyRegions(); +// } +// }
@Override public void reset() { if (hitCountFillPlot != null) {
@@ -112,6 +123,8 @@
public void redraw() { hitCountDrawPlot.reset(); hitCountDrawPlot.add(hitCountFillPlot);
+ clusterCountDrawPlot.reset(); + clusterCountDrawPlot.add(clusterCountFillPlot);
} @Override
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