hps-java/src/main/java/org/lcsim/hps/monitoring/ecal
diff -u -r1.6 -r1.7
--- TriggerPlots.java 3 Aug 2012 00:05:26 -0000 1.6
+++ TriggerPlots.java 31 Aug 2012 01:23:22 -0000 1.7
@@ -24,9 +24,9 @@
AIDAFrame plotterFrame;
String inputCollection = "EcalCalHits";
String clusterCollection = "EcalClusters";
- double clusterEnergyCut = 130.0;
+ double clusterEnergyCut = 1280.0;
AIDA aida = AIDA.defaultInstance();
- IPlotter plotter, plotter2, plotter3, plotter4, plotter5;
+ IPlotter plotter, plotter2, plotter3, plotter4, plotter5, plotter6;
IHistogram1D topHitTimePlot, botHitTimePlot, orHitTimePlot;
IHistogram1D topTrigTimePlot, botTrigTimePlot, orTrigTimePlot;
IHistogram2D topTimePlot2D, botTimePlot2D, orTimePlot2D;
@@ -37,7 +37,8 @@
IHistogram1D topClusTimeDiff, botClusTimeDiff, orClusTimeDiff;
IHistogram2D trigType;
IHistogram1D simTrigTop, simTrigBot, simTrigAnd;
- IHistogram1D toptrig_cl_ecal_e_top, toptrig_cl_ecal_emax_top, toptrig_cl_ecal_n_top, toptrig_cl_ecal_n_bottom, toptrig_cl_ecal_e_bottom, toptrig_cl_ecal_e_bottom_trig, toptrigtag_cl_ecal_e_bottom, toptrigtag_cl_ecal_e_bottom_trig;
+ IHistogram1D toptrig_cl_ecal_e_tag, toptrig_cl_ecal_emax_tag, toptrig_cl_ecal_n_tag, toptrig_cl_ecal_e_probe, toptrig_cl_ecal_e_probe_trig, toptrigtag_cl_ecal_e_probe, toptrigtag_cl_ecal_e_probe_trig;
+ IHistogram1D bottrig_cl_ecal_e_tag, bottrig_cl_ecal_emax_tag, bottrig_cl_ecal_n_tag, bottrig_cl_ecal_e_probe, bottrig_cl_ecal_e_probe_trig, bottrigtag_cl_ecal_e_probe, bottrigtag_cl_ecal_e_probe_trig;
public void setInputCollection(String inputCollection) {
this.inputCollection = inputCollection;
@@ -175,30 +176,47 @@
plotter4.region(1).plot(simTrigBot);
plotter4.region(2).plot(simTrigAnd);
- plotter5 = aida.analysisFactory().createPlotterFactory().create("Trigger Types");
- plotter5.setTitle("Trigger Types");
+ plotter5 = aida.analysisFactory().createPlotterFactory().create("Bottom turn-on");
+ plotter5.setTitle("Bottom turn-on");
plotterFrame.addPlotter(plotter5);
plotter5.style().dataStyle().errorBarStyle().setVisible(false);
plotter5.createRegions(3, 3);
- toptrig_cl_ecal_n_top = aida.histogram1D("toptrig_cl_ecal_n_top", 7, 0, 7);
- toptrig_cl_ecal_e_bottom = aida.histogram1D("toptrig_cl_ecal_e_bottom", 200, 0, 10000);
- toptrigtag_cl_ecal_e_bottom = aida.histogram1D("toptrigtag_cl_ecal_e_bottom", 200, 0, 10000);
- toptrig_cl_ecal_e_top = aida.histogram1D("toptrig_cl_ecal_e_top", 200, 0, 10000);
- toptrig_cl_ecal_e_bottom_trig = aida.histogram1D("toptrig_cl_ecal_e_bottom_trig", 200, 0, 10000);
- toptrigtag_cl_ecal_e_bottom_trig = aida.histogram1D("toptrigtag_cl_ecal_e_bottom_trig", 200, 0, 10000);
- toptrig_cl_ecal_emax_top = aida.histogram1D("toptrig_cl_ecal_emax_top", 200, 0, 10000);
- toptrig_cl_ecal_n_bottom = aida.histogram1D("toptrig_cl_ecal_n_bottom", 7, 0, 7);
-// toptrig_cl_ecal_n_top = aida.histogram1D("toptrig_cl_ecal_n_top",7,0,7);
- plotter5.region(0).plot(toptrig_cl_ecal_n_top);
- plotter5.region(1).plot(toptrig_cl_ecal_e_bottom);
- plotter5.region(2).plot(toptrigtag_cl_ecal_e_bottom);
- plotter5.region(3).plot(toptrig_cl_ecal_e_top);
- plotter5.region(4).plot(toptrig_cl_ecal_e_bottom_trig);
- plotter5.region(5).plot(toptrigtag_cl_ecal_e_bottom_trig);
- plotter5.region(6).plot(toptrig_cl_ecal_emax_top);
-// plotter5.region(3).plot(toptrig_cl_ecal_n_bottom);
-// plotter5.region(0).plot();
+ toptrig_cl_ecal_n_tag = aida.histogram1D("toptrig_cl_ecal_n_tag", 7, 0, 7);
+ toptrig_cl_ecal_e_probe = aida.histogram1D("toptrig_cl_ecal_e_probe", 200, 0, 10000);
+ toptrigtag_cl_ecal_e_probe = aida.histogram1D("toptrigtag_cl_ecal_e_probe", 200, 0, 10000);
+ toptrig_cl_ecal_e_tag = aida.histogram1D("toptrig_cl_ecal_e_tag", 200, 0, 10000);
+ toptrig_cl_ecal_e_probe_trig = aida.histogram1D("toptrig_cl_ecal_e_probe_trig", 200, 0, 10000);
+ toptrigtag_cl_ecal_e_probe_trig = aida.histogram1D("toptrigtag_cl_ecal_e_probe_trig", 200, 0, 10000);
+ toptrig_cl_ecal_emax_tag = aida.histogram1D("toptrig_cl_ecal_emax_tag", 200, 0, 10000);
+ plotter5.region(0).plot(toptrig_cl_ecal_n_tag);
+ plotter5.region(1).plot(toptrig_cl_ecal_e_probe);
+ plotter5.region(2).plot(toptrigtag_cl_ecal_e_probe);
+ plotter5.region(3).plot(toptrig_cl_ecal_e_tag);
+ plotter5.region(4).plot(toptrig_cl_ecal_e_probe_trig);
+ plotter5.region(5).plot(toptrigtag_cl_ecal_e_probe_trig);
+ plotter5.region(6).plot(toptrig_cl_ecal_emax_tag);
+
+ plotter6 = aida.analysisFactory().createPlotterFactory().create("Top turn-on");
+ plotter6.setTitle("Top turn-on");
+ plotterFrame.addPlotter(plotter6);
+ plotter6.style().dataStyle().errorBarStyle().setVisible(false);
+ plotter6.createRegions(3, 3);
+
+ bottrig_cl_ecal_n_tag = aida.histogram1D("bottrig_cl_ecal_n_tag", 7, 0, 7);
+ bottrig_cl_ecal_e_probe = aida.histogram1D("bottrig_cl_ecal_e_probe", 200, 0, 10000);
+ bottrigtag_cl_ecal_e_probe = aida.histogram1D("bottrigtag_cl_ecal_e_probe", 200, 0, 10000);
+ bottrig_cl_ecal_e_tag = aida.histogram1D("bottrig_cl_ecal_e_tag", 200, 0, 10000);
+ bottrig_cl_ecal_e_probe_trig = aida.histogram1D("bottrig_cl_ecal_e_probe_trig", 200, 0, 10000);
+ bottrigtag_cl_ecal_e_probe_trig = aida.histogram1D("bottrigtag_cl_ecal_e_probe_trig", 200, 0, 10000);
+ bottrig_cl_ecal_emax_tag = aida.histogram1D("bottrig_cl_ecal_emax_tag", 200, 0, 10000);
+ plotter6.region(0).plot(bottrig_cl_ecal_n_tag);
+ plotter6.region(1).plot(bottrig_cl_ecal_e_probe);
+ plotter6.region(2).plot(bottrigtag_cl_ecal_e_probe);
+ plotter6.region(3).plot(bottrig_cl_ecal_e_tag);
+ plotter6.region(4).plot(bottrig_cl_ecal_e_probe_trig);
+ plotter6.region(5).plot(bottrigtag_cl_ecal_e_probe_trig);
+ plotter6.region(6).plot(bottrig_cl_ecal_emax_tag);
plotterFrame.setVisible(true);
plotterFrame.pack();
@@ -391,77 +409,103 @@
if (topTrig != 0) {
//Find the tag
- double Emax = -999999.9;
+ double Etag = -999999.9;
HPSEcalCluster cl_tag = null; //highest-E cluster in top half
- int n = 0; //num. clusters in top half
+ int nTag = 0; //num. clusters in top half
+
+ //Find a probe
+ double Eprobe = -999999.9;
+ HPSEcalCluster cl_probe = null; //highest-E cluster in bottom half
+ int nProbe = 0; //num. clusters in bottom half
+
for (HPSEcalCluster cl : clusters) {
if (cl.getPosition()[1] > 0) { //top half
- ++n;
- toptrig_cl_ecal_e_top.fill(cl.getEnergy());
- if (cl.getEnergy() > Emax) {
- Emax = cl.getEnergy();
+ ++nTag;
+ toptrig_cl_ecal_e_tag.fill(cl.getEnergy());
+ if (cl.getEnergy() > Etag) {
+ Etag = cl.getEnergy();
cl_tag = cl;
}
}
- }
-
- //Find a probe
- double Emaxb = -999999.9;
- HPSEcalCluster cl_probe = null; //highest-E cluster in bottom half
- int nb = 0; //num. clusters in bottom half
- for (HPSEcalCluster cl : clusters) {
if (cl.getPosition()[1] <= 0) { //bottom half
- ++nb;
- if (cl.getEnergy() > Emaxb) {
- Emaxb = cl.getEnergy();
+ ++nProbe;
+ if (cl.getEnergy() > Eprobe) {
+ Eprobe = cl.getEnergy();
cl_probe = cl;
}
}
}
- if (Emax > -9999) {
- toptrig_cl_ecal_emax_top.fill(Emax);
- }
- toptrig_cl_ecal_n_top.fill(n);
+ toptrig_cl_ecal_n_tag.fill(nTag);
if (cl_tag != null) {
-
+ toptrig_cl_ecal_emax_tag.fill(cl_tag.getEnergy());
//use only cases where the is a single probe candidate
- if (nb == 0) {
- toptrig_cl_ecal_n_bottom.fill(0);
-
- } else if (nb > 1) {
- toptrig_cl_ecal_n_bottom.fill(1);
- } else if (nb == 1) {
-
+ if (nProbe == 1) {
+ toptrig_cl_ecal_e_probe.fill(cl_probe.getEnergy());
+ if (botTrig != 0) {
+ toptrig_cl_ecal_e_probe_trig.fill(cl_probe.getEnergy());
+ }
+ if (cl_tag.getEnergy() > 2.0 * clusterEnergyCut) {
+ toptrigtag_cl_ecal_e_probe.fill(cl_probe.getEnergy());
+ if (botTrig != 0) {
+ toptrigtag_cl_ecal_e_probe_trig.fill(cl_probe.getEnergy());
+ }
+ }
+ }
+ } //tag found
+ }//topTrigger
+
+ if (botTrig != 0) {
- toptrig_cl_ecal_n_bottom.fill(2);
+ //Find the tag
+ double Etag = -999999.9;
+ HPSEcalCluster cl_tag = null; //highest-E cluster in top half
+ int nTag = 0; //num. clusters in top half
- toptrig_cl_ecal_e_bottom.fill(cl_probe.getEnergy());
+ //Find a probe
+ double Eprobe = -999999.9;
+ HPSEcalCluster cl_probe = null; //highest-E cluster in bottom half
+ int nProbe = 0; //num. clusters in bottom half
- if (botTrig != 0) {
- toptrig_cl_ecal_n_bottom.fill(3);
- toptrig_cl_ecal_e_bottom_trig.fill(cl_probe.getEnergy());
+ for (HPSEcalCluster cl : clusters) {
+ if (cl.getPosition()[1] < 0) { //bottom half
+ ++nTag;
+ bottrig_cl_ecal_e_tag.fill(cl.getEnergy());
+ if (cl.getEnergy() > Etag) {
+ Etag = cl.getEnergy();
+ cl_tag = cl;
}
+ }
+ if (cl.getPosition()[1] > 0) { //top half
+ ++nProbe;
+ if (cl.getEnergy() > Eprobe) {
+ Eprobe = cl.getEnergy();
+ cl_probe = cl;
+ }
+ }
+ }
- if (cl_tag.getEnergy() > 2000) {
- toptrig_cl_ecal_n_bottom.fill(4);
- toptrigtag_cl_ecal_e_bottom.fill(cl_probe.getEnergy());
+ bottrig_cl_ecal_n_tag.fill(nTag);
- if (botTrig != 0) {
- toptrig_cl_ecal_n_bottom.fill(5);
- toptrigtag_cl_ecal_e_bottom_trig.fill(cl_probe.getEnergy());
+ if (cl_tag != null) {
+ bottrig_cl_ecal_emax_tag.fill(cl_tag.getEnergy());
+ //use only cases where the is a single probe candidate
+ if (nProbe == 1) {
+ bottrig_cl_ecal_e_probe.fill(cl_probe.getEnergy());
+ if (topTrig != 0) {
+ bottrig_cl_ecal_e_probe_trig.fill(cl_probe.getEnergy());
+ }
+ if (cl_tag.getEnergy() > 2.0 * clusterEnergyCut) {
+ bottrigtag_cl_ecal_e_probe.fill(cl_probe.getEnergy());
+ if (topTrig != 0) {
+ bottrigtag_cl_ecal_e_probe_trig.fill(cl_probe.getEnergy());
}
-
}
-
}
} //tag found
- }//topTrigger
+ }//botTrigger
-
- //fillResetEff(aida.histogram1D("toptrig_cl_ecal_e_bottom_trig"),aida.histogram1D("toptrig_cl_ecal_e_bottom"),aida.histogram1D("toptrig_cl_ecal_e_bottom_trigeff"));
- //fillResetEff(aida.histogram1D("toptrigtag_cl_ecal_e_bottom_trig"),aida.histogram1D("toptrigtag_cl_ecal_e_bottom"),aida.histogram1D("toptrigtag_cl_ecal_e_bottom_trigeff"));
}
if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) {
@@ -500,12 +544,19 @@
@Override
public void redraw() {
- IHistogram1D heff = aida.histogramFactory().divide("turn-on", toptrig_cl_ecal_e_bottom_trig, toptrig_cl_ecal_e_bottom);
+ IHistogram1D heffTop = aida.histogramFactory().divide("turn-on: top tag", toptrig_cl_ecal_e_probe_trig, toptrig_cl_ecal_e_probe);
plotter5.region(7).clear();
- plotter5.region(7).plot(heff);
- IHistogram1D heff2 = aida.histogramFactory().divide("turn-on: tag > 2000 ADC", toptrigtag_cl_ecal_e_bottom_trig, toptrig_cl_ecal_e_bottom);
+ plotter5.region(7).plot(heffTop);
+ IHistogram1D heffTop2 = aida.histogramFactory().divide("turn-on: top tag > " + 2.0 * clusterEnergyCut, toptrigtag_cl_ecal_e_probe_trig, toptrigtag_cl_ecal_e_probe);
plotter5.region(8).clear();
- plotter5.region(8).plot(heff2);
+ plotter5.region(8).plot(heffTop2);
+
+ IHistogram1D heffBot = aida.histogramFactory().divide("turn-on: bottom tag", bottrig_cl_ecal_e_probe_trig, bottrig_cl_ecal_e_probe);
+ plotter6.region(7).clear();
+ plotter6.region(7).plot(heffBot);
+ IHistogram1D heffBot2 = aida.histogramFactory().divide("turn-on: bottom tag > " + 2.0 * clusterEnergyCut, bottrigtag_cl_ecal_e_probe_trig, bottrigtag_cl_ecal_e_probe);
+ plotter6.region(8).clear();
+ plotter6.region(8).plot(heffBot2);
}
@Override