LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  December 2014

HPS-SVN December 2014

Subject:

r1718 - /java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Sat, 13 Dec 2014 22:53:02 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (166 lines)

Author: mccaky
Date: Sat Dec 13 14:52:58 2014
New Revision: 1718

Log:
Replaced waveform single channel plots with cluster energy plot. Waveform code is commented out, so it can be easily reactivated or placed in another IPlotter row if desired.

Modified:
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java	Sat Dec 13 14:52:58 2014
@@ -62,8 +62,9 @@
 	
 	// Channel plot lists.
 	private ArrayList<IHistogram1D> channelEnergyPlot;
+	private ArrayList<IHistogram1D> clusterEnergyPlot;
 	private ArrayList<IHistogram1D> channelTimePlot;
-	private ArrayList<IHistogram1D> channelRawWaveform;
+	//private ArrayList<IHistogram1D> channelRawWaveform;
 	private ArrayList<IHistogram2D> channelTimeVsEnergyPlot;
 	
 	// Internal variables.
@@ -80,11 +81,13 @@
 	
 	// Plot style and title variables.
 	private static final String NO_TITLE = "";
-	private static final String SIGNAL_TIME_TITLE = "Time (ns)";
+	//private static final String SIGNAL_TIME_TITLE = "Time (ns)";
 	private static final String HIT_TIME_TITLE = "Hit Time (ns)";
 	private static final String SIGNAL_DATA_STYLE_COLOR = "orange";
+	//private static final String RAW_WAVEFORM_TITLE = "Raw Waveform";
 	private static final String HIT_ENERGY_TITLE = "Hit Energy (GeV)";
-	private static final String SIGNAL_AMPLITUDE_TITLE = "Signal Amplitude (mV)";
+	private static final String CLUSTER_ENERGY_TITLE = "Cluster Energy (GeV)";
+	//private static final String SIGNAL_AMPLITUDE_TITLE = "Signal Amplitude (mV)";
 	
 	/**
 	 * Sets the upper bound of the energy scales used by the driver.
@@ -153,14 +156,15 @@
 		aida.tree().cd("/");
 		
 		// Store histograms for the crystals.
-		channelEnergyPlot = new ArrayList<IHistogram1D>();
-		channelTimePlot = new ArrayList<IHistogram1D>();
-		channelRawWaveform = new ArrayList<IHistogram1D>();
-		channelTimeVsEnergyPlot = new ArrayList<IHistogram2D>();
+		channelEnergyPlot = new ArrayList<IHistogram1D>(NUM_CHANNELS);
+		channelTimePlot = new ArrayList<IHistogram1D>(NUM_CHANNELS);
+		//channelRawWaveform = new ArrayList<IHistogram1D>(NUM_CHANNELS);
+		clusterEnergyPlot = new ArrayList<IHistogram1D>(NUM_CHANNELS);
+		channelTimeVsEnergyPlot = new ArrayList<IHistogram2D>(NUM_CHANNELS);
 		
 		// Create the histograms for single channel energy and time
 		// distribution.
-		for(int ii = 0; ii < (47 * 11); ii++) {
+		for(int ii = 0; ii < NUM_CHANNELS; ii++) {
 			// The above instruction is a terrible hack, just to fill
 			// the arrayList with all the elements. They'll be initialized
 			// properly during the event readout, Since we want to account
@@ -173,15 +177,18 @@
 			// Initialize the histograms for the current crystal channel.
 			channelEnergyPlot.add(aida.histogram1D(detector.getDetectorName() + " : "
 						+ inputCollection + " : Hit Energy : " + column + " " + row
-						+ ": " + ii, 100, -0.2, maxEch));  
+						+ ": " + ii, 100, -0.2, maxEch));
 			channelTimePlot.add(aida.histogram1D(detector.getDetectorName() + " : "
 						+ inputCollection + " : Hit Time : " + column + " " + row + ": "
 						+ ii, 100, 0, 400));     
 			channelTimeVsEnergyPlot.add(aida.histogram2D(detector.getDetectorName()
 					+ " : " + inputCollection + " : Hit Time Vs Energy : " + column
 					+ " " + row + ": " + ii, 100, 0, 400, 100, -0.2, maxEch));              
-			channelRawWaveform.add(aida.histogram1D(detector.getDetectorName() + " : "
-					+ inputCollection + " : Hit Energy : " + column + " " + row + ": " + ii));
+			//channelRawWaveform.add(aida.histogram1D(detector.getDetectorName() + " : "
+			//		+ inputCollection + " : Hit Energy : " + column + " " + row + ": " + ii));
+			clusterEnergyPlot.add(aida.histogram1D(detector.getDetectorName() + " : "
+					+ inputCollection + " : Cluster Energy : " + column + " " + row
+					+ ": " + ii, 100, -0.2, maxEch));
 			
 			// Note that no raw waveform has yet been read for this
 			// crystal/channel.
@@ -213,14 +220,22 @@
 		pstyle.yAxisStyle().setLabel(HIT_ENERGY_TITLE);
 		plotter.region(2).plot(channelTimeVsEnergyPlot.get(0), pstyle);
 		
+		// Define the fourth plot region; this encompasses the cluster
+		// energy for each channel.
+		pstyle.xAxisStyle().setLabel(CLUSTER_ENERGY_TITLE);
+		pstyle.yAxisStyle().setLabel(NO_TITLE);
+		plotter.region(3).plot(clusterEnergyPlot.get(0), pstyle);
+		
+		/**
 		// Define the fourth plot region; this encompasses the raw
 		// wave form plots.
-		pstyle.xAxisStyle().setLabel(HIT_ENERGY_TITLE);
+		pstyle.xAxisStyle().setLabel(RAW_WAVEFORM_TITLE);
 		pstyle.yAxisStyle().setLabel(NO_TITLE);
 		pstyle.dataStyle().fillStyle().setColor(SIGNAL_DATA_STYLE_COLOR);
 		pstyle.dataStyle().markerStyle().setColor(SIGNAL_DATA_STYLE_COLOR);
 		pstyle.dataStyle().errorBarStyle().setVisible(false);
 		plotter.region(3).plot(channelRawWaveform.get(0), pstyle);
+		**/
 		
 		// Display the plot region.
 		plotter.show();
@@ -322,10 +337,24 @@
 			// Iterate over the clusters and add them to the event
 			// display if appropriate.
 			for (HPSEcalCluster cluster : clusters) {
+				// Get the ix and iy indices for the seed.
+				int ix = cluster.getSeedHit().getIdentifierFieldValue("ix");
+				int iy = cluster.getSeedHit().getIdentifierFieldValue("iy");
+				
+				// Get the histogram index for the hit.
+				int id = ECalUtils.getHistoIDFromRowColumn(iy, ix);
+				
+				// Add the cluster energy to the plot.
+				if(cluster.getEnergy() > 0.0) {
+					clusterEnergyPlot.get(id).fill(cluster.getEnergy());
+				}
+				
+				// If an update is needed, add the cluster to the viewer.
 				if(update) { viewer.addCluster(cluster); }
 			}
 		}
 		
+		/**
 		// Plot the raw waveform only if raw tracker hit exist in the
 		// event.
 		if (event.hasCollection(RawTrackerHit.class, inputCollectionRaw)){
@@ -377,6 +406,7 @@
 				}
 			}
 		}
+		**/
 		
 		// Update the single event display.
 		if(update) { viewer.updateDisplay(); }
@@ -422,8 +452,14 @@
 				pstyle.xAxisStyle().setLabel(HIT_TIME_TITLE);
 				pstyle.yAxisStyle().setLabel(HIT_ENERGY_TITLE);
 				plotter.region(2).plot(channelTimeVsEnergyPlot.get(id), pstyle);
+				
+				// Process and plot the region 3 plot.
 				plotter.region(3).clear();
-				
+				pstyle.xAxisStyle().setLabel(CLUSTER_ENERGY_TITLE);
+				pstyle.yAxisStyle().setLabel(NO_TITLE);
+				plotter.region(3).plot(clusterEnergyPlot.get(id), pstyle);
+				
+				/**
 				// Process and plot the region 3 plot.
 				if(!isFirstRaw[id]) {
 					pstyle.yAxisStyle().setLabel(SIGNAL_AMPLITUDE_TITLE);
@@ -437,6 +473,7 @@
 					pstyle.yAxisStyle().setLabel("");
 				}
 				plotter.region(3).plot(channelRawWaveform.get(id), pstyle);
+				**/
 		}
 	}
 	

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use