Commit in hps-java/src/main on MAIN | |||
java/org/lcsim/hps/monitoring/RunControlDriver.java | +17 | -13 | 1.2 -> 1.3 |
java/org/lcsim/hps/monitoring/ecal/EcalClusterPlots.java | +3 | -11 | 1.3 -> 1.4 |
/EcalPedestalPlots.java | +71 | -39 | 1.6 -> 1.7 |
/EcalWindowEventPlots.java | +4 | -42 | 1.1 -> 1.2 |
/EcalDaqPlots.java | +5 | -5 | 1.5 -> 1.6 |
/EcalEvsX.java | +16 | -28 | 1.4 -> 1.5 |
/EcalMonitoringPlots.java | +10 | 1.5 -> 1.6 | |
/EcalHitPlots.java | +1 | -1 | 1.2 -> 1.3 |
resources/org/lcsim/hps/steering/ECalTriggerWindowMonitoring.lcsim | +1 | 1.2 -> 1.3 | |
/ECalCalibration.lcsim | +1 | -1 | 1.1 -> 1.2 |
/ECalTriggerMonitoring.lcsim | +1 | -2 | 1.2 -> 1.3 |
/ECalMonitoring.lcsim | +3 | -1 | 1.7 -> 1.8 |
java/org/lcsim/hps/recon/ecal/HPSEcalConditions.java | +1 | -2 | 1.7 -> 1.8 |
/HPSEcalRawConverter.java | +4 | -7 | 1.6 -> 1.7 |
/FADCConverterDriver.java | +2 | -5 | 1.2 -> 1.3 |
/HPSEcalRawConverterDriver.java | +13 | -22 | 1.8 -> 1.9 |
+153 | -179 |
more ECal plots and calibration and stuff
diff -u -r1.2 -r1.3 --- RunControlDriver.java 12 May 2012 23:09:05 -0000 1.2 +++ RunControlDriver.java 13 May 2012 21:39:24 -0000 1.3 @@ -9,18 +9,26 @@
import org.lcsim.util.Driver; /**
- * Lightweight driver for stepping through events in offline analysis, without running the MonitoringApp.
+ * Lightweight driver for stepping through events in offline analysis, without + * running the MonitoringApp. + *
* @author Sho Uemura <[log in to unmask]>
- * @version $Id: RunControlDriver.java,v 1.2 2012/05/12 23:09:05 meeg Exp $
+ * @version $Id: RunControlDriver.java,v 1.3 2012/05/13 21:39:24 meeg Exp $
*/ public class RunControlDriver extends Driver implements ActionListener {
- final JButton nextButton;
+ JButton nextButton;
JButton runButton; JFrame nextFrame; boolean run = false;
+ final Object syncObject;
public RunControlDriver() {
+ syncObject = new Object(); + } + + @Override + protected void startOfData() {
nextFrame = new JFrame(); nextFrame.setAlwaysOnTop(true); nextFrame.getContentPane().setLayout(new BoxLayout(nextFrame.getContentPane(), BoxLayout.X_AXIS));
@@ -33,19 +41,15 @@
nextFrame.add(runButton); nextFrame.pack();
- } - - @Override - protected void startOfData() {
nextFrame.setVisible(true); } @Override protected void process(EventHeader event) { if (!run) {
- synchronized (nextButton) {
+ synchronized (syncObject) {
try {
- nextButton.wait();
+ syncObject.wait();
} catch (InterruptedException e) { } }
@@ -60,16 +64,16 @@
@Override public void actionPerformed(ActionEvent ae) { if (ae.getSource() == nextButton) {
- synchronized (nextButton) { - nextButton.notify();
+ synchronized (syncObject) { + syncObject.notify();
} } if (ae.getSource() == runButton) { if (!run) { runButton.setText("Pause"); run = true;
- synchronized (nextButton) { - nextButton.notify();
+ synchronized (syncObject) { + syncObject.notify();
} } else { run = false;
diff -u -r1.3 -r1.4 --- EcalClusterPlots.java 12 May 2012 23:09:05 -0000 1.3 +++ EcalClusterPlots.java 13 May 2012 21:39:24 -0000 1.4 @@ -96,18 +96,10 @@
} }
- public void endOfData() { - if (plotter != null) { - plotter.hide(); - plotter.destroyRegions(); - } - if (clusterCountPlot != null) { - clusterCountPlot.reset(); - } - } -
public void reset() {
- plotter.hide();
clusterCountPlot.reset();
+ clusterSizePlot.reset(); + clusterEnergyPlot.reset(); + clusterMaxEnergyPlot.reset();
} }
\ No newline at end of file
diff -u -r1.6 -r1.7 --- EcalPedestalPlots.java 8 May 2012 15:49:31 -0000 1.6 +++ EcalPedestalPlots.java 13 May 2012 21:39:24 -0000 1.7 @@ -1,7 +1,6 @@
package org.lcsim.hps.monitoring.ecal; import hep.aida.*;
-import hep.aida.ref.plotter.PlotterRegion;
import java.awt.event.ActionEvent; import java.awt.event.ActionListener;
@@ -27,12 +26,15 @@
private String inputCollection; private IPlotter plotter;
+ private IPlotter plotter2;
private AIDA aida = AIDA.defaultInstance(); private AIDAFrame plotterFrame;
- private IHistogram2D meanPlot; - private IHistogram2D sigmaPlot; -// private ICloud1D[][] plots = new ICloud1D[47][11]; - private IHistogram1D[][] plots = new IHistogram1D[47][11];
+ private IHistogram2D aMeanPlot; + private IHistogram2D aSigmaPlot; + private IHistogram2D tMeanPlot; + private IHistogram2D tSigmaPlot; + private IHistogram1D[][] aPlots = new IHistogram1D[47][11]; + private IHistogram1D[][] tPlots = new IHistogram1D[47][11];
private JLabel xLabel, yLabel; private JComboBox xCombo; private JComboBox yCombo;
@@ -78,16 +80,12 @@
throw new RuntimeException("The inputCollection parameter was not set."); }
- // Setup the plotter. - plotter = aida.analysisFactory().createPlotterFactory().create(); - plotter.setTitle("HPS ECal Pedestal Plots"); - plotterFrame = new AIDAFrame(); - plotterFrame.addPlotter(plotter); -
aida = AIDA.defaultInstance(); aida.tree().cd("/");
- sigmaPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Sigma", 47, -23.5, 23.5, 11, -5.5, 5.5); - meanPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Mean", 47, -23.5, 23.5, 11, -5.5, 5.5);
+ aSigmaPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Sigma (Amplitude)", 47, -23.5, 23.5, 11, -5.5, 5.5); + aMeanPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Mean (Amplitude)", 47, -23.5, 23.5, 11, -5.5, 5.5); + tSigmaPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Sigma (Time)", 47, -23.5, 23.5, 11, -5.5, 5.5); + tMeanPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Mean (Time)", 47, -23.5, 23.5, 11, -5.5, 5.5);
for (int x = -23; x <= 23; x++) { // slot for (int y = -5; y <= 5; y++) { // crate
@@ -95,16 +93,16 @@
// 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) {
- plots[x + 23][y + 5] = aida.histogram1D("ECAL: x=" + x + "; y=" + y, 500, -1000, 10000);
+ aPlots[x + 23][y + 5] = aida.histogram1D("ECAL Amplitudes: x=" + x + "; y=" + y, 500, -100, 1000);
} else {
- plots[x + 23][y + 5] = aida.histogram1D("ECAL: x=" + x + "; y=" + y, 1024, -0.5, 1023.5);
+ aPlots[x + 23][y + 5] = aida.histogram1D("ECAL Amplitudes: x=" + x + "; y=" + y, 1024, -0.5, 1023.5);
}
-
+ tPlots[x + 23][y + 5] = aida.histogram1D("ECAL Times: x=" + x + "; y=" + y, 100, 0, 100);
} }
- // Create the plotter regions. - plotter.createRegions(1, 3);
+ plotterFrame = new AIDAFrame(); + plotterFrame.setTitle("HPS ECal Crystal Plots");
xCombo = new JComboBox(xList); xCombo.addActionListener(this);
@@ -122,9 +120,14 @@
plotterFrame.getControlsPanel().add(blankButton); blankButton.addActionListener(this);
- plotterFrame.pack();
+ // Setup the plotter. + plotter = aida.analysisFactory().createPlotterFactory().create(); + plotter.setTitle("HPS ECal Hit Amplitude Plots"); + plotterFrame.addPlotter(plotter); + plotter.createRegions(1, 3);
plotter.style().statisticsBoxStyle().setVisible(false);
+ plotter.style().dataStyle().errorBarStyle().setVisible(false);
plotter.style().zAxisStyle().setParameter("allowZeroSuppression", "true"); IPlotterStyle style = plotter.region(0).style(); style.setParameter("hist2DStyle", "colorMap");
@@ -132,15 +135,33 @@
style = plotter.region(1).style(); style.setParameter("hist2DStyle", "colorMap"); style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
- plotter.region(0).plot(sigmaPlot); - plotter.region(1).plot(meanPlot); - plotter.region(2).plot(plots[-5 + 23][2 + 5]); -// ((PlotterRegion) plotter.region(0)).getPlot().setAllowUserInteraction(false); -// ((PlotterRegion) plotter.region(0)).getPlot().setAllowPopupMenus(false); -// -// ((PlotterRegion) plotter.region(1)).getPlot().setAllowUserInteraction(false); -// ((PlotterRegion) plotter.region(1)).getPlot().setAllowPopupMenus(false);
+ plotter.region(0).plot(aSigmaPlot); + plotter.region(1).plot(aMeanPlot);
+ // Setup the plotter. + plotter2 = aida.analysisFactory().createPlotterFactory().create(); + plotter2.setTitle("HPS ECal Hit Time Plots"); + plotterFrame.addPlotter(plotter2); + plotter2.createRegions(1, 3); + + plotter2.style().statisticsBoxStyle().setVisible(false); + plotter2.style().dataStyle().errorBarStyle().setVisible(false); + plotter2.style().zAxisStyle().setParameter("allowZeroSuppression", "true"); + style = plotter2.region(0).style(); + style.setParameter("hist2DStyle", "colorMap"); + style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + style = plotter2.region(1).style(); + style.setParameter("hist2DStyle", "colorMap"); + style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow"); + plotter2.region(0).plot(tSigmaPlot); + plotter2.region(1).plot(tMeanPlot); + + plotter.region(2).plot(aPlots[-5 + 23][2 + 5 - 1]); + plotter2.region(2).plot(tPlots[-5 + 23][2 + 5 - 1]); + xCombo.setSelectedIndex(-5 + 23); + yCombo.setSelectedIndex(2 + 5 - 1); + + plotterFrame.pack();
if (!hide) { plotterFrame.setVisible(true); }
@@ -162,7 +183,7 @@
IIdentifier compactId = new Identifier(id); int x = helper.getValue(compactId, "ix"); int y = helper.getValue(compactId, "iy");
- System.out.printf("%d\t%d\t%d\t%f\t%f\n", crate, slot, ch, plots[x + 23][y + 5].mean(), plots[x + 23][y + 5].rms());
+ System.out.printf("%d\t%d\t%d\t%f\t%f\n", crate, slot, ch, aPlots[x + 23][y + 5].mean(), aPlots[x + 23][y + 5].rms());
} } }
@@ -175,7 +196,7 @@
plotter.destroyRegions(); for (int x = -23; x <= 23; x++) { // slot for (int y = -5; y <= 5; y++) { // crate
- plots[x + 23][y + 5].reset();
+ aPlots[x + 23][y + 5].reset();
} } }
@@ -189,11 +210,11 @@
int y = hit.getIdentifierFieldValue("iy"); if (calWindow > 0) { for (int i = 0; i < calWindow; i++) {
- plots[x + 23][y + 5].fill(hit.getADCValues()[i]);
+ aPlots[x + 23][y + 5].fill(hit.getADCValues()[i]);
} } else { for (int i = 0; i < hit.getADCValues().length; i++) {
- plots[x + 23][y + 5].fill(hit.getADCValues()[i]);
+ aPlots[x + 23][y + 5].fill(hit.getADCValues()[i]);
} } }
@@ -207,7 +228,8 @@
for (BaseRawCalorimeterHit hit : hits) { int x = hit.getIdentifierFieldValue("ix"); int y = hit.getIdentifierFieldValue("iy");
- plots[x + 23][y + 5].fill(hit.getAmplitude());
+ aPlots[x + 23][y + 5].fill(hit.getAmplitude());
+ tPlots[x + 23][y + 5].fill(hit.getTimeStamp() / 64);
} if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) { redraw();
@@ -219,7 +241,8 @@
for (CalorimeterHit hit : hits) { int x = hit.getIdentifierFieldValue("ix"); int y = hit.getIdentifierFieldValue("iy");
- plots[x + 23][y + 5].fill(hit.getRawEnergy());
+ aPlots[x + 23][y + 5].fill(hit.getRawEnergy());
+ tPlots[x + 23][y + 5].fill(hit.getTime() / 4.0);
} if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) { redraw();
@@ -231,12 +254,15 @@
public void actionPerformed(ActionEvent ae) { if (ae.getSource() == blankButton) { plotter.region(2).clear();
+ plotter2.region(2).clear();
} else { Integer x, y; x = (Integer) xCombo.getSelectedItem(); y = (Integer) yCombo.getSelectedItem(); plotter.region(2).clear();
- plotter.region(2).plot(plots[x + 23][y + 5]);
+ plotter.region(2).plot(aPlots[x + 23][y + 5]);
+ plotter2.region(2).clear();
+ plotter2.region(2).plot(tPlots[x + 23][y + 5]);
// ((PlotterRegion) plotter.region(2)).getPlot().setAllowUserInteraction(false); // ((PlotterRegion) plotter.region(2)).getPlot().setAllowPopupMenus(false); }
@@ -244,13 +270,19 @@
@Override public void redraw() {
- sigmaPlot.reset(); - meanPlot.reset();
+ aSigmaPlot.reset(); + aMeanPlot.reset(); + tSigmaPlot.reset(); + tMeanPlot.reset();
for (int x = -23; x <= 23; x++) { // slot for (int y = -5; y <= 5; y++) { // crate
- if (plots[x + 23][y + 5].entries() > 10) { - sigmaPlot.fill(x, y, plots[x + 23][y + 5].rms()); - meanPlot.fill(x, y, plots[x + 23][y + 5].mean());
+ if (aPlots[x + 23][y + 5].entries() > 10) { + aSigmaPlot.fill(x, y, aPlots[x + 23][y + 5].rms()); + aMeanPlot.fill(x, y, aPlots[x + 23][y + 5].mean()); + } + if (tPlots[x + 23][y + 5].entries() > 10) { + tSigmaPlot.fill(x, y, tPlots[x + 23][y + 5].rms()); + tMeanPlot.fill(x, y, tPlots[x + 23][y + 5].mean());
} } }
diff -u -r1.1 -r1.2 --- EcalWindowEventPlots.java 8 May 2012 15:49:31 -0000 1.1 +++ EcalWindowEventPlots.java 13 May 2012 21:39:24 -0000 1.2 @@ -1,35 +1,25 @@
package org.lcsim.hps.monitoring.ecal; import hep.aida.*;
-import hep.aida.ref.plotter.PlotterRegion;
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; import javax.swing.*;
-import org.lcsim.detector.identifier.IIdentifier; -import org.lcsim.detector.identifier.IIdentifierHelper; -import org.lcsim.detector.identifier.Identifier; -import org.lcsim.event.CalorimeterHit;
import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit;
-import org.lcsim.event.base.BaseRawCalorimeterHit;
import org.lcsim.geometry.Detector; import org.lcsim.hps.monitoring.AIDAFrame;
-import org.lcsim.hps.monitoring.Redrawable; -import org.lcsim.hps.monitoring.Resettable; -import org.lcsim.hps.recon.ecal.HPSEcalConditions;
import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
-public class EcalWindowEventPlots extends Driver implements Resettable, ActionListener {
+public class EcalWindowEventPlots extends Driver implements ActionListener {
private String inputCollection; private IPlotter plotter; private AIDA aida = AIDA.defaultInstance(); private AIDAFrame plotterFrame;
-// private ICloud1D[][] plots = new ICloud1D[47][11];
private IHistogram1D[][] plots = new IHistogram1D[47][11]; private JLabel xLabel, yLabel; private JComboBox xCombo;
@@ -37,8 +27,6 @@
private JButton blankButton; private static final Integer[] xList = new Integer[46]; private static final Integer[] yList = new Integer[10];
- int eventRefreshRate = 1; - int eventn = 0;
boolean hide = false; int window = 100;
@@ -71,6 +59,7 @@
this.inputCollection = inputCollection; }
+ @Override
public void detectorChanged(Detector detector) { if (inputCollection == null) { throw new RuntimeException("The inputCollection parameter was not set.");
@@ -87,11 +76,7 @@
for (int x = -23; x <= 23; x++) { // slot for (int y = -5; y <= 5; y++) { // crate
- //System.out.println("creating plot: " + "ECAL: Crate " + j + "; Slot " + i + " in region " + region); -// IHistogram1D hist = aida.histogram1D("ECAL: x=" + i + "; y=" + j, 1000, 0, 16); -// plots[x + 23][y + 5] = aida.cloud1D("ECAL: x=" + x + "; y=" + y);
plots[x + 23][y + 5] = aida.histogram1D("ECAL window: x=" + x + "; y=" + y, window, -0.5, window - 0.5);
-
} }
@@ -116,43 +101,20 @@
plotterFrame.pack();
-// plotter.style().statisticsBoxStyle().setVisible(false);
+ plotter.style().statisticsBoxStyle().setVisible(false);
plotter.style().zAxisStyle().setParameter("allowZeroSuppression", "true"); plotter.style().dataStyle().errorBarStyle().setVisible(false);
- IPlotterStyle style = plotter.region(0).style();
plotter.region(0).plot(plots[-5 + 23][2 + 5]); xCombo.setSelectedIndex((-5 + 23)); yCombo.setSelectedIndex((2 + 5 - 1));
-// ((PlotterRegion) plotter.region(0)).getPlot().setAllowUserInteraction(false); -// ((PlotterRegion) plotter.region(0)).getPlot().setAllowPopupMenus(false); -// -// ((PlotterRegion) plotter.region(1)).getPlot().setAllowUserInteraction(false); -// ((PlotterRegion) plotter.region(1)).getPlot().setAllowPopupMenus(false);
if (!hide) { plotterFrame.setVisible(true); } }
- public void endOfData() { - if (plotter != null) { - plotter.hide(); - } - } - - public void reset() { - if (plotter != null) { - plotter.hide(); - plotter.destroyRegions(); - for (int x = -23; x <= 23; x++) { // slot - for (int y = -5; y <= 5; y++) { // crate - plots[x + 23][y + 5].reset(); - } - } - } - } -
+ @Override
public void process(EventHeader event) { for (int x = -23; x <= 23; x++) { // slot for (int y = -5; y <= 5; y++) { // crate
diff -u -r1.5 -r1.6 --- EcalDaqPlots.java 12 May 2012 23:09:05 -0000 1.5 +++ EcalDaqPlots.java 13 May 2012 21:39:24 -0000 1.6 @@ -83,11 +83,11 @@
plotter.show(); }
- public void endOfData() { - if (plotter != null) { - plotter.hide(); - } - }
+// public void endOfData() { +// if (plotter != null) { +// plotter.hide(); +// } +// }
public void reset() { if (plotter != null) {
diff -u -r1.4 -r1.5 --- EcalEvsX.java 12 May 2012 23:09:05 -0000 1.4 +++ EcalEvsX.java 13 May 2012 21:39:24 -0000 1.5 @@ -4,8 +4,7 @@
import hep.aida.IHistogram2D; import hep.aida.IPlotter; import hep.aida.IPlotterStyle;
-import hep.aida.ref.plotter.PlotterRegion; -import hep.physics.vec.BasicHepLorentzVector;
+import hep.physics.vec.*;
import java.util.List; import org.lcsim.event.Cluster;
@@ -54,8 +53,8 @@
// Setup plots. aida.tree().cd("/");
- EvsXPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : E vs X", 50, -400.0, 400.0, 200, -500, 10000); - invMassPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Photon Pair Mass", 1000, 0.0, 5000.0);
+ 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);
clusterPairEnergyPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Pair Energies", 1000, -100, 2000, 1000, -100, 2000); // Create the plotter regions.
@@ -95,35 +94,18 @@
EvsXPlot.fill(cluster.getPosition()[0], cluster.getEnergy()); } }
- double[] totalP = new double[3]; - double totalE = 0; - if (clusters.size() == 2) { - for (Cluster cluster : clusters) { -// double[] pos = cluster.getPosition(); -// double[] direction = new double[3]; -// direction[0] = pos[0]; -// direction[1] = pos[1]; -// direction[2] = pos[2] + targetZ; -// double length = Math.sqrt(direction[0] * direction[0] + direction[1] * direction[1] + direction[2] * direction[2]); -// direction[0] *= cluster.getEnergy() / length; -// direction[1] *= cluster.getEnergy() / length; -// direction[2] *= cluster.getEnergy() / length; -// totalE += cluster.getEnergy(); -// totalP[0] += direction[0]; -// totalP[1] += direction[1]; -// totalP[2] += direction[2]; - } -// double invariantMass = (new BasicHepLorentzVector(totalE, totalP)).magnitude(); -// invMassPlot.fill(invariantMass); - }
for (int i = 0; i < clusters.size() - 1; i++) { double e1 = clusters.get(i).getEnergy(); 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; + }
clusterPairEnergyPlot.fill(Math.max(e1, e2), Math.min(e1, e2));
- 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)));
+// 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))); + invMassPlot.fill(VecOp.add(clusterAsPhoton(clusters.get(i)), clusterAsPhoton(clusters.get(j))).magnitude());
} }
@@ -131,6 +113,12 @@
} }
+ public HepLorentzVector clusterAsPhoton(Cluster cluster) { + Hep3Vector position = new BasicHep3Vector(cluster.getPosition()); + Hep3Vector direction = VecOp.unit(VecOp.add(position, new BasicHep3Vector(0, 0, targetZ))); + return new BasicHepLorentzVector(cluster.getEnergy(), VecOp.mult(cluster.getEnergy(), direction)); + } +
public void endOfData() { if (plotter != null) { plotter.hide();
diff -u -r1.5 -r1.6 --- EcalMonitoringPlots.java 10 May 2012 15:55:55 -0000 1.5 +++ EcalMonitoringPlots.java 13 May 2012 21:39:24 -0000 1.6 @@ -6,6 +6,7 @@
import hep.aida.ref.plotter.PlotterRegion; import java.util.List;
+import org.lcsim.event.CalorimeterHit;
import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit;
@@ -79,6 +80,15 @@
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(); + } + }
} public void endOfData() {
diff -u -r1.2 -r1.3 --- EcalHitPlots.java 12 May 2012 23:09:05 -0000 1.2 +++ EcalHitPlots.java 13 May 2012 21:39:24 -0000 1.3 @@ -43,7 +43,7 @@
// Setup plots. aida.tree().cd("/"); hitCountPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Count In Event", 10, -0.5, 9.5);
- hitTimePlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time", 1000, 0*64,100*64);
+ hitTimePlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time", 100, 0*4.0,100*4.0);
// Create the plotter regions. plotter.createRegions(1,2);
diff -u -r1.2 -r1.3 --- ECalTriggerWindowMonitoring.lcsim 10 May 2012 15:55:55 -0000 1.2 +++ ECalTriggerWindowMonitoring.lcsim 13 May 2012 21:39:24 -0000 1.3 @@ -40,6 +40,7 @@
<driver name="EcalDaqPlots" type="org.lcsim.hps.monitoring.ecal.EcalDaqPlots"> </driver> <driver name="EcalMonitoringPlots" type="org.lcsim.hps.monitoring.ecal.EcalMonitoringPlots">
+ <inputCollection>EcalIntegralHits</inputCollection>
<eventRefreshRate>100</eventRefreshRate> </driver> <driver name="EcalEventMonitor" type="org.lcsim.hps.monitoring.ecal.EcalEventMonitor">
diff -u -r1.1 -r1.2 --- ECalCalibration.lcsim 8 May 2012 15:49:32 -0000 1.1 +++ ECalCalibration.lcsim 13 May 2012 21:39:24 -0000 1.2 @@ -23,7 +23,7 @@
<drivers> <driver name="HPSEcalConditions" type="org.lcsim.hps.recon.ecal.HPSEcalConditions"/> <driver name="EcalRawConverter" type="org.lcsim.hps.recon.ecal.HPSEcalRawConverterDriver">
- <integralWindow>30</integralWindow>
+ <integralWindow>35</integralWindow>
</driver> <driver name="EcalMonitoringPlots" type="org.lcsim.hps.monitoring.ecal.EcalMonitoringPlots"> <eventRefreshRate>100</eventRefreshRate>
diff -u -r1.2 -r1.3 --- ECalTriggerMonitoring.lcsim 10 May 2012 15:55:55 -0000 1.2 +++ ECalTriggerMonitoring.lcsim 13 May 2012 21:39:24 -0000 1.3 @@ -17,7 +17,6 @@
<driver name="EcalClusterPlots"/> <!-- <driver name="EcalEventMonitor"/>
- <driver name="EcalPedestalPlots"/>
<driver name="EcalEvsX"/> <driver name="EcalWindowPlots"/> <driver name="EcalDaqPlots"/>
@@ -28,7 +27,7 @@
<driver name="EcalRawConverter" type="org.lcsim.hps.recon.ecal.HPSEcalRawConverterDriver"> <rawCollectionName>EcalReadoutHits</rawCollectionName> <integralWindow>35</integralWindow>
- <gain>1.0</gain>
+<!-- <gain>1.0</gain>-->
</driver> <driver name="EcalDaqPlots" type="org.lcsim.hps.monitoring.ecal.EcalDaqPlots"> </driver>
diff -u -r1.7 -r1.8 --- ECalMonitoring.lcsim 12 May 2012 23:09:05 -0000 1.7 +++ ECalMonitoring.lcsim 13 May 2012 21:39:24 -0000 1.8 @@ -24,10 +24,12 @@
<driver name="HPSCalibrationDriver" type="org.lcsim.hps.monitoring.HPSCalibrationDriver"/> <driver name="EcalRawConverter" type="org.lcsim.hps.recon.ecal.HPSEcalRawConverterDriver"> <integralWindow>35</integralWindow>
+ <threshold>100</threshold>
</driver> <driver name="EcalDaqPlots" type="org.lcsim.hps.monitoring.ecal.EcalDaqPlots"> </driver> <driver name="EcalMonitoringPlots" type="org.lcsim.hps.monitoring.ecal.EcalMonitoringPlots">
+ <inputCollection>EcalCalHits</inputCollection>
<eventRefreshRate>100</eventRefreshRate> </driver> <driver name="EcalEventMonitor" type="org.lcsim.hps.monitoring.ecal.EcalEventMonitor">
@@ -52,7 +54,7 @@
<ecalCollectionName>EcalCalHits</ecalCollectionName> </driver> <driver name="EcalEvsX" type="org.lcsim.hps.monitoring.ecal.EcalEvsX">
- <targetZ>350</targetZ>
+ <targetZ>1000</targetZ>
<inputCollection>EcalClusters</inputCollection> </driver> </drivers>
diff -u -r1.7 -r1.8 --- HPSEcalConditions.java 12 May 2012 23:09:05 -0000 1.7 +++ HPSEcalConditions.java 13 May 2012 21:39:24 -0000 1.8 @@ -17,7 +17,7 @@
/** * * @author meeg
- * @version $Id: HPSEcalConditions.java,v 1.7 2012/05/12 23:09:05 meeg Exp $
+ * @version $Id: HPSEcalConditions.java,v 1.8 2012/05/13 21:39:24 meeg Exp $
*/ public class HPSEcalConditions extends Driver {
@@ -175,7 +175,6 @@
System.out.println("reading DAQ map");
- IIdentifierHelper helper = ecal.getDetectorElement().getIdentifierHelper();
IExpandedIdentifier expId = new ExpandedIdentifier(helper.getIdentifierDictionary().getNumberOfFields()); expId.setValue(helper.getFieldIndex("system"), ecal.getSystemID());
diff -u -r1.6 -r1.7 --- HPSEcalRawConverter.java 12 May 2012 23:09:05 -0000 1.6 +++ HPSEcalRawConverter.java 13 May 2012 21:39:24 -0000 1.7 @@ -22,16 +22,10 @@
} public double getPedestal(RawTrackerHit hit) {
- if (!HPSEcalConditions.pedestalsLoaded()) { - HPSEcalConditions.loadPedestals(); - }
return HPSEcalConditions.physicalToPedestal(hit.getCellID()); } public double getPedestal(BaseRawCalorimeterHit hit) {
- if (!HPSEcalConditions.pedestalsLoaded()) { - HPSEcalConditions.loadPedestals(); - }
return HPSEcalConditions.physicalToPedestal(hit.getCellID()); }
@@ -70,7 +64,10 @@
} public CalorimeterHit HitDtoA(BaseRawCalorimeterHit hit, int window) {
- double time = hit.getTimeStamp();
+ if (hit.getTimeStamp()%64 !=0) { + System.out.println("unexpected timestamp "+hit.getTimeStamp()); + } + double time = hit.getTimeStamp()/16.0;
long id = hit.getCellID(); double rawEnergy = gain*(hit.getAmplitude() - window * getPedestal(hit)); // Hep3Vector pvec = hit.getDetectorElement().getGeometry().getPosition();
diff -u -r1.2 -r1.3 --- FADCConverterDriver.java 10 May 2012 15:55:56 -0000 1.2 +++ FADCConverterDriver.java 13 May 2012 21:39:24 -0000 1.3 @@ -10,7 +10,7 @@
/** *
- * @version $Id: FADCConverterDriver.java,v 1.2 2012/05/10 15:55:56 meeg Exp $
+ * @version $Id: FADCConverterDriver.java,v 1.3 2012/05/13 21:39:24 meeg Exp $
*/ public class FADCConverterDriver extends Driver {
@@ -62,9 +62,6 @@
@Override public void process(EventHeader event) {
- if (!HPSEcalConditions.pedestalsLoaded()) { - HPSEcalConditions.loadPedestals(); - }
ArrayList<BaseRawCalorimeterHit> readoutHits = new ArrayList<BaseRawCalorimeterHit>(); ArrayList<BaseRawCalorimeterHit> triggerHits = new ArrayList<BaseRawCalorimeterHit>();
@@ -86,7 +83,7 @@
adcSum += window[i - pointerOffset]; numSamplesToRead--; if (numSamplesToRead == 0) {
- readoutHits.add(new BaseRawCalorimeterHit(id, adcSum, thresholdCrossing));
+ readoutHits.add(new BaseRawCalorimeterHit(id, adcSum, 64*thresholdCrossing));
} } else if ((i == 0 || window[i - 1] <= crystalThreshold) && window[i] > crystalThreshold) { thresholdCrossing = i;
diff -u -r1.8 -r1.9 --- HPSEcalRawConverterDriver.java 10 May 2012 15:55:56 -0000 1.8 +++ HPSEcalRawConverterDriver.java 13 May 2012 21:39:24 -0000 1.9 @@ -22,11 +22,16 @@
String ecalCollectionName = "EcalCalHits"; int integralWindow = 30; boolean debug = false;
+ double threshold = Double.NEGATIVE_INFINITY;
public HPSEcalRawConverterDriver() { converter = new HPSEcalRawConverter(); }
+ public void setThreshold(double threshold) { + this.threshold = threshold; + } +
public void setGain(double gain) { converter.setGain(gain); }
@@ -63,35 +68,21 @@
List<RawTrackerHit> hits = event.get(RawTrackerHit.class, rawCollectionName); for (RawTrackerHit hit : hits) {
- newHits.add(converter.HitDtoA(hit));
+ CalorimeterHit newHit = converter.HitDtoA(hit); + if (newHit.getRawEnergy() > threshold) { + newHits.add(newHit); + }
}
-// String s = ecalCollectionName; //"EcalCalHits"; -// -// System.out.println(" char: " + event.hasCollection(CalorimeterHit.class, "EcalCalHits")); -// System.out.println(" str: " + event.hasCollection(CalorimeterHit.class, ecalCollectionName)); -// -// List<CalorimeterHit> ll = event.get(CalorimeterHit.class,s); -// -// System.out.println("ll size " + ll.size()); -// List<List<CalorimeterHit>> lll = event.get(CalorimeterHit.class); -// System.out.println("lll size " + lll.size());
} if (event.hasCollection(BaseRawCalorimeterHit.class, rawCollectionName)) { List<BaseRawCalorimeterHit> hits = event.get(BaseRawCalorimeterHit.class, rawCollectionName); for (BaseRawCalorimeterHit hit : hits) {
- newHits.add(converter.HitDtoA(hit, integralWindow));
+ CalorimeterHit newHit = converter.HitDtoA(hit, integralWindow); + if (newHit.getRawEnergy() > threshold) { + newHits.add(newHit); + }
}
-// String s = ecalCollectionName; //"EcalCalHits"; -// -// System.out.println(" char: " + event.hasCollection(CalorimeterHit.class, "EcalCalHits")); -// System.out.println(" str: " + event.hasCollection(CalorimeterHit.class, ecalCollectionName)); -// -// List<CalorimeterHit> ll = event.get(CalorimeterHit.class,s); -// -// System.out.println("ll size " + ll.size()); -// List<List<CalorimeterHit>> lll = event.get(CalorimeterHit.class); -// System.out.println("lll size " + lll.size());
} int flags = 0; event.put(ecalCollectionName, newHits, CalorimeterHit.class, flags, ecalReadoutName);
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