hps-java/src/main/java/org/lcsim/hps/users/phansson
diff -u -r1.1 -r1.2
--- TriggerTurnOnAnalysis.java 2 Oct 2012 01:56:58 -0000 1.1
+++ TriggerTurnOnAnalysis.java 2 Oct 2012 22:48:30 -0000 1.2
@@ -37,12 +37,19 @@
private List<MCParticle> positrons = null;
private IHistogram1D hCountTrig;
- //private IHistogram1D hTrigEffThetaySmallest;
- private IHistogram1D hTrigThetaySmallestEcut;
+ private IHistogram1D hThetay;
+ private IHistogram1D hThetayAll;
+ private IHistogram2D hThetayvsEAll;
private IHistogram1D hThetaySmallest;
private IHistogram1D hThetaySmallestEcut;
+ private IHistogram1D hTrigThetaySmallestEcut;
+ private IHistogram1D hThetayLargest;
+ private IHistogram1D hThetayLargestEcut;
+ private IHistogram1D hTrigThetayLargestEcut;
private IHistogram2D hThetaySmallestvsE;
private IHistogram2D hTrigThetaySmallestvsE;
+ private IHistogram2D hThetayLargestvsE;
+ private IHistogram2D hTrigThetayLargestvsE;
private IHistogram2D hThetayvsThetay;
private IHistogram2D hTrigThetayvsThetay;
private IHistogram2D hele1vsele2;
@@ -55,6 +62,8 @@
IPlotter plotter_count_2;
IPlotter plotter_count_3;
IPlotter plotter_count_4;
+ IPlotter plotter_count_11;
+ IPlotter plotter_count_22;
@Override
public void detectorChanged(Detector detector) {
@@ -121,6 +130,9 @@
// Use electron/positron with highest E
MCParticle electron = null;
for(MCParticle e : electrons) {
+ hThetayAll.fill( Math.abs(Math.atan(e.getMomentum().y()/e.getMomentum().z())) );
+ hThetayvsEAll.fill( Math.abs(Math.atan(e.getMomentum().y()/e.getMomentum().z())) , e.getEnergy() );
+
if (electron==null) {
electron = e;
} else {
@@ -134,6 +146,8 @@
}
MCParticle positron = null;
for(MCParticle e : positrons) {
+ hThetayAll.fill( Math.abs(Math.atan(e.getMomentum().y()/e.getMomentum().z())) );
+ hThetayvsEAll.fill( Math.abs(Math.atan(e.getMomentum().y()/e.getMomentum().z())) , e.getEnergy() );
if (positron==null) {
positron = e;
} else {
@@ -142,23 +156,50 @@
}
}
}
+
+
if(electron!=null && positron!=null) {
double electron_thetay = Math.abs(Math.atan(electron.getMomentum().y()/electron.getMomentum().z()));
double positron_thetay = Math.abs(Math.atan(positron.getMomentum().y()/positron.getMomentum().z()));
+ double electron_E = electron.getEnergy();
+ double positron_E = positron.getEnergy();
double thetay_smallest = electron_thetay < positron_thetay ? electron_thetay : positron_thetay;
double E_thetay_smallest = electron_thetay < positron_thetay ? electron.getEnergy() : positron.getEnergy();
- double thetay_larger = electron_thetay < positron_thetay ? positron_thetay : electron_thetay;
+ double thetay_largest = electron_thetay < positron_thetay ? positron_thetay : electron_thetay;
+ double E_thetay_largest = electron_thetay < positron_thetay ? positron.getEnergy() : electron.getEnergy();
+
+ double highest_E = -1;//electron.getEnergy() > positron.getEnergy() ? electron.getEnergy() : positron.getEnergy();
+ double highest_E_thetay = -1;//electron.getEnergy() > positron.getEnergy() ? electron_thetay : positron_thetay;
+
+ if(electron_thetay > positron_thetay && electron_E > positron_E) {
+ highest_E_thetay = electron_thetay;
+ highest_E = electron_E;
+ } else if(electron_thetay < positron_thetay && electron_E < positron_E) {
+ highest_E_thetay = positron_thetay;
+ highest_E = positron_E;
+ }
+
+
+ hThetay.fill( electron_thetay );
+ hThetay.fill( positron_thetay );
hThetaySmallest.fill( thetay_smallest );
+ if(highest_E>0) hThetayLargest.fill( highest_E_thetay );
hThetaySmallestvsE.fill(thetay_smallest, E_thetay_smallest);
- hThetayvsThetay.fill(thetay_smallest, thetay_larger );
+ if(highest_E>0) hThetayLargestvsE.fill(highest_E_thetay, highest_E);
+ hThetayvsThetay.fill(thetay_smallest, thetay_largest );
if(E_thetay_smallest>0.0) {
hThetaySmallestEcut.fill( thetay_smallest );
+ hThetayLargestEcut.fill( highest_E_thetay );
if(trigger_data!=null) {
hTrigThetaySmallestvsE.fill(thetay_smallest, E_thetay_smallest);
- hTrigThetayvsThetay.fill(thetay_smallest, thetay_larger );
+ if(highest_E>0) hTrigThetayLargestvsE.fill(highest_E_thetay, highest_E);
+ hTrigThetayvsThetay.fill(thetay_smallest, thetay_largest );
hTrigThetaySmallestEcut.fill( thetay_smallest );
+ if(highest_E>0) hTrigThetayLargestEcut.fill( highest_E_thetay );
}
}
+
+
}
if(totalEvents % 500 == 0) updatePlots();
totalEvents++;
@@ -196,34 +237,57 @@
private void makePlots() {
hCountTrig = aida.histogram1D("hCountTrig",2,0,2);
- //hTrigThetaySmallestE = aida.histogram1D("hTrigThetaySmallest",50,0,0.1);
- hTrigThetaySmallestEcut = aida.histogram1D("hTrigThetaySmallestEcut",50,0,0.1);
- hThetaySmallest = aida.histogram1D("hThetaySmallest",50,0,0.1);
- hThetaySmallestEcut = aida.histogram1D("hThetaySmallestEcut",50,0,0.1);
- hThetaySmallestvsE = aida.histogram2D("hThetaySmallestvsE",25,0,0.1,20,0,2.);
- hTrigThetaySmallestvsE = aida.histogram2D("hTrigThetaySmallestvsE",25,0,0.1,20,0,2.);
- hThetayvsThetay = aida.histogram2D("hThetayvsThetay",50,0,0.1,50,0,0.2);
- hTrigThetayvsThetay = aida.histogram2D("hTrigThetayvsThetay",50,0,0.1,50,0,0.2);
+ hThetay = aida.histogram1D("Theta_y",50,0,0.1);
+ hThetayAll = aida.histogram1D("Theta_y all",50,0,0.1);
+
+ hThetayvsEAll = aida.histogram2D("Theta_y vs E all",25,0,0.1,20,0,2.);
+ hThetaySmallest = aida.histogram1D("Theta_y smallest",50,0,0.05);
+ hThetaySmallestEcut = aida.histogram1D("Theta_y smallest Ecut",50,0,0.05);
+ hTrigThetaySmallestEcut = aida.histogram1D("Triggered Theta_y smallest Ecut",50,0,0.05);
+ hTrigThetaySmallestEcut.annotation().addItem("xAxisLabel", "Theta_y [rad]");
+ hThetayLargest = aida.histogram1D("Theta_y largest",50,0,0.05);
+ hThetayLargestEcut = aida.histogram1D("Theta_y largest Ecut",50,0,0.05);
+ hTrigThetayLargestEcut = aida.histogram1D("Triggered Theta_y largest Ecut",50,0,0.05);
+ hTrigThetayLargestEcut.annotation().addItem("xAxisLabel", "Theta_y [rad]");
+ hThetaySmallestvsE = aida.histogram2D("Theta_y smallest vs E",25,0,0.1,20,0,2.);
+ hTrigThetaySmallestvsE = aida.histogram2D("Triggered Theta_y smallest vs E",25,0,0.1,20,0,2.);
+ hThetayLargestvsE = aida.histogram2D("Theta_y largest vs E",25,0,0.1,20,0,2.);
+ hTrigThetayLargestvsE = aida.histogram2D("Triggered Theta_y largest vs E",25,0,0.1,20,0,2.);
+ hThetayvsThetay = aida.histogram2D("Theta_y for e+e- pair",50,0,0.1,50,0,0.2);
+ hTrigThetayvsThetay = aida.histogram2D("Triggered Theta_y for e+e- pair",50,0,0.1,50,0,0.2);
hele1vsele2 = aida.histogram2D("hele1vsele2", 50,0,2,50,0,2);
plotter_count = af.createPlotterFactory().create();
- plotter_count.createRegions(1,1);
+ plotter_count.createRegions(2,2);
plotter_count.setTitle("Trigger Count");
- //plotter_count.style().statisticsBoxStyle().setVisible(true);
+ plotter_count.style().setParameter("hist2DStyle", "colorMap");
+ plotter_count.style().dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
plotter_count.region(0).plot(hCountTrig);
+ plotter_count.region(1).plot(hThetayvsEAll);
+ plotter_count.region(2).plot(hThetay);
+ plotter_count.region(3).plot(hThetayAll);
plotter_count.show();
plotter_count_1 = af.createPlotterFactory().create();
plotter_count_1.createRegions(2,2);
plotter_count_1.setTitle("Acceptance vs Thetay");
- //plotter_count.style().statisticsBoxStyle().setVisible(true);
plotter_count_1.region(0).plot(hThetaySmallest);
plotter_count_1.region(1).plot(hThetaySmallestEcut);
plotter_count_1.region(2).plot(hTrigThetaySmallestEcut);
plotter_count_1.region(3).style().statisticsBoxStyle().setVisible(false);
plotter_count_1.show();
+ plotter_count_11 = af.createPlotterFactory().create();
+ plotter_count_11.createRegions(2,2);
+ plotter_count_11.setTitle("Acceptance vs Thetay largest");
+ //plotter_count.style().statisticsBoxStyle().setVisible(true);
+ plotter_count_11.region(0).plot(hThetayLargest);
+ plotter_count_11.region(1).plot(hThetayLargestEcut);
+ plotter_count_11.region(2).plot(hTrigThetayLargestEcut);
+ plotter_count_11.region(3).style().statisticsBoxStyle().setVisible(false);
+ plotter_count_11.show();
+
plotter_count_2 = af.createPlotterFactory().create();
plotter_count_2.createRegions(2,2);
plotter_count_2.setTitle("Trigger Count");
@@ -234,6 +298,17 @@
plotter_count_2.region(1).plot(hTrigThetaySmallestvsE);
plotter_count_2.region(2).style().statisticsBoxStyle().setVisible(false);
plotter_count_2.show();
+
+ plotter_count_22 = af.createPlotterFactory().create();
+ plotter_count_22.createRegions(2,2);
+ plotter_count_22.setTitle("Trigger Count");
+ //plotter_count.style().statisticsBoxStyle().setVisible(true);
+ plotter_count_22.style().setParameter("hist2DStyle", "colorMap");
+ plotter_count_22.style().dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+ plotter_count_22.region(0).plot(hThetayLargestvsE);
+ plotter_count_22.region(1).plot(hTrigThetayLargestvsE);
+ plotter_count_22.region(2).style().statisticsBoxStyle().setVisible(false);
+ plotter_count_22.show();
IPlotter plotter_count_3 = af.createPlotterFactory().create();
plotter_count_3.createRegions(1,2);
@@ -261,14 +336,31 @@
private void updatePlots() {
//hTrigEffThetaySmallest = aida.histogram1D("hTrigEffThetaySmallest",50,0,0.1);
- IHistogram1D hTrigEffThetaySmallest = hf.divide("hTrigEffThetaySmallest", hTrigThetaySmallestEcut, hThetaySmallestEcut);
+ IHistogram1D hTrigEffThetaySmallest = hf.divide("Trigger efficiency vs Theta_y smallest", hTrigThetaySmallestEcut, hThetaySmallestEcut);
+ hTrigEffThetaySmallest.annotation().addItem("xAxisLabel", "Theta_y [rad]");
+ hTrigEffThetaySmallest.annotation().addItem("yAxisLabel", "Trigger Efficiency");
plotter_count_1.region(3).clear();
- plotter_count_1.region(3).plot(hTrigEffThetaySmallest);
plotter_count_1.region(3).style().statisticsBoxStyle().setVisible(false);
- IHistogram2D hTrigEffThetaySmallestvsE = hf.divide("hTrigEffThetaySmallestvsE", hTrigThetaySmallestvsE,hThetaySmallestvsE);
+ plotter_count_1.region(3).plot(hTrigEffThetaySmallest);
+ IHistogram2D hTrigEffThetaySmallestvsE = hf.divide("Trigger efficiency Theta_y vs E smallest", hTrigThetaySmallestvsE,hThetaySmallestvsE);
+ hTrigEffThetaySmallestvsE.annotation().addItem("xAxisLabel", "Theta_y [rad]");
+ hTrigEffThetaySmallestvsE.annotation().addItem("yAxisLabel", "Energy [GeV]");
plotter_count_2.region(2).clear();
- plotter_count_2.region(2).plot(hTrigEffThetaySmallestvsE);
plotter_count_2.region(2).style().statisticsBoxStyle().setVisible(false);
+ plotter_count_2.region(2).plot(hTrigEffThetaySmallestvsE);
+
+ IHistogram1D hTrigEffThetayLargest = hf.divide("Trigger efficiency vs Theta_y largest", hTrigThetayLargestEcut, hThetayLargestEcut);
+ hTrigEffThetayLargest.annotation().addItem("xAxisLabel", "Theta_y [rad]");
+ hTrigEffThetayLargest.annotation().addItem("yAxisLabel", "Trigger Efficiency");
+ plotter_count_11.region(3).clear();
+ plotter_count_11.region(3).style().statisticsBoxStyle().setVisible(false);
+ plotter_count_11.region(3).plot(hTrigEffThetayLargest);
+ IHistogram2D hTrigEffThetayLargestvsE = hf.divide("Trigger efficiency Theta_y vs E largest", hTrigThetayLargestvsE,hThetayLargestvsE);
+ hTrigEffThetayLargestvsE.annotation().addItem("xAxisLabel", "Theta_y [rad]");
+ hTrigEffThetayLargestvsE.annotation().addItem("yAxisLabel", "Energy [GeV]");
+ plotter_count_22.region(2).clear();
+ plotter_count_22.region(2).style().statisticsBoxStyle().setVisible(false);
+ plotter_count_22.region(2).plot(hTrigEffThetayLargestvsE);
}