hps-java/src/main/java/org/lcsim/hps/analysis/ecal
diff -u -r1.6 -r1.7
--- HPSMCParticlePlotsDriver.java 12 Oct 2012 06:02:59 -0000 1.6
+++ HPSMCParticlePlotsDriver.java 22 Oct 2012 19:04:12 -0000 1.7
@@ -18,7 +18,7 @@
* Diagnostic plots for HPS ECal.
*
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: HPSMCParticlePlotsDriver.java,v 1.6 2012/10/12 06:02:59 phansson Exp $
+ * @version $Id: HPSMCParticlePlotsDriver.java,v 1.7 2012/10/22 19:04:12 phansson Exp $
*/
public class HPSMCParticlePlotsDriver extends Driver {
@@ -34,10 +34,11 @@
ICloud1D fsCountEventTypePlot;
ICloud1D fsCountEventTypePlot2;
ICloud1D fsCountTypePlot500;
- ICloud1D fsEPlot;
+ IHistogram1D fsEPlot;
IHistogram1D fsGammaEPlot;
IHistogram1D fsElectronEPlot;
IHistogram1D fsPositronEPlot;
+ IHistogram1D fsThetayPlot;
ICloud1D fsGammaThetaPlot;
IHistogram1D fsGammaThetayPlot;
IHistogram1D fsGammaThetayTrigPlot;
@@ -92,25 +93,29 @@
fsCountEventTypePlot2 = aida.cloud1D("MCParticle: Number of Final State Types Gamma E>500");
fsCountEventTypePlot2.annotation().addItem("xAxisLabel", "Number of FS Types Gamma E>500");
- fsEPlot = aida.cloud1D("MCParticle: FS Particle E");
+ fsEPlot = aida.histogram1D("MCParticle: FS Particle E",100,0,3);
fsEPlot.annotation().addItem("xAxisLabel", "Particle E [GeV]");
- fsGammaEPlot = aida.histogram1D("MCParticle: FS Gamma E",100,0,5);
+ fsGammaEPlot = aida.histogram1D("MCParticle: FS Gamma E",100,0,3);
fsGammaEPlot.annotation().addItem("xAxisLabel", "Particle E [GeV]");
- fsElectronEPlot = aida.histogram1D("MCParticle: FS Electron E",100,0,5);
+ fsElectronEPlot = aida.histogram1D("MCParticle: FS Electron E",100,0,3);
fsElectronEPlot.annotation().addItem("xAxisLabel", "Particle E [GeV]");
- fsPositronEPlot = aida.histogram1D("MCParticle: FS Positron E",100,0,5);
+ fsPositronEPlot = aida.histogram1D("MCParticle: FS Positron E",100,0,3);
fsPositronEPlot.annotation().addItem("xAxisLabel", "Particle E [GeV]");
fsGammaThetaPlot = aida.cloud1D("MCParticle: FS Gamma Theta");
fsGammaThetaPlot.annotation().addItem("xAxisLabel", "Particle angle [rad]");
- fsGammaThetayPlot = aida.histogram1D("MCParticle: FS Gamma Thetay",100,0,1.0);
+ fsThetayPlot = aida.histogram1D("MCParticle: FS Particle Thetay",100,0,0.1);
+ fsThetayPlot.annotation().addItem("xAxisLabel", "Particle Thetay angle [rad]");
+
+
+ fsGammaThetayPlot = aida.histogram1D("MCParticle: FS Gamma Thetay",100,0,0.1);
fsGammaThetayPlot.annotation().addItem("xAxisLabel", "Particle Thetay angle [rad]");
- fsGammaThetayTrigPlot = aida.histogram1D("MCParticle: FS Gamma Thetay Trig",100,0,1.0);
+ fsGammaThetayTrigPlot = aida.histogram1D("MCParticle: FS Gamma Thetay Trig",100,0,0.1);
fsGammaThetayTrigPlot.annotation().addItem("xAxisLabel", "Particle Thetay angle [rad]");
fsGammaThetayEPlot = aida.cloud2D("MCParticle: FS Gamma Thetay vs E");
@@ -123,7 +128,7 @@
fsElectronThetayPlot = aida.histogram1D("MCParticle: FS Electron Thetay",100,0,0.1);
fsElectronThetayPlot.annotation().addItem("xAxisLabel", "Particle Thetay angle [rad]");
- fsElectronThetayTrigPlot = aida.histogram1D("MCParticle: FS Electron Thetay Trig",100,0,1.0);
+ fsElectronThetayTrigPlot = aida.histogram1D("MCParticle: FS Electron Thetay Trig",100,0,0.1);
fsElectronThetayTrigPlot.annotation().addItem("xAxisLabel", "Particle Thetay angle [rad]");
fsElectronThetayEPlot = aida.cloud2D("MCParticle: FS Electron Thetay vs E");
@@ -133,10 +138,10 @@
fsPositronThetaPlot = aida.cloud1D("MCParticle: FS Positron Theta");
fsPositronThetaPlot.annotation().addItem("xAxisLabel", "Particle angle [rad]");
- fsPositronThetayPlot = aida.histogram1D("MCParticle: FS Positron Thetay",100,0,1.0);
+ fsPositronThetayPlot = aida.histogram1D("MCParticle: FS Positron Thetay",100,0,0.1);
fsPositronThetayPlot.annotation().addItem("xAxisLabel", "Particle Thetay angle [rad]");
- fsPositronThetayTrigPlot = aida.histogram1D("MCParticle: FS Positron Thetay Trig",100,0,1.0);
+ fsPositronThetayTrigPlot = aida.histogram1D("MCParticle: FS Positron Thetay Trig",100,0,0.1);
fsPositronThetayTrigPlot.annotation().addItem("xAxisLabel", "Particle Thetay angle [rad]");
fsPositronThetayEPlot = aida.cloud2D("MCParticle: FS Positron Thetay vs E");
@@ -153,26 +158,44 @@
pFrame = new AIDAFrame();
pFrame.setTitle("Truth MC Particle Plots");
- IPlotter pPlotter = af.createPlotterFactory().create("MCParticle Plots");
- pPlotter.setTitle("MCParticle Event Types");
+ IPlotter pPlotter = af.createPlotterFactory().create();
+ pPlotter.setTitle("Truth MC Types");
pPlotter.createRegions(2,2);
- pPlotter.region(0).plot(fsCountTypePlot);
- pPlotter.region(1).plot(fsCountEventTypePlot);
- //pPlotter.region(1).plot(fsCountVsEventPlot);
- pPlotter.region(2).plot(fsEPlot);
- pPlotter.region(2).plot(fsGammaEPlot,"mode=overlay");
- pPlotter.region(2).plot(fsElectronEPlot,"mode=overlay");
- pPlotter.region(2).plot(fsPositronEPlot,"mode=overlay");
- pPlotter.region(2).style().dataStyle().fillStyle().setVisible(false);
- pPlotter.region(3).plot(fsElectronThetayPlot);
- pPlotter.region(3).plot(fsPositronThetayPlot,"mode=overlay");
- pPlotter.region(3).plot(fsGammaThetayPlot,"mode=overlay");
- pPlotter.region(3).style().dataStyle().fillStyle().setVisible(false);
+ pPlotter.region(0).plot(fsCountPlot);
+ pPlotter.region(1).plot(fsCountTypePlot);
+ pPlotter.region(2).plot(fsCountEventTypePlot);
+ pPlotter.region(3).plot(fsCountVsEventPlot);
for(int i=0;i<4;++i) {
((PlotterRegion) pPlotter.region(i)).getPlot().setAllowPopupMenus(true);
((PlotterRegion) pPlotter.region(i)).getPlot().setAllowUserInteraction(true);
}
+ IPlotter pPlotter2 = af.createPlotterFactory().create();
+ pPlotter2.setTitle("Truth MC Kinematics 1");
+ pPlotter2.createRegions(2,2);
+ pPlotter2.region(0).plot(fsEPlot);
+ pPlotter2.region(0).plot(fsElectronEPlot,"mode=overlay");
+ pPlotter2.region(0).plot(fsPositronEPlot,"mode=overlay");
+ pPlotter2.region(0).plot(fsGammaEPlot,"mode=overlay");
+ pPlotter2.region(0).style().dataStyle().fillStyle().setVisible(false);
+ pPlotter2.region(1).plot(fsThetayPlot);
+ pPlotter2.region(1).plot(fsElectronThetayPlot,"mode=overlay");
+ pPlotter2.region(1).plot(fsPositronThetayPlot,"mode=overlay");
+ pPlotter2.region(1).plot(fsGammaThetayPlot,"mode=overlay");
+ pPlotter2.region(1).style().dataStyle().fillStyle().setVisible(false);
+ //.dataStyle().fillStyle()
+ pPlotter2.region(2).plot(fsElectronThetayEPlot);
+ pPlotter2.region(3).plot(fsPositronThetayEPlot);
+ pPlotter2.region(2).style().setParameter("hist2DStyle", "colorMap");
+ pPlotter2.region(2).style().dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+ pPlotter2.region(3).style().setParameter("hist2DStyle", "colorMap");
+ pPlotter2.region(3).style().dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+ for(int i=0;i<4;++i) {
+ ((PlotterRegion) pPlotter2.region(i)).getPlot().setAllowPopupMenus(true);
+ ((PlotterRegion) pPlotter2.region(i)).getPlot().setAllowUserInteraction(true);
+ }
+
+ pFrame.addPlotter(pPlotter2);
pFrame.addPlotter(pPlotter);
pFrame.pack();
pFrame.setVisible(!_hideFrame);
@@ -211,6 +234,7 @@
double thetay = Math.atan2(fs.getPY(), fs.getPZ());
int fsPdg = fs.getPDGID();
fsEPlot.fill(fsE);
+ this.fsThetayPlot.fill(Math.abs(thetay));
fsCountTypePlot.fill(fsPdg);
if(fsE>0.5) fsCountTypePlot500.fill(fsPdg);
if (ParticleTypeClassifier.isElectron(fsPdg)) {